prompt stringclasses 1
value | completions listlengths 2 1.33k | labels listlengths 2 1.33k | source stringclasses 1
value | other_info dict | index int64 0 719 | cwe stringclasses 9
values | language stringclasses 6
values |
|---|---|---|---|---|---|---|---|
Determine whether the {function_name} code is vulnerable or not. | [
"def _find_host_exhaustive(self, connector, hosts):\n for host in hosts:",
" ssh_cmd = 'svcinfo lshost -delim ! %s' % host",
" out, err = self._run_ssh(ssh_cmd)\n self._assert_ssh_return(len(out.strip()),\n '_find_host_exhaustive',\n ... | [
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 105,
"char_start": 104,
"chars": "["
},
{
"char_end": 115,
"char_start": 113,
"chars": "',"
},
{
"char_end": 117,
"char_start": 116,
"chars": "'"
},
{
... | 100 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _find_host_exhaustive(self, connector, hosts):\n for host in hosts:",
" ssh_cmd = ['svcinfo', 'lshost', '-delim', '!', host]",
" out, err = self._run_ssh(ssh_cmd)\n self._assert_ssh_return(len(out.strip()),\n '_find_host_exhaustive'... | [
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 105,
"char_start": 104,
"chars": "["
},
{
"char_end": 115,
"char_start": 113,
"chars": "',"
},
{
"char_end": 117,
"char_start": 116,
"chars": "'"
},
{
... | 100 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _create_vdisk(self, name, size, units, opts):\n \"\"\"Create a new vdisk.\"\"\"",
" LOG.debug(_('enter: _create_vdisk: vdisk %s ') % name)",
" model_update = None",
" autoex = '-autoexpand' if opts['autoexpand'] else ''\n easytier = '-easytier on' if opts['easytier'] el... | [
1,
1,
1,
0,
1,
0,
1,
0,
1,
0,
1,
0,
1,
0,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 338,
"char_start": 336,
"chars": "[]"
},
{
"char_end": 405,
"char_start": 382,
"chars": "['-rsize', '%s%%' % str"
},
{
"char_end": 421,
"char_start": 406,
"chars": "op... | 101 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _create_vdisk(self, name, size, units, opts):\n \"\"\"Create a new vdisk.\"\"\"",
" LOG.debug(_('enter: _create_vdisk: vdisk %s ') % name)",
" model_update = None",
" easytier = 'on' if opts['easytier'] else 'off'",
"\n # Set space-efficient options\n if opts['... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 338,
"char_start": 336,
"chars": "[]"
},
{
"char_end": 405,
"char_start": 382,
"chars": "['-rsize', '%s%%' % str"
},
{
"char_end": 421,
"char_start": 406,
"chars": "op... | 101 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def test_invalid_iscsi_ip(self):\n self.flags(lock_path=self.tempdir)",
" #record driver set up\n self.clear_mox()\n _run_ssh = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._run_ssh)\n self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, \"_run_ssh\", _run_ssh)\n",
" s... | [
1,
1,
0,
1,
0,
1,
0,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 319,
"char_start": 318,
"chars": "["
},
{
"char_end": 330,
"char_start": 329,
"chars": "]"
},
{
"char_end": 430,
"char_start": 429,
"chars": "["
},
{
... | 102 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def test_invalid_iscsi_ip(self):\n self.flags(lock_path=self.tempdir)",
" #record driver set up\n self.clear_mox()\n _run_ssh = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._run_ssh)\n self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, \"_run_ssh\", _run_ssh)\n",
" s... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 319,
"char_start": 318,
"chars": "["
},
{
"char_end": 330,
"char_start": 329,
"chars": "]"
},
{
"char_end": 430,
"char_start": 429,
"chars": "["
},
{
... | 102 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def get_output(command: str) -> bytes:",
" \"\"\"\n Run a command and return raw output",
" :param str command: the command to run\n :returns: the stdout output of the command\n \"\"\"",
" return subprocess.check_output(command.split())"
] | [
0,
1,
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 29,
"char_start": 24,
"chars": "List["
},
{
"char_end": 33,
"char_start": 32,
"chars": "]"
},
{
"char_end": 39,
"char_start": 38,
"chars": "s"
},
{
... | 103 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def get_output(command: List[str]) -> str:",
" \"\"\"\n Run a command and return raw output",
" :param str command: the command to run\n :returns: the stdout output of the command\n \"\"\"",
" result = subprocess.run(command, stdout=subprocess.PIPE, check=True)\n return result.stdout.dec... | [
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 29,
"char_start": 24,
"chars": "List["
},
{
"char_end": 33,
"char_start": 32,
"chars": "]"
},
{
"char_end": 39,
"char_start": 38,
"chars": "s"
},
{
... | 103 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"openscript(\n char_u\t*name,\n int\t\tdirectly)\t/* when TRUE execute directly */\n{\n if (curscript + 1 == NSCRIPT)\n {\n\temsg(_(e_nesting));\n\treturn;\n }",
"",
"#ifdef FEAT_EVAL\n if (ignore_script)\n\t/* Not reading from script, also don't open one. Warning message? */\n\treturn;\n#end... | [
1,
0,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 321,
"char_start": 160,
"chars": "\n // Disallow sourcing a file in the sandbox, the commands would be executed\n // later, possibly outside of the sandbox.\n if (check_secure())\n\treturn;\n\n"
}
],
"deleted": []
... | 104 | cwe-078 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"openscript(\n char_u\t*name,\n int\t\tdirectly)\t/* when TRUE execute directly */\n{\n if (curscript + 1 == NSCRIPT)\n {\n\temsg(_(e_nesting));\n\treturn;\n }",
"\n // Disallow sourcing a file in the sandbox, the commands would be executed\n // later, possibly outside of the sandbox.\n if... | [
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 321,
"char_start": 160,
"chars": "\n // Disallow sourcing a file in the sandbox, the commands would be executed\n // later, possibly outside of the sandbox.\n if (check_secure())\n\treturn;\n\n"
}
],
"deleted": []
... | 104 | cwe-078 | c |
Determine whether the {function_name} code is vulnerable or not. | [
"def add_user(username, password):\n encPass = crypt.crypt(password,\"22\")",
" os.system(\"useradd -G docker,wheel -p \"+encPass+\" \"+username)"
] | [
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 85,
"char_start": 79,
"chars": "#subpr"
},
{
"char_end": 88,
"char_start": 86,
"chars": "ce"
},
{
"char_end": 92,
"char_start": 90,
"chars": " e"
},
{
... | 105 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def add_user(username, password):\n encPass = crypt.crypt(password,\"22\")",
" #subprocess escapes the username stopping code injection\n subprocess.call(['useradd','-G','docker,wheel','-p',encPass,username])"
] | [
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 85,
"char_start": 79,
"chars": "#subpr"
},
{
"char_end": 88,
"char_start": 86,
"chars": "ce"
},
{
"char_end": 92,
"char_start": 90,
"chars": " e"
},
{
... | 105 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def write_section(self, section_name, section_data):\n self.write_line(\"\")\n self.write_line(\"define %s {\" % section_name)\n sorted_keys = section_data.keys()\n sorted_keys.sort()\n for key in sorted_keys:",
" value = section_data[key]\n self.icinga_li... | [
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 283,
"char_start": 262,
"chars": "lf.value_to_icinga(se"
},
{
"char_end": 299,
"char_start": 298,
"chars": ")"
},
{
"char_end": 326,
"char_start": 323,
"chars": " = "
... | 106 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def write_section(self, section_name, section_data):\n self.write_line(\"\")\n self.write_line(\"define %s {\" % section_name)\n sorted_keys = section_data.keys()\n sorted_keys.sort()\n for key in sorted_keys:",
" value = self.value_to_icinga(section_data[key])\n ... | [
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 283,
"char_start": 262,
"chars": "lf.value_to_icinga(se"
},
{
"char_end": 299,
"char_start": 298,
"chars": ")"
},
{
"char_end": 326,
"char_start": 323,
"chars": " = "
... | 106 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _update_volume_stats(self):\n \"\"\"Retrieve stats info from volume group.\"\"\"",
" LOG.debug(_(\"Updating volume stats\"))\n data = {}",
" data['vendor_name'] = 'IBM'\n data['driver_version'] = '1.1'\n data['storage_protocol'] = list(self._enabled_protocols)",
... | [
1,
1,
1,
1,
1,
0,
1,
1,
0,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 603,
"char_start": 602,
"chars": "["
},
{
"char_end": 613,
"char_start": 611,
"chars": "',"
},
{
"char_end": 615,
"char_start": 614,
"chars": "'"
},
{
... | 107 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _update_volume_stats(self):\n \"\"\"Retrieve stats info from volume group.\"\"\"",
" LOG.debug(_(\"Updating volume stats\"))\n data = {}",
" data['vendor_name'] = 'IBM'\n data['driver_version'] = '1.1'\n data['storage_protocol'] = list(self._enabled_protocols)",
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 603,
"char_start": 602,
"chars": "["
},
{
"char_end": 613,
"char_start": 611,
"chars": "',"
},
{
"char_end": 615,
"char_start": 614,
"chars": "'"
},
{
... | 107 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def test_create_modify_host(self):\n self.flags(lock_path=self.tempdir)",
" #record\n self.clear_mox()\n self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, \"get_cpg\",\n self.fake_get_cpg)\n self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, \"get_domain\",\n ... | [
1,
1,
0,
1,
0,
1,
0,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 529,
"char_start": 528,
"chars": "["
},
{
"char_end": 540,
"char_start": 538,
"chars": "',"
},
{
"char_end": 542,
"char_start": 541,
"chars": "'"
},
{
... | 108 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def test_create_modify_host(self):\n self.flags(lock_path=self.tempdir)",
" #record\n self.clear_mox()\n self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, \"get_cpg\",\n self.fake_get_cpg)\n self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, \"get_domain\",\n ... | [
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 529,
"char_start": 528,
"chars": "["
},
{
"char_end": 540,
"char_start": 538,
"chars": "',"
},
{
"char_end": 542,
"char_start": 541,
"chars": "'"
},
{
... | 108 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def install(filename, target):\n '''Run a package's installer script against the given target directory.'''\n print(' Unpacking %s...' % filename)",
" os.system('tar xf ' + filename)",
" basename = filename.split('.tar')[0]\n print(' Installing %s...' % basename)",
" install_opts = '--prefix=${PWD}/%s ... | [
1,
0,
1,
0,
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 154,
"char_start": 149,
"chars": "subpr"
},
{
"char_end": 158,
"char_start": 155,
"chars": "ces"
},
{
"char_end": 162,
"char_start": 160,
"chars": "ch"
},
... | 109 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def install(filename, target):\n '''Run a package's installer script against the given target directory.'''\n print(' Unpacking %s...' % filename)",
" subprocess.check_call(['tar', 'xf', filename])",
" basename = filename.split('.tar')[0]\n print(' Installing %s...' % basename)",
" install_cmd = [os.pa... | [
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 154,
"char_start": 149,
"chars": "subpr"
},
{
"char_end": 158,
"char_start": 155,
"chars": "ces"
},
{
"char_end": 162,
"char_start": 160,
"chars": "ch"
},
... | 109 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _get_least_used_nsp(self, nspss):\n \"\"\"\"Return the nsp that has the fewest active vluns.\"\"\"\n # return only the nsp (node:server:port)",
" result = self.common._cli_run('showvlun -a -showcols Port', None)",
"\n # count the number of nsps (there is 1 for each active vlun)\... | [
1,
0,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 194,
"char_start": 193,
"chars": "["
},
{
"char_end": 205,
"char_start": 203,
"chars": "',"
},
{
"char_end": 207,
"char_start": 206,
"chars": "'"
},
{
... | 110 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _get_least_used_nsp(self, nspss):\n \"\"\"\"Return the nsp that has the fewest active vluns.\"\"\"\n # return only the nsp (node:server:port)",
" result = self.common._cli_run(['showvlun', '-a', '-showcols', 'Port'])",
"\n # count the number of nsps (there is 1 for each active v... | [
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 194,
"char_start": 193,
"chars": "["
},
{
"char_end": 205,
"char_start": 203,
"chars": "',"
},
{
"char_end": 207,
"char_start": 206,
"chars": "'"
},
{
... | 110 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _start_fc_map(self, fc_map_id, source, target):\n try:",
" out, err = self._run_ssh('svctask startfcmap %s' % fc_map_id)",
" except exception.ProcessExecutionError as e:\n with excutils.save_and_reraise_exception():\n LOG.error(_('_start_fc_map: Failed to ... | [
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 107,
"char_start": 106,
"chars": "["
},
{
"char_end": 117,
"char_start": 115,
"chars": "',"
},
{
"char_end": 119,
"char_start": 118,
"chars": "'"
},
{
... | 111 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _start_fc_map(self, fc_map_id, source, target):\n try:",
" out, err = self._run_ssh(['svctask', 'startfcmap', fc_map_id])",
" except exception.ProcessExecutionError as e:\n with excutils.save_and_reraise_exception():\n LOG.error(_('_start_fc_map: Failed to... | [
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 107,
"char_start": 106,
"chars": "["
},
{
"char_end": 117,
"char_start": 115,
"chars": "',"
},
{
"char_end": 119,
"char_start": 118,
"chars": "'"
},
{
... | 111 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"@then(parsers.parse(\"the hostname '{hostname}' should be resolved\"))\ndef resolve_hostname(busybox_pod, host, hostname):",
" with host.sudo():\n # test dns resolve\n cmd_nslookup = (\"kubectl --kubeconfig=/etc/kubernetes/admin.conf\"\n \" exec -ti {0} nsl... | [
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 179,
"char_start": 177,
"chars": "re"
},
{
"char_end": 181,
"char_start": 180,
"chars": "u"
},
{
"char_end": 187,
"char_start": 182,
"chars": "t = h"
},
{
... | 112 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"@then(parsers.parse(\"the hostname '{hostname}' should be resolved\"))\ndef resolve_hostname(busybox_pod, host, hostname):",
" with host.sudo():\n # test dns resolve\n result = host.run(\n \"kubectl --kubeconfig=/etc/kubernetes/admin.conf \"\n \"exec -ti %s nslookup %s\",\n... | [
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 179,
"char_start": 177,
"chars": "re"
},
{
"char_end": 181,
"char_start": 180,
"chars": "u"
},
{
"char_end": 187,
"char_start": 182,
"chars": "t = h"
},
{
... | 112 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _modify_3par_fibrechan_host(self, hostname, wwn):",
" # when using -add, you can not send the persona or domain options",
" out = self.common._cli_run('createhost -add %s %s'\n % (hostname, \" \".join(wwn)), None)"
] | [
0,
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 56,
"char_start": 55,
"chars": "s"
},
{
"char_end": 146,
"char_start": 145,
"chars": "a"
},
{
"char_end": 152,
"char_start": 147,
"chars": "d = ["
},
{
... | 113 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _modify_3par_fibrechan_host(self, hostname, wwns):",
" # when using -add, you can not send the persona or domain options",
" command = ['createhost', '-add', hostname]\n for wwn in wwns:\n command.append(wwn)",
" out = self.common._cli_run(command)"
] | [
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 56,
"char_start": 55,
"chars": "s"
},
{
"char_end": 146,
"char_start": 145,
"chars": "a"
},
{
"char_end": 152,
"char_start": 147,
"chars": "d = ["
},
{
... | 113 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def test_settings_path_skip_issue_909(tmpdir):\n base_dir = tmpdir.mkdir('project')\n config_dir = base_dir.mkdir('conf')\n config_dir.join('.isort.cfg').write('[isort]\\n'\n 'skip =\\n'\n ' file_to_be_skipped.py\\n'\n ... | [
1,
1,
1,
0,
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1215,
"char_start": 1209,
"chars": "subpro"
},
{
"char_end": 1221,
"char_start": 1217,
"chars": "ss.r"
},
{
"char_end": 1223,
"char_start": 1222,
"chars": "n"
},... | 114 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def test_settings_path_skip_issue_909(tmpdir):\n base_dir = tmpdir.mkdir('project')\n config_dir = base_dir.mkdir('conf')\n config_dir.join('.isort.cfg').write('[isort]\\n'\n 'skip =\\n'\n ' file_to_be_skipped.py\\n'\n ... | [
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1215,
"char_start": 1209,
"chars": "subpro"
},
{
"char_end": 1221,
"char_start": 1217,
"chars": "ss.r"
},
{
"char_end": 1223,
"char_start": 1222,
"chars": "n"
},... | 114 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _create_3par_fibrechan_host(self, hostname, wwn, domain, persona_id):",
" \"\"\"Create a 3PAR host.",
" Create a 3PAR host, if there is already a host on the 3par using\n the same wwn but with a different hostname, return the hostname\n used by 3PAR.\n \"\"\"",
" ... | [
0,
1,
1,
0,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 56,
"char_start": 55,
"chars": "s"
},
{
"char_end": 303,
"char_start": 302,
"chars": "a"
},
{
"char_end": 309,
"char_start": 304,
"chars": "d = ["
},
{
... | 115 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _create_3par_fibrechan_host(self, hostname, wwns, domain, persona_id):",
" \"\"\"Create a 3PAR host.",
" Create a 3PAR host, if there is already a host on the 3par using\n the same wwn but with a different hostname, return the hostname\n used by 3PAR.\n \"\"\"",
" ... | [
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 56,
"char_start": 55,
"chars": "s"
},
{
"char_end": 303,
"char_start": 302,
"chars": "a"
},
{
"char_end": 309,
"char_start": 304,
"chars": "d = ["
},
{
... | 115 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def take_bug_report(self, test_name, begin_time):\n \"\"\"Takes a bug report on the device and stores it in a file.",
" Args:\n test_name: Name of the test case that triggered this bug report.\n begin_time: Logline format timestamp taken when the test started.\n \"\"\"\... | [
1,
1,
0,
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1553,
"char_start": 1552,
"chars": "["
},
{
"char_end": 1580,
"char_start": 1579,
"chars": "]"
},
{
"char_end": 1725,
"char_start": 1608,
"chars": "# shell=True as thi... | 116 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def take_bug_report(self, test_name, begin_time):\n \"\"\"Takes a bug report on the device and stores it in a file.",
" Args:\n test_name: Name of the test case that triggered this bug report.\n begin_time: Logline format timestamp taken when the test started.\n \"\"\"\... | [
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1553,
"char_start": 1552,
"chars": "["
},
{
"char_end": 1580,
"char_start": 1579,
"chars": "]"
},
{
"char_end": 1725,
"char_start": 1608,
"chars": "# shell=True as thi... | 116 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def test_create_invalid_host(self):\n self.flags(lock_path=self.tempdir)",
" #record\n self.clear_mox()\n self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, \"get_cpg\",\n self.fake_get_cpg)\n self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, \"get_domain\",\n ... | [
1,
1,
0,
1,
0,
1,
0,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 530,
"char_start": 529,
"chars": "["
},
{
"char_end": 541,
"char_start": 539,
"chars": "',"
},
{
"char_end": 543,
"char_start": 542,
"chars": "'"
},
{
... | 117 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def test_create_invalid_host(self):\n self.flags(lock_path=self.tempdir)",
" #record\n self.clear_mox()\n self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, \"get_cpg\",\n self.fake_get_cpg)\n self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, \"get_domain\",\n ... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 530,
"char_start": 529,
"chars": "["
},
{
"char_end": 541,
"char_start": 539,
"chars": "',"
},
{
"char_end": 543,
"char_start": 542,
"chars": "'"
},
{
... | 117 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def adb_call(*args):",
" clean_name = name.replace('_', '-')",
" arg_str = ' '.join(str(elem) for elem in args)\n return self._exec_adb_cmd(clean_name, arg_str)"
] | [
0,
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 43,
"char_start": 25,
"chars": "=None, shell=False"
},
{
"char_end": 66,
"char_start": 58,
"chars": "\"\"\"Wrapp"
},
{
"char_end": 73,
"char_start": 67,
"chars": "r fo... | 118 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def adb_call(args=None, shell=False):\n \"\"\"Wrapper for an ADB command.",
" Args:\n args: string or list of strings, arguments to the adb command.\n See subprocess.Proc() documentation.\n shell: bool, True to run this command through the sy... | [
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 43,
"char_start": 25,
"chars": "=None, shell=False"
},
{
"char_end": 66,
"char_start": 58,
"chars": "\"\"\"Wrapp"
},
{
"char_end": 73,
"char_start": 67,
"chars": "r fo... | 118 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def test_skip_paths_issue_938(tmpdir):\n base_dir = tmpdir.mkdir('project')\n config_dir = base_dir.mkdir('conf')\n config_dir.join('.isort.cfg').write('[isort]\\n'\n 'line_length = 88\\n'\n 'multi_line_output = 4\\n'\n ... | [
1,
1,
1,
0,
1,
0,
1,
0,
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1206,
"char_start": 1200,
"chars": "subpro"
},
{
"char_end": 1212,
"char_start": 1208,
"chars": "ss.r"
},
{
"char_end": 1214,
"char_start": 1213,
"chars": "n"
},... | 119 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def test_skip_paths_issue_938(tmpdir):\n base_dir = tmpdir.mkdir('project')\n config_dir = base_dir.mkdir('conf')\n config_dir.join('.isort.cfg').write('[isort]\\n'\n 'line_length = 88\\n'\n 'multi_line_output = 4\\n'\n ... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1206,
"char_start": 1200,
"chars": "subpro"
},
{
"char_end": 1212,
"char_start": 1208,
"chars": "ss.r"
},
{
"char_end": 1214,
"char_start": 1213,
"chars": "n"
},... | 119 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _ensure_vdisk_no_fc_mappings(self, name, allow_snaps=True):\n # Ensure vdisk has no FlashCopy mappings\n mapping_ids = self._get_vdisk_fc_mappings(name)\n while len(mapping_ids):\n wait_for_copy = False\n for map_id in mapping_ids:\n attrs = self._get_f... | [
1,
1,
0,
1,
0,
1,
0,
1,
0,
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 855,
"char_start": 854,
"chars": "["
},
{
"char_end": 865,
"char_start": 863,
"chars": "',"
},
{
"char_end": 867,
"char_start": 866,
"chars": "'"
},
{
... | 120 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _ensure_vdisk_no_fc_mappings(self, name, allow_snaps=True):\n # Ensure vdisk has no FlashCopy mappings\n mapping_ids = self._get_vdisk_fc_mappings(name)\n while len(mapping_ids):\n wait_for_copy = False\n for map_id in mapping_ids:\n attrs = self._get_f... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 855,
"char_start": 854,
"chars": "["
},
{
"char_end": 865,
"char_start": 863,
"chars": "',"
},
{
"char_end": 867,
"char_start": 866,
"chars": "'"
},
{
... | 120 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def tcp_forward(self, host_port, device_port):\n \"\"\"Starts tcp forwarding.",
" Args:\n host_port: Port number to use on the computer.\n device_port: Port number to use on the android device.\n \"\"\"",
" self.forward('tcp:%d tcp:%d' % (host_port, device_port... | [
1,
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 260,
"char_start": 259,
"chars": "["
},
{
"char_end": 293,
"char_start": 282,
"chars": "'tcp:%d' % "
},
{
"char_end": 305,
"char_start": 304,
"chars": "]"
}
... | 121 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def tcp_forward(self, host_port, device_port):\n \"\"\"Starts tcp forwarding.",
" Args:\n host_port: Port number to use on the computer.\n device_port: Port number to use on the android device.\n \"\"\"",
" self.forward(['tcp:%d' % host_port, 'tcp:%d' % device_... | [
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 260,
"char_start": 259,
"chars": "["
},
{
"char_end": 293,
"char_start": 282,
"chars": "'tcp:%d' % "
},
{
"char_end": 305,
"char_start": 304,
"chars": "]"
}
... | 121 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def repack(host, targets, channel='stable'):",
"",
" url = 'https://static.rust-lang.org/dist/channel-rust-' + channel + '.toml'\n req = requests.get(url)\n req.raise_for_status()\n manifest = toml.loads(req.content)\n if manifest['manifest-version'] != '2':\n print('ERROR: unrecognized manifest versio... | [
1,
0,
1,
0,
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 90,
"char_start": 47,
"chars": "print(\"Repacking rust for %s...\" % host)\n "
},
{
"char_end": 1211,
"char_start": 1206,
"chars": "subpr"
},
{
"char_end": 1214,
"char_start"... | 122 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def repack(host, targets, channel='stable'):",
" print(\"Repacking rust for %s...\" % host)",
" url = 'https://static.rust-lang.org/dist/channel-rust-' + channel + '.toml'\n req = requests.get(url)\n req.raise_for_status()\n manifest = toml.loads(req.content)\n if manifest['manifest-version'] != '2':\n ... | [
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 90,
"char_start": 47,
"chars": "print(\"Repacking rust for %s...\" % host)\n "
},
{
"char_end": 1211,
"char_start": 1206,
"chars": "subpr"
},
{
"char_end": 1214,
"char_start"... | 122 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def extend_volume(self, volume, new_size):\n volume_name = self._get_3par_vol_name(volume['id'])\n old_size = volume.size\n growth_size = int(new_size) - old_size\n LOG.debug(\"Extending Volume %s from %s to %s, by %s GB.\" %\n (volume_name, old_size, new_size, growth_s... | [
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 359,
"char_start": 357,
"chars": "['"
},
{
"char_end": 367,
"char_start": 365,
"chars": "',"
},
{
"char_end": 369,
"char_start": 368,
"chars": "'"
},
{
... | 123 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def extend_volume(self, volume, new_size):\n volume_name = self._get_3par_vol_name(volume['id'])\n old_size = volume.size\n growth_size = int(new_size) - old_size\n LOG.debug(\"Extending Volume %s from %s to %s, by %s GB.\" %\n (volume_name, old_size, new_size, growth_s... | [
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 359,
"char_start": 357,
"chars": "['"
},
{
"char_end": 367,
"char_start": 365,
"chars": "',"
},
{
"char_end": 369,
"char_start": 368,
"chars": "'"
},
{
... | 123 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _remove_volume_set(self, vvs_name):\n # Must first clear the QoS rules before removing the volume set",
" self._cli_run('setqos -clear vvset:%s' % (vvs_name), None)\n self._cli_run('removevvset -f %s' % (vvs_name), None)"
] | [
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 139,
"char_start": 138,
"chars": "["
},
{
"char_end": 148,
"char_start": 146,
"chars": "',"
},
{
"char_end": 150,
"char_start": 149,
"chars": "'"
},
{
... | 124 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _remove_volume_set(self, vvs_name):\n # Must first clear the QoS rules before removing the volume set",
" self._cli_run(['setqos', '-clear', 'vvset:%s' % (vvs_name)])\n self._cli_run(['removevvset', '-f', vvs_name])"
] | [
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 139,
"char_start": 138,
"chars": "["
},
{
"char_end": 148,
"char_start": 146,
"chars": "',"
},
{
"char_end": 150,
"char_start": 149,
"chars": "'"
},
{
... | 124 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _get_3par_hostname_from_wwn_iqn(self, wwns_iqn):",
" out = self._cli_run('showhost -d', None)",
" # wwns_iqn may be a list of strings or a single\n # string. So, if necessary, create a list to loop.\n if not isinstance(wwns_iqn, list):\n wwn_iqn_list = [wwns_iqn]\n ... | [
1,
0,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 86,
"char_start": 85,
"chars": "["
},
{
"char_end": 97,
"char_start": 95,
"chars": "',"
},
{
"char_end": 99,
"char_start": 98,
"chars": "'"
},
{
"c... | 125 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _get_3par_hostname_from_wwn_iqn(self, wwns_iqn):",
" out = self._cli_run(['showhost', '-d'])",
" # wwns_iqn may be a list of strings or a single\n # string. So, if necessary, create a list to loop.\n if not isinstance(wwns_iqn, list):\n wwn_iqn_list = [wwns_iqn]\n ... | [
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 86,
"char_start": 85,
"chars": "["
},
{
"char_end": 97,
"char_start": 95,
"chars": "',"
},
{
"char_end": 99,
"char_start": 98,
"chars": "'"
},
{
"c... | 125 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def get_ports(self):\n # First get the active FC ports",
" out = self._cli_run('showport', None)",
"\n # strip out header\n # N:S:P,Mode,State,----Node_WWN----,-Port_WWN/HW_Addr-,Type,\n # Protocol,Label,Partner,FailoverState\n out = out[1:len(out) - 2]",
" po... | [
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
0,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 94,
"char_start": 93,
"chars": "["
},
{
"char_end": 105,
"char_start": 104,
"chars": "]"
},
{
"char_end": 628,
"char_start": 627,
"chars": "["
},
{
... | 126 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def get_ports(self):\n # First get the active FC ports",
" out = self._cli_run(['showport'])",
"\n # strip out header\n # N:S:P,Mode,State,----Node_WWN----,-Port_WWN/HW_Addr-,Type,\n # Protocol,Label,Partner,FailoverState\n out = out[1:len(out) - 2]",
" ports ... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 94,
"char_start": 93,
"chars": "["
},
{
"char_end": 105,
"char_start": 104,
"chars": "]"
},
{
"char_end": 628,
"char_start": 627,
"chars": "["
},
{
... | 126 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def test_get_least_used_nsp(self):\n self.flags(lock_path=self.tempdir)",
" #record\n self.clear_mox()\n _run_ssh = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._run_ssh)\n self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, \"_run_ssh\", _run_ssh)\n",
" show_vlun_cmd... | [
1,
1,
0,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 307,
"char_start": 306,
"chars": "["
},
{
"char_end": 318,
"char_start": 316,
"chars": "',"
},
{
"char_end": 320,
"char_start": 319,
"chars": "'"
},
{
... | 127 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def test_get_least_used_nsp(self):\n self.flags(lock_path=self.tempdir)",
" #record\n self.clear_mox()\n _run_ssh = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._run_ssh)\n self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, \"_run_ssh\", _run_ssh)\n",
" show_vlun_cmd... | [
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 307,
"char_start": 306,
"chars": "["
},
{
"char_end": 318,
"char_start": 316,
"chars": "',"
},
{
"char_end": 320,
"char_start": 319,
"chars": "'"
},
{
... | 127 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _cmd_to_dict(self, cmd):\n arg_list = cmd.split()",
" no_param_args = [\n 'autodelete',\n 'autoexpand',\n 'bytes',\n 'compressed',\n 'force',\n 'nohdr',\n ]\n one_param_args = [\n 'chapsecret',\n ... | [
0,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 37,
"char_start": 36,
"chars": ":"
}
],
"deleted": [
{
"char_end": 41,
"char_start": 27,
"chars": "cmd):\n "
},
{
"char_end": 62,
"char_start": 49,
"cha... | 128 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _cmd_to_dict(self, arg_list):",
" no_param_args = [\n 'autodelete',\n 'autoexpand',\n 'bytes',\n 'compressed',\n 'force',\n 'nohdr',\n ]\n one_param_args = [\n 'chapsecret',\n 'cleanrate',\n ... | [
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 37,
"char_start": 36,
"chars": ":"
}
],
"deleted": [
{
"char_end": 41,
"char_start": 27,
"chars": "cmd):\n "
},
{
"char_end": 62,
"char_start": 49,
"cha... | 128 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _cli_run(self, verb, cli_args):",
" \"\"\"Runs a CLI command over SSH, without doing any result parsing.\"\"\"",
" cli_arg_strings = []\n if cli_args:\n for k, v in cli_args.items():\n if k == '':\n cli_arg_strings.append(\" %s\" % k)\n ... | [
0,
1,
0,
0,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 26,
"char_start": 24,
"chars": "md"
}
],
"deleted": [
{
"char_end": 29,
"char_start": 23,
"chars": "verb, "
},
{
"char_end": 37,
"char_start": 30,
"chars": "li... | 129 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _cli_run(self, cmd):",
" \"\"\"Runs a CLI command over SSH, without doing any result parsing.\"\"\"",
"",
" LOG.debug(\"SSH CMD = %s \" % cmd)",
" (stdout, stderr) = self._run_ssh(cmd, False)",
" # we have to strip out the input and exit lines\n tmp = stdout.split(\... | [
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 26,
"char_start": 24,
"chars": "md"
}
],
"deleted": [
{
"char_end": 29,
"char_start": 23,
"chars": "verb, "
},
{
"char_end": 37,
"char_start": 30,
"chars": "li... | 129 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _call_external_zip(base_dir, zip_filename, verbose=False, dry_run=False):",
" # XXX see if we want to keep an external call here\n if verbose:\n zipoptions = \"-r\"\n else:\n zipoptions = \"-rq\"",
" from distutils.errors import DistutilsExecError\n from distutils.spawn import ... | [
0,
1,
0,
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 65,
"char_start": 63,
"chars": ", "
},
{
"char_end": 69,
"char_start": 66,
"chars": "ogg"
},
{
"char_end": 71,
"char_start": 70,
"chars": "r"
},
{
... | 130 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _call_external_zip(base_dir, zip_filename, verbose, dry_run, logger):",
" # XXX see if we want to keep an external call here\n if verbose:\n zipoptions = \"-r\"\n else:\n zipoptions = \"-rq\"",
" cmd = [\"zip\", zipoptions, zip_filename, base_dir]\n if logger is not None:\n ... | [
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 65,
"char_start": 63,
"chars": ", "
},
{
"char_end": 69,
"char_start": 66,
"chars": "ogg"
},
{
"char_end": 71,
"char_start": 70,
"chars": "r"
},
{
... | 130 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _create_host(self, connector):\n \"\"\"Create a new host on the storage system.",
" We create a host name and associate it with the given connection\n information.",
" \"\"\"",
" LOG.debug(_('enter: _create_host: host %s') % connector['host'])",
" rand_id = str... | [
1,
1,
1,
1,
1,
1,
1,
0,
1,
1,
0,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 966,
"char_start": 924,
"chars": "arg_name, arg_val = port1.split()\n "
},
{
"char_end": 977,
"char_start": 976,
"chars": "["
},
{
"char_end": 987,
"char_start": 985,
... | 131 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _create_host(self, connector):\n \"\"\"Create a new host on the storage system.",
" We create a host name and associate it with the given connection\n information.",
" \"\"\"",
" LOG.debug(_('enter: _create_host: host %s') % connector['host'])",
" rand_id = str... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 966,
"char_start": 924,
"chars": "arg_name, arg_val = port1.split()\n "
},
{
"char_end": 977,
"char_start": 976,
"chars": "["
},
{
"char_end": 987,
"char_start": 985,
... | 131 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _get_iscsi_ip_addrs(self):",
" generator = self._port_conf_generator('svcinfo lsportip')",
" header = next(generator, None)\n if not header:\n return",
" for port_data in generator:\n try:\n port_node_id = port_data['node_id']\n ... | [
1,
0,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 82,
"char_start": 81,
"chars": "["
},
{
"char_end": 92,
"char_start": 90,
"chars": "',"
},
{
"char_end": 94,
"char_start": 93,
"chars": "'"
},
{
"c... | 132 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _get_iscsi_ip_addrs(self):",
" generator = self._port_conf_generator(['svcinfo', 'lsportip'])",
" header = next(generator, None)\n if not header:\n return",
" for port_data in generator:\n try:\n port_node_id = port_data['node_id']\n ... | [
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 82,
"char_start": 81,
"chars": "["
},
{
"char_end": 92,
"char_start": 90,
"chars": "',"
},
{
"char_end": 94,
"char_start": 93,
"chars": "'"
},
{
"c... | 132 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def talk(myText):\r\n if( myText.find( \"twitter\" ) >= 0 ):\r\n myText += \"0\"\r\n myText = myText[7:-1]\r\n try:\r\n\t myText = twitter.getTweet( myText )\r\n\texcept:\r\n\t print( \"!!!ERROR: INVALID TWITTER CREDENTIALS. Please read README.md for instructions.\")\r\n re... | [
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 450,
"char_start": 445,
"chars": "subpr"
},
{
"char_end": 454,
"char_start": 451,
"chars": "ces"
},
{
"char_end": 460,
"char_start": 456,
"chars": "call"
},
... | 133 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def talk(myText):\r\n if( myText.find( \"twitter\" ) >= 0 ):\r\n myText += \"0\"\r\n myText = myText[7:-1]\r\n try:\r\n\t myText = twitter.getTweet( myText )\r\n\texcept:\r\n\t print( \"!!!ERROR: INVALID TWITTER CREDENTIALS. Please read README.md for instructions.\")\r\n re... | [
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 450,
"char_start": 445,
"chars": "subpr"
},
{
"char_end": 454,
"char_start": 451,
"chars": "ces"
},
{
"char_end": 460,
"char_start": 456,
"chars": "call"
},
... | 133 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _exec_cmd(self, cmd):\n \"\"\"Executes adb commands in a new shell.",
" This is specific to executing adb binary because stderr is not a good\n indicator of cmd execution status.",
"\n Args:",
" cmds: A string that is the adb command to execute.",
"\n Retur... | [
0,
0,
1,
0,
1,
1,
0,
1,
0,
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 35,
"char_start": 24,
"chars": "args, shell"
},
{
"char_end": 73,
"char_start": 70,
"chars": ".\n\n"
},
{
"char_end": 80,
"char_start": 76,
"chars": " "
},
... | 134 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _exec_cmd(self, args, shell):\n \"\"\"Executes adb commands.",
"\n Args:",
" args: string or list of strings, program arguments.\n See subprocess.Popen() documentation.\n shell: bool, True to run this command through the system shell,\n Fals... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 35,
"char_start": 24,
"chars": "args, shell"
},
{
"char_end": 73,
"char_start": 70,
"chars": ".\n\n"
},
{
"char_end": 80,
"char_start": 76,
"chars": " "
},
... | 134 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _get_conn_fc_wwpns(self, host_name):\n wwpns = []",
" cmd = 'svcinfo lsfabric -host %s' % host_name",
" generator = self._port_conf_generator(cmd)\n header = next(generator, None)\n if not header:\n return wwpns",
" for port_data in generator:\n ... | [
1,
0,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 79,
"char_start": 78,
"chars": "["
},
{
"char_end": 89,
"char_start": 87,
"chars": "',"
},
{
"char_end": 91,
"char_start": 90,
"chars": "'"
},
{
"c... | 135 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _get_conn_fc_wwpns(self, host_name):\n wwpns = []",
" cmd = ['svcinfo', 'lsfabric', '-host', host_name]",
" generator = self._port_conf_generator(cmd)\n header = next(generator, None)\n if not header:\n return wwpns",
" for port_data in generator:\n ... | [
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 79,
"char_start": 78,
"chars": "["
},
{
"char_end": 89,
"char_start": 87,
"chars": "',"
},
{
"char_end": 91,
"char_start": 90,
"chars": "'"
},
{
"c... | 135 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _create_3par_iscsi_host(self, hostname, iscsi_iqn, domain, persona_id):\n \"\"\"Create a 3PAR host.",
" Create a 3PAR host, if there is already a host on the 3par using\n the same iqn but with a different hostname, return the hostname\n used by 3PAR.\n \"\"\"",
" c... | [
1,
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 306,
"char_start": 305,
"chars": "["
},
{
"char_end": 319,
"char_start": 317,
"chars": "',"
},
{
"char_end": 321,
"char_start": 320,
"chars": "'"
},
{
... | 136 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _create_3par_iscsi_host(self, hostname, iscsi_iqn, domain, persona_id):\n \"\"\"Create a 3PAR host.",
" Create a 3PAR host, if there is already a host on the 3par using\n the same iqn but with a different hostname, return the hostname\n used by 3PAR.\n \"\"\"",
" c... | [
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 306,
"char_start": 305,
"chars": "["
},
{
"char_end": 319,
"char_start": 317,
"chars": "',"
},
{
"char_end": 321,
"char_start": 320,
"chars": "'"
},
{
... | 136 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _delete_3par_host(self, hostname):",
" self._cli_run('removehost %s' % hostname, None)"
] | [
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 66,
"char_start": 65,
"chars": "["
},
{
"char_end": 79,
"char_start": 78,
"chars": ","
},
{
"char_end": 89,
"char_start": 88,
"chars": "]"
}
],
"deleted"... | 137 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _delete_3par_host(self, hostname):",
" self._cli_run(['removehost', hostname])"
] | [
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 66,
"char_start": 65,
"chars": "["
},
{
"char_end": 79,
"char_start": 78,
"chars": ","
},
{
"char_end": 89,
"char_start": 88,
"chars": "]"
}
],
"deleted"... | 137 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def process_statistics(self, metadata, _):\n args = [metadata.hostname, '-p', metadata.profile, '-g',\n ':'.join([g for g in metadata.groups])]",
"",
" for notifier in os.listdir(self.data):",
"",
" if ((notifier[-1] == '~') or\n (notifier[:2] == '.#')... | [
1,
0,
1,
0,
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 219,
"char_start": 176,
"chars": "self.debug_log(\"running triggers\")\n "
},
{
"char_end": 309,
"char_start": 257,
"chars": "\n self.debug_log(\"running %s\" % notifier)"
},
... | 138 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def process_statistics(self, metadata, _):\n args = [metadata.hostname, '-p', metadata.profile, '-g',\n ':'.join([g for g in metadata.groups])]",
" self.debug_log(\"running triggers\")",
" for notifier in os.listdir(self.data):",
" self.debug_log(\"running %s\" ... | [
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 219,
"char_start": 176,
"chars": "self.debug_log(\"running triggers\")\n "
},
{
"char_end": 309,
"char_start": 257,
"chars": "\n self.debug_log(\"running %s\" % notifier)"
},
... | 138 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _delete_host(self, host_name):\n \"\"\"Delete a host on the storage system.\"\"\"",
" LOG.debug(_('enter: _delete_host: host %s ') % host_name)\n",
" ssh_cmd = 'svctask rmhost %s ' % host_name",
" out, err = self._run_ssh(ssh_cmd)\n # No output should be returned from r... | [
1,
1,
0,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 177,
"char_start": 176,
"chars": "["
},
{
"char_end": 187,
"char_start": 185,
"chars": "',"
},
{
"char_end": 189,
"char_start": 188,
"chars": "'"
},
{
... | 139 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _delete_host(self, host_name):\n \"\"\"Delete a host on the storage system.\"\"\"",
" LOG.debug(_('enter: _delete_host: host %s ') % host_name)\n",
" ssh_cmd = ['svctask', 'rmhost', host_name]",
" out, err = self._run_ssh(ssh_cmd)\n # No output should be returned from r... | [
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 177,
"char_start": 176,
"chars": "["
},
{
"char_end": 187,
"char_start": 185,
"chars": "',"
},
{
"char_end": 189,
"char_start": 188,
"chars": "'"
},
{
... | 139 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def fetch(url):\n '''Download and verify a package url.'''\n base = os.path.basename(url)\n print('Fetching %s...' % base)\n fetch_file(url + '.asc')\n fetch_file(url)\n fetch_file(url + '.sha256')\n fetch_file(url + '.asc.sha256')\n print('Verifying %s...' % base)\n # TODO: check for verification failure... | [
1,
0
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 315,
"char_start": 310,
"chars": "subpr"
},
{
"char_end": 319,
"char_start": 316,
"chars": "ces"
},
{
"char_end": 323,
"char_start": 321,
"chars": "ch"
},
... | 140 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def fetch(url):\n '''Download and verify a package url.'''\n base = os.path.basename(url)\n print('Fetching %s...' % base)\n fetch_file(url + '.asc')\n fetch_file(url)\n fetch_file(url + '.sha256')\n fetch_file(url + '.asc.sha256')\n print('Verifying %s...' % base)\n # TODO: check for verification failure... | [
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 315,
"char_start": 310,
"chars": "subpr"
},
{
"char_end": 319,
"char_start": 316,
"chars": "ces"
},
{
"char_end": 323,
"char_start": 321,
"chars": "ch"
},
... | 140 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _formatCredentials(self, data, name):\n \"\"\"\n Credentials are of the form\n RCLONE_CONFIG_CURRENT_TYPE=s3\n ^ ^ ^ ^\n [mandatory ][name ][key][value]\n \"\"\"",
" prefix = \"RCLONE_CONFIG_{}\".format(name.upper())\n",
" cred... | [
1,
1,
0,
1,
0,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 307,
"char_start": 305,
"chars": "{}"
},
{
"char_end": 329,
"char_start": 327,
"chars": "['"
},
{
"char_end": 355,
"char_start": 351,
"chars": ")] ="
},
{
... | 141 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _formatCredentials(self, data, name):\n \"\"\"\n Credentials are of the form\n RCLONE_CONFIG_CURRENT_TYPE=s3\n ^ ^ ^ ^\n [mandatory ][name ][key][value]\n \"\"\"",
" prefix = \"RCLONE_CONFIG_{}\".format(name.upper())\n",
" cred... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 307,
"char_start": 305,
"chars": "{}"
},
{
"char_end": 329,
"char_start": 327,
"chars": "['"
},
{
"char_end": 355,
"char_start": 351,
"chars": ")] ="
},
{
... | 141 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def initHeader(self):\n \"\"\"Initialize the IP header according to the IP format definition.",
" \"\"\"",
" # Ethernet header",
" # Retrieve remote MAC address\n dstMacAddr = arpreq.arpreq(self.remoteIP)\n if dstMacAddr is not None:\n dstMacAddr = dstMacA... | [
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 457,
"char_start": 456,
"chars": "["
},
{
"char_end": 463,
"char_start": 458,
"chars": "/bin/"
},
{
"char_end": 469,
"char_start": 467,
"chars": "\","
},
{... | 142 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def initHeader(self):\n \"\"\"Initialize the IP header according to the IP format definition.",
" \"\"\"",
" # Ethernet header",
" # Retrieve remote MAC address\n dstMacAddr = arpreq.arpreq(self.remoteIP)\n if dstMacAddr is not None:\n dstMacAddr = dstMacA... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 457,
"char_start": 456,
"chars": "["
},
{
"char_end": 463,
"char_start": 458,
"chars": "/bin/"
},
{
"char_end": 469,
"char_start": 467,
"chars": "\","
},
{... | 142 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def poll(self, poll_input):\n username = poll_input.credentials.username\n password = poll_input.credentials.password\n domain = poll_input.credentials.domain\n \n if domain is None:",
" opt_str = '--ignore-certificate --authonly -u {} -p {} {}:{}'",
" o... | [
1,
0,
1,
0,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 277,
"char_start": 275,
"chars": "\\'"
},
{
"char_end": 281,
"char_start": 279,
"chars": "\\'"
},
{
"char_end": 287,
"char_start": 285,
"chars": "\\'"
},
{... | 143 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def poll(self, poll_input):\n username = poll_input.credentials.username\n password = poll_input.credentials.password\n domain = poll_input.credentials.domain\n \n if domain is None:",
" opt_str = '--ignore-certificate --authonly -u \\'{}\\' -p \\'{}\\' {}:{}'",
" ... | [
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 277,
"char_start": 275,
"chars": "\\'"
},
{
"char_end": 281,
"char_start": 279,
"chars": "\\'"
},
{
"char_end": 287,
"char_start": 285,
"chars": "\\'"
},
{... | 143 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def terminate_connection(self, volume, connector, **kwargs):\n \"\"\"Cleanup after an iSCSI connection has been terminated.",
" When we clean up a terminated connection between a given connector\n and volume, we:\n 1. Translate the given connector to a host name\n 2. Remove the... | [
1,
1,
1,
1,
0,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1300,
"char_start": 1299,
"chars": "["
},
{
"char_end": 1310,
"char_start": 1308,
"chars": "',"
},
{
"char_end": 1312,
"char_start": 1311,
"chars": "'"
},
... | 144 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def terminate_connection(self, volume, connector, **kwargs):\n \"\"\"Cleanup after an iSCSI connection has been terminated.",
" When we clean up a terminated connection between a given connector\n and volume, we:\n 1. Translate the given connector to a host name\n 2. Remove the... | [
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 1300,
"char_start": 1299,
"chars": "["
},
{
"char_end": 1310,
"char_start": 1308,
"chars": "',"
},
{
"char_end": 1312,
"char_start": 1311,
"chars": "'"
},
... | 144 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _port_conf_generator(self, cmd):",
" ssh_cmd = '%s -delim !' % cmd",
" out, err = self._run_ssh(ssh_cmd)",
" if not len(out.strip()):\n return\n port_lines = out.strip().split('\\n')\n if not len(port_lines):\n return",
" header = port_lin... | [
1,
0,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 64,
"char_start": 59,
"chars": "cmd +"
},
{
"char_end": 67,
"char_start": 65,
"chars": "['"
},
{
"char_end": 75,
"char_start": 73,
"chars": "',"
},
{
... | 145 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def _port_conf_generator(self, cmd):",
" ssh_cmd = cmd + ['-delim', '!']",
" out, err = self._run_ssh(ssh_cmd)",
" if not len(out.strip()):\n return\n port_lines = out.strip().split('\\n')\n if not len(port_lines):\n return",
" header = port_l... | [
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 64,
"char_start": 59,
"chars": "cmd +"
},
{
"char_end": 67,
"char_start": 65,
"chars": "['"
},
{
"char_end": 75,
"char_start": 73,
"chars": "',"
},
{
... | 145 | cwe-078 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def init_settings(self, ipython_app, kernel_manager, contents_manager,\n cluster_manager, session_manager, kernel_spec_manager,\n config_manager,\n log, base_url, default_url, settings_overrides,\n jinja_env_options=None):",
" ... | [
1,
1,
0,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 693,
"char_start": 648,
"chars": "{\"autoescape\": True}\n jenv_opt.update("
},
{
"char_end": 741,
"char_start": 739,
"chars": ")\n"
}
],
"deleted": []
},
"commit_link": "github.... | 146 | cwe-079 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def init_settings(self, ipython_app, kernel_manager, contents_manager,\n cluster_manager, session_manager, kernel_spec_manager,\n config_manager,\n log, base_url, default_url, settings_overrides,\n jinja_env_options=None):",
" ... | [
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 693,
"char_start": 648,
"chars": "{\"autoescape\": True}\n jenv_opt.update("
},
{
"char_end": 741,
"char_start": 739,
"chars": ")\n"
}
],
"deleted": []
},
"commit_link": "github.... | 146 | cwe-079 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"DeletionConfirmationDlg(QWidget *parent, const int &size, const QString &name, bool defaultDeleteFiles): QDialog(parent) {\n setupUi(this);\n if (size == 1)",
" label->setText(tr(\"Are you sure you want to delete '%1' from the transfer list?\", \"Are you sure you want to delete 'ubuntu-linux-iso' from... | [
1,
0,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 362,
"char_start": 333,
"chars": "Utils::String::toHtmlEscaped("
},
{
"char_end": 367,
"char_start": 366,
"chars": ")"
}
],
"deleted": []
},
"commit_link": "github.com/qbittorrent/qBitt... | 147 | cwe-079 | h |
Determine whether the {function_name} code is vulnerable or not. | [
"DeletionConfirmationDlg(QWidget *parent, const int &size, const QString &name, bool defaultDeleteFiles): QDialog(parent) {\n setupUi(this);\n if (size == 1)",
" label->setText(tr(\"Are you sure you want to delete '%1' from the transfer list?\", \"Are you sure you want to delete 'ubuntu-linux-iso' from... | [
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 362,
"char_start": 333,
"chars": "Utils::String::toHtmlEscaped("
},
{
"char_end": 367,
"char_start": 366,
"chars": ")"
}
],
"deleted": []
},
"commit_link": "github.com/qbittorrent/qBitt... | 147 | cwe-079 | h |
Determine whether the {function_name} code is vulnerable or not. | [
"@auth.public\n def get(self, build_id):\n try:\n build_id = int(build_id)",
" except ValueError as ex:\n self.response.write(ex.message)",
" self.abort(400)",
" build = model.Build.get_by_id(build_id)\n can_view = build and user.can_view_build_async(build).get_result()",
" if... | [
1,
0,
1,
1,
1,
0,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 135,
"char_start": 131,
"chars": "'inv"
},
{
"char_end": 149,
"char_start": 136,
"chars": "lid build id'"
},
{
"char_end": 395,
"char_start": 393,
"chars": "lf"
... | 148 | cwe-079 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"@auth.public\n def get(self, build_id):\n try:\n build_id = int(build_id)",
" except ValueError:\n self.response.write('invalid build id')",
" self.abort(400)",
" build = model.Build.get_by_id(build_id)\n can_view = build and user.can_view_build_async(build).get_result()",
" ... | [
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 135,
"char_start": 131,
"chars": "'inv"
},
{
"char_end": 149,
"char_start": 136,
"chars": "lid build id'"
},
{
"char_end": 395,
"char_start": 393,
"chars": "lf"
... | 148 | cwe-079 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def index(request, is_mobile=False):\n hue_collections = DashboardController(request.user).get_search_collections()\n collection_id = request.GET.get('collection')",
" if not hue_collections or not collection_id:\n return admin_collections(request, True, is_mobile)",
" try:\n collection_doc = Documen... | [
1,
1,
1,
1,
1,
0,
1,
0,
1,
1,
0,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 850,
"char_start": 842,
"chars": "antixss("
},
{
"char_end": 874,
"char_start": 869,
"chars": ", '')"
},
{
"char_end": 932,
"char_start": 924,
"chars": "antixss("
... | 149 | cwe-079 | py |
Determine whether the {function_name} code is vulnerable or not. | [
"def index(request, is_mobile=False):\n hue_collections = DashboardController(request.user).get_search_collections()\n collection_id = request.GET.get('collection')",
" if not hue_collections or not collection_id:\n return admin_collections(request, True, is_mobile)",
" try:\n collection_doc = Documen... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | SVEN | {
"char_changes": {
"added": [
{
"char_end": 850,
"char_start": 842,
"chars": "antixss("
},
{
"char_end": 874,
"char_start": 869,
"chars": ", '')"
},
{
"char_end": 932,
"char_start": 924,
"chars": "antixss("
... | 149 | cwe-079 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.