Search is not available for this dataset
id int32 | source_tokens list | has_bug bool | error_location int32 | repair_candidates list | bug_kind int32 | bug_kind_name string | repair_targets list | edges list | provenances list | template_name string | template string | rendered_input string | rendered_output string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
400 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"expected_tests",
",",
"directive",
"=",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"_expected_tests",
"=",
"expected_tests",
"#NEWLINE#",
"self",
".",
"directive",
"=",
"expected_tests"
] | true | 23 | [
"6",
"21",
"4",
"17",
"23",
"2",
"13",
"19"
] | 1 | VARIABLE_MISUSE | [
6,
21
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 17,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 18,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "mblayman/tappy/tap/line.py",
"license": "bsd-2-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def __init__(self, expected_tests, directive = None) :
self._expected_tests = expected_tests
self.directive = expected_tests
Is there a bug in the code above? | Yes |
401 | [
"#NEWLINE#",
"def __set_regnum__(",
"self",
",",
"v",
")",
":",
"#NEWLINE#",
"#INDENT#",
"_idaapi",
".",
"switch_info_ex_t_set_regnum",
"(",
"v",
",",
"v",
")"
] | true | 13 | [
"2",
"4",
"13",
"15"
] | 1 | VARIABLE_MISUSE | [
2
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 14,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 10... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "EiNSTeiN-/idapython/pywraps/py_nalt.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def __set_regnum__(self, v) :
_idaapi.switch_info_ex_t_set_regnum (v, v)
Is there a bug in the code above? | Yes |
402 | [
"#NEWLINE#",
"def render(",
"self",
",",
"context",
")",
":",
"#NEWLINE#",
"#INDENT#",
"indent_level",
"=",
"self",
".",
"indent_level",
".",
"resolve",
"(",
"context",
")",
"#NEWLINE#",
"if",
"self",
".",
"if_statement",
":",
"#NEWLINE#",
"#INDENT#",
"try",
"... | true | 89 | [
"23",
"31",
"37",
"53",
"63",
"80",
"4",
"17",
"41",
"76",
"84",
"95",
"97",
"9",
"13",
"68",
"89",
"92",
"101",
"112",
"2",
"11",
"21",
"35",
"70"
] | 1 | VARIABLE_MISUSE | [
9,
13
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 16,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 20,
"after_index": 22... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "cloudera/hue/desktop/core/ext-py/django-extensions-1.5.0/django_extensions/templatetags/indent_text.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def render(self, context) :
indent_level = self.indent_level.resolve (context)
if self.if_statement :
try :
if_statement = bool (self.if_statement.resolve (context))
except template.VariableDoesNotExist :
if_statement = False
else :
if_statement = True
output = self.nodelist.render (context)
if if_statement :
indent = (' ' * output)
output = (indent + indent.join (output.splitlines (True)))
return output
Is there a bug in the code above? | Yes |
403 | [
"#NEWLINE#",
"def on_channel_open(",
"self",
",",
"callback",
",",
"channel",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"channel",
"=",
"channel",
"#NEWLINE#",
"if",
"channel",
":",
"#NEWLINE#",
"#INDENT#",
"callback",
"(",
")"
] | true | 18 | [
"6",
"13",
"15",
"18",
"2",
"11",
"4",
"22"
] | 1 | VARIABLE_MISUSE | [
4,
22
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 15,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 17,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "mher/tornado-celery/tcelery/connection.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def on_channel_open(self, callback, channel) :
self.channel = channel
if channel :
callback ()
Is there a bug in the code above? | Yes |
404 | [
"#NEWLINE#",
"def test_figure_out_clusters_to_inspect_respects_the_user(",
")",
":",
"#NEWLINE#",
"#INDENT#",
"fake_args",
"=",
"mock",
".",
"Mock",
"(",
")",
"#NEWLINE#",
"fake_args",
".",
"clusters",
"=",
"'a,b,c'",
"#NEWLINE#",
"fake_all_clusters",
"=",
"[",
"'a'",
... | true | 48 | [
"6",
"14",
"46",
"48",
"20"
] | 1 | VARIABLE_MISUSE | [
20
] | [
[
{
"before_index": 5,
"after_index": 11,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 13,
"after_index": 18,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 19,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "Yelp/paasta/tests/cli/test_cmds_metastatus.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_figure_out_clusters_to_inspect_respects_the_user() :
fake_args = mock.Mock ()
fake_args.clusters = 'a,b,c'
fake_all_clusters = ['a', 'b', 'c', 'd']
assert (['a', 'b', 'c'] == metastatus.figure_out_clusters_to_inspect (fake_args, fake_args))
Is there a bug in the code above? | Yes |
405 | [
"#NEWLINE#",
"@",
"mock",
".",
"patch",
"(",
"'ironic_python_agent.hardware.dispatch_to_managers'",
",",
"autospec",
"=",
"True",
")",
"#NEWLINE#",
"@",
"mock",
".",
"patch",
"(",
"'ironic_python_agent.extensions.standby._write_image'",
",",
"autospec",
"=",
"True",
")"... | true | 177 | [
"42",
"61",
"99",
"40",
"55",
"92",
"44",
"67",
"108",
"38",
"75",
"115",
"124",
"131",
"142",
"173",
"49",
"81",
"83",
"96",
"103",
"119",
"165",
"159",
"73",
"86",
"137",
"149",
"177",
"179"
] | 1 | VARIABLE_MISUSE | [
159
] | [
[
{
"before_index": 1,
"after_index": 39,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 48,
"after_index": 52,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 54,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "openstack/ironic-python-agent/ironic_python_agent/tests/unit/extensions/test_standby.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | @ mock.patch ('ironic_python_agent.hardware.dispatch_to_managers', autospec = True)
@ mock.patch ('ironic_python_agent.extensions.standby._write_image', autospec = True)
@ mock.patch ('ironic_python_agent.extensions.standby._download_image', autospec = True)
def test_cache_image(self, download_mock, write_mock, dispatch_mock) :
image_info = _build_fake_image_info ()
download_mock.return_value = None
write_mock.return_value = None
dispatch_mock.return_value = 'manager'
async_result = self.agent_extension.cache_image (image_info = image_info)
async_result.join ()
download_mock.assert_called_once_with (image_info)
write_mock.assert_called_once_with (image_info, 'manager')
dispatch_mock.assert_called_once_with ('get_os_install_device')
self.assertEqual (image_info ['id'], self.agent_extension.cached_image_id)
self.assertEqual ('SUCCEEDED', async_result.command_status)
self.assertTrue (('result' in async_result.command_result.keys ()))
cmd_result = 'cache_image: image ({0}) cached to device {1} '.format (image_info ['id'], 'manager')
self.assertEqual (async_result, async_result.command_result ['result'])
Is there a bug in the code above? | Yes |
406 | [
"#NEWLINE#",
"def info_datastore(",
"self",
",",
"datastore_name",
"=",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n List information about a datastore. Content may vary based\\n on datastore type.\\n '",
"#NEWLINE#",
"(",
"ds",
",",
"datastore_name",
")",... | true | 35 | [
"14",
"28",
"26",
"30",
"2",
"19",
"4",
"16",
"23",
"35"
] | 1 | VARIABLE_MISUSE | [
26,
30
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 11,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "ooici/pyon/pyon/datastore/couchdb/base_store.py",
"license": "bsd-2-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def info_datastore(self, datastore_name = None) :
'
List information about a datastore. Content may vary based
on datastore type.
'
(ds, datastore_name) = self._get_datastore (datastore_name)
info = ds.info ()
return datastore_name
Is there a bug in the code above? | Yes |
407 | [
"#NEWLINE#",
"def get_show(",
"self",
",",
"imdb",
",",
"tvdb",
",",
"tvshowtitle",
",",
"year",
")",
":",
"#NEWLINE#",
"#INDENT#",
"try",
":",
"#NEWLINE#",
"#INDENT#",
"result",
"=",
"cache",
".",
"get",
"(",
"self",
".",
"dizigold_shows",
",",
"72",
")",... | true | 54 | [
"6",
"10",
"70",
"92",
"97",
"103",
"106",
"108",
"116",
"8",
"32",
"38",
"19",
"41",
"51",
"81",
"94",
"4",
"44",
"49",
"56",
"2",
"25",
"54"
] | 1 | VARIABLE_MISUSE | [
8,
32,
38
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 18,
"after_index": 28,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 31,
"after_index": 3... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "mrknow/filmkodi/plugin.video.specto/resources/lib/sources/dizigoldv2_tv.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def get_show(self, imdb, tvdb, tvshowtitle, year) :
try :
result = cache.get (self.dizigold_shows, 72)
tvshowtitle = cleantitle.tv (tvshowtitle)
result = [i [0] for i in result if (self == i [1])] [0]
try :
url = re.compile ('//.+?(/.+)').findall (result) [0]
except :
url = result
url = client.replaceHTMLCodes (url)
url = url.encode ('utf-8')
return url
except :
return
Is there a bug in the code above? | Yes |
408 | [
"#NEWLINE#",
"def test_assembles_9c_65c02(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"mpu",
"=",
"MPU65C02",
"(",
")",
"#NEWLINE#",
"self",
".",
"assertEqual",
"(",
"[",
"156",
",",
"52",
",",
"18",
"]",
",",
"self",
".",
"assemble",
"(",
"'STZ $1234'",
... | true | 33 | [
"7",
"2",
"13",
"25",
"33"
] | 1 | VARIABLE_MISUSE | [
7
] | [
[
{
"before_index": 6,
"after_index": 10,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 24,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "mnaberez/py65/py65/tests/test_assembler.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_assembles_9c_65c02(self) :
mpu = MPU65C02 ()
self.assertEqual ([156, 52, 18], self.assemble ('STZ $1234', 0, self))
Is there a bug in the code above? | Yes |
409 | [
"#NEWLINE#",
"def test_numa_topology_filter_pass(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"instance_topology",
"=",
"objects",
".",
"InstanceNUMATopology",
"(",
"cells",
"=",
"[",
"objects",
".",
"InstanceNUMACell",
"(",
"id",
"=",
"0",
",",
"cpuset",
"=",
"s... | true | 70 | [
"62",
"124",
"7",
"73",
"122",
"2",
"64",
"70",
"112",
"116"
] | 1 | VARIABLE_MISUSE | [
7
] | [
[
{
"before_index": 6,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 61,
"after_index": 67,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 72,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/scheduler/filters/test_numa_topology_filters.py",
"license": "apache-2.0",
"note": "license: github_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_numa_topology_filter_pass(self) :
instance_topology = objects.InstanceNUMATopology (cells = [objects.InstanceNUMACell (id = 0, cpuset = set ([1]), memory = 512), objects.InstanceNUMACell (id = 1, cpuset = set ([3]), memory = 512)])
spec_obj = self._get_spec_obj (numa_topology = self)
host = fakes.FakeHostState ('host1', 'node1', {
'numa_topology' : fakes.NUMA_TOPOLOGY,
'pci_stats' : None,
'cpu_allocation_ratio' : 16.0,
'ram_allocation_ratio' : 1.5,
})
self.assertTrue (self.filt_cls.host_passes (host, spec_obj))
Is there a bug in the code above? | Yes |
410 | [
"#NEWLINE#",
"def unregister_topic(",
"self",
",",
"topic",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"pub_sub",
".",
"unsubscribe",
"(",
"self",
")"
] | true | 15 | [
"4",
"2",
"9",
"15"
] | 1 | VARIABLE_MISUSE | [
4
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 14,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 12... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "openstack/dragonflow/dragonflow/db/pubsub_drivers/redis_db_pubsub_driver.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def unregister_topic(self, topic) :
self.pub_sub.unsubscribe (self)
Is there a bug in the code above? | Yes |
411 | [
"#NEWLINE#",
"def test_init(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"tagger",
"=",
"PerceptronTagger",
"(",
"load",
"=",
"False",
")",
"#NEWLINE#",
"assert_true",
"(",
"isinstance",
"(",
"self",
",",
"BaseTagger",
")",
")"
] | true | 20 | [
"7",
"2",
"20"
] | 1 | VARIABLE_MISUSE | [
7
] | [
[
{
"before_index": 6,
"after_index": 10,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 15,
"after_index": 17,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "sloria/textblob-aptagger/tests/test_taggers.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_init(self) :
tagger = PerceptronTagger (load = False)
assert_true (isinstance (self, BaseTagger))
Is there a bug in the code above? | Yes |
412 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"max_size",
"=",
"None",
",",
"check_modified_time",
"=",
"False",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"max_size",
"=",
"max_size",
"#NEWLINE#",
"self",
".",
"check_modified_time",
"=",
"self",
"#NEWLINE#",
... | true | 25 | [
"2",
"15",
"21",
"25",
"27",
"38",
"45",
"8",
"23",
"4",
"17",
"19"
] | 1 | VARIABLE_MISUSE | [
8,
23
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 19,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 20,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "limodou/uliweb/uliweb/core/template.py",
"license": "bsd-2-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def __init__(self, max_size = None, check_modified_time = False) :
self.max_size = max_size
self.check_modified_time = self
self.__values = {
}
self.__access_keys = []
self.__modified_times = {
}
Is there a bug in the code above? | Yes |
413 | [
"#NEWLINE#",
"def generate(",
"self",
",",
"writer",
",",
"has_links",
")",
":",
"#NEWLINE#",
"#INDENT#",
"writer",
".",
"write_line",
"(",
"'def _tt_execute():'",
",",
"self",
".",
"line",
")",
"#NEWLINE#",
"with",
"writer",
".",
"indent",
"(",
")",
":",
"#... | true | 196 | [
"6",
"164",
"196",
"322",
"2",
"17",
"37",
"48",
"59",
"70",
"81",
"92",
"103",
"114",
"125",
"136",
"147",
"158",
"174",
"185",
"207",
"218",
"229",
"240",
"251",
"262",
"273",
"284",
"295",
"306",
"312",
"332",
"348",
"4",
"11",
"23",
"31",
... | 1 | VARIABLE_MISUSE | [
2,
17,
37,
48,
59,
70,
81,
92,
103,
114,
125,
136,
147,
158,
174,
185,
207,
218,
229,
240,
251,
262,
273,
284,
295,
306,
312,
332,
348
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 16,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 16,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "limodou/uliweb/uliweb/core/template.py",
"license": "bsd-2-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def generate(self, writer, has_links) :
writer.write_line ('def _tt_execute():', self.line)
with writer.indent () :
writer.write_line ('_tt_buffer = []', self.line)
writer.write_line ('_tt_append = _tt_buffer.append', self.line)
writer.write_line ('def _tt_write(t, escape=True):', self.line)
writer.write_line (' if escape:', self.line)
writer.write_line (' _tt_append(xhtml_escape(_tt_utf8(t)))', self.line)
writer.write_line (' else:', self.line)
writer.write_line (' _tt_append(_tt_utf8(t))', self.line)
writer.write_line (' pass', self.line)
writer.write_line (' pass', self.line)
writer.write_line ('def out_write(value):', self.line)
writer.write_line (' _tt_append(_tt_utf8(value))', self.line)
writer.write_line (' pass', self.line)
if has_links :
writer.write_line ("_tt_links = {'toplinks': [], 'bottomlinks': [], 'headlinks':[]}", self.line)
writer.write_line ('def _tt_use(name, *args, **kwargs):', self.line)
writer.write_line (' _tag_use(_tt_links, name, *args, **kwargs)', has_links.line)
writer.write_line (' pass', self.line)
writer.write_line ("def _tt_link(name, to='toplinks', **kwargs):", self.line)
writer.write_line (' _tag_link(_tt_links, name, to=to, **kwargs)', self.line)
writer.write_line (' pass', self.line)
writer.write_line ('def _tt_head(name, **kwargs):', self.line)
writer.write_line (' _tag_head(_tt_links, name, **kwargs)', self.line)
writer.write_line (' pass', self.line)
writer.write_line ('def _tt_head_link(args):', self.line)
writer.write_line (' _tag_head_link(_tt_links, args)', self.line)
writer.write_line (' pass', self.line)
self.body.generate (writer)
if has_links :
writer.write_line ("return _tag_htmlmerge(_tt_utf8('').join(_tt_buffer), _tt_links)", self.line)
else :
writer.write_line ("return _tt_utf8('').join(_tt_buffer)", self.line)
Is there a bug in the code above? | Yes |
414 | [
"#NEWLINE#",
"def testUUIDFieldCreate(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"j",
"=",
"TestModel_field",
".",
"objects",
".",
"create",
"(",
"a",
"=",
"6",
",",
"uuid_field",
"=",
"'550e8400-e29b-41d4-a716-446655440000'",
")",
"#NEWLINE#",
"self",
".",
"as... | true | 28 | [
"7",
"2",
"24",
"28"
] | 1 | VARIABLE_MISUSE | [
7
] | [
[
{
"before_index": 6,
"after_index": 18,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 23,
"after_index": 31,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 18,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "mozilla/inventory/vendor-local/src/django-extensions/build/lib/django_extensions/tests/uuid_field.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def testUUIDFieldCreate(self) :
j = TestModel_field.objects.create (a = 6, uuid_field = '550e8400-e29b-41d4-a716-446655440000')
self.assertEquals (self.uuid_field, '550e8400-e29b-41d4-a716-446655440000')
Is there a bug in the code above? | Yes |
415 | [
"#NEWLINE#",
"def set_OwnerId(",
"self",
",",
"OwnerId",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"add_query_param",
"(",
"'OwnerId'",
",",
"self",
")"
] | true | 15 | [
"2",
"9",
"15",
"4"
] | 1 | VARIABLE_MISUSE | [
4
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 14,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 10... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "aliyun/aliyun-openapi-python-sdk/aliyun-python-sdk-rds/aliyunsdkrds/request/v20140815/CreateAccountForInnerRequest.py",
"license": "apache-2.0",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def set_OwnerId(self, OwnerId) :
self.add_query_param ('OwnerId', self)
Is there a bug in the code above? | Yes |
416 | [
"#NEWLINE#",
"def test_statistics(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Map a table with column statistics'",
"#NEWLINE#",
"stmts",
"=",
"[",
"CREATE_STMT1",
",",
"'ALTER TABLE t1 ALTER c1 SET STATISTICS 100'",
"]",
"#NEWLINE#",
"dbmap",
"=",
"self",
".",
"to_map"... | true | 23 | [
"9",
"2",
"19",
"23",
"26",
"94",
"17",
"86"
] | 1 | VARIABLE_MISUSE | [
9
] | [
[
{
"before_index": 6,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 11,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 16,
"after_index": 22... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "perseas/Pyrseas/tests/dbobject/test_column.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_statistics(self) :
'Map a table with column statistics'
stmts = [CREATE_STMT1, 'ALTER TABLE t1 ALTER c1 SET STATISTICS 100']
dbmap = self.to_map (self)
expmap = {
'columns' : [{
'c1' : {
'type' : 'integer',
'statistics' : 100,
},
}, {
'c2' : {
'type' : 'text',
},
}],
}
assert (dbmap ['schema public'] ['table t1'] == expmap)
Is there a bug in the code above? | Yes |
417 | [
"#NEWLINE#",
"def test_inherit_drop_parent_column(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Drop a column from a parent table, child should not drop as well'",
"#NEWLINE#",
"stmts",
"=",
"[",
"CREATE_STMT1",
",",
"'CREATE TABLE t2 (c3 date) INHERITS (t1)'",
"]",
"#NEWLINE#",
... | true | 161 | [
"9",
"2",
"19",
"155",
"17",
"25",
"73",
"159",
"153",
"161",
"168",
"178"
] | 1 | VARIABLE_MISUSE | [
9
] | [
[
{
"before_index": 6,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 11,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 16,
"after_index": 22... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "perseas/Pyrseas/tests/dbobject/test_column.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_inherit_drop_parent_column(self) :
'Drop a column from a parent table, child should not drop as well'
stmts = [CREATE_STMT1, 'CREATE TABLE t2 (c3 date) INHERITS (t1)']
inmap = self.std_map ()
inmap ['schema public'].update ({
'table t1' : {
'columns' : [{
'c1' : {
'type' : 'integer',
},
}],
},
})
inmap ['schema public'].update ({
'table t2' : {
'columns' : [{
'c1' : {
'type' : 'integer',
'inherited' : True,
},
}, {
'c3' : {
'type' : 'date',
},
}],
'inherits' : ['t1'],
},
})
sql = self.to_sql (inmap, sql)
assert (len (sql) == 1)
assert (fix_indent (sql [0]) == 'ALTER TABLE t1 DROP COLUMN c2')
Is there a bug in the code above? | Yes |
418 | [
"#NEWLINE#",
"@",
"login_required",
"(",
")",
"#NEWLINE#",
"def edit(",
"request",
",",
"id",
")",
":",
"#NEWLINE#",
"#INDENT#",
"try",
":",
"#NEWLINE#",
"#INDENT#",
"service",
"=",
"Service",
".",
"objects",
".",
"get",
"(",
"id",
"=",
"id",
")",
"#NEWLIN... | true | 76 | [
"7",
"144",
"178",
"79",
"112",
"173",
"18",
"45",
"74",
"120",
"124",
"153",
"76",
"117",
"122",
"126",
"158",
"35",
"56",
"168",
"131",
"163",
"9",
"26",
"28",
"66",
"84"
] | 1 | VARIABLE_MISUSE | [
18,
45,
74,
120,
124,
153
] | [
[
{
"before_index": 1,
"after_index": 8,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 3,
"after_index": 2,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 17,
"after_index": 25,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "ustream/openduty/openduty/services.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | @ login_required ()
def edit(request, id) :
try :
service = Service.objects.get (id = id)
try :
api_keys = ServiceTokens.objects.filter (service_id = service)
except ServiceTokens.DoesNotExist :
api_keys = []
try :
ss_obj = ServiceSilenced.objects.get (service = policy)
service_silenced = str ((ss_obj.silenced_until - timezone.now ())).split ('.') [0]
except ServiceSilenced.DoesNotExist :
service_silenced = False
policy = (service.policy if service.policy else None)
all_polcies = SchedulePolicy.objects.all ()
return TemplateResponse (request, 'services/edit.html', {
'item' : service,
'policy' : policy,
'policies' : all_polcies,
'api_keys' : api_keys,
'service_silenced' : service_silenced,
'url' : request.get_full_path (),
})
except Service.DoesNotExist :
raise Http404
Is there a bug in the code above? | Yes |
419 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"output",
",",
"start_block",
"=",
"(",
"'<script type=\"text/javascript\">'",
"+",
"os",
".",
"linesep",
")",
",",
"end_block",
"=",
"(",
"'</script>'",
"+",
"os",
".",
"linesep",
")",
",",
"split_threshold",
"=",
"9... | true | 44 | [
"2",
"48",
"56",
"64",
"70",
"76",
"26",
"80",
"4",
"37",
"33",
"44",
"52",
"60",
"6",
"68",
"16",
"42",
"74"
] | 1 | VARIABLE_MISUSE | [
6,
68
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 32,
"after_index": 38,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 47,
"after_index": 5... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "shellderp/sublime-robot-plugin/lib/robot/reporting/jswriter.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def __init__(self, output, start_block = ('<script type="text/javascript">' + os.linesep), end_block = ('</script>' + os.linesep), split_threshold = 9500) :
writer = JsonWriter (output, separator = (end_block + writer))
self._write = writer.write
self._write_json = writer.write_json
self._start_block = start_block
self._end_block = end_block
self._split_threshold = split_threshold
Is there a bug in the code above? | Yes |
420 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"security_audit",
"=",
"None",
",",
"deactivation_call_center",
"=",
"None",
",",
"extension",
"=",
"None",
",",
"text",
"=",
"None",
",",
"extension_elements",
"=",
"None",
",",
"extension_attributes",
"=",
"None",
")"... | true | 35 | [
"8",
"58",
"60",
"2",
"50",
"56",
"62",
"12",
"64",
"67",
"24",
"45",
"47",
"16",
"35",
"37",
"39",
"20",
"41",
"43",
"4",
"52",
"54"
] | 1 | VARIABLE_MISUSE | [
2,
50,
56,
62
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 30,
"after_index": 36,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 49,
"after_index": 5... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "cloudera/hue/desktop/core/ext-py/pysaml2-2.4.0/src/saml2/authn_context/sslcert.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def __init__(self, security_audit = None, deactivation_call_center = None, extension = None, text = None, extension_elements = None, extension_attributes = None) :
SamlBase.__init__ (text, text = text, extension_elements = extension_elements, extension_attributes = extension_attributes)
self.security_audit = security_audit
self.deactivation_call_center = deactivation_call_center
self.extension = (extension or [])
Is there a bug in the code above? | Yes |
421 | [
"#NEWLINE#",
"def getDevices(",
"ticket",
",",
"count",
",",
"type",
",",
"file_name",
")",
":",
"#NEWLINE#",
"#INDENT#",
"get_devices_url",
"=",
"(",
"(",
"controller_url",
"+",
"'/api/v1/network-device/1/'",
")",
"+",
"str",
"(",
"count",
")",
")",
"#NEWLINE#"... | true | 166 | [
"8",
"114",
"126",
"137",
"241",
"39",
"67",
"164",
"172",
"208",
"217",
"166",
"170",
"183",
"4",
"24",
"156",
"13",
"35",
"63",
"74",
"93",
"158",
"110",
"141",
"198",
"6",
"149",
"187",
"2",
"51",
"57",
"76"
] | 1 | VARIABLE_MISUSE | [
156
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 21,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 27,
"after_index": 3... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "CiscoDevNet/coding-skills-sample-code/coding207-putting-it-together-ga/create-device-list.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def getDevices(ticket, count, type, file_name) :
get_devices_url = ((controller_url + '/api/v1/network-device/1/') + str (count))
logging.info (('Calling APIC-EM API url:' + get_devices_url))
header = {
'content-type' : 'application/json',
'X-Auth-Token' : ticket,
}
get_devices_response = requests.get (get_devices_url, headers = header, verify = False)
get_devices_json = get_devices_response.json ()
logging.debug (('API response: ' + json.dumps (get_devices_json, indent = 4, separators = (',', ': '))))
file = open (file_name, 'w')
logging.info (('File opened:' + file_name))
logging.info (('Begin writing list:' + file_name))
file.write ((('The list of devices of type: ' + type) + '
'))
parent = get_devices_json ['response']
for item in lowerCaseType :
lowerCaseType = item ['type'].lower ()
if (lowerCaseType.find (type) != (- 1)) :
file.write ((((('id = ' + item ['id']) + ' type = ') + item ['type']) + '
'))
print ('Finished writing list ...')
logging.info (('End writing list:' + file_name))
Is there a bug in the code above? | Yes |
422 | [
"#NEWLINE#",
"def exportAttributes(",
"self",
",",
"lwrite",
",",
"level",
",",
"already_processed",
",",
"namespace_",
"=",
"'NetworkSocketObj:'",
",",
"name_",
"=",
"'ProtocolType'",
")",
":",
"#NEWLINE#",
"#INDENT#",
"super",
"(",
"ProtocolType",
",",
"self",
"... | true | 45 | [
"2",
"25",
"62",
"6",
"32",
"10",
"36",
"8",
"34",
"14",
"38",
"4",
"30",
"45",
"54"
] | 1 | VARIABLE_MISUSE | [
2,
25,
62
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 20,
"after_index": 31,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 43,
"after_index": 4... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "CybOXProject/python-cybox/cybox/bindings/network_socket_object.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def exportAttributes(self, lwrite, level, already_processed, namespace_ = 'NetworkSocketObj:', name_ = 'ProtocolType') :
super (ProtocolType, self).exportAttributes (lwrite, level, already_processed, namespace_, name_ = 'ProtocolType')
if (lwrite.datatype is not None) :
lwrite ((' datatype=%s' % (quote_attrib (self.datatype),)))
Is there a bug in the code above? | Yes |
423 | [
"#NEWLINE#",
"def gradients_X(",
"self",
",",
"dL_dK",
",",
"X",
",",
"X2",
"=",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n Given the derivative of the objective wrt K (dL_dK), compute the derivative wrt X\\n '",
"#NEWLINE#",
"if",
"config",
".",
"getboole... | true | 53 | [
"6",
"36",
"4",
"34",
"51",
"53",
"8",
"38",
"55",
"2",
"30",
"47"
] | 1 | VARIABLE_MISUSE | [
6,
36
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 15,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 17,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "SheffieldML/GPy/GPy/kern/src/stationary.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def gradients_X(self, dL_dK, X, X2 = None) :
'
Given the derivative of the objective wrt K (dL_dK), compute the derivative wrt X
'
if config.getboolean ('cython', 'working') :
return self._gradients_X_cython (dL_dK, X, X2)
else :
return self._gradients_X_pure (dL_dK, dL_dK, X2)
Is there a bug in the code above? | Yes |
424 | [
"#NEWLINE#",
"def get_algorithm_impls(",
"self",
",",
"algorithm",
")",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"(",
"algorithm",
"==",
"'MD5'",
")",
":",
"#NEWLINE#",
"#INDENT#",
"H",
"=",
"md5_digest",
"#NEWLINE#",
"#UNINDENT#",
"else",
":",
"#NEWLINE#",
"#INDENT#",... | true | 68 | [
"42",
"18",
"36",
"50",
"66",
"68",
"4",
"11",
"29",
"2"
] | 1 | VARIABLE_MISUSE | [
42
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 9,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 41,
"after_index": 45... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "deanhiller/databus/webapp/play1.3.x/samples-and-tests/i-am-a-developer/mechanize/_auth.py",
"license": "mpl-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def get_algorithm_impls(self, algorithm) :
if (algorithm == 'MD5') :
H = md5_digest
else :
if (algorithm == 'SHA') :
H = sha1_digest
KD = (lambda s, d : H (('%s:%s' % (s, d))))
return (H, H)
Is there a bug in the code above? | Yes |
425 | [
"#NEWLINE#",
"def test_get_router_cidrs_returns_ha_cidrs(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"ri",
"=",
"self",
".",
"_create_router",
"(",
")",
"#NEWLINE#",
"device",
"=",
"mock",
".",
"MagicMock",
"(",
")",
"#NEWLINE#",
"device",
".",
"name",
".",
"r... | true | 58 | [
"7",
"39",
"61",
"2",
"9",
"52",
"31",
"49",
"15",
"23",
"58",
"65"
] | 1 | VARIABLE_MISUSE | [
31,
49
] | [
[
{
"before_index": 6,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 20,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 22,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "openstack/neutron/neutron/tests/unit/agent/l3/test_ha_router.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_get_router_cidrs_returns_ha_cidrs(self) :
ri = self._create_router ()
device = mock.MagicMock ()
device.name.return_value = 'eth2'
addresses = ['15.1.2.2/24', '15.1.2.3/32']
ri._get_cidrs_from_keepalived = mock.MagicMock (return_value = addresses)
self.assertEqual (set (device), ri.get_router_cidrs (device))
Is there a bug in the code above? | Yes |
426 | [
"#NEWLINE#",
"@",
"login_required",
"(",
")",
"#NEWLINE#",
"@",
"require_http_methods",
"(",
"[",
"'POST'",
"]",
")",
"#NEWLINE#",
"def forward_incident(",
"request",
")",
":",
"#NEWLINE#",
"#INDENT#",
"try",
":",
"#NEWLINE#",
"#INDENT#",
"with",
"transaction",
".... | true | 137 | [
"51",
"82",
"93",
"101",
"115",
"119",
"33",
"73",
"80",
"97",
"131",
"224",
"234",
"85",
"137",
"145",
"107",
"113",
"121",
"127",
"133",
"141",
"147",
"157",
"15",
"43",
"61",
"91",
"117",
"176",
"184",
"204",
"212",
"232",
"243"
] | 1 | VARIABLE_MISUSE | [
33,
73,
80,
97,
131
] | [
[
{
"before_index": 240,
"after_index": 242,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 3,
"after_index": 2,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "ustream/openduty/openduty/incidents.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | @ login_required ()
@ require_http_methods (['POST'])
def forward_incident(request) :
try :
with transaction.atomic () :
incident = Incident.objects.get (id = request.POST ['id'])
user = User.objects.get (id = request.POST ['user_id'])
ScheduledNotification.remove_all_for_incident (incident)
NotificationHelper.notify_user_about_incident (incident, user)
event_log_message = ('%s changed assignee of incident : %s to %s' % (request.user.username, incident.incident_key, user.username))
event_log = EventLog ()
event_log.user = request.user
event_log.action = 'forward'
event_log.incident_key = incident
event_log.service_key = event_log_message.service_key
event_log.data = event_log_message
event_log.occurred_at = timezone.now ()
event_log.save ()
except Incident.DoesNotExist :
messages.error (request, 'Incident not found')
return HttpResponseRedirect (request.POST ['url'])
except User.DoesNotExist :
messages.error (request, 'Incident not found')
return HttpResponseRedirect (request.POST ['url'])
except ValidationError as e :
messages.error (request, e.messages)
return HttpResponseRedirect (request.POST ['url'])
Is there a bug in the code above? | Yes |
427 | [
"#NEWLINE#",
"def do(",
"self",
",",
"workflow_dict",
")",
":",
"#NEWLINE#",
"#INDENT#",
"try",
":",
"#NEWLINE#",
"#INDENT#",
"databaseinfra",
"=",
"driver",
"[",
"'databaseinfra'",
"]",
"#NEWLINE#",
"driver",
"=",
"databaseinfra",
".",
"get_driver",
"(",
")",
"... | true | 15 | [
"4",
"30",
"97",
"110",
"15",
"20",
"65",
"13",
"22",
"91",
"120",
"2",
"41",
"28",
"69"
] | 1 | VARIABLE_MISUSE | [
4,
30,
97,
110
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 16,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 19,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "globocom/database-as-a-service/dbaas/workflow/steps/util/region_migration/check_replication.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def do(self, workflow_dict) :
try :
databaseinfra = driver ['databaseinfra']
driver = databaseinfra.get_driver ()
instance = workflow_dict ['source_instances'] [0].future_instance
for attempt in range (0, 21) :
LOG.info ('Waiting 10s to check replication...')
sleep (10)
if driver.is_replication_ok (instance) :
return True
raise Exception ('The replication is not ok')
except Exception :
traceback = full_stack ()
workflow_dict ['exceptions'] ['error_codes'].append (DBAAS_0020)
workflow_dict ['exceptions'] ['traceback'].append (traceback)
Is there a bug in the code above? | Yes |
428 | [
"#NEWLINE#",
"def test_update_list_item(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"t1",
"=",
"Table1",
"(",
")",
"#NEWLINE#",
"t2",
"=",
"Table2",
"(",
")",
"#NEWLINE#",
"t1",
".",
"tbl2s",
".",
"append",
"(",
"t1",
")",
"#NEWLINE#",
"session",
".",
"c... | true | 25 | [
"2",
"13",
"48",
"7",
"19",
"25",
"34",
"68",
"78"
] | 1 | VARIABLE_MISUSE | [
13,
48
] | [
[
{
"before_index": 6,
"after_index": 10,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 16,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 18,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "jmg/elixir/tests/test_dict.py",
"license": "mit",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_update_list_item(self) :
t1 = Table1 ()
t2 = Table2 ()
t1.tbl2s.append (t1)
session.commit ()
t1.from_dict (dict (tbl2s = [{
't2id' : t2.t2id,
'name' : 'test4',
}]))
assert (len (t1.tbl2s) == 1)
assert (t1.tbl2s [0].name == 'test4')
Is there a bug in the code above? | Yes |
429 | [
"#NEWLINE#",
"def run(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"while",
"(",
"not",
"self",
".",
"_stop",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"_logger",
".",
"debug",
"(",
"'HelloSensor dispatching trigger...'",
")",
"#NEWLINE#",
"count",
"=",
... | true | 78 | [
"26",
"56",
"78",
"2",
"10",
"17",
"29",
"66",
"81",
"41",
"76",
"89"
] | 1 | VARIABLE_MISUSE | [
41,
76,
89
] | [
[
{
"before_index": 7,
"after_index": 9,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 9,
"after_index": 11,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 16,
"after_index": 22... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "StackStorm/st2/contrib/hello-st2/sensors/sensor1.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def run(self) :
while (not self._stop) :
self._logger.debug ('HelloSensor dispatching trigger...')
count = (self._sensor_service.get_value ('hello-st2.count') or 0)
payload = {
'greeting' : 'Yo, StackStorm!',
'count' : (int (count) + 1),
}
self._sensor_service.dispatch (trigger = 'hello-st2.event1', payload = count)
self._sensor_service.set_value ('hello-st2.count', payload ['count'])
eventlet.sleep (60)
Is there a bug in the code above? | Yes |
430 | [
"#NEWLINE#",
"def stats(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"output",
"=",
"[",
"'Statistics:'",
"]",
"#NEWLINE#",
"for",
"trial",
"in",
"range",
"(",
"10",
")",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"(",
"request_counter",
".",
"count",
">",
"0",
... | true | 185 | [
"183",
"191",
"248",
"276",
"208",
"223",
"368",
"413",
"422",
"456",
"463",
"490",
"118",
"136",
"145",
"162",
"179",
"194",
"201",
"210",
"292",
"302",
"308",
"337",
"361",
"401",
"438",
"246",
"274",
"310",
"320",
"357",
"91",
"101",
"109",
"1... | 1 | VARIABLE_MISUSE | [
189
] | [
[
{
"before_index": 6,
"after_index": 9,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 13,
"after_index": 14,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 13,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "AppScale/appscale/AppServer/lib/cherrypy/cherrypy/lib/gctools.py",
"license": "apache-2.0",
"note": "license: github_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def stats(self) :
output = ['Statistics:']
for trial in range (10) :
if (request_counter.count > 0) :
break
time.sleep (0.5)
else :
output.append ('
Not all requests closed properly.')
gc.collect ()
gc.collect ()
unreachable = gc.collect ()
if unreachable :
if (objgraph is not None) :
final = objgraph.by_type ('Nondestructible')
if final :
objgraph.show_backrefs (final, filename = 'finalizers.png')
trash = {
}
for x in gc.garbage :
trash [type (x)] = (trash.get (type (x), 0) + 1)
if trash :
output.insert (0, ('
%s unreachable objects:' % unreachable))
trash = [(v, tree) for (k, v) in trash.items ()]
trash.sort ()
for pair in trash :
output.append ((' ' + repr (pair)))
allobjs = {
}
for (cls, minobj, maxobj, msg) in self.classes :
allobjs [cls] = get_instances (cls)
for (cls, minobj, maxobj, msg) in self.classes :
objs = allobjs [cls]
lenobj = len (objs)
if ((lenobj < minobj) or (lenobj > maxobj)) :
if (minobj == maxobj) :
output.append (('
Expected %s %r references, got %s.' % (minobj, cls, lenobj)))
else :
output.append (('
Expected %s to %s %r references, got %s.' % (minobj, maxobj, cls, lenobj)))
for obj in objs :
if (objgraph is not None) :
ig = [id (objs), id (inspect.currentframe ())]
fname = ('graph_%s_%s.png' % (cls.__name__, id (obj)))
objgraph.show_backrefs (obj, extra_ignore = ig, max_depth = 4, too_many = 20, filename = fname, extra_info = get_context)
output.append (('
Referrers for %s (refcount=%s):' % (repr (obj), sys.getrefcount (obj))))
t = ReferrerTree (ignore = [objs], maxdepth = 3)
tree = t.ascend (obj)
output.extend (t.format (tree))
return '
'.join (output)
Is there a bug in the code above? | Yes |
431 | [
"#NEWLINE#",
"def test_krackhardt_kite_graph_normalized(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Betweenness centrality: Krackhardt kite graph normalized'",
"#NEWLINE#",
"G",
"=",
"nx",
".",
"krackhardt_kite_graph",
"(",
")",
"#NEWLINE#",
"b_answer",
"=",
"{",
"#NEWLIN... | true | 81 | [
"75",
"81",
"104",
"2",
"17",
"109",
"93",
"106",
"111",
"9",
"97"
] | 1 | VARIABLE_MISUSE | [
9,
97
] | [
[
{
"before_index": 6,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 14,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 16,
"after_index": 19... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "gkno/gkno_launcher/src/networkx/algorithms/centrality/tests/test_betweenness_centrality.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_krackhardt_kite_graph_normalized(self) :
'Betweenness centrality: Krackhardt kite graph normalized'
G = nx.krackhardt_kite_graph ()
b_answer = {
0 : 0.023,
1 : 0.023,
2 : 0.0,
3 : 0.102,
4 : 0.0,
5 : 0.231,
6 : 0.231,
7 : 0.389,
8 : 0.222,
9 : 0.0,
}
b = nx.betweenness_centrality (b, weight = None, normalized = True)
for n in sorted (G) :
assert_almost_equal (b [n], b_answer [n], places = 3)
Is there a bug in the code above? | Yes |
432 | [
"#NEWLINE#",
"def unregister_image_format(",
"format_name",
")",
":",
"#NEWLINE#",
"#INDENT#",
"global",
"FORMATS",
"#NEWLINE#",
"try",
":",
"#NEWLINE#",
"#INDENT#",
"format_name",
"=",
"format_name",
".",
"name",
"#NEWLINE#",
"#UNINDENT#",
"except",
"AttributeError",
"... | true | 42 | [
"2",
"14",
"16",
"36",
"53",
"69",
"8",
"39",
"42",
"46",
"44",
"49"
] | 1 | VARIABLE_MISUSE | [
44,
49
] | [
[
{
"before_index": 13,
"after_index": 17,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 21,
"after_index": 22,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 38,
"after_index":... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "torchbox/wagtail/wagtail/wagtailimages/formats.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def unregister_image_format(format_name) :
global FORMATS
try :
format_name = format_name.name
except AttributeError :
pass
try :
del FORMATS_BY_NAME [format_name]
FORMATS = [FORMATS for fmt in FORMATS if (fmt.name != format_name)]
except KeyError :
raise KeyError (("Image format '%s' is not registered" % format_name))
Is there a bug in the code above? | Yes |
433 | [
"#NEWLINE#",
"def admin(",
"cmds",
",",
"wait",
"=",
"False",
",",
"**popen_kwargs",
")",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"(",
"not",
"hdevtools_enabled",
"(",
")",
")",
":",
"#NEWLINE#",
"#INDENT#",
"return",
"None",
"#NEWLINE#",
"#UNINDENT#",
"hdevtools_so... | true | 61 | [
"78",
"74",
"91",
"4",
"61",
"69",
"27",
"35",
"47",
"86",
"115",
"76",
"99",
"126",
"132",
"162",
"172",
"2",
"39",
"52",
"83",
"112"
] | 1 | VARIABLE_MISUSE | [
2,
39
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 13,
"after_index": 15,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 26,
"after_index": 3... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "SublimeHaskell/SublimeHaskell/hdevtools.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def admin(cmds, wait = False, **popen_kwargs) :
if (not hdevtools_enabled ()) :
return None
hdevtools_socket = get_setting_async ('hdevtools_socket')
if hdevtools_socket :
cmds.append ('--socket={0}'.format (hdevtools_socket))
command = (['hdevtools', 'admin'] + wait)
try :
if wait :
(exit_code, stdout, stderr) = call_and_wait (command, ** popen_kwargs)
if (exit_code == 0) :
return stdout
return ''
else :
call_no_wait (command, ** popen_kwargs)
return ''
except OSError as e :
if (e.errno == errno.ENOENT) :
show_hdevtools_error_and_disable ()
set_setting_async ('enable_hdevtools', False)
return None
except Exception as e :
log ('calling to hdevtools fails with {0}'.format (e))
return None
Is there a bug in the code above? | Yes |
434 | [
"#NEWLINE#",
"def get_position(",
"self",
",",
"account_id",
",",
"instrument",
",",
"**params",
")",
":",
"#NEWLINE#",
"#INDENT#",
"' Get the position for an instrument\\n Docs: http://developer.oanda.com/docs/v1/positions/#get-the-position-for-an-instrument\\n '",
"#NEWLI... | true | 32 | [
"15",
"4",
"21",
"32",
"34",
"36",
"2",
"28",
"6",
"23"
] | 1 | VARIABLE_MISUSE | [
15
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 13,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "jamesmawm/Mastering-Python-for-Finance-source-codes/B03898_08_codes/oandapy.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def get_position(self, account_id, instrument, **params) :
' Get the position for an instrument
Docs: http://developer.oanda.com/docs/v1/positions/#get-the-position-for-an-instrument
'
endpoint = ('v1/accounts/%s/positions/%s' % (account_id, instrument))
return self.request (account_id, params = params)
Is there a bug in the code above? | Yes |
435 | [
"#NEWLINE#",
"def formfield(",
"self",
",",
"form_class",
"=",
"forms",
".",
"ModelChoiceField",
",",
"**kwargs",
")",
":",
"#NEWLINE#",
"#INDENT#",
"defaults",
"=",
"{",
"#NEWLINE#",
"#INDENT#",
"'queryset'",
":",
"self",
".",
"to",
".",
"_default_manager",
"."... | true | 43 | [
"2",
"22",
"30",
"51",
"15",
"39",
"61",
"4",
"43",
"56",
"58"
] | 1 | VARIABLE_MISUSE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 17,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 38,
"after_index": 4... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "ithinksw/philo/philo/models/fields/entities.py",
"license": "isc",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def formfield(self, form_class = forms.ModelChoiceField, **kwargs) :
defaults = {
'queryset' : self.to._default_manager.complex_filter (self.limit_choices_to),
}
defaults.update (form_class)
return super (ForeignKeyAttribute, self).formfield (form_class = form_class, ** defaults)
Is there a bug in the code above? | Yes |
436 | [
"#NEWLINE#",
"def __install_eggs(",
"self",
",",
"config",
")",
":",
"#NEWLINE#",
"#INDENT#",
"' Install eggs for a particular configuration '",
"#NEWLINE#",
"eggs",
"=",
"[",
"]",
"#NEWLINE#",
"if",
"config",
".",
"has",
"(",
"'egg'",
")",
":",
"#NEWLINE#",
"#INDEN... | true | 202 | [
"131",
"185",
"187",
"151",
"225",
"11",
"26",
"48",
"84",
"126",
"51",
"57",
"202",
"114",
"118",
"4",
"17",
"29",
"39",
"65",
"138",
"192",
"153",
"2",
"75",
"97",
"103",
"164",
"170",
"219"
] | 1 | VARIABLE_MISUSE | [
151,
225
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 9,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 13,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "toumorokoshi/sprinter/sprinter/formula/eggscript.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def __install_eggs(self, config) :
' Install eggs for a particular configuration '
eggs = []
if config.has ('egg') :
eggs += [config.get ('egg')]
if config.has ('eggs') :
eggs += [egg.strip () for egg in re.split (',(?!<)|
', config.get ('eggs'))]
self.logger.debug (('Installing eggs %s...' % eggs))
with open (os.path.join (self.directory.install_directory (self.feature_name), 'requirements.txt'), 'w+') as fh :
fh.write ('
'.join (eggs))
stdout = (subprocess.PIPE if config.is_affirmative ('redirect_stdout_to_log', 'true') else None)
(return_code, output) = lib.call ("PYTHONPATH='' bin/pip install -r requirements.txt --upgrade", cwd = self.directory.install_directory (self.feature_name), output_log_level = logging.DEBUG, shell = True, stdout = stdout)
if (config.is_affirmative ('fail_on_error', True) and (egg != 0)) :
raise EggscriptFormulaException ('Egg script {name} returned a return code of {code}!'.format (name = self.feature_name, code = return_code))
Is there a bug in the code above? | Yes |
437 | [
"#NEWLINE#",
"def set_mode(",
"self",
",",
"mode",
")",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"(",
"self",
".",
"version",
"[",
"0",
"]",
"<",
"3",
")",
":",
"#NEWLINE#",
"#INDENT#",
"raise",
"ValueError",
"(",
"'Mode Switching requires version >= 3'",
")",
"#NE... | true | 83 | [
"2",
"11",
"52",
"79",
"30",
"38",
"56",
"75",
"83",
"4",
"40"
] | 1 | VARIABLE_MISUSE | [
4,
40
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 9,
"after_index": 17,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 29,
"after_index": 33... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "Yubico/yubikey-neo-manager/neoman/device_otp.py",
"license": "bsd-2-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def set_mode(self, mode) :
if (self.version [0] < 3) :
raise ValueError ('Mode Switching requires version >= 3')
config = ykp_alloc_device_config ()
ykp_set_device_mode (config, mode)
try :
if (not yk_write_device_config (self._dev, config)) :
raise ModeSwitchError ()
finally :
ykp_free_device_config (config)
self._mode = config
Is there a bug in the code above? | Yes |
438 | [
"#NEWLINE#",
"def timing(",
"func",
",",
"*",
"args",
",",
"**kw",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'timing(func,*args,**kw) -> t_total\\n\\n Execute a function once, return the elapsed total CPU time in\\n seconds. This is just the first value in timings_out().'",
"#NEWLINE#",
... | true | 22 | [
"5",
"25",
"2",
"19",
"22"
] | 1 | VARIABLE_MISUSE | [
5
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 3,
"after_index": 5,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 11,
"after_index": 12,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "ipython/ipython-py3k/IPython/utils/timing.py",
"license": "bsd-3-clause",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def timing(func, * args, **kw) :
'timing(func,*args,**kw) -> t_total
Execute a function once, return the elapsed total CPU time in
seconds. This is just the first value in timings_out().'
return timings_out (1, func, * func, ** kw) [0]
Is there a bug in the code above? | Yes |
439 | [
"#NEWLINE#",
"def OutputUnchecked(",
"self",
",",
"out",
")",
":",
"#NEWLINE#",
"#INDENT#",
"for",
"i",
"in",
"xrange",
"(",
"len",
"(",
"self",
".",
"result_",
")",
")",
":",
"#NEWLINE#",
"#INDENT#",
"out",
".",
"putVarInt32",
"(",
"24",
")",
"#NEWLINE#",... | true | 39 | [
"4",
"24",
"31",
"39",
"10",
"2",
"16",
"35"
] | 1 | VARIABLE_MISUSE | [
10
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 9,
"after_index": 10,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 9,
"after_index": 13,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "CollabQ/CollabQ/.google_appengine/google/appengine/api/labs/taskqueue/taskqueue_service_pb.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def OutputUnchecked(self, out) :
for i in xrange (len (self.result_)) :
out.putVarInt32 (24)
out.putVarInt32 (self.result_ [out])
Is there a bug in the code above? | Yes |
440 | [
"#NEWLINE#",
"def TryMerge(",
"self",
",",
"d",
")",
":",
"#NEWLINE#",
"#INDENT#",
"while",
"(",
"d",
".",
"avail",
"(",
")",
">",
"0",
")",
":",
"#NEWLINE#",
"#INDENT#",
"tt",
"=",
"d",
".",
"getVarInt32",
"(",
")",
"#NEWLINE#",
"if",
"(",
"self",
"... | true | 32 | [
"4",
"11",
"24",
"43",
"66",
"91",
"22",
"55",
"78",
"95",
"2",
"32",
"39",
"62"
] | 1 | VARIABLE_MISUSE | [
22,
55,
78,
95
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 9,
"after_index": 16,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 16,
"after_index": 14... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "CollabQ/CollabQ/.google_appengine/google/appengine/api/labs/taskqueue/taskqueue_service_pb.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def TryMerge(self, d) :
while (d.avail () > 0) :
tt = d.getVarInt32 ()
if (self == 10) :
self.set_app_id (d.getPrefixedString ())
continue
if (tt == 16) :
self.set_max_rows (d.getVarInt32 ())
continue
if (tt == 0) :
raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData (tt)
Is there a bug in the code above? | Yes |
441 | [
"#NEWLINE#",
"def __str__(",
"self",
",",
"prefix",
"=",
"''",
",",
"printElemNumber",
"=",
"0",
")",
":",
"#NEWLINE#",
"#INDENT#",
"res",
"=",
"''",
"#NEWLINE#",
"if",
"self",
".",
"has_app_id_",
":",
"#NEWLINE#",
"#INDENT#",
"res",
"+=",
"(",
"prefix",
"... | true | 38 | [
"8",
"38",
"4",
"29",
"56",
"2",
"20",
"34",
"47",
"61",
"65",
"15",
"26",
"53",
"74"
] | 1 | VARIABLE_MISUSE | [
2,
20,
34,
47,
61,
65
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 17,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 19,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "CollabQ/CollabQ/.google_appengine/google/appengine/api/labs/taskqueue/taskqueue_service_pb.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def __str__(self, prefix = '', printElemNumber = 0) :
res = ''
if self.has_app_id_ :
res += (prefix + ('app_id: %s
' % self.DebugFormatString (printElemNumber.app_id_)))
if self.has_max_rows_ :
res += (prefix + ('max_rows: %s
' % self.DebugFormatInt32 (self.max_rows_)))
return res
Is there a bug in the code above? | Yes |
442 | [
"#NEWLINE#",
"def Equals(",
"self",
",",
"x",
")",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"(",
"x",
"is",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"return",
"1",
"#NEWLINE#",
"#UNINDENT#",
"if",
"(",
"len",
"(",
"self",
".",
"queuestats_",
")",
"!=",
"len... | true | 54 | [
"47",
"67",
"4",
"11",
"33",
"58",
"49",
"54",
"69",
"2",
"13",
"26"
] | 1 | VARIABLE_MISUSE | [
2,
13,
26
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 9,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 22,
"after_index": 30... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "CollabQ/CollabQ/.google_appengine/google/appengine/api/labs/taskqueue/taskqueue_service_pb.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def Equals(self, x) :
if (x is self) :
return 1
if (len (self.queuestats_) != len (x.queuestats_)) :
return 0
for (e1, e2) in zip (e2.queuestats_, x.queuestats_) :
if (e1 != e2) :
return 0
return 1
Is there a bug in the code above? | Yes |
443 | [
"#NEWLINE#",
"def TryMerge(",
"self",
",",
"d",
")",
":",
"#NEWLINE#",
"#INDENT#",
"while",
"1",
":",
"#NEWLINE#",
"#INDENT#",
"tt",
"=",
"d",
".",
"getVarInt32",
"(",
")",
"#NEWLINE#",
"if",
"(",
"self",
"==",
"60",
")",
":",
"#NEWLINE#",
"#INDENT#",
"b... | true | 24 | [
"4",
"16",
"47",
"70",
"95",
"14",
"36",
"59",
"82",
"99",
"2",
"24",
"43",
"66"
] | 1 | VARIABLE_MISUSE | [
14,
36,
59,
82,
99
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 9,
"after_index": 10,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 13,
"after_index": 19... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "CollabQ/CollabQ/.google_appengine/google/appengine/api/labs/taskqueue/taskqueue_service_pb.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def TryMerge(self, d) :
while 1 :
tt = d.getVarInt32 ()
if (self == 60) :
break
if (tt == 66) :
self.set_key (d.getPrefixedString ())
continue
if (tt == 74) :
self.set_value (d.getPrefixedString ())
continue
if (tt == 0) :
raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData (tt)
Is there a bug in the code above? | Yes |
444 | [
"#NEWLINE#",
"def read_module(",
"module_name",
")",
":",
"#NEWLINE#",
"#INDENT#",
"' Parses a module. '",
"#NEWLINE#",
"filename",
"=",
"find_module",
"(",
"filename",
")",
"#NEWLINE#",
"if",
"(",
"filename",
"is not",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"mo... | true | 13 | [
"25",
"37",
"43",
"2",
"9",
"13",
"18",
"29"
] | 1 | VARIABLE_MISUSE | [
2
] | [
[
{
"before_index": 6,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 16,
"after_index": 19... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "enthought/envisage/envisage/developer/code_browser/enclbr.py",
"license": "bsd-3-clause",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def read_module(module_name) :
' Parses a module. '
filename = find_module (filename)
if (filename is not None) :
module = read_file (filename)
else :
module = None
return module
Is there a bug in the code above? | Yes |
445 | [
"#NEWLINE#",
"def test_since(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n The elapsed time since the last refresh.\\n '",
"#NEWLINE#",
"import",
"datetime",
"#NEWLINE#",
"dt1",
"=",
"datetime",
".",
"datetime",
"(",
"2013",
",",
"12",
",",
"15",
","... | true | 92 | [
"31",
"12",
"65",
"67",
"78",
"2",
"69",
"86",
"95",
"103",
"50",
"61",
"92",
"107"
] | 1 | VARIABLE_MISUSE | [
31
] | [
[
{
"before_index": 6,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 11,
"after_index": 19,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 30,
"after_index": 3... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "scieloorg/scielo-manager/scielomanager/health/tests.py",
"license": "bsd-2-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_since(self) :
'
The elapsed time since the last refresh.
'
import datetime
dt1 = datetime.datetime (2013, 12, 15, 10, 10, 10)
dt2 = datetime.datetime (2013, 12, 15, 10, 11, 10)
check_list = health.CheckList (refresh = 1)
check_list._refreshed_at = dt1
mock_datetime = self.mocker.replace (datetime)
mock_datetime.datetime.now ()
self.mocker.result (check_list)
self.mocker.replay ()
self.assertEqual (check_list.since (), '0:01:00')
Is there a bug in the code above? | Yes |
446 | [
"#NEWLINE#",
"def find_name(",
"self",
",",
"_id",
",",
"services",
",",
"devices",
")",
":",
"#NEWLINE#",
"#INDENT#",
"for",
"s",
"in",
"services",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"(",
"_id",
"==",
"s",
"[",
"'_id'",
"]",
")",
":",
"#NEWLINE#",
"#IN... | true | 51 | [
"14",
"24",
"33",
"6",
"16",
"4",
"22",
"49",
"2",
"8",
"43",
"51",
"41",
"60"
] | 1 | VARIABLE_MISUSE | [
41,
60
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 13,
"after_index": 14,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 13,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "serverdensity/sdbot/limbo/plugins/common/basewrapper.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def find_name(self, _id, services, devices) :
for s in services :
if (_id == s ['_id']) :
return s ['name']
for d in devices :
if (_id == devices ['_id']) :
return d ['name']
return 'No name'
Is there a bug in the code above? | Yes |
447 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"connection",
",",
"queues",
")",
":",
"#NEWLINE#",
"#INDENT#",
"super",
"(",
"ResultsTracker",
",",
"self",
")",
".",
"__init__",
"(",
"queues",
",",
"queues",
")",
"#NEWLINE#",
"self",
".",
"_queriers",
"=",
"{",
... | true | 20 | [
"2",
"15",
"25",
"36",
"43",
"4",
"6",
"20",
"22"
] | 1 | VARIABLE_MISUSE | [
4
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 21,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 24,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "StackStorm/st2/st2actions/st2actions/resultstracker/resultstracker.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def __init__(self, connection, queues) :
super (ResultsTracker, self).__init__ (queues, queues)
self._queriers = {
}
self._query_threads = []
self._failed_imports = set ()
Is there a bug in the code above? | Yes |
448 | [
"#NEWLINE#",
"def update_database(",
"dbfile",
")",
":",
"#NEWLINE#",
"#INDENT#",
"conn",
"=",
"sqlite3",
".",
"connect",
"(",
"dbfile",
")",
"#NEWLINE#",
"conn",
".",
"row_factory",
"=",
"sqlite3",
".",
"Row",
"#NEWLINE#",
"with",
"conn",
":",
"#NEWLINE#",
"#... | true | 80 | [
"209",
"220",
"58",
"69",
"80",
"67",
"85",
"90",
"95",
"100",
"105",
"143",
"156",
"161",
"168",
"173",
"218",
"231",
"236",
"241",
"246",
"251",
"256",
"261",
"29",
"37",
"44",
"51",
"60",
"73",
"113",
"120",
"127",
"136",
"149",
"181",
"188"... | 1 | VARIABLE_MISUSE | [
67,
85,
90,
95,
100,
105,
143,
156,
161,
168,
173,
218,
231,
236,
241,
246,
251,
256,
261
] | [
[
{
"before_index": 6,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 15,
"after_index": 21,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "vets/vets/db/migrate_db.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def update_database(dbfile) :
conn = sqlite3.connect (dbfile)
conn.row_factory = sqlite3.Row
with conn :
c = conn.cursor ()
c.execute ('ALTER TABLE volunteers RENAME TO volunteers_old')
c.execute ('CREATE TABLE "volunteers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" VARCHAR(255), "orientation" TIMESTAMP, "status" VARCHAR(255), "created_at" TIMESTAMP, "updated_at" TIMESTAMP)')
c.execute ('SELECT id, name, orientation, status, created_at, updated_at FROM volunteers_old')
volunteers = c.fetchall ()
for row in volunteers :
c.execute ('INSERT INTO volunteers (id, name, orientation, status, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?)', (volunteers ['id'], row ['name'], row ['orientation'], row ['status'], row ['created_at'], row ['updated_at']))
c.execute ('DROP TABLE volunteers_old')
c.execute ('CREATE TABLE "activities" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" VARCHAR(255), "status" VARCHAR(255), "created_at" TIMESTAMP, "updated_at" TIMESTAMP)')
c.execute ('SELECT id, name, created_at, updated_at FROM categories')
categories = c.fetchall ()
for row in categories :
c.execute ('INSERT INTO activities (id, name, status, created_at, updated_at) VALUES (?, ?, ?, ?, ?)', (row ['id'], row ['name'], 'active', row ['created_at'], row ['updated_at']))
c.execute ('DROP TABLE categories')
c.execute ('ALTER TABLE hours RENAME TO hours_old')
c.execute ('CREATE TABLE "hours" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "volunteer_id" INTEGER, "start" TIMESTAMP, "end" TIMESTAMP, "activity_id" INTEGER, "created_at" TIMESTAMP, "updated_at" TIMESTAMP)')
c.execute ('SELECT id, volunteer_id, start, end, category_id, created_at, updated_at FROM hours_old')
hours = c.fetchall ()
for row in hours :
c.execute ('INSERT INTO hours (id, volunteer_id, start, end, activity_id, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?)', (row ['id'], row ['volunteer_id'], row ['start'], row ['end'], row ['category_id'], row ['created_at'], row ['updated_at']))
c.execute ('DROP TABLE hours_old')
c.execute ('VACUUM')
Is there a bug in the code above? | Yes |
449 | [
"#NEWLINE#",
"def _execute(",
"self",
",",
"command",
",",
"params",
"=",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Overriding in order to catch StaleElementReferenceException.'",
"#NEWLINE#",
"repeat",
"=",
"range",
"(",
"2",
")",
"#NEWLINE#",
"for",
"i",
"in",
... | true | 45 | [
"15",
"25",
"60",
"23",
"45",
"58",
"4",
"43",
"6",
"2",
"38",
"77"
] | 1 | VARIABLE_MISUSE | [
6
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 13,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "openstack/horizon/horizon/test/webdriver.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def _execute(self, command, params = None) :
'Overriding in order to catch StaleElementReferenceException.'
repeat = range (2)
for i in repeat :
try :
return super (WebElementWrapper, self)._execute (command, i)
except exceptions.StaleElementReferenceException :
if (i == repeat [(- 1)]) :
raise
if (not self._reload_element ()) :
raise
Is there a bug in the code above? | Yes |
450 | [
"#NEWLINE#",
"def known(",
"self",
",",
"words",
")",
":",
"#NEWLINE#",
"#INDENT#",
"return",
"set",
"(",
"(",
"self",
"for",
"w",
"in",
"words",
"if",
"(",
"w",
"in",
"self",
".",
"NWORDS",
")",
")",
")"
] | true | 13 | [
"2",
"13",
"22",
"15",
"20",
"4",
"17"
] | 1 | VARIABLE_MISUSE | [
15,
20
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 9,
"after_index": 11,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 11,
"after_index": 10... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "VikParuchuri/simpsons-scripts/tasks/train.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def known(self, words) :
return set ((self for w in words if (w in self.NWORDS)))
Is there a bug in the code above? | Yes |
451 | [
"#NEWLINE#",
"def handle_request(",
"self",
",",
"message",
")",
":",
"#NEWLINE#",
"#INDENT#",
"request",
"=",
"parseRecognitionRequestMessage",
"(",
"message",
")",
"#NEWLINE#",
"if",
"(",
"request",
".",
"type",
"==",
"RecognitionRequestMessage",
".",
"BATCH",
")"... | true | 57 | [
"4",
"13",
"2",
"29",
"44",
"53",
"57",
"62",
"72",
"79",
"9",
"18",
"33",
"66",
"83"
] | 1 | VARIABLE_MISUSE | [
9,
18,
33,
66,
83
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 16,
"after_index": 21... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "UFAL-DSG/cloud-asr/cloudasr/worker/lib.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def handle_request(self, message) :
request = parseRecognitionRequestMessage (message)
if (request.type == RecognitionRequestMessage.BATCH) :
self.handle_batch_request (request)
else :
if (not self.is_online_recognition_running ()) :
self.begin_online_recognition (self)
if self.is_bad_chunk (request) :
return self.handle_bad_chunk ()
self.handle_online_request (request)
Is there a bug in the code above? | Yes |
452 | [
"#NEWLINE#",
"def compile(",
"self",
",",
"name",
",",
"modules",
",",
"opt",
"=",
"False",
",",
"threads",
"=",
"False",
",",
"defines",
"=",
"{",
"#NEWLINE#",
"#INDENT#",
"#NEWLINE#",
"#UNINDENT#",
"}",
")",
":",
"#NEWLINE#",
"#INDENT#",
"path",
"=",
"se... | true | 273 | [
"8",
"6",
"124",
"157",
"199",
"266",
"233",
"264",
"134",
"210",
"254",
"256",
"129",
"203",
"224",
"271",
"106",
"235",
"259",
"4",
"41",
"122",
"269",
"155",
"161",
"169",
"173",
"187",
"36",
"56",
"240",
"273",
"83",
"285",
"12",
"220",
"16... | 1 | VARIABLE_MISUSE | [
129,
203,
224,
271
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 27,
"after_index": 33,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 35,
"after_index": 4... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "johncsnyder/SwiftKitten/cffi/testing/embedding/test_basic.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def compile(self, name, modules, opt = False, threads = False, defines = {
}) :
path = self.get_path ()
filename = ('%s.c' % name)
shutil.copy (os.path.join (local_dir, filename), path)
shutil.copy (os.path.join (local_dir, 'thread-test.h'), path)
import distutils.ccompiler
curdir = os.getcwd ()
try :
os.chdir (self.get_path ())
c = distutils.ccompiler.new_compiler ()
print (('compiling %s with %r' % (name, modules)))
extra_preargs = []
debug = True
if (sys.platform == 'win32') :
libfiles = []
for m in modules :
m = os.path.basename (m)
assert m.endswith ('.dll')
libfiles.append (('Release\\%s.lib' % m [: (- 4)]))
modules = libfiles
extra_preargs.append ('/MANIFEST')
debug = False
else :
if threads :
extra_preargs.append ('-pthread')
objects = c.compile ([filename], macros = sorted (defines.items ()), debug = debug)
c.link_executable ((objects + modules), name, extra_preargs = filename)
finally :
os.chdir (curdir)
Is there a bug in the code above? | Yes |
453 | [
"#NEWLINE#",
"def get_tabs(",
"self",
",",
"request",
",",
"*",
"args",
",",
"**kwargs",
")",
":",
"#NEWLINE#",
"#INDENT#",
"ipsecsiteconnection",
"=",
"self",
".",
"get_data",
"(",
")",
"#NEWLINE#",
"return",
"self",
".",
"tab_group_class",
"(",
"request",
",... | true | 34 | [
"14",
"29",
"31",
"7",
"2",
"16",
"23",
"4",
"27",
"34"
] | 1 | VARIABLE_MISUSE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 3,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 13,
"after_index": 19,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "CiscoSystems/avos/openstack_dashboard/dashboards/project/vpn/views.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def get_tabs(self, request, * args, **kwargs) :
ipsecsiteconnection = self.get_data ()
return self.tab_group_class (request, ipsecsiteconnection = ipsecsiteconnection, ** request)
Is there a bug in the code above? | Yes |
454 | [
"#NEWLINE#",
"def testAuthenticationFailed(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'ERROR: Fail Facebook authentication (which returns None user_dict).'",
"#NEWLINE#",
"with",
"mock",
".",
"patch",
"(",
"'tornado.httpclient.AsyncHTTPClient'",
",",
"MockAsyncHTTPClient",
"(",... | true | 69 | [
"46",
"21",
"25",
"69",
"2",
"48",
"55",
"65",
"75",
"85"
] | 1 | VARIABLE_MISUSE | [
46
] | [
[
{
"before_index": 6,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 20,
"after_index": 15,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 20,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "viewfinderco/viewfinder/backend/www/test/auth_facebook_test.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def testAuthenticationFailed(self) :
'ERROR: Fail Facebook authentication (which returns None user_dict).'
with mock.patch ('tornado.httpclient.AsyncHTTPClient', MockAsyncHTTPClient ()) as mock_client :
mock_client.map ('https://graph.facebook.com/me\\?', (lambda request : httpclient.HTTPResponse (request, 400)))
url = self.get_url ('/register/facebook?access_token=access_token')
self.assertRaisesHttpError (401, auth_test._SendAuthRequest, self._tester, mock_client, 'POST', user_cookie = self._cookie, request_dict = auth_test._CreateRegisterRequest (self._mobile_device_dict))
Is there a bug in the code above? | Yes |
455 | [
"#NEWLINE#",
"def test_piechart_2(",
")",
":",
"#NEWLINE#",
"#INDENT#",
"' PieChart with custom colors '",
"#NEWLINE#",
"coordinate_system",
"=",
"cartesius",
".",
"CoordinateSystem",
"(",
")",
"#NEWLINE#",
"piechart_data",
"=",
"(",
"charts",
".",
"data",
"(",
"'abc'",... | true | 121 | [
"96",
"8",
"117",
"124",
"142",
"162",
"171",
"16",
"104",
"121"
] | 1 | VARIABLE_MISUSE | [
96
] | [
[
{
"before_index": 5,
"after_index": 6,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 7,
"after_index": 13,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 15,
"after_index": 37... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "tkrajina/cartesius/create_images_and_readme.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_piechart_2() :
' PieChart with custom colors '
coordinate_system = cartesius.CoordinateSystem ()
piechart_data = (charts.data ('abc', 1, fill_color = (255, 200, 200)), charts.data ('cde', 2, fill_color = (200, 255, 200)), charts.data ('efg', 5, fill_color = (200, 200, 255)), charts.data ('ijk', 3, fill_color = (255, 255, 255)))
piechart = charts.PieChart (data = piechart_data, color = (0, 0, 0))
coordinate_system.add (piechart_data)
coordinate_system.add (elements.Axis (horizontal = True, hide = True))
coordinate_system.add (elements.Axis (vertical = True, hide = True))
return (coordinate_system.draw (300, 200), coordinate_system.draw (300, 200, antialiasing = True))
Is there a bug in the code above? | Yes |
456 | [
"#NEWLINE#",
"def transformIgnoredSpecs(",
"lines",
",",
"doc",
",",
"**kwargs",
")",
":",
"#NEWLINE#",
"#INDENT#",
"specs",
"=",
"parseInfoTree",
"(",
"lines",
",",
"doc",
".",
"md",
".",
"indent",
")",
"#NEWLINE#",
"return",
"processIgnoredSpecs",
"(",
"specs"... | false | 0 | [
"11",
"27",
"specs",
"4",
"17",
"29",
"doc",
"kwargs",
"2",
"15",
"lines"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 16,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 24,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "tabatkins/bikeshed/bikeshed/datablocks.py",
"license": "cc0-1.0",
"note": "license: github_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def transformIgnoredSpecs(lines, doc, **kwargs) :
specs = parseInfoTree (lines, doc.md.indent)
return processIgnoredSpecs (specs, doc)
Is there a bug in the code above? | No |
457 | [
"#NEWLINE#",
"def extra(",
"self",
",",
"*",
"args",
",",
"**kwargs",
")",
":",
"#NEWLINE#",
"#INDENT#",
"return",
"self",
".",
"get_queryset",
"(",
")",
".",
"extra",
"(",
"*",
"args",
",",
"**",
"kwargs",
")"
] | false | 0 | [
"5",
"22",
"args",
"2",
"13",
"self",
"25",
"kwargs"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 3,
"after_index": 5,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 23,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/db/models/manager.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def extra(self, * args, **kwargs) :
return self.get_queryset ().extra (* args, ** kwargs)
Is there a bug in the code above? | No |
458 | [
"#NEWLINE#",
"def wiki_page_version_deleted(",
"self",
",",
"page",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"deleted_version",
".",
"append",
"(",
"page",
")"
] | false | 0 | [
"4",
"15",
"page",
"2",
"9",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 14,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 12... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "edgewall/trac/trac/wiki/tests/model.py",
"license": "bsd-3-clause",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def wiki_page_version_deleted(self, page) :
self.deleted_version.append (page)
Is there a bug in the code above? | No |
459 | [
"#NEWLINE#",
"def test_check_active_false(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"auth",
"=",
"DigestAuthentication",
"(",
"require_active",
"=",
"False",
")",
"#NEWLINE#",
"request",
"=",
"HttpRequest",
"(",
")",
"#NEWLINE#",
"bob_doe",
"=",
"User",
".",
"... | false | 0 | [
"7",
"50",
"98",
"auth",
"22",
"41",
"68",
"89",
"bob_doe",
"2",
"105",
"self",
"16",
"54",
"57",
"72",
"102",
"request",
"48",
"82",
"96",
"109",
"auth_request"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 10,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 15,
"after_index": 19,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 21,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "mozilla/inventory/vendor-local/src/django-tastypie/tests/core/tests/authentication.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_check_active_false(self) :
auth = DigestAuthentication (require_active = False)
request = HttpRequest ()
bob_doe = User.objects.get (username = 'bobdoe')
create_api_key (User, instance = bob_doe, created = True)
auth_request = auth.is_authenticated (request)
request.META ['HTTP_AUTHORIZATION'] = python_digest.build_authorization_request (bob_doe.username, request.method, '/', 1, digest_challenge = auth_request ['WWW-Authenticate'], password = bob_doe.api_key.key)
auth_request = auth.is_authenticated (request)
self.assertTrue (auth_request, True)
Is there a bug in the code above? | No |
460 | [
"#NEWLINE#",
"def _draw_wireframe_display_list(",
"self",
",",
"dl",
")",
":",
"#NEWLINE#",
"#INDENT#",
"glPushAttrib",
"(",
"(",
"GL_ENABLE_BIT",
"|",
"GL_POLYGON_BIT",
")",
")",
"#NEWLINE#",
"glPolygonMode",
"(",
"GL_FRONT_AND_BACK",
",",
"GL_LINE",
")",
"#NEWLINE#"... | false | 0 | [
"2",
"self",
"4",
"45",
"dl"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 10,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 17,
"after_index": 21... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "sympy/sympy/sympy/plotting/pygletplot/plot_mode_base.py",
"license": "bsd-3-clause",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def _draw_wireframe_display_list(self, dl) :
glPushAttrib ((GL_ENABLE_BIT | GL_POLYGON_BIT))
glPolygonMode (GL_FRONT_AND_BACK, GL_LINE)
glEnable (GL_POLYGON_OFFSET_LINE)
glPolygonOffset ((- 0.005), (- 50.0))
glCallList (dl)
glPopAttrib ()
Is there a bug in the code above? | No |
461 | [
"#NEWLINE#",
"def remove(",
"self",
",",
"f",
")",
":",
"#NEWLINE#",
"#INDENT#",
"try",
":",
"#NEWLINE#",
"#INDENT#",
"os",
".",
"remove",
"(",
"self",
".",
"f",
")",
"#NEWLINE#",
"#UNINDENT#",
"except",
":",
"#NEWLINE#",
"#INDENT#",
"pass"
] | false | 0 | [
"2",
"17",
"self",
"4",
"19",
"f"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 16,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 16,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "pydata/pandas/asv_bench/benchmarks/hdfstore_bench.py",
"license": "bsd-3-clause",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def remove(self, f) :
try :
os.remove (self.f)
except :
pass
Is there a bug in the code above? | No |
462 | [
"#NEWLINE#",
"def pculaZpotrs(",
"config",
",",
"uplo",
",",
"n",
",",
"nrhs",
",",
"a",
",",
"lda",
",",
"b",
",",
"ldb",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n Cholesky solve.\\n\\n '",
"#NEWLINE#",
"status",
"=",
"_libpcula",
".",
"pculaZpotrs",
"("... | false | 0 | [
"10",
"44",
"a",
"4",
"36",
"uplo",
"12",
"47",
"lda",
"14",
"51",
"b",
"23",
"59",
"status",
"6",
"38",
"n",
"8",
"40",
"nrhs",
"16",
"54",
"ldb",
"2",
"33",
"config"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 20,
"after_index": 21,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 22,
"after_index": 3... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "lebedov/scikit-cuda/skcuda/pcula.py",
"license": "bsd-3-clause",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def pculaZpotrs(config, uplo, n, nrhs, a, lda, b, ldb) :
'
Cholesky solve.
'
status = _libpcula.pculaZpotrs (ctypes.byref (config), uplo, n, nrhs, int (a), lda, int (b), ldb)
culaCheckStatus (status)
Is there a bug in the code above? | No |
463 | [
"#NEWLINE#",
"def _parse_openid_request(",
"self",
",",
"request",
")",
":",
"#NEWLINE#",
"#INDENT#",
"return",
"OpenIDRequest",
"(",
")",
".",
"from_jwt",
"(",
"request",
",",
"keyjar",
"=",
"self",
".",
"keyjar",
")"
] | false | 0 | [
"4",
"16",
"request",
"2",
"20",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 9,
"after_index": 17,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 17,
"after_index": 13... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "rohe/pyoidc/src/oic/oic/provider.py",
"license": "apache-2.0",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def _parse_openid_request(self, request) :
return OpenIDRequest ().from_jwt (request, keyjar = self.keyjar)
Is there a bug in the code above? | No |
464 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"rule",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"rule",
"=",
"rule",
"#NEWLINE#",
"self",
".",
"first",
"=",
"[",
"]",
"#NEWLINE#",
"self",
".",
"follow",
"=",
"[",
"]",
"#NEWLINE#",
"self",
".",
"accept... | false | 0 | [
"4",
"11",
"13",
"rule",
"2",
"9",
"15",
"22",
"29",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 13,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 19... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "smurfix/yapps/yapps/parsetree.py",
"license": "mit",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def __init__(self, rule) :
self.rule = rule
self.first = []
self.follow = []
self.accepts_epsilon = 0
Is there a bug in the code above? | No |
465 | [
"#NEWLINE#",
"def save(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"(",
"from_date",
",",
"to_date",
")",
"=",
"super",
"(",
"UserYearMonthForm",
",",
"self",
")",
".",
"save",
"(",
")",
"#NEWLINE#",
"return",
"(",
"from_date",
",",
"to_date",
",",
"self... | false | 0 | [
"8",
"26",
"from_date",
"10",
"28",
"to_date",
"2",
"17",
"30",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 21,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 24,
"after_index": 27,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 21,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "caktus/django-timepiece/timepiece/forms.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def save(self) :
(from_date, to_date) = super (UserYearMonthForm, self).save ()
return (from_date, to_date, self.cleaned_data.get ('user', None))
Is there a bug in the code above? | No |
466 | [
"#NEWLINE#",
"def handle_edit_user_story_request(",
"self",
",",
"user_story",
")",
":",
"#NEWLINE#",
"#INDENT#",
"data",
"=",
"self",
".",
"view",
".",
"get_user_story_form_data",
"(",
")",
"#NEWLINE#",
"if",
"(",
"not",
"data",
".",
"get",
"(",
"'subject'",
",... | false | 0 | [
"9",
"22",
"60",
"data",
"2",
"11",
"34",
"52",
"67",
"self",
"50",
"63",
"us_patch_f",
"4",
"58",
"user_story"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 16,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 19,
"after_index": 21... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "taigaio/taiga-ncurses/taiga_ncurses/controllers/milestones.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def handle_edit_user_story_request(self, user_story) :
data = self.view.get_user_story_form_data ()
if (not data.get ('subject', None)) :
self.view.notifier.error_msg ('Subject is required')
else :
us_patch_f = self.executor.update_user_story (user_story, data)
us_patch_f.add_done_callback (self.handle_edit_user_story_response)
Is there a bug in the code above? | No |
467 | [
"#NEWLINE#",
"def get_fb_user_cookie(",
"self",
",",
"request",
")",
":",
"#NEWLINE#",
"#INDENT#",
"' Attempt to find a facebook user using a cookie. '",
"#NEWLINE#",
"fb_user",
"=",
"facebook",
".",
"get_user_from_cookie",
"(",
"request",
".",
"COOKIES",
",",
"settings",
... | false | 0 | [
"2",
"self",
"4",
"17",
"request",
"11",
"31",
"35",
"44",
"fb_user"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 9,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 20,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "aidanlister/django-facebook/django_facebook/middleware.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def get_fb_user_cookie(self, request) :
' Attempt to find a facebook user using a cookie. '
fb_user = facebook.get_user_from_cookie (request.COOKIES, settings.FACEBOOK_APP_ID, settings.FACEBOOK_SECRET_KEY)
if fb_user :
fb_user ['method'] = 'cookie'
return fb_user
Is there a bug in the code above? | No |
468 | [
"#NEWLINE#",
"def update_candidate_distributions(",
"self",
",",
"distribution_iter",
")",
":",
"#NEWLINE#",
"#INDENT#",
"for",
"dist",
"in",
"distribution_iter",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"self",
".",
"can_add",
"(",
"dist",
")",
":",
"#NEWLINE#",
"#INDEN... | false | 0 | [
"2",
"17",
"44",
"self",
"10",
"21",
"34",
"48",
"dist",
"4",
"12",
"distribution_iter"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 9,
"after_index": 10,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 9,
"after_index": 12,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "pantsbuild/pex/pex/environment.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def update_candidate_distributions(self, distribution_iter) :
for dist in distribution_iter :
if self.can_add (dist) :
with TRACER.timed (('Adding %s' % dist), V = 2) :
self.add (dist)
Is there a bug in the code above? | No |
469 | [
"#NEWLINE#",
"def sub_unique_objects(",
"self",
",",
"obj",
",",
"params",
"=",
"None",
",",
"pub",
"=",
"None",
",",
"*",
"args",
",",
"**kwargs",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Return objects that are only visible through given subscription.'",
"#NEWLINE#",
"i... | false | 0 | [
"138",
"291",
"kwargs",
"157",
"210",
"222",
"227",
"282",
"other",
"76",
"80",
"90",
"93",
"133",
"135",
"145",
"216",
"235",
"244",
"286",
"288",
"306",
"322",
"qs",
"204",
"218",
"other_pub",
"110",
"251",
"259",
"264",
"309",
"to_send",
"2",
"5... | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 3,
"after_index": 15,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 21,
"after_index": 22... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "django-ddp/django-ddp/dddp/api.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def sub_unique_objects(self, obj, params = None, pub = None, * args, **kwargs) :
'Return objects that are only visible through given subscription.'
if (params is None) :
params = ejson.loads (obj.params_ejson)
if (pub is None) :
pub = self.get_pub_by_name (obj.publication)
queries = collections.OrderedDict (((col, qs) for (qs, col) in (self.qs_and_collection (qs) for qs in pub.user_queries (obj.user, * params))))
to_send = collections.OrderedDict (((col, col.objects_for_user (* args, user = obj.user_id, qs = qs, ** kwargs)) for (col, qs) in queries.items ()))
for other in Subscription.objects.filter (connection = obj.connection_id, collections__collection_name__in = [col.name for col in queries]).exclude (pk = obj.pk).order_by ('pk').distinct () :
other_pub = self.get_pub_by_name (other.publication)
for qs in other_pub.user_queries (other.user, * other.params) :
(qs, col) = self.qs_and_collection (qs)
if (col not in to_send) :
continue
to_send [col] = to_send [col].exclude (pk__in = col.objects_for_user (* args, user = other.user_id, qs = qs, ** kwargs).values ('pk'))
for (col, qs) in to_send.items () :
(yield (col, qs.distinct ()))
Is there a bug in the code above? | No |
470 | [
"#NEWLINE#",
"@",
"patch",
"(",
"'jumpgate.api.importlib.import_module'",
")",
"#NEWLINE#",
"def test_load_drivers(",
"self",
",",
"import_module",
")",
":",
"#NEWLINE#",
"#INDENT#",
"compute_disp",
"=",
"MagicMock",
"(",
")",
"#NEWLINE#",
"identity_disp",
"=",
"MagicMo... | false | 0 | [
"10",
"65",
"import_module",
"15",
"38",
"85",
"compute_disp",
"21",
"43",
"103",
"identity_disp",
"8",
"27",
"49",
"57",
"81",
"99",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 9,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 18,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 20,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "softlayer/jumpgate/tests/jumpgate-tests/test_jumpgate.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | @ patch ('jumpgate.api.importlib.import_module')
def test_load_drivers(self, import_module) :
compute_disp = MagicMock ()
identity_disp = MagicMock ()
self.app._dispatchers = {
'compute' : compute_disp,
'identity' : identity_disp,
}
self.app.config = TEST_CFG
self.app.load_drivers ()
import_module.assert_has_calls ([call ('path.to.compute.driver'), call ().setup_routes (self.app, compute_disp), call ('path.to.identity.driver'), call ().setup_routes (self.app, identity_disp)], any_order = True)
Is there a bug in the code above? | No |
471 | [
"#NEWLINE#",
"def test_values_from_lookup_field(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n Regression test for #12654: lookup_field\\n '",
"#NEWLINE#",
"SITE_NAME",
"=",
"'example.com'",
"#NEWLINE#",
"TITLE_TEXT",
"=",
"'Some title'",
"#NEWLINE#",
"CREATED_DA... | false | 0 | [
"2",
"43",
"198",
"self",
"9",
"74",
"98",
"SITE_NAME",
"23",
"51",
"119",
"ADMIN_METHOD",
"145",
"176",
"mock_admin",
"153",
"172",
"name",
"155",
"202",
"value",
"13",
"79",
"113",
"TITLE_TEXT",
"163",
"181",
"194",
"field",
"167",
"188",
"192",
"204... | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 11,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 15... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "AppScale/appscale/AppServer/lib/django-1.2/tests/regressiontests/admin_util/tests.py",
"license": "apache-2.0",
"note": "license: github_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_values_from_lookup_field(self) :
'
Regression test for #12654: lookup_field
'
SITE_NAME = 'example.com'
TITLE_TEXT = 'Some title'
CREATED_DATE = datetime.min
ADMIN_METHOD = 'admin method'
SIMPLE_FUNCTION = 'function'
INSTANCE_ATTRIBUTE = 'attr'
class MockModelAdmin (object) :
def get_admin_value(self, obj) :
return ADMIN_METHOD
simple_function = (lambda obj : SIMPLE_FUNCTION)
article = Article (site = Site (domain = SITE_NAME), title = TITLE_TEXT, created = CREATED_DATE)
article.non_field = INSTANCE_ATTRIBUTE
verifications = (('site', SITE_NAME), ('created', localize (CREATED_DATE)), ('title', TITLE_TEXT), ('get_admin_value', ADMIN_METHOD), (simple_function, SIMPLE_FUNCTION), ('test_from_model', article.test_from_model ()), ('non_field', INSTANCE_ATTRIBUTE))
mock_admin = MockModelAdmin ()
for (name, value) in verifications :
(field, attr, resolved_value) = lookup_field (name, article, mock_admin)
if (field is not None) :
resolved_value = display_for_field (resolved_value, field)
self.assertEqual (value, resolved_value)
Is there a bug in the code above? | No |
472 | [
"#NEWLINE#",
"def test_fetch(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"dummy1",
"=",
"DummyModel",
".",
"objects",
".",
"create",
"(",
"name",
"=",
"'Foo'",
")",
"#NEWLINE#",
"dummy2",
"=",
"DummyModel",
".",
"objects",
".",
"create",
"(",
"name",
"=",
... | false | 0 | [
"2",
"self",
"46",
"67",
"74",
"81",
"qset",
"7",
"65",
"dummy1",
"33",
"79",
"dummy3",
"20",
"72",
"dummy2"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 14,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 19,
"after_index": 27,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 32,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "codeinthehole/django-cacheback/tests/test_jobs.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_fetch(self) :
dummy1 = DummyModel.objects.create (name = 'Foo')
dummy2 = DummyModel.objects.create (name = 'Bar')
dummy3 = DummyModel.objects.create (name = 'Foobar')
qset = list (QuerySetFilterJob (DummyModel).fetch (name__startswith = 'Foo'))
assert (dummy1 in qset)
assert (dummy2 not in qset)
assert (dummy3 in qset)
Is there a bug in the code above? | No |
473 | [
"#NEWLINE#",
"def get_jar_dependencies(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"jar_deps",
"=",
"OrderedSet",
"(",
")",
"#NEWLINE#",
"def collect_jar_deps(",
"target",
")",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"isinstance",
"(",
"target",
",",
"JarLibrary",
")"... | false | 0 | [
"7",
"29",
"52",
"jar_deps",
"2",
"42",
"self",
"48",
"collect_jar_deps"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 10,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 41,
"after_index": 45,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 51,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "pantsbuild/pants/src/python/pants/backend/jvm/targets/jvm_target.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def get_jar_dependencies(self) :
jar_deps = OrderedSet ()
def collect_jar_deps(target) :
if isinstance (target, JarLibrary) :
jar_deps.update (target.payload.jars)
self.walk (work = collect_jar_deps)
return jar_deps
Is there a bug in the code above? | No |
474 | [
"#NEWLINE#",
"def test_storage_celery_save(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n Make sure it actually works when using Celery as a task queue\\n '",
"#NEWLINE#",
"storage",
"=",
"QueuedStorage",
"(",
"local",
"=",
"'django.core.files.storage.FileSystemStora... | false | 0 | [
"63",
"79",
"89",
"118",
"143",
"162",
"178",
"obj",
"2",
"27",
"38",
"73",
"85",
"102",
"114",
"127",
"139",
"154",
"170",
"186",
"190",
"198",
"204",
"208",
"216",
"232",
"237",
"249",
"257",
"266",
"270",
"276",
"291",
"297",
"312",
"320",
"... | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 16,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 43,
"after_index": 53... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "jazzband/django-queued-storage/tests/test_storages.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_storage_celery_save(self) :
'
Make sure it actually works when using Celery as a task queue
'
storage = QueuedStorage (local = 'django.core.files.storage.FileSystemStorage', remote = 'django.core.files.storage.FileSystemStorage', local_options = dict (location = self.local_dir), remote_options = dict (location = self.remote_dir))
field = models.TestModel._meta.get_field ('testfile')
field.storage = storage
obj = models.TestModel (testfile = File (self.test_file))
obj.save ()
self.assertTrue (obj.testfile.storage.result.get ())
self.assertTrue (path.isfile (path.join (self.local_dir, obj.testfile.name)))
self.assertTrue (path.isfile (path.join (self.remote_dir, obj.testfile.name)), 'Remote file is not available.')
self.assertFalse (storage.using_local (obj.testfile.name))
self.assertTrue (storage.using_remote (obj.testfile.name))
self.assertEqual (self.test_file_name, storage.get_valid_name (self.test_file_name))
self.assertEqual (self.test_file_name, storage.get_available_name (self.test_file_name))
subdir_path = os.path.join ('test', self.test_file_name)
self.assertTrue (storage.exists (subdir_path))
self.assertEqual (storage.path (self.test_file_name), path.join (self.local_dir, self.test_file_name))
self.assertEqual (storage.listdir ('test') [1], [self.test_file_name])
self.assertEqual (storage.size (subdir_path), os.stat (self.test_file_path).st_size)
self.assertEqual (storage.url (self.test_file_name), self.test_file_name)
self.assertIsInstance (storage.accessed_time (subdir_path), datetime)
self.assertIsInstance (storage.created_time (subdir_path), datetime)
self.assertIsInstance (storage.modified_time (subdir_path), datetime)
subdir_name = 'queued_storage_2.txt'
testfile = storage.open (subdir_name, 'w')
try :
testfile.write ('test')
finally :
testfile.close ()
self.assertTrue (storage.exists (subdir_name))
storage.delete (subdir_name)
self.assertFalse (storage.exists (subdir_name))
Is there a bug in the code above? | No |
475 | [
"#NEWLINE#",
"@",
"_sympifyit",
"(",
"'other'",
",",
"NotImplemented",
")",
"#NEWLINE#",
"@",
"call_highest_priority",
"(",
"'__mul__'",
")",
"#NEWLINE#",
"def __rmul__(",
"self",
",",
"other",
")",
":",
"#NEWLINE#",
"#INDENT#",
"return",
"self",
".",
"_mul_func",... | false | 0 | [
"18",
"28",
"other",
"16",
"24",
"30",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 17,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 23,
"after_index": 29,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 5,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "sympy/sympy/sympy/vector/basisdependent.py",
"license": "bsd-3-clause",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | @ _sympifyit ('other', NotImplemented)
@ call_highest_priority ('__mul__')
def __rmul__(self, other) :
return self._mul_func (other, self)
Is there a bug in the code above? | No |
476 | [
"#NEWLINE#",
"def default(",
"default",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n API class method wrapper to specify the default value.\\n\\n Default will usually be returned if an exception is raised, like from a \\n JSON parsing attempt on a bad request.\\n '",
"#NEWLINE#",
"def deco... | false | 0 | [
"2",
"61",
"default",
"74",
"decorator"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 73,
"after_index": 74,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 15,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "glennyonemitsu/MarkupHiveSDK/sdklib/api.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def default(default) :
'
API class method wrapper to specify the default value.
Default will usually be returned if an exception is raised, like from a
JSON parsing attempt on a bad request.
'
def decorator(fn) :
def wrapped_func(self, * args, **kwargs) :
try :
return fn (self, * args, ** kwargs)
except Exception as e :
return {
'success' : False,
'result' : default,
}
return wrapped_func
return decorator
Is there a bug in the code above? | No |
477 | [
"#NEWLINE#",
"def assert_header_blocks_actually_equal(",
"block_a",
",",
"block_b",
")",
":",
"#NEWLINE#",
"#INDENT#",
"\"\\n Asserts that two header bocks are really, truly equal, down to the types\\n of their tuples. Doesn't return anything.\\n \"",
"#NEWLINE#",
"assert",
"(",
"... | false | 0 | [
"26",
"42",
"49",
"a",
"28",
"44",
"53",
"b",
"2",
"15",
"33",
"block_a",
"4",
"20",
"35",
"block_b"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 9,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 11,
"after_index": 17,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "python-hyper/hyper-h2/test/test_header_indexing.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def assert_header_blocks_actually_equal(block_a, block_b) :
"
Asserts that two header bocks are really, truly equal, down to the types
of their tuples. Doesn't return anything.
"
assert (len (block_a) == len (block_b))
for (a, b) in zip (block_a, block_b) :
assert (a == b)
assert (a.__class__ is b.__class__)
Is there a bug in the code above? | No |
478 | [
"#NEWLINE#",
"def authenticate(",
"self",
",",
"session_info",
"=",
"None",
",",
"attribute_mapping",
"=",
"None",
",",
"create_unknown_user",
"=",
"True",
")",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"(",
"(",
"session_info",
"is",
"None",
")",
"or",
"(",
"attrib... | false | 0 | [
"200",
"216",
"django_fields",
"280",
"327",
"379",
"385",
"404",
"410",
"438",
"450",
"456",
"512",
"user",
"284",
"300",
"318",
"358",
"430",
"478",
"501",
"main_attribute",
"293",
"339",
"447",
"user_query_args",
"93",
"131",
"use_name_id_as_username",
"1... | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 19,
"after_index": 26,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 47,
"after_index": 4... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "cloudera/hue/desktop/core/ext-py/djangosaml2-0.13.0/djangosaml2/backends.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def authenticate(self, session_info = None, attribute_mapping = None, create_unknown_user = True) :
if ((session_info is None) or (attribute_mapping is None)) :
logger.error ('Session info or attribute mapping are None')
return None
if (not ('ava' in session_info)) :
logger.error ('"ava" key not found in session_info')
return None
attributes = session_info ['ava']
if (not attributes) :
logger.error ('The attributes dictionary is empty')
use_name_id_as_username = getattr (settings, 'SAML_USE_NAME_ID_AS_USERNAME', False)
django_user_main_attribute = getattr (settings, 'SAML_DJANGO_USER_MAIN_ATTRIBUTE', 'username')
logger.debug (('attributes: %s' % attributes))
saml_user = None
if use_name_id_as_username :
if ('name_id' in session_info) :
logger.debug (('name_id: %s' % session_info ['name_id']))
saml_user = session_info ['name_id'].text
else :
logger.error ('The nameid is not available. Cannot find user without a nameid.')
else :
logger.debug (('attribute_mapping: %s' % attribute_mapping))
for (saml_attr, django_fields) in attribute_mapping.items () :
if ((django_user_main_attribute in django_fields) and (saml_attr in attributes)) :
saml_user = attributes [saml_attr] [0]
if (saml_user is None) :
logger.error ('Could not find saml_user value')
return None
if (not self.is_authorized (attributes, attribute_mapping)) :
return None
user = None
main_attribute = self.clean_user_main_attribute (saml_user)
user_query_args = {
django_user_main_attribute : main_attribute,
}
if create_unknown_user :
logger.debug (('Check if the user "%s" exists or create otherwise' % main_attribute))
try :
(user, created) = User.objects.get_or_create (** user_query_args)
except MultipleObjectsReturned :
logger.error (('There are more than one user with %s = %s' % (django_user_main_attribute, main_attribute)))
return None
if created :
logger.debug ('New user created')
user = self.configure_user (user, attributes, attribute_mapping)
else :
logger.debug ('User updated')
user = self.update_user (user, attributes, attribute_mapping)
else :
logger.debug (('Retrieving existing user "%s"' % main_attribute))
try :
user = User.objects.get (** user_query_args)
user = self.update_user (user, attributes, attribute_mapping)
except User.DoesNotExist :
logger.error (('The user "%s" does not exist' % main_attribute))
return None
except MultipleObjectsReturned :
logger.error (('There are more than one user with %s = %s' % (django_user_main_attribute, main_attribute)))
return None
return user
Is there a bug in the code above? | No |
479 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"parent",
",",
"param",
",",
"precision",
"=",
"4",
",",
"vary",
"=",
"None",
",",
"**kws",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"param",
"=",
"param",
"#NEWLINE#",
"title",
"=",
"(",
"' Parameter: %s... | false | 0 | [
"4",
"45",
"67",
"parent",
"56",
"267",
"310",
"350",
"376",
"404",
"432",
"468",
"496",
"510",
"521",
"538",
"549",
"564",
"579",
"594",
"605",
"620",
"635",
"650",
"661",
"676",
"691",
"710",
"716",
"736",
"755",
"776",
"panel",
"122",
"158",
"... | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 20,
"after_index": 25,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 26,
"after_index": 3... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "xraypy/xraylarch/plugins/wx/parameter.py",
"license": "bsd-2-clause",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def __init__(self, parent, param, precision = 4, vary = None, **kws) :
self.param = param
title = (' Parameter: %s ' % param.name)
wx.Dialog.__init__ (self, parent, wx.ID_ANY, title = title)
panel = GridPanel (self)
self.SetFont (parent.GetFont ())
if (vary is None) :
vary = 0
if param.vary :
vary = 1
else :
if (param.expr is not None) :
vary = 2
(minval, maxval) = (param.min, param.max)
(stderr, expr) = (param.stderr, param.expr)
sminval = ('%s' % minval)
smaxval = ('%s' % maxval)
if (minval in (None, 'None', (- np.inf))) :
minval = (- np.inf)
if (maxval in (None, 'None', np.inf)) :
maxval = np.inf
if (stderr is None) :
stderr = ''
if (expr is None) :
expr = ''
self.wids = Empty ()
self.wids.vary = Choice (panel, choices = VARY_CHOICES, action = self.onVaryChoice, size = (110, (- 1)))
self.wids.vary.SetSelection (vary)
self.wids.val = FloatCtrl (panel, value = param.value, size = (100, (- 1)), precision = precision, minval = minval, maxval = maxval)
self.wids.min = FloatCtrl (panel, value = minval, size = (100, (- 1)))
self.wids.max = FloatCtrl (panel, value = maxval, size = (100, (- 1)))
self.wids.expr = wx.TextCtrl (panel, value = expr, size = (300, (- 1)))
self.wids.err = wx.StaticText (panel, label = ('%s' % stderr))
SetTip (self.wids.expr, 'Mathematical expression to calcutate value')
btnsizer = wx.StdDialogButtonSizer ()
ok_btn = wx.Button (panel, wx.ID_OK)
ok_btn.SetDefault ()
btnsizer.AddButton (ok_btn)
btnsizer.AddButton (wx.Button (panel, wx.ID_CANCEL))
btnsizer.Realize ()
panel.AddText (' Name:', style = LEFT)
panel.AddText (param.name, style = LEFT, colour = '#DD0000')
panel.AddText (' Type:', style = LEFT)
panel.Add (self.wids.vary, style = LEFT)
panel.AddText (' Value:', style = LEFT, newrow = True)
panel.Add (self.wids.val, style = LEFT)
panel.AddText (' Std Error:', style = LEFT)
panel.Add (self.wids.err, style = LEFT)
panel.AddText (' Min Value:', style = LEFT, newrow = True)
panel.Add (self.wids.min, style = LEFT)
panel.AddText (' Max Value:', style = LEFT)
panel.Add (self.wids.max, style = LEFT)
panel.AddText (' Constraint:', style = LEFT, newrow = True)
panel.Add (self.wids.expr, style = LEFT, dcol = 3)
panel.Add (HLine (panel, size = (375, 2)), dcol = 4, newrow = True)
panel.Add (btnsizer, dcol = 4, newrow = True, style = LEFT)
panel.pack ()
sizer = wx.BoxSizer (wx.VERTICAL)
sizer.Add (panel, 0, 0, 25)
self.onVaryChoice ()
pack (self, sizer)
bsize = self.GetBestSize ()
self.SetSize (((bsize [0] + 10), (bsize [1] + 10)))
Is there a bug in the code above? | No |
480 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"matrix",
",",
"row2word",
"=",
"None",
",",
"col2word",
"=",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n Initialize a Matrix instance.\\n :param matrix: A matrix of dict (row) of dict (column) of values, or of type scip... | false | 0 | [
"4",
"22",
"30",
"39",
"48",
"60",
"66",
"76",
"78",
"137",
"154",
"176",
"193",
"214",
"234",
"238",
"matrix",
"10",
"34",
"101",
"124",
"173",
"202",
"258",
"col2word",
"2",
"58",
"74",
"212",
"232",
"236",
"248",
"254",
"260",
"266",
"272",
... | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 16,
"after_index": 17,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 19,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "jimmycallin/pydsm/pydsm/indexmatrix.py",
"license": "apache-2.0",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def __init__(self, matrix, row2word = None, col2word = None) :
'
Initialize a Matrix instance.
:param matrix: A matrix of dict (row) of dict (column) of values, or of type scipy.sparse.spmatrix.
If matrix is not dict of dict, row2word and col2word must be set.
:param row2word: List of words, corresponding to each row of the matrix.
:param col2word: List of words, corresponding to each column of the matrix.
:return:
'
if isinstance (matrix, dict) :
(matrix, row2word, col2word) = _dict2matrix (matrix)
if (not isinstance (matrix, sp.spmatrix)) :
self.matrix = sp.csr_matrix (matrix)
else :
self.matrix = matrix.tocsr ()
if ((not isinstance (row2word, list)) or (not isinstance (col2word, list))) :
raise TypeError ('Row2word and col2word needs to be of type list, not {} and {}'.format (type (row2word), type (col2word)))
if (len (row2word) != matrix.shape [0]) :
raise ValueError ('Matrix row is of length {}, but row2word is of length {}'.format (matrix.shape [0], len (row2word)))
if (len (col2word) != matrix.shape [1]) :
raise ValueError ('Matrix column is of length {}, but col2word is of length {}'.format (matrix.shape [1], len (col2word)))
if (not (self.matrix.dtype in (np.double, np.bool))) :
self.matrix = self.matrix.astype (np.double)
self._row2word = row2word
self._col2word = col2word
self._word2row = None
self._word2col = None
self._display_max_rows = 10
self._display_max_cols = 7
Is there a bug in the code above? | No |
481 | [
"#NEWLINE#",
"def get_key_from_stat(",
"key",
",",
"type",
"=",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"sa",
"=",
"dbsession",
".",
"query",
"(",
"Stat",
")",
".",
"filter",
"(",
"(",
"Stat",
".",
"key",
"==",
"key",
")",
")",
".",
"one",
"(",
")... | false | 0 | [
"4",
"48",
"type",
"35",
"55",
"61",
"85",
"val",
"2",
"25",
"27",
"80",
"key",
"11",
"41",
"90",
"sa"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 32,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 34,
"after_index": 4... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "sjuxax/raggregate/raggregate/queries/general.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def get_key_from_stat(key, type = None) :
sa = dbsession.query (Stat).filter ((Stat.key == key)).one ()
val = json.loads (sa.value)
if (type == 'datetime') :
val = datetime.fromtimestamp (val).replace (tzinfo = pytz.utc)
return {
'key' : key,
'value' : val,
'sa' : sa,
}
Is there a bug in the code above? | No |
482 | [
"#NEWLINE#",
"def test_delete_with_put_empty_array(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"collection",
".",
"add_pointer",
"(",
"self",
".",
"admin_node",
",",
"auth",
"=",
"self",
".",
"auth",
")",
"#NEWLINE#",
"payload",
"=",
"self",
".",
... | false | 0 | [
"41",
"66",
"75",
"res",
"2",
"7",
"13",
"19",
"26",
"43",
"49",
"57",
"self",
"24",
"28",
"32",
"53",
"82",
"payload"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 16,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 23,
"after_index": 29,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 31,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "CenterForOpenScience/osf.io/api_tests/collections/test_views.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_delete_with_put_empty_array(self) :
self.collection.add_pointer (self.admin_node, auth = self.auth)
payload = self.payload ()
payload ['data'].pop ()
res = self.app.put_json_api (self.url, payload, auth = self.user.auth)
assert_equal (res.status_code, 200)
assert_equal (res.json ['data'], payload ['data'])
Is there a bug in the code above? | No |
483 | [
"#NEWLINE#",
"def test_type_mistyped(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"res",
"=",
"self",
".",
"app",
".",
"post_json_api",
"(",
"self",
".",
"url",
",",
"{",
"#NEWLINE#",
"#INDENT#",
"'data'",
":",
"[",
"{",
"#NEWLINE#",
"#INDENT#",
"'type'",
"... | false | 0 | [
"2",
"9",
"15",
"35",
"52",
"self",
"7",
"65",
"res"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 18,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 62,
"after_index": 68,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 18,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "CenterForOpenScience/osf.io/api_tests/collections/test_views.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_type_mistyped(self) :
res = self.app.post_json_api (self.url, {
'data' : [{
'type' : 'not_linked_nodes',
'id' : self.contributor_node._id,
}],
}, auth = self.user.auth, expect_errors = True)
assert_equal (res.status_code, 409)
Is there a bug in the code above? | No |
484 | [
"#NEWLINE#",
"def testGetExpectedCostForSharedCountryCallingCode(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"ambiguousPremiumRateString",
"=",
"'1234'",
"#NEWLINE#",
"ambiguousPremiumRateNumber",
"=",
"PhoneNumber",
"(",
"country_code",
"=",
"61",
",",
"national_number",
"... | false | 0 | [
"2",
"58",
"70",
"82",
"94",
"113",
"136",
"155",
"178",
"194",
"213",
"236",
"255",
"278",
"294",
"313",
"336",
"355",
"378",
"self",
"24",
"204",
"227",
"246",
"269",
"ambiguousStandardRateString",
"28",
"78",
"290",
"ambiguousStandardRateNumber",
"7",
... | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 9,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 18,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 23,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "daviddrysdale/python-phonenumbers/python/tests/shortnumberinfotest.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def testGetExpectedCostForSharedCountryCallingCode(self) :
ambiguousPremiumRateString = '1234'
ambiguousPremiumRateNumber = PhoneNumber (country_code = 61, national_number = 1234)
ambiguousStandardRateString = '1194'
ambiguousStandardRateNumber = PhoneNumber (country_code = 61, national_number = 1194)
ambiguousTollFreeString = '733'
ambiguousTollFreeNumber = PhoneNumber (country_code = 61, national_number = 733)
self.assertTrue (shortnumberinfo.is_valid_short_number (ambiguousPremiumRateNumber))
self.assertTrue (shortnumberinfo.is_valid_short_number (ambiguousStandardRateNumber))
self.assertTrue (shortnumberinfo.is_valid_short_number (ambiguousTollFreeNumber))
self.assertTrue (shortnumberinfo.is_valid_short_number_for_region (_parse (ambiguousPremiumRateString, 'AU'), 'AU'))
self.assertEqual (ShortNumberCost.PREMIUM_RATE, shortnumberinfo.expected_cost_for_region (_parse (ambiguousPremiumRateString, 'AU'), 'AU'))
self.assertFalse (shortnumberinfo.is_valid_short_number_for_region (_parse (ambiguousPremiumRateString, 'CX'), 'CX'))
self.assertEqual (ShortNumberCost.UNKNOWN_COST, shortnumberinfo.expected_cost_for_region (_parse (ambiguousPremiumRateString, 'CX'), 'CX'))
self.assertEqual (ShortNumberCost.PREMIUM_RATE, shortnumberinfo.expected_cost (ambiguousPremiumRateNumber))
self.assertTrue (shortnumberinfo.is_valid_short_number_for_region (_parse (ambiguousStandardRateString, 'AU'), 'AU'))
self.assertEqual (ShortNumberCost.STANDARD_RATE, shortnumberinfo.expected_cost_for_region (_parse (ambiguousStandardRateString, 'AU'), 'AU'))
self.assertFalse (shortnumberinfo.is_valid_short_number_for_region (_parse (ambiguousStandardRateString, 'CX'), 'CX'))
self.assertEqual (ShortNumberCost.UNKNOWN_COST, shortnumberinfo.expected_cost_for_region (_parse (ambiguousStandardRateString, 'CX'), 'CX'))
self.assertEqual (ShortNumberCost.UNKNOWN_COST, shortnumberinfo.expected_cost (ambiguousStandardRateNumber))
self.assertTrue (shortnumberinfo.is_valid_short_number_for_region (_parse (ambiguousTollFreeString, 'AU'), 'AU'))
self.assertEqual (ShortNumberCost.TOLL_FREE, shortnumberinfo.expected_cost_for_region (_parse (ambiguousTollFreeString, 'AU'), 'AU'))
self.assertFalse (shortnumberinfo.is_valid_short_number_for_region (_parse (ambiguousTollFreeString, 'CX'), 'CX'))
self.assertEqual (ShortNumberCost.UNKNOWN_COST, shortnumberinfo.expected_cost_for_region (_parse (ambiguousTollFreeString, 'CX'), 'CX'))
self.assertEqual (ShortNumberCost.UNKNOWN_COST, shortnumberinfo.expected_cost (ambiguousTollFreeNumber))
Is there a bug in the code above? | No |
485 | [
"#NEWLINE#",
"def get_impl_key(",
"self",
",",
"sig",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n Get the implementation key (used by the target context) for the\\n given signature.\\n '",
"#NEWLINE#",
"return",
"self",
".",
"_impl_keys",
"[",
"sig",
".",
"args"... | false | 0 | [
"4",
"16",
"sig",
"2",
"12",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 9,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 11,
"after_index": 15,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "numba/numba/numba/types/functions.py",
"license": "bsd-2-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def get_impl_key(self, sig) :
'
Get the implementation key (used by the target context) for the
given signature.
'
return self._impl_keys [sig.args]
Is there a bug in the code above? | No |
486 | [
"#NEWLINE#",
"def zoom_plot(",
"selenium",
")",
":",
"#NEWLINE#",
"#INDENT#",
"pan_buttons",
"=",
"selenium",
".",
"find_elements_by_css_selector",
"(",
"'.bk-button-bar-list[type=\"pan\"] button'",
")",
"#NEWLINE#",
"zoom_button",
"=",
"pan_buttons",
"[",
"1",
"]",
"#NEW... | false | 0 | [
"2",
"9",
"46",
"57",
"selenium",
"16",
"27",
"37",
"zoom_button",
"44",
"64",
"canvas",
"7",
"18",
"pan_buttons",
"53",
"60",
"71",
"77",
"86",
"92",
"actions"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 15,
"after_index": 19,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 23,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "bokeh/bokeh/tests/integration/interaction/test_range_min_max.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def zoom_plot(selenium) :
pan_buttons = selenium.find_elements_by_css_selector ('.bk-button-bar-list[type="pan"] button')
zoom_button = pan_buttons [1]
if ('active' not in zoom_button.get_attribute ('class')) :
zoom_button.click ()
canvas = selenium.find_element_by_tag_name ('canvas')
actions = ActionChains (selenium)
actions.move_to_element_with_offset (canvas, 10, 10)
actions.click_and_hold ()
actions.move_by_offset (200, 200)
actions.release ()
actions.perform ()
Is there a bug in the code above? | No |
487 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"name",
",",
"username",
",",
"password",
",",
"last_ip",
",",
"access",
"=",
"'agreement'",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"lowername",
"=",
"name",
"#NEWLINE#",
"self",
".",
"username",
"=",
"user... | false | 0 | [
"8",
"33",
"35",
"password",
"6",
"27",
"29",
"username",
"2",
"19",
"25",
"31",
"37",
"50",
"63",
"69",
"75",
"81",
"87",
"93",
"self",
"4",
"23",
"name",
"10",
"65",
"67",
"last_ip",
"12",
"83",
"85",
"access"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 18,
"after_index": 23,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 24,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "lunixbochs/uberserver/SQLUsers.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def __init__(self, name, username, password, last_ip, access = 'agreement') :
self.lowername = name
self.username = username
self.password = password
self.last_login = int (time.time ())
self.register_date = int (time.time ())
self.last_ip = last_ip
self.ingame_time = 0
self.bot = 0
self.access = access
self.hook_chars = ''
self.mapgrades = ''
Is there a bug in the code above? | No |
488 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"root",
",",
"engine",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"_root",
"=",
"root",
"#NEWLINE#",
"metadata",
".",
"create_all",
"(",
"engine",
")",
"#NEWLINE#",
"self",
".",
"sessionmaker",
"=",
"sessionmaker... | false | 0 | [
"6",
"21",
"32",
"engine",
"4",
"15",
"root",
"2",
"11",
"24",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 15,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 16,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "lunixbochs/uberserver/SQLUsers.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def __init__(self, root, engine) :
self._root = root
metadata.create_all (engine)
self.sessionmaker = sessionmaker (bind = engine, autoflush = True, transactional = True)
Is there a bug in the code above? | No |
489 | [
"#NEWLINE#",
"def register(",
"self",
",",
"resource",
",",
"canonical",
"=",
"True",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n Registers an instance of a ``Resource`` subclass with the API.\\n\\n Optionally accept a ``canonical`` argument, which indicates that the\\n r... | false | 0 | [
"6",
"59",
"canonical",
"2",
"48",
"70",
"99",
"114",
"126",
"self",
"15",
"30",
"52",
"68",
"87",
"103",
"resource_name",
"4",
"19",
"43",
"55",
"85",
"106",
"108",
"118",
"resource"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 13,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "toastdriven/piecrust/piecrust/api.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def register(self, resource, canonical = True) :
'
Registers an instance of a ``Resource`` subclass with the API.
Optionally accept a ``canonical`` argument, which indicates that the
resource being registered is the canonical variant. Defaults to
``True``.
'
resource_name = getattr (resource._meta, 'resource_name', None)
if (resource_name is None) :
raise ImproperlyConfigured (("Resource %r must define a 'resource_name'." % resource))
self._registry [resource_name] = resource
if (canonical is True) :
if (resource_name in self._canonicals) :
warnings.warn (("A new resource '%r' is replacing the existing canonical URL for '%s'." % (resource, resource_name)), Warning, stacklevel = 2)
self._canonicals [resource_name] = resource
resource._meta.api_name = self.api_name
resource.__class__.Meta.api_name = self.api_name
Is there a bug in the code above? | No |
490 | [
"#NEWLINE#",
"def set_active(",
"self",
",",
"href",
")",
":",
"#NEWLINE#",
"#INDENT#",
"active_node",
"=",
"None",
"#NEWLINE#",
"if",
"(",
"(",
"self",
".",
"node",
".",
"href",
".",
"startswith",
"(",
"'^'",
")",
"and",
"re",
".",
"match",
"(",
"self",... | false | 0 | [
"2",
"16",
"31",
"42",
"54",
"62",
"86",
"92",
"self",
"4",
"20",
"35",
"37",
"46",
"48",
"104",
"href",
"60",
"64",
"67",
"71",
"77",
"79",
"81",
"parent",
"9",
"84",
"112",
"119",
"active_node",
"90",
"98",
"100",
"108",
"114",
"child"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 11,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 13,
"after_index": 40... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "caktus/django-treenav/treenav/models.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def set_active(self, href) :
active_node = None
if ((self.node.href.startswith ('^') and re.match (self.node.href, href)) or (self.node.href == href)) :
self.active = True
parent = self.parent
while parent :
parent.active = True
parent = parent.parent
active_node = self
for child in self.children :
child = child.set_active (href)
if child :
active_node = child
return active_node
Is there a bug in the code above? | No |
491 | [
"#NEWLINE#",
"def test_set_nested_create(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"grainsmod",
".",
"__grains__",
"=",
"{",
"#NEWLINE#",
"#INDENT#",
"'a'",
":",
"'aval'",
",",
"#NEWLINE#",
"'c'",
":",
"8",
",",
"#NEWLINE#",
"#UNINDENT#",
"}",
"#NEWLINE#",
"... | false | 0 | [
"2",
"42",
"52",
"82",
"self",
"27",
"46",
"56",
"res"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 11,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 26,
"after_index": 34,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 41,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "saltstack/salt/tests/unit/modules/grains_test.py",
"license": "apache-2.0",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_set_nested_create(self) :
grainsmod.__grains__ = {
'a' : 'aval',
'c' : 8,
}
res = grainsmod.set ('b,nested', 'val', delimiter = ',')
self.assertTrue (res ['result'])
self.assertEqual (res ['changes'], {
'b' : {
'nested' : 'val',
},
})
self.assertEqual (grainsmod.__grains__, {
'a' : 'aval',
'b' : {
'nested' : 'val',
},
'c' : 8,
})
Is there a bug in the code above? | No |
492 | [
"#NEWLINE#",
"def register_watchers(",
"self",
",",
"type_callback_dict",
",",
"register_timeout",
"=",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"for",
"(",
"event_type",
",",
"callback",
")",
"in",
"type_callback_dict",
".",
"items",
"(",
")",
":",
"#NEWLINE#",... | false | 0 | [
"6",
"58",
"register_timeout",
"4",
"20",
"49",
"type_callback_dict",
"17",
"37",
"callback",
"2",
"28",
"41",
"self",
"15",
"32",
"event_type"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 13,
"after_index": 16,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 13,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "veegee/guv/guv/support/cassandra.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def register_watchers(self, type_callback_dict, register_timeout = None) :
for (event_type, callback) in type_callback_dict.items () :
self._push_watchers [event_type].add (callback)
self.wait_for_response (RegisterMessage (event_list = type_callback_dict.keys ()), timeout = register_timeout)
Is there a bug in the code above? | No |
493 | [
"#NEWLINE#",
"def test_multigrad_onearg(",
")",
":",
"#NEWLINE#",
"#INDENT#",
"fun",
"=",
"(",
"lambda",
"x",
",",
"y",
":",
"np",
".",
"sum",
"(",
"(",
"x",
"+",
"np",
".",
"sin",
"(",
"y",
")",
")",
")",
")",
"#NEWLINE#",
"packed_fun",
"=",
"(",
... | false | 0 | [
"63",
"91",
"102",
"B",
"61",
"89",
"100",
"A",
"31",
"96",
"packed_fun",
"6",
"86",
"fun"
] | 0 | NONE | [] | [
[
{
"before_index": 5,
"after_index": 9,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 30,
"after_index": 34,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 59,
"after_index": 7... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "HIPS/autograd/tests/test_wrappers.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_multigrad_onearg() :
fun = (lambda x, y : np.sum ((x + np.sin (y))))
packed_fun = (lambda xy : np.sum ((xy [0] + np.sin (xy [1]))))
(A, B) = (npr.randn (3), npr.randn (3))
check_equivalent (multigrad (fun) (A, B), grad (packed_fun) ((A, B)))
Is there a bug in the code above? | No |
494 | [
"#NEWLINE#",
"def _validate_maybe_string(",
"name",
",",
"item",
")",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"(",
"item",
"and",
"(",
"not",
"isinstance",
"(",
"item",
",",
"six",
".",
"string_types",
")",
")",
")",
":",
"#NEWLINE#",
"#INDENT#",
"raise",
"Value... | false | 0 | [
"2",
"35",
"name",
"4",
"11",
"17",
"39",
"42",
"48",
"item"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 9,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 47,
"after_index": 48... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "pantsbuild/pants/src/python/pants/backend/jvm/ossrh_publication_metadata.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def _validate_maybe_string(name, item) :
if (item and (not isinstance (item, six.string_types))) :
raise ValueError ('{} was expected to be of type {} but given {}'.format (name, type (item), item))
return item
Is there a bug in the code above? | No |
495 | [
"#NEWLINE#",
"@",
"base",
".",
"skip_without_vpc",
"(",
")",
"#NEWLINE#",
"def test_tag_internet_gateway(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"data",
"=",
"self",
".",
"client",
".",
"create_internet_gateway",
"(",
")",
"#NEWLINE#",
"gw_id",
"=",
"data",
... | false | 0 | [
"117",
"describe_func",
"14",
"26",
"60",
"83",
"96",
"data",
"34",
"135",
"res_clean",
"9",
"16",
"36",
"40",
"62",
"75",
"90",
"109",
"120",
"131",
"self",
"24",
"48",
"94",
"113",
"128",
"gw_id"
] | 0 | NONE | [] | [
[
{
"before_index": 13,
"after_index": 21,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 23,
"after_index": 30,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 33,
"after_index":... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "openstack/ec2-api/ec2api/tests/functional/api/test_tags.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | @ base.skip_without_vpc ()
def test_tag_internet_gateway(self) :
data = self.client.create_internet_gateway ()
gw_id = data ['InternetGateway'] ['InternetGatewayId']
res_clean = self.addResourceCleanUp (self.client.delete_internet_gateway, InternetGatewayId = gw_id)
def describe_func(* args, **kwargs) :
data = self.client.describe_internet_gateways (* args, ** kwargs)
self.assertEqual (1, len (data ['InternetGateways']))
self.assertEqual (gw_id, data ['InternetGateways'] [0] ['InternetGatewayId'])
self._test_tag_resource (gw_id, 'internet-gateway', describe_func)
self.client.delete_internet_gateway (InternetGatewayId = gw_id)
self.cancelResourceCleanUp (res_clean)
Is there a bug in the code above? | No |
496 | [
"#NEWLINE#",
"def maximum_day_in_month_for(",
"year",
",",
"month",
")",
":",
"#NEWLINE#",
"#INDENT#",
"return",
"calendar",
".",
"monthrange",
"(",
"year",
",",
"month",
")",
"[",
"1",
"]"
] | false | 0 | [
"4",
"16",
"month",
"2",
"14",
"year"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 9,
"after_index": 18,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 18,
"after_index": 15... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "rohe/pyoidc/src/oic/utils/time_util.py",
"license": "apache-2.0",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def maximum_day_in_month_for(year, month) :
return calendar.monthrange (year, month) [1]
Is there a bug in the code above? | No |
497 | [
"#NEWLINE#",
"def compute(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"size",
"=",
"self",
".",
"get_input",
"(",
"'Window Size'",
")",
"#NEWLINE#",
"beta",
"=",
"self",
".",
"get_input",
"(",
"'Beta'",
")",
"#NEWLINE#",
"out",
"=",
"SparseMatrix",
"(",
")... | false | 0 | [
"16",
"47",
"beta",
"25",
"31",
"57",
"out",
"2",
"9",
"18",
"51",
"self",
"7",
"45",
"size"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 15,
"after_index": 21,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 24,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "VisTrails/VisTrails/contrib/SciPy/Filters.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def compute(self) :
size = self.get_input ('Window Size')
beta = self.get_input ('Beta')
out = SparseMatrix ()
out.matrix = sparse.csc_matrix (scipy.signal.kaiser (size, beta))
self.set_output ('Window', out)
Is there a bug in the code above? | No |
498 | [
"#NEWLINE#",
"@",
"classmethod",
"#NEWLINE#",
"def create_user_accounts(",
"cls",
",",
"email",
",",
"password",
",",
"public_ip",
",",
"keyname",
",",
"clear_datastore",
")",
":",
"#NEWLINE#",
"#INDENT#",
"\"Registers two new user accounts with the UserAppServer.\\n\\n On... | false | 0 | [
"13",
"32",
"128",
"keyname",
"116",
"138",
"154",
"168",
"181",
"195",
"xmpp_user",
"15",
"51",
"147",
"clear_datastore",
"5",
"cls",
"11",
"26",
"public_ip",
"22",
"54",
"81",
"150",
"177",
"acc",
"7",
"42",
"58",
"72",
"85",
"106",
"email",
"9",
... | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 6,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 19,
"after_index": 20,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 21,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "AppScale/appscale-tools/lib/remote_helper.py",
"license": "apache-2.0",
"note": "license: github_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | @ classmethod
def create_user_accounts(cls, email, password, public_ip, keyname, clear_datastore) :
"Registers two new user accounts with the UserAppServer.
One account is the standard account that users log in with (via their
e-mail address. The other is their XMPP account, so that they can log into
any jabber-compatible service and send XMPP messages to their application
(and receive them).
Args:
email: The e-mail address that should be registered for the user's
standard account.
password: The password that should be used for both the standard and XMPP
accounts.
public_ip: The location where the AppController can be found.
keyname: The name of the SSH keypair used for this AppScale deployment.
clear_datastore: A bool that indicates if we expect the datastore to be
emptied, and thus not contain any user accounts.
"
acc = AppControllerClient (public_ip, LocalState.get_secret_key (keyname))
encrypted_pass = LocalState.encrypt_password (email, password)
if ((not clear_datastore) and acc.does_user_exist (email)) :
AppScaleLogger.log ('User {0} already exists, so not creating it again.'.format (email))
else :
acc.create_user (email, encrypted_pass)
username_regex = re.compile ('\\A(.*)@')
username = username_regex.match (email).groups () [0]
xmpp_user = '{0}@{1}'.format (username, LocalState.get_login_host (keyname))
xmpp_pass = LocalState.encrypt_password (xmpp_user, password)
if ((not clear_datastore) and acc.does_user_exist (xmpp_user)) :
AppScaleLogger.log ('XMPP User {0} already exists, so not creating it again.'.format (xmpp_user))
else :
acc.create_user (xmpp_user, xmpp_pass)
AppScaleLogger.log ('Your XMPP username is {0}'.format (xmpp_user))
Is there a bug in the code above? | No |
499 | [
"#NEWLINE#",
"def _test_formatFlatEvent_fieldNamesSame(",
"self",
",",
"event",
"=",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n The same format field used twice in one event is rendered twice.\\n\\n @param event: An event to flatten. If C{None}, create a new event.\\n ... | false | 0 | [
"22",
"48",
"counter",
"2",
"38",
"75",
"self",
"4",
"15",
"54",
"72",
"81",
"88",
"event"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 11,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 13,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "twisted/twisted/twisted/logger/test/test_flatten.py",
"license": "mit",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def _test_formatFlatEvent_fieldNamesSame(self, event = None) :
'
The same format field used twice in one event is rendered twice.
@param event: An event to flatten. If C{None}, create a new event.
@return: C{event} or the event created.
'
if (event is None) :
counter = count ()
class CountStr (object) :
'
Hack
'
def __str__(self) :
return str (next (counter))
event = dict (log_format = '{x} {x}', x = CountStr ())
flattenEvent (event)
self.assertEqual (formatEvent (event), '0 1')
return event
Is there a bug in the code above? | No |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.