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
500
[ "#NEWLINE#", "def update(", "self", ",", "feed", ",", "branch", "=", "None", ",", "name", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "' Update a toolchain given a feed\\n\\n ``feed`` can be:\\n\\n * a path\\n * a url\\n * a git url (in this case bra...
false
0
[ "76", "119", "140", "206", "230", "245", "266", "353", "remote_packages", "94", "178", "558", "583", "596", "to_add", "100", "212", "497", "522", "535", "to_remove", "133", "152", "other_packages", "334", "410", "441", "515", "531", "576", "592", "644", ...
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": 18, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "aldebaran/qibuild/python/qitoolchain/database.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 update(self, feed, branch = None, name = None) : ' Update a toolchain given a feed ``feed`` can be: * a path * a url * a git url (in this case branch and name cannot be None, and ``feeds/<name>.xml`` must exist on the given branch) ' ui.info (ui.green, 'Updating from', ui.reset, ui.blue, feed) feed_parser = qitoolchain.feed.ToolchainFeedParser (self.name) feed_parser.parse (feed, branch = branch, name = name) self.strict_feed = feed_parser.strict_feed remote_packages = feed_parser.get_packages () local_packages = self.packages.values () to_add = list () to_remove = list () to_update = list () svn_packages = [x for x in remote_packages if isinstance (x, qitoolchain.svn_package.SvnPackage)] other_packages = [x for x in remote_packages if (x not in svn_packages)] for remote_package in other_packages : if (remote_package.name in (x.name for x in local_packages)) : continue to_add.append (remote_package) for local_package in local_packages : if (local_package.name not in (x.name for x in remote_packages)) : to_remove.append (local_package) remote_names = [x.name for x in remote_packages] for local_package in local_packages : if ((local_package not in remote_packages) and (local_package.name in remote_names)) : remote_package = [x for x in remote_packages if (x.name == local_package.name)] [0] to_update.append (remote_package) to_update = [x for x in to_update if (not isinstance (x, qitoolchain.svn_package.SvnPackage))] if to_update : ui.info (ui.red, 'Updating packages') for (i, package) in enumerate (to_update) : remote_package = [x for x in remote_packages if (x.name == package.name)] [0] local_package = [x for x in local_packages if (x.name == package.name)] [0] if isinstance (local_package, qitoolchain.svn_package.SvnPackage) : ui.info_count (i, len (to_update), ui.blue, package.name, 'from subversion to', remote_package.version) else : ui.info_count (i, len (to_update), ui.blue, package.name, 'from', local_package.version, 'to', remote_package.version) self.remove_package (package.name) self.handle_package (package, feed) self.add_package (package) if to_remove : ui.info (ui.red, 'Removing packages') for (i, package) in enumerate (to_remove) : ui.info_count (i, len (to_remove), ui.blue, package.name) self.remove_package (package.name) if to_add : ui.info (ui.green, 'Adding packages') for (i, package) in enumerate (to_add) : ui.info_count (i, len (to_add), ui.blue, package.name) self.handle_package (package, feed) self.add_package (package) if svn_packages : ui.info (ui.green, 'Updating svn packages') for (i, svn_package) in enumerate (svn_packages) : ui.info_count (i, len (svn_packages), ui.blue, svn_package.name) self.handle_svn_package (svn_package) self.add_package (svn_package) ui.info (ui.green, 'Done') self.save () Is there a bug in the code above?
No
501
[ "#NEWLINE#", "def setUp(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "super", "(", "NonPythonDependenciesTest", ",", "self", ")", ".", "setUp", "(", ")", "#NEWLINE#", "third", "=", "self", ".", "make_target", "(", "'dependencies:third'", ",", "target_type", "="...
false
0
[ "50", "93", "110", "second", "31", "91", "first", "76", "112", "project", "2", "11", "20", "33", "52", "78", "97", "self", "18", "46", "third" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 25, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 30, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pantsbuild/pants/tests/python/pants_test/backend/project_info/tasks/test_dependencies.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 setUp(self) : super (NonPythonDependenciesTest, self).setUp () third = self.make_target ('dependencies:third', target_type = JavaLibrary) first = self.make_target ('dependencies:first', target_type = JavaLibrary, dependencies = [third]) second = self.make_target ('dependencies:second', target_type = JarLibrary, jars = [JarDependency ('org.apache', 'apache-jar', '12.12.2012')]) project = self.make_target ('project:project', target_type = JavaLibrary, dependencies = [first, second]) self.make_target ('project:dep-bag', target_type = Target, dependencies = [second, project]) Is there a bug in the code above?
No
502
[ "#NEWLINE#", "@", "requires_multi_emails_mode", "#NEWLINE#", "@", "login_required", "#NEWLINE#", "def delete_email(", "request", ",", "email_id", ",", "template_name", "=", "'emailauth/delete_email.html'", ")", ":", "#NEWLINE#", "#INDENT#", "user_email", "=", "get_object_or...
false
0
[ "19", "73", "126", "user_email", "51", "65", "94", "121", "form", "8", "31", "42", "55", "59", "98", "108", "request", "12", "114", "template_name", "104", "134", "context", "10", "27", "email_id" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 24, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 40, "after_index": 4...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "redvasily/django-emailauth/emailauth/views.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] }}
@ requires_multi_emails_mode @ login_required def delete_email(request, email_id, template_name = 'emailauth/delete_email.html') : user_email = get_object_or_404 (UserEmail, id = email_id, user = request.user, verified = True) if (request.method == 'POST') : form = DeleteEmailForm (request.user, request.POST) if form.is_valid () : user_email.delete () return HttpResponseRedirect (reverse ('emailauth_account')) else : form = DeleteEmailForm (request.user) context = RequestContext (request) return render_to_response (template_name, { 'form' : form, 'email' : user_email, }, context_instance = context) Is there a bug in the code above?
No
503
[ "#NEWLINE#", "def create(", "kernel", ")", ":", "#NEWLINE#", "#INDENT#", "result", "=", "Creature", "(", ")", "#NEWLINE#", "result", ".", "template", "=", "'object/mobile/shared_dressed_tatooine_pfilbee_jhorn.iff'", "#NEWLINE#", "result", ".", "attribute_template_id", "="...
false
0
[ "7", "13", "19", "25", "35", "result", "2", "kernel" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 10, "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": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "anhstudios/swganh/data/scripts/templates/object/mobile/shared_dressed_tatooine_pfilbee_jhorn.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 create(kernel) : result = Creature () result.template = 'object/mobile/shared_dressed_tatooine_pfilbee_jhorn.iff' result.attribute_template_id = 9 result.stfName ('theme_park_name', 'pfilbee_jhorn') return result Is there a bug in the code above?
No
504
[ "#NEWLINE#", "def postings_highlight(", "self", ",", "fields", "=", "None", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "newself", "=", "self", ".", "clone", "(", ")", "#NEWLINE#", "newself", ".", "postings_highlighter", ".", "update", "(", "fields", "...
false
0
[ "4", "27", "fields", "2", "15", "self", "13", "21", "34", "newself", "30", "kwargs" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 18, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 20, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "lugensa/scorched/scorched/search.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 postings_highlight(self, fields = None, **kwargs) : newself = self.clone () newself.postings_highlighter.update (fields, ** kwargs) return newself Is there a bug in the code above?
No
505
[ "#NEWLINE#", "def __init__(", "self", ",", "original", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "original", "is", "None", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "queries", "=", "[", "]", "#NEWLINE#", "#UNINDENT#", "else", ":", "#...
false
0
[ "2", "20", "32", "self", "4", "13", "45", "original", "37", "43", "q" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "lugensa/scorched/scorched/search.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, original = None) : if (original is None) : self.queries = [] else : self.queries = [q.clone () for q in original.queries] Is there a bug in the code above?
No
506
[ "#NEWLINE#", "def read_manifest(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "\"Read the manifest file (named by 'self.manifest') and use it to\\n fill in 'self.filelist', the list of files to include in the source\\n distribution.\\n \"", "#NEWLINE#", "log", ".", "info",...
false
0
[ "32", "56", "58", "78", "86", "88", "96", "105", "120", "line", "17", "20", "26", "34", "124", "manifest", "2", "15", "24", "114", "self" ]
0
NONE
[]
[ [ { "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": 19, "after_index": 27...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "balanced/status.balancedpayments.com/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/sdist.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 read_manifest(self) : "Read the manifest file (named by 'self.manifest') and use it to fill in 'self.filelist', the list of files to include in the source distribution. " log.info ("reading manifest file '%s'", self.manifest) manifest = open (self.manifest, 'rbU') for line in manifest : if (sys.version_info >= (3,)) : try : line = line.decode ('UTF-8') except UnicodeDecodeError : log.warn (('%r not UTF-8 decodable -- skipping' % line)) continue line = line.strip () if (line.startswith ('#') or (not line)) : continue self.filelist.append (line) manifest.close () Is there a bug in the code above?
No
507
[ "#NEWLINE#", "def test_write_sheet_views8(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "'Test the _write_sheet_views() method with split panes'", "#NEWLINE#", "self", ".", "worksheet", ".", "select", "(", ")", "#NEWLINE#", "self", ".", "worksheet", ".", "split_panes", "(...
false
0
[ "40", "60", "exp", "44", "58", "got", "2", "9", "17", "32", "46", "54", "self" ]
0
NONE
[]
[ [ { "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": 24...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "jmcnamara/XlsxWriter/xlsxwriter/test/worksheet/test_write_sheet_views4.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 test_write_sheet_views8(self) : 'Test the _write_sheet_views() method with split panes' self.worksheet.select () self.worksheet.split_panes (45, 54.14, 3, 6) self.worksheet._write_sheet_views () exp = '<sheetViews><sheetView tabSelected="1" workbookViewId="0"><pane xSplit="6150" ySplit="1200" topLeftCell="G4"/><selection pane="topRight" activeCell="G1" sqref="G1"/><selection pane="bottomLeft" activeCell="A4" sqref="A4"/><selection pane="bottomRight" activeCell="G4" sqref="G4"/></sheetView></sheetViews>' got = self.fh.getvalue () self.assertEqual (got, exp) Is there a bug in the code above?
No
508
[ "#NEWLINE#", "def test_can_concatenate_path_and_relationship(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "result", "=", "(", "Walkable", "(", "[", "alice", ",", "alice_knows_bob", ",", "bob", "]", ")", "+", "carol_dislikes_bob", ")", "#NEWLINE#", "assert", "(", ...
false
0
[ "2", "self", "7", "26", "result" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 24, "after_index": 27, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 20, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "nigelsmall/py2neo/test/test_types.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_can_concatenate_path_and_relationship(self) : result = (Walkable ([alice, alice_knows_bob, bob]) + carol_dislikes_bob) assert (result == Walkable ([alice, alice_knows_bob, bob, carol_dislikes_bob, carol])) Is there a bug in the code above?
No
509
[ "#NEWLINE#", "def test_graph_union(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "graph_1", "=", "(", "(", "alice_knows_bob", "|", "alice_likes_carol", ")", "|", "carol_dislikes_bob", ")", "#NEWLINE#", "graph_2", "=", "(", "(", "carol_dislikes_bob", "|", "carol_marr...
false
0
[ "31", "43", "53", "61", "graph", "7", "34", "graph_1", "19", "36", "graph_2", "2", "self" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 27, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 30, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "nigelsmall/py2neo/test/test_types.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_graph_union(self) : graph_1 = ((alice_knows_bob | alice_likes_carol) | carol_dislikes_bob) graph_2 = ((carol_dislikes_bob | carol_married_to_dave) | dave_works_for_dave) graph = (graph_1 | graph_2) assert (order (graph) == 4) assert (size (graph) == 5) assert (graph.nodes () == (((alice | bob) | carol) | dave).nodes ()) Is there a bug in the code above?
No
510
[ "#NEWLINE#", "def __init__(", "self", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "super", "(", "BatchAction", ",", "self", ")", ".", "__init__", "(", "**", "kwargs", ")", "#NEWLINE#", "action_present_method", "=", "False", "#NEWLINE#", "if", "hasattr", ...
false
0
[ "2", "13", "29", "39", "64", "82", "92", "117", "162", "198", "207", "218", "229", "238", "244", "257", "267", "272", "285", "294", "300", "306", "313", "323", "self", "19", "182", "211", "222", "248", "261", "276", "317", "kwargs", "75", "99", ...
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 17, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 21, "after_index": 24...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/horizon/horizon/tables/actions.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, **kwargs) : super (BatchAction, self).__init__ (** kwargs) action_present_method = False if hasattr (self, 'action_present') : if callable (self.action_present) : action_present_method = True else : warnings.warn (DeprecationWarning (('The %s BatchAction class must have an action_present method instead of attribute.' % self.__class__.__name__))) action_past_method = False if hasattr (self, 'action_past') : if callable (self.action_past) : action_past_method = True else : warnings.warn (DeprecationWarning (('The %s BatchAction class must have an action_past method instead of attribute.' % self.__class__.__name__))) action_methods = (action_present_method and action_past_method) has_action_method = (action_present_method or action_past_method) if (has_action_method and (not action_methods)) : raise NotImplementedError (('The %s BatchAction class must have both action_past andaction_present methods.' % self.__class__.__name__)) if (not action_methods) : if (not kwargs.get ('data_type_singular')) : raise NotImplementedError (('The %s BatchAction class must have a data_type_singular attribute when action_past and action_present attributes are used.' % self.__class__.__name__)) self.data_type_singular = kwargs.get ('data_type_singular') self.data_type_plural = kwargs.get ('data_type_plural', (self.data_type_singular + 's')) self.use_action_method = action_methods self.success_url = kwargs.get ('success_url', None) self.verbose_name = kwargs.get ('verbose_name', self._get_action_name) self.verbose_name_plural = kwargs.get ('verbose_name_plural', (lambda : self._get_action_name ('plural'))) self.current_present_action = 0 self.current_past_action = 0 self.success_ids = [] self.help_text = kwargs.get ('help_text', self.help_text) Is there a bug in the code above?
No
511
[ "#NEWLINE#", "def _get_media(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "\"\\n Mimic the MultiWidget '_get_media' method, adding other media\\n \"", "#NEWLINE#", "if", "(", "'FORCE_SCHEMA'", "in", "self", ".", "flags", ")", ":", "#NEWLINE#", "#INDENT#", "medi...
false
0
[ "42", "55", "w", "20", "31", "50", "53", "57", "62", "media", "2", "13", "44", "self" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 7, "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": 42...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "MongoEngine/django-mongoengine/django_mongoengine/forms/widgets.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 _get_media(self) : " Mimic the MultiWidget '_get_media' method, adding other media " if ('FORCE_SCHEMA' in self.flags) : media = Media () else : media = Media (js = MEDIAS) for w in self.widgets : media = (media + w.media) return media Is there a bug in the code above?
No
512
[ "#NEWLINE#", "def _GetBestOfferingId(", "self", ",", "disk_size", ")", ":", "#NEWLINE#", "#INDENT#", "' Given a disk_size (in GB), try to find a disk\\n offering that is atleast as big as the requested\\n one.\\n '", "#NEWLINE#", "disk_offerings", "=", "self", ".", "cs", "."...
false
0
[ "4", "57", "disk_size", "2", "13", "self", "11", "25", "disk_offerings", "41", "51", "63", "do", "21", "43", "sorted_do" ]
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": 18,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/providers/cloudstack/cloudstack_disk.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 _GetBestOfferingId(self, disk_size) : ' Given a disk_size (in GB), try to find a disk offering that is atleast as big as the requested one. ' disk_offerings = self.cs.list_disk_offerings () sorted_do = sorted (disk_offerings, key = (lambda x : x ['disksize'])) for do in sorted_do : if (int (do ['disksize']) >= disk_size) : return do ['id'] return None Is there a bug in the code above?
No
513
[ "#NEWLINE#", "def _assert_sudo(", "self", ",", "options", ",", "args", ",", "use_root_namespace", "=", "False", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "not", "self", ".", "check_dev_args", ")", ":", "#NEWLINE#", "#INDENT#", "args", "=", "self", ".", "...
false
0
[ "4", "44", "options", "8", "use_root_namespace", "6", "25", "31", "46", "args", "2", "18", "27", "39", "self" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 15, "after_index": 17, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 34, "after_index": 4...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/neutron/neutron/tests/unit/agent/linux/test_ip_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 _assert_sudo(self, options, args, use_root_namespace = False) : if (not self.check_dev_args) : args = self._remove_dev_args (args) super (TestIPRoute, self)._assert_sudo (options, args) Is there a bug in the code above?
No
514
[ "#NEWLINE#", "def clear_feature(", "dev", ",", "feature", ",", "recipient", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "'Clear/disable a specific feature.\\n\\n dev is the Device object to which the request will be\\n sent to.\\n\\n feature is the feature you want to disable....
false
0
[ "6", "28", "44", "recipient", "37", "55", "57", "bmRequestType", "4", "17", "69", "feature", "2", "24", "51", "dev", "39", "63", "65", "wIndex" ]
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": 15, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "walac/pyusb/usb/control.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 clear_feature(dev, feature, recipient = None) : 'Clear/disable a specific feature. dev is the Device object to which the request will be sent to. feature is the feature you want to disable. The recipient can be None (on which the status will be queried from the device), an Interface or Endpoint descriptors. ' if (feature == ENDPOINT_HALT) : dev.clear_halt (recipient) else : (bmRequestType, wIndex) = _parse_recipient (recipient, util.CTRL_OUT) dev.ctrl_transfer (bmRequestType = bmRequestType, bRequest = 1, wIndex = wIndex, wValue = feature) Is there a bug in the code above?
No
515
[ "#NEWLINE#", "@", "staticmethod", "#NEWLINE#", "def compute_metavar(", "kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "'Compute the metavar to display in help for an option registered with these kwargs.'", "#NEWLINE#", "metavar", "=", "kwargs", ".", "get", "(", "'metavar'", ")", ...
false
0
[ "12", "24", "70", "79", "93", "metavar", "5", "14", "31", "51", "kwargs", "29", "42", "49", "63", "85", "typ" ]
0
NONE
[]
[ [ { "before_index": 9, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 17, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 21, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pantsbuild/pants/src/python/pants/help/help_info_extracter.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] }}
@ staticmethod def compute_metavar(kwargs) : 'Compute the metavar to display in help for an option registered with these kwargs.' metavar = kwargs.get ('metavar') if (not metavar) : typ = kwargs.get ('type', str) if (typ == list) : typ = kwargs.get ('member_type', str) if (typ == dict) : metavar = '"{\'key1\':val1,\'key2\':val2,...}"' else : metavar = '<{}>'.format (typ.__name__) return metavar Is there a bug in the code above?
No
516
[ "#NEWLINE#", "def test_gather_lockable_models(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "from", "locking", "import", "utils", "#NEWLINE#", "from", "locking.tests", "import", "models", "#NEWLINE#", "lockable_models", "=", "utils", ".", "gather_lockable_models", "(", ...
false
0
[ "2", "25", "39", "self", "17", "32", "46", "lockable_models" ]
0
NONE
[]
[ [ { "before_index": 16, "after_index": 22, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 24, "after_index": 28, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 38, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "debrouwere/django-locking/locking/tests/tests.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 test_gather_lockable_models(self) : from locking import utils from locking.tests import models lockable_models = utils.gather_lockable_models () self.assertTrue (('story' in lockable_models ['tests'])) self.assertTrue (('unlockable' not in lockable_models ['tests'])) Is there a bug in the code above?
No
517
[ "#NEWLINE#", "def __init__(", "self", ",", "seq", ")", ":", "#NEWLINE#", "#INDENT#", "if", "isinstance", "(", "seq", ",", "ConstSequence", ")", ":", "#NEWLINE#", "#INDENT#", "seq", "=", "seq", ".", "_adaptee", "#NEWLINE#", "#UNINDENT#", "self", ".", "_adaptee"...
false
0
[ "4", "12", "19", "21", "30", "seq", "2", "26", "self" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 25, "after_index": 30...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "tow/sunburnt/sunburnt/walktree.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, seq) : if isinstance (seq, ConstSequence) : seq = seq._adaptee self._adaptee = seq Is there a bug in the code above?
No
518
[ "#NEWLINE#", "def format_date(", "date", "=", "None", ",", "format", "=", "'medium'", ",", "locale", "=", "LC_TIME", ")", ":", "#NEWLINE#", "#INDENT#", "'Return a date formatted according to the given pattern.\\n \\n >>> d = date(2007, 04, 01)\\n >>> format_date(d, locale=...
false
0
[ "2", "21", "28", "44", "51", "53", "55", "111", "date", "99", "107", "pattern", "10", "61", "67", "93", "95", "113", "locale", "6", "72", "87", "91", "103", "format" ]
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": "cloudera/hue/desktop/core/ext-py/Babel-0.9.6/babel/dates.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 format_date(date = None, format = 'medium', locale = LC_TIME) : 'Return a date formatted according to the given pattern. >>> d = date(2007, 04, 01) >>> format_date(d, locale=\'en_US\') u\'Apr 1, 2007\' >>> format_date(d, format=\'full\', locale=\'de_DE\') u\'Sonntag, 1. April 2007\' If you don\'t want to use the locale default formats, you can specify a custom date pattern: >>> format_date(d, "EEE, MMM d, \'\'yy", locale=\'en\') u"Sun, Apr 1, \'07" :param date: the ``date`` or ``datetime`` object; if `None`, the current date is used :param format: one of "full", "long", "medium", or "short", or a custom date/time pattern :param locale: a `Locale` object or a locale identifier :rtype: `unicode` :note: If the pattern contains time fields, an `AttributeError` will be raised when trying to apply the formatting. This is also true if the value of ``date`` parameter is actually a ``datetime`` object, as this function automatically converts that to a ``date``. ' if (date is None) : date = date_.today () else : if isinstance (date, datetime) : date = date.date () locale = Locale.parse (locale) if (format in ('full', 'long', 'medium', 'short')) : format = get_date_format (format, locale = locale) pattern = parse_pattern (format) return pattern.apply (date, locale) Is there a bug in the code above?
No
519
[ "#NEWLINE#", "def create_todos(", "content", ",", "protocol", ",", "ref_id", ")", ":", "#NEWLINE#", "#INDENT#", "content", "=", "re", ".", "sub", "(", "'\\\\[ \\\\](.*)'", ",", "(", "'<label><input type=\"checkbox\" class=\"todo-checkbox\" data-protocol=\"%s\" data-id=\"%s\">...
false
0
[ "4", "23", "44", "protocol", "6", "25", "46", "ref_id", "2", "11", "29", "32", "50", "54", "content" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 18, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 31, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "tomashanacek/mock-server/mock_server/text.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 create_todos(content, protocol, ref_id) : content = re.sub ('\\[\\](.*)', ('<label><input type="checkbox" class="todo-checkbox" data-protocol="%s" data-id="%s">\\1</label>' % (protocol, ref_id)), content) content = re.sub ('\\[x\\](.*)', ('<label><input type="checkbox" class="todo-checkbox" data-protocol="%s" data-id="%s" checked>\\1</label>' % (protocol, ref_id)), content) return content Is there a bug in the code above?
No
520
[ "#NEWLINE#", "def callback_team_create(", "self", ",", "request", ",", "uri", ",", "headers", ",", "status_code", "=", "201", ",", "read_only", "=", "True", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Create a new team as requested\\n '", "#NEWLINE#", "self",...
false
0
[ "8", "29", "121", "headers", "44", "73", "91", "108", "json_body", "6", "uri", "2", "23", "38", "66", "87", "104", "self", "4", "27", "50", "request", "14", "83", "read_only", "56", "71", "item", "10", "119", "status_code" ]
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": "mitodl/orcoursetrion/orcoursetrion/tests/base.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 callback_team_create(self, request, uri, headers, status_code = 201, read_only = True) : ' Create a new team as requested ' self.assertEqual (request.headers ['Authorization'], 'token {0}'.format (self.OAUTH2_TOKEN)) json_body = json.loads (request.body) for item in ['name', 'permission'] : self.assertTrue ((item in json_body.keys ())) if read_only : self.assertEqual (json_body ['permission'], 'pull') else : self.assertEqual (json_body ['permission'], 'push') return (status_code, headers, json.dumps ({ 'id' : 2, })) Is there a bug in the code above?
No
521
[ "#NEWLINE#", "def __init__(", "self", ",", "line_number", ",", "start", ")", ":", "#NEWLINE#", "#INDENT#", "super", "(", "LineToDraw", ",", "self", ")", ".", "__init__", "(", "line_number", ",", "start", ")" ]
false
0
[ "4", "20", "line_number", "6", "22", "start", "2", "15", "self" ]
0
NONE
[]
[ [ { "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": 21, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "zsong/diffy/diffy_lib/diffier.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, line_number, start) : super (LineToDraw, self).__init__ (line_number, start) Is there a bug in the code above?
No
522
[ "#NEWLINE#", "def __init__(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "try", ":", "#NEWLINE#", "#INDENT#", "settings_module", "=", "os", ".", "environ", "[", "ENVIRONMENT_VARIABLE", "]", "#NEWLINE#", "if", "(", "not", "settings_module", ")", ":", "#NEWLINE#", ...
false
0
[ "11", "23", "53", "63", "settings_module", "101", "123", "129", "module", "2", "49", "55", "59", "66", "73", "82", "90", "106", "self", "103", "131", "modfile" ]
0
NONE
[]
[ [ { "before_index": 48, "after_index": 53, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 54, "after_index": 62, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 65, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "hrbonz/django-flexisettings/flexisettings/settings.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 __init__(self) : try : settings_module = os.environ [ENVIRONMENT_VARIABLE] if (not settings_module) : raise KeyError except KeyError : raise ImportError (('Flexisettings cannot be imported, because environment variable %s is undefined.' % ENVIRONMENT_VARIABLE)) self._settings_module = settings_module self._settings_path = self._get_mod_dir (settings_module) self._import_settings () if self._globals ['FLEXI_LAYOUT_DISCOVERY'] : self._layout_discovery () if self._globals ['FLEXI_AUTORELOAD'] : for (module, modfile) in self._wrapped_modules.iteritems () : sys.modules [('flexisettings.wrapped.%s' % module)] = MockModule (module, modfile) Is there a bug in the code above?
No
523
[ "#NEWLINE#", "@", "rest_api", ".", "post", "(", "'/imagefactory/<image_collection>'", ")", "#NEWLINE#", "@", "rest_api", ".", "post", "(", "'/imagefactory/base_images/<base_image_id>/<image_collection>'", ")", "#NEWLINE#", "@", "rest_api", ".", "post", "(", "'/imagefactor...
false
0
[ "179", "365", "target_img_id", "497", "509", "522", "529", "key", "314", "336", "357", "397", "402", "422", "_credentials", "49", "186", "target_image_id", "45", "176", "base_image_id", "72", "87", "95", "101", "content_type", "107", "116", "129", "153", "...
0
NONE
[]
[ [ { "before_index": 1, "after_index": 44, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 5, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 11...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "redhat-imaging/imagefactory/imgfac/rest/RESTv2.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] }}
@ rest_api.post ('/imagefactory/<image_collection>') @ rest_api.post ('/imagefactory/base_images/<base_image_id>/<image_collection>') @ rest_api.post ('/imagefactory/base_images/<base_image_id>/target_images/<target_image_id>/<image_collection>') @ rest_api.post ('/imagefactory/target_images/<target_image_id>/<image_collection>') @ log_request @ oauth_protect @ check_accept_header def create_image(image_collection, base_image_id = None, target_image_id = None) : try : image_type = image_collection [0 : (- 1)] content_type = request.headers.get ('Content-Type') form_data = form_data_for_content_type (content_type) if (('application/x-www-form-urlencoded' in content_type) or ('multipart/form-data' in content_type)) : request_data = form_data else : request_data = form_data.get (image_type) if (not request_data) : raise HTTPResponse (status = 400, output = ('%s not found in request.' % image_type)) req_base_img_id = request_data.get ('base_image_id') req_target_img_id = request_data.get ('target_image_id') base_img_id = (req_base_img_id if req_base_img_id else base_image_id) target_img_id = (req_target_img_id if req_target_img_id else target_image_id) if (image_collection == 'base_images') : builder = BuildDispatcher ().builder_for_base_image (template = request_data.get ('template'), parameters = request_data.get ('parameters')) image = builder.base_image else : if (image_collection == 'target_images') : builder = BuildDispatcher ().builder_for_target_image (target = request_data.get ('target'), image_id = base_img_id, template = request_data.get ('template'), parameters = request_data.get ('parameters')) image = builder.target_image else : if (image_collection == 'provider_images') : _provider = request_data.get ('provider') _credentials = request_data.get ('credentials') _target = request_data.get ('target') if (_provider and _credentials and _target) : builder = BuildDispatcher ().builder_for_provider_image (provider = _provider, credentials = _credentials, target = _target, image_id = target_img_id, template = request_data.get ('template'), parameters = request_data.get ('parameters')) image = builder.provider_image else : _credentials = ('REDACTED' if _credentials else None) raise HTTPResponse (status = 400, output = ('Missing key/value pair: provider(%s), credentials(%s), target(%s)' % (_provider, _credentials, _target))) else : raise HTTPResponse (status = 404, output = ('%s not found' % image_collection)) _response = { '_type' : type (image).__name__, 'id' : image.identifier, 'href' : ('%s/%s' % (request.url, image.identifier)), } for key in image.metadata () : if (key not in ('identifier', 'data')) : _response [key] = getattr (image, key, None) response.status = 202 return converted_response ({ image_collection [0 : (- 1)] : _response, }) except KeyError as e : log.exception (e) raise HTTPResponse (status = 400, output = ('Missing value for key: %s' % e)) except Exception as e : log.exception (e) raise HTTPResponse (status = 500, output = e) Is there a bug in the code above?
No
524
[ "#NEWLINE#", "def analyse_text(", "text", ")", ":", "#NEWLINE#", "#INDENT#", "rv", "=", "(", "DjangoLexer", ".", "analyse_text", "(", "text", ")", "-", "0.01", ")", "#NEWLINE#", "if", "looks_like_xml", "(", "text", ")", ":", "#NEWLINE#", "#INDENT#", "rv", "+...
false
0
[ "2", "14", "23", "text", "7", "28", "34", "rv" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 16, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 20, "after_index": 22, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 33, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "adieu/allbuttonspressed/pygments/lexers/templates.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 analyse_text(text) : rv = (DjangoLexer.analyse_text (text) - 0.01) if looks_like_xml (text) : rv += 0.4 return rv Is there a bug in the code above?
No
525
[ "#NEWLINE#", "@", "property", "#NEWLINE#", "def blocks(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "for", "blockaddr", "in", "self", ".", "block_addrs", ":", "#NEWLINE#", "#INDENT#", "try", ":", "#NEWLINE#", "#INDENT#", "(", "yield", "self", ".", "_get_block",...
false
0
[ "11", "29", "blockaddr", "5", "13", "25", "self" ]
0
NONE
[]
[ [ { "before_index": 10, "after_index": 11, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "angr/angr/angr/knowledge/function.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] }}
@ property def blocks(self) : for blockaddr in self.block_addrs : try : (yield self._get_block (blockaddr)) except AngrTranslationError : pass Is there a bug in the code above?
No
526
[ "#NEWLINE#", "def get_call_return(", "self", ",", "callsite_addr", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Get the hypothetical return address of a call.\\n\\n :param callsite_addr: The address of the basic block that ends in a call.\\n :return: The l...
false
0
[ "2", "15", "23", "self", "4", "13", "27", "callsite_addr" ]
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": 14,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "angr/angr/angr/knowledge/function.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_call_return(self, callsite_addr) : ' Get the hypothetical return address of a call. :param callsite_addr: The address of the basic block that ends in a call. :return: The likely return target of said call, or None if callsite_addr is not a callsite. ' if (callsite_addr in self._call_sites) : return self._call_sites [callsite_addr] [1] return None Is there a bug in the code above?
No
527
[ "#NEWLINE#", "def test_function_argrouting_working(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "f", "=", "simpleEval", "(", "sym", "(", "'Function'", ")", ",", "sym", "(", "'Call'", ")", ",", "'fun(x,y) { x+y }'", ")", "#NEWLINE#", "f", "=", "simpleEval", "(",...
false
0
[ "2", "36", "self", "7", "24", "28", "42", "f" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": 29, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 35, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ufora/ufora/ufora/FORA/Axioms/TupleMatchStructureAxiom_test.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_function_argrouting_working(self) : f = simpleEval (sym ('Function'), sym ('Call'), 'fun(x,y) { x+y }') f = simpleEval (f, sym ('Call')) self.assertEqual (simpleEval (f, sym ('Call'), 2, 3), 5) Is there a bug in the code above?
No
528
[ "#NEWLINE#", "def test_repo(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "repo", "=", "self", ".", "client", ".", "repos", ".", "show", "(", "'JNRowe/misc-overlay'", ")", "#NEWLINE#", "eq_", "(", "repo", ".", "name", ",", "'misc-overlay'", ")", "#NEWLINE#", ...
false
0
[ "2", "9", "self", "7", "22", "31", "40", "49", "58", "67", "repo" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 16, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 25, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 28, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ask/python-github2/tests/test_repositories.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_repo(self) : repo = self.client.repos.show ('JNRowe/misc-overlay') eq_ (repo.name, 'misc-overlay') eq_ (repo.description, 'Gentoo overlay -- miscellaneous packages') eq_ (repo.url, 'https://github.com/JNRowe/misc-overlay') eq_ (repo.owner, 'JNRowe') eq_ (repo.homepage, 'http://jnrowe.github.com/misc-overlay/') eq_ (repo.project, 'JNRowe/misc-overlay') Is there a bug in the code above?
No
529
[ "#NEWLINE#", "@", "unittest", ".", "skipIf", "(", "(", "threading", "is", "None", ")", ",", "'Test requires threading'", ")", "#NEWLINE#", "def test_cache_backend(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "kv", "=", "KVStore", "(", ")", "#NEWLINE#", "cache_b...
false
0
[ "48", "x", "65", "thread_cache_backend", "57", "68", "74", "t", "21", "41", "kv", "16", "81", "self", "27", "37", "85", "90", "cache_backends" ]
0
NONE
[]
[ [ { "before_index": 20, "after_index": 24, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": 29, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 47, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "mariocesar/sorl-thumbnail/tests/thumbnail_tests/test_kvstore.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] }}
@ unittest.skipIf ((threading is None), 'Test requires threading') def test_cache_backend(self) : kv = KVStore () cache_backends = [] def thread_cache_backend() : cache_backends.append (kv.cache) for x in range (2) : t = threading.Thread (target = thread_cache_backend) t.start () t.join () self.assertNotEqual (cache_backends [0], cache_backends [1]) Is there a bug in the code above?
No
530
[ "#NEWLINE#", "def test_delete_view(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "kwargs", "=", "self", ".", "admin_model", ".", "get_view_kwargs", "(", ")", "#NEWLINE#", "kwargs", "[", "'object'", "]", "=", "SimpleDocument", "(", ")", "#NEWLINE#", "view", "=", ...
false
0
[ "2", "9", "38", "51", "62", "75", "88", "99", "self", "7", "17", "33", "kwargs", "26", "57", "94", "view", "36", "47", "59", "73", "84", "96", "request", "55", "66", "92", "103", "response" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 16, "after_index": 23, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 25, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "zbyte64/django-dockit/dockit/tests/admin/views.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_delete_view(self) : kwargs = self.admin_model.get_view_kwargs () kwargs ['object'] = SimpleDocument () view = TestableDeleteView.as_view (** kwargs) request = self.factory.get ('/1/delete/') request.user = self.super_user response = view (request) self.assertEqual (response.status_code, 200) request = self.factory.post ('/1/delete/') request.user = self.super_user response = view (request) self.assertEqual (response.status_code, 302) Is there a bug in the code above?
No
531
[ "#NEWLINE#", "def test_id_missing(", "client", ")", ":", "#NEWLINE#", "#INDENT#", "response", "=", "helpers", ".", "request", "(", "client", ",", "'PATCH'", ",", "'/widgets/1'", ",", "{", "#NEWLINE#", "#INDENT#", "'name'", ":", "'Bar'", ",", "#NEWLINE#", "#UNIND...
false
0
[ "2", "13", "client", "7", "33", "46", "response" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 31, "after_index": 36, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 40, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "4Catalyzer/flask-resty/tests/test_view_errors.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_id_missing(client) : response = helpers.request (client, 'PATCH', '/widgets/1', { 'name' : 'Bar', }) assert (response.status_code == 422) assert (helpers.get_errors (response) == [{ 'code' : 'invalid_id.missing', }]) Is there a bug in the code above?
No
532
[ "#NEWLINE#", "def test02_appendMD(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "'Appending multi-dimensional elements of enumerated values.'", "#NEWLINE#", "vlarr", "=", "self", ".", "h5file", ".", "create_vlarray", "(", "'/'", ",", "'test'", ",", "self", ".", "_atom",...
false
0
[ "46", "88", "98", "126", "137", "appended", "9", "40", "84", "94", "104", "112", "vlarr", "110", "114", "128", "139", "read", "2", "11", "21", "33", "51", "55", "63", "67", "73", "77", "133", "self" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 7, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 18, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 39, "after_index": 44...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "PyTables/PyTables/tables/tests/test_enum.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 test02_appendMD(self) : 'Appending multi-dimensional elements of enumerated values.' vlarr = self.h5file.create_vlarray ('/', 'test', self._atom ((2,)), title = self._getMethodName ()) vlarr.flavor = 'python' appended = [[[self.valueInEnum, self.valueInEnum]], [[self.valueInEnum, self.valueOutOfEnum], [self.valueInEnum, self.valueInEnum]]] vlarr.append (appended [0]) vlarr.append (appended [1]) vlarr.flush () read = vlarr.read () common.verbosePrint (('* appended value: %s * read value: %s ' % (appended, read))) self.assertEqual (appended, read, 'Written and read values differ.') Is there a bug in the code above?
No
533
[ "#NEWLINE#", "def testRandomAccessWorksCorrectlyForSmallUncompactedCollection(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "with", "aff4", ".", "FACTORY", ".", "Create", "(", "self", ".", "collection_urn", ",", "'PackedVersionedCollection'", ",", "mode", "=", "'w'", ",...
false
0
[ "31", "45", "fd", "36", "55", "i", "2", "14", "26", "61", "self" ]
0
NONE
[]
[ [ { "before_index": 60, "after_index": 64, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 30, "after_index": 17, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 30, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "google/grr/grr/lib/aff4_objects/collects_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 testRandomAccessWorksCorrectlyForSmallUncompactedCollection(self) : with aff4.FACTORY.Create (self.collection_urn, 'PackedVersionedCollection', mode = 'w', token = self.token) as fd : for i in range (5) : fd.Add (rdf_flows.GrrMessage (request_id = i)) self._testRandomAccessEqualsIterator () Is there a bug in the code above?
No
534
[ "#NEWLINE#", "def reprovision(", "vm", ",", "image", ",", "key", "=", "'uuid'", ")", ":", "#NEWLINE#", "#INDENT#", "\"\\n Reprovision a vm\\n\\n vm : string\\n vm to be reprovisioned\\n image : string\\n uuid of new image\\n key : string [uuid|alias|hostname]\\n ...
false
0
[ "117", "160", "cmd", "15", "45", "53", "101", "114", "183", "207", "ret", "153", "169", "189", "197", "res", "6", "32", "64", "key", "4", "89", "110", "131", "144", "image", "167", "176", "202", "retcode", "24", "123", "125", "vmadm", "2", "56", ...
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": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "saltstack/salt/salt/modules/smartos_vmadm.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 reprovision(vm, image, key = 'uuid') : " Reprovision a vm vm : string vm to be reprovisioned image : string uuid of new image key : string [uuid|alias|hostname] value type of 'vm' parameter CLI Example: .. code-block:: bash salt '*' vmadm.reprovision 186da9ab-7392-4f55-91a5-b8f1fe770543 c02a2044-c1bd-11e4-bd8c-dfc1db8b0182 salt '*' vmadm.reprovision nacl c02a2044-c1bd-11e4-bd8c-dfc1db8b0182 key=alias " ret = { } vmadm = _check_vmadm () if (key not in ['uuid', 'alias', 'hostname']) : ret ['Error'] = 'Key must be either uuid, alias or hostname' return ret vm = lookup ('{0}={1}'.format (key, vm), one = True) if ('Error' in vm) : return vm if (image not in __salt__ ['imgadm.list'] ()) : ret ['Error'] = 'Image ({0}) is not present on this host'.format (image) return ret cmd = 'echo {image} | {vmadm} reprovision {uuid}'.format (vmadm = vmadm, uuid = vm, image = _quote_args (json.dumps ({ 'image_uuid' : image, }))) res = __salt__ ['cmd.run_all'] (cmd, python_shell = True) retcode = res ['retcode'] if (retcode != 0) : ret ['Error'] = (res ['stderr'] if ('stderr' in res) else _exit_status (retcode)) return ret return True Is there a bug in the code above?
No
535
[ "#NEWLINE#", "def receive(", "uuid", ",", "source", ")", ":", "#NEWLINE#", "#INDENT#", "\"\\n Receive a vm from a directory\\n\\n uuid : string\\n uuid of vm to be received\\n source : string\\n source directory\\n\\n CLI Example:\\n\\n .. code-block:: bash\\n\\n ...
false
0
[ "103", "139", "267", "309", "360", "382", "cmd", "11", "47", "55", "87", "100", "177", "201", "332", "356", "420", "444", "ret", "2", "79", "127", "208", "295", "370", "372", "uuid", "204", "215", "241", "vmobj", "26", "273", "275", "zfs", "248",...
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": 13,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "saltstack/salt/salt/modules/smartos_vmadm.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 receive(uuid, source) : " Receive a vm from a directory uuid : string uuid of vm to be received source : string source directory CLI Example: .. code-block:: bash salt '*' vmadm.receive 186da9ab-7392-4f55-91a5-b8f1fe770543 /opt/backups " ret = { } vmadm = _check_vmadm () zfs = _check_zfs () if (not os.path.isdir (source)) : ret ['Error'] = 'Source must be a directory or host' return ret if (not os.path.exists (os.path.join (source, '{0}.vmdata'.format (uuid)))) : ret ['Error'] = 'Unknow vm with uuid in {0}'.format (source) return ret cmd = '{vmadm} receive < {source}'.format (vmadm = vmadm, source = os.path.join (source, '{0}.vmdata'.format (uuid))) res = __salt__ ['cmd.run_all'] (cmd, python_shell = True) retcode = res ['retcode'] if ((retcode != 0) and (not res ['stderr'].endswith ('datasets'))) : ret ['Error'] = (res ['stderr'] if ('stderr' in res) else _exit_status (retcode)) return ret vmobj = get (uuid) if ('datasets' not in vmobj) : return True log.warning ('one or more datasets detected, this is not supported!') log.warning ('trying to restore datasets, mountpoints will need to be set again...') for dataset in vmobj ['datasets'] : name = dataset.split ('/') name = name [(- 1)] cmd = '{zfs} receive {dataset} < {source}'.format (zfs = zfs, dataset = dataset, source = os.path.join (source, '{0}-{1}.zfsds'.format (uuid, name))) res = __salt__ ['cmd.run_all'] (cmd, python_shell = True) retcode = res ['retcode'] if (retcode != 0) : ret ['Error'] = (res ['stderr'] if ('stderr' in res) else _exit_status (retcode)) return ret cmd = '{vmadm} install {uuid}'.format (vmadm = vmadm, uuid = uuid) res = __salt__ ['cmd.run_all'] (cmd, python_shell = True) retcode = res ['retcode'] if ((retcode != 0) and (not res ['stderr'].endswith ('datasets'))) : ret ['Error'] = (res ['stderr'] if ('stderr' in res) else _exit_status (retcode)) return ret return True Is there a bug in the code above?
No
536
[ "#NEWLINE#", "def post(", "self", ",", "request", ",", "*", "args", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "object", "=", "None", "#NEWLINE#", "return", "super", "(", "BaseCreateView", ",", "self", ")", ".", "post", "(", "request"...
false
0
[ "4", "30", "request", "36", "kwargs", "2", "14", "25", "self", "7", "33", "args" ]
0
NONE
[]
[ [ { "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": 18,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "AppScale/appscale/AppServer/lib/django-1.5/django/views/generic/edit.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 post(self, request, * args, **kwargs) : self.object = None return super (BaseCreateView, self).post (request, * args, ** kwargs) Is there a bug in the code above?
No
537
[ "#NEWLINE#", "def test_grid_search(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "maximizer", "=", "GridSearch", "(", "self", ".", "acquisition_func", ",", "self", ".", "X_lower", ",", "self", ".", "X_upper", ")", "#NEWLINE#", "x", "=", "maximizer", ".", "maxi...
false
0
[ "2", "11", "15", "19", "53", "71", "93", "110", "self", "24", "34", "46", "64", "86", "108", "x", "7", "26", "maximizer" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": 29, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 32, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "automl/RoBO/robo/test/test_maximizers.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_grid_search(self) : maximizer = GridSearch (self.acquisition_func, self.X_lower, self.X_upper) x = maximizer.maximize () assert (x.shape [0] == 1) assert (x.shape [1] == self.dims) assert np.all ((x [:, 0] >= self.X_lower [0])) assert np.all ((x [:, 0] <= self.X_upper [0])) assert np.all ((x < self.X_upper)) Is there a bug in the code above?
No
538
[ "#NEWLINE#", "def get_virtual_source_info(", "self", ",", "virtual_source_path", ")", ":", "#NEWLINE#", "#INDENT#", "virtual_source", "=", "self", ".", "pad", ".", "get", "(", "virtual_source_path", ")", "#NEWLINE#", "if", "(", "not", "virtual_source", ")", ":", "...
false
0
[ "50", "68", "checksum", "39", "66", "mtime", "9", "23", "41", "52", "virtual_source", "2", "11", "45", "56", "self", "4", "17", "31", "64", "virtual_source_path" ]
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": 20, "after_index": 22...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "lektor/lektor/lektor/builder.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 get_virtual_source_info(self, virtual_source_path) : virtual_source = self.pad.get (virtual_source_path) if (not virtual_source) : return VirtualSourceInfo (virtual_source_path, None, None) mtime = virtual_source.get_mtime (self.path_cache) checksum = virtual_source.get_checksum (self.path_cache) return VirtualSourceInfo (virtual_source_path, mtime, checksum) Is there a bug in the code above?
No
539
[ "#NEWLINE#", "@", "utils", ".", "arg", "(", "'containers'", ",", "metavar", "=", "'<container>'", ",", "nargs", "=", "'+'", ",", "help", "=", "'ID or name of the (container)s to stop.'", ")", "#NEWLINE#", "def do_container_stop(", "cs", ",", "args", ")", ":", "#...
false
0
[ "57", "76", "e", "24", "34", "args", "22", "44", "cs", "32", "50", "71", "container" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 23, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 28, "after_index": 29, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 31, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/python-magnumclient/magnumclient/v1/containers_shell.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] }}
@ utils.arg ('containers', metavar = '<container>', nargs = '+', help = 'ID or name of the (container)s to stop.') def do_container_stop(cs, args) : 'Stop specified containers.' for container in args.containers : try : cs.containers.stop (container) except Exception as e : print (('Stop for container %(container)s failed: %(e)s' % { 'container' : container, 'e' : e, })) Is there a bug in the code above?
No
540
[ "#NEWLINE#", "def __deepcopy__(", "self", ",", "memo", ")", ":", "#NEWLINE#", "#INDENT#", "result", "=", "super", "(", "ChoiceField", ",", "self", ")", ".", "__deepcopy__", "(", "memo", ")", "#NEWLINE#", "result", ".", "queryset", "=", "result", ".", "querys...
false
0
[ "2", "15", "self", "9", "23", "27", "32", "result", "4", "20", "memo" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 19, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 22, "after_index": 28...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "zbyte64/django-dockit/dockit/forms/fields.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 __deepcopy__(self, memo) : result = super (ChoiceField, self).__deepcopy__ (memo) result.queryset = result.queryset return result Is there a bug in the code above?
No
541
[ "#NEWLINE#", "def test_get_docker_run_cmd_with_env_vars(", ")", ":", "#NEWLINE#", "#INDENT#", "memory", "=", "555", "#NEWLINE#", "random_port", "=", "666", "#NEWLINE#", "container_name", "=", "(", "(", "'Docker'", "*", "6", ")", "+", "'Doc'", ")", "#NEWLINE#", "vo...
false
0
[ "79", "105", "net", "26", "93", "volumes", "10", "89", "random_port", "63", "99", "docker_hash", "83", "112", "119", "126", "actual", "59", "97", "interactive", "71", "101", "command", "14", "91", "container_name", "6", "87", "memory", "75", "103", "host...
0
NONE
[]
[ [ { "before_index": 5, "after_index": 8, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 12, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 22...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "Yelp/paasta/tests/cli/test_cmds_local_run.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_docker_run_cmd_with_env_vars() : memory = 555 random_port = 666 container_name = (('Docker' * 6) + 'Doc') volumes = ['7_Brides_for_7_Brothers', '7-Up', '7-11'] env = { 'foo' : 'bar', 'baz' : 'qux', 'x' : ' with spaces', } interactive = False docker_hash = ('8' * 40) command = None hostname = 'fake_hostname' net = 'bridge' actual = get_docker_run_cmd (memory, random_port, container_name, volumes, env, interactive, docker_hash, command, hostname, net) assert ('--env="foo=bar"' in actual) assert ('--env="baz=qux"' in actual) assert ('--env="x= with spaces"' in actual) Is there a bug in the code above?
No
542
[ "#NEWLINE#", "def send(", "self", ",", "*", "args", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "'Writes the passed chunk and flushes it to the client.'", "#NEWLINE#", "self", ".", "write", "(", "*", "args", ",", "**", "kwargs", ")", "#NEWLINE#", "self", "...
false
0
[ "2", "14", "25", "self", "22", "kwargs", "5", "19", "args" ]
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": 11, "after_index": 12,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "armet/python-armet/armet/http/response.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 send(self, * args, **kwargs) : 'Writes the passed chunk and flushes it to the client.' self.write (* args, ** kwargs) self.flush () Is there a bug in the code above?
No
543
[ "#NEWLINE#", "def append(", "self", ",", "name", ",", "value", ")", ":", "#NEWLINE#", "#INDENT#", "'Add a value to the end of the list for the named header.'", "#NEWLINE#", "return", "self", ".", "headers", ".", "append", "(", "name", ",", "value", ")" ]
false
0
[ "2", "14", "self", "6", "22", "value", "4", "20", "name" ]
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": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "armet/python-armet/armet/http/response.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 append(self, name, value) : 'Add a value to the end of the list for the named header.' return self.headers.append (name, value) Is there a bug in the code above?
No
544
[ "#NEWLINE#", "def _wrap_result(", "self", ",", "result", ")", ":", "#NEWLINE#", "#INDENT#", "' potentially wrap any results '", "#NEWLINE#", "if", "(", "isinstance", "(", "result", ",", "com", ".", "ABCSeries", ")", "and", "(", "self", ".", "_selection", "is not",...
false
0
[ "4", "15", "33", "43", "result", "2", "23", "37", "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": 21,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pydata/pandas/pandas/tseries/resample.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 _wrap_result(self, result) : ' potentially wrap any results ' if (isinstance (result, com.ABCSeries) and (self._selection is not None)) : result.name = self._selection return result Is there a bug in the code above?
No
545
[ "#NEWLINE#", "@", "reflection", ".", "cache", "#NEWLINE#", "@", "_db_plus_owner", "#NEWLINE#", "def get_view_definition(", "self", ",", "connection", ",", "viewname", ",", "dbname", ",", "owner", ",", "schema", ",", "**kw", ")", ":", "#NEWLINE#", "#INDENT#", "rp...
false
0
[ "20", "schema", "27", "82", "88", "rp", "kw", "86", "95", "view_def", "10", "self", "16", "dbname", "18", "66", "owner", "12", "29", "connection", "14", "48", "viewname" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 11, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": 32, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 81, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "RoseOu/flasky/venv/lib/python2.7/site-packages/sqlalchemy/dialects/mssql/base.py", "license": "mit", "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] }}
@ reflection.cache @ _db_plus_owner def get_view_definition(self, connection, viewname, dbname, owner, schema, **kw) : rp = connection.execute (sql.text ('select definition from sys.sql_modules as mod, sys.views as views, sys.schemas as sch where mod.object_id=views.object_id and views.schema_id=sch.schema_id and views.name=:viewname and sch.name=:schname', bindparams = [sql.bindparam ('viewname', viewname, sqltypes.String (convert_unicode = True)), sql.bindparam ('schname', owner, sqltypes.String (convert_unicode = True))])) if rp : view_def = rp.scalar () return view_def Is there a bug in the code above?
No
546
[ "#NEWLINE#", "def get_blocks_byte_array(", "self", ",", "buffer", "=", "False", ")", ":", "#NEWLINE#", "#INDENT#", "'Return a list of all blocks in this chunk.'", "#NEWLINE#", "if", "buffer", ":", "#NEWLINE#", "#INDENT#", "length", "=", "len", "(", "self", ".", "block...
false
0
[ "4", "14", "buffer", "18", "35", "length", "2", "22", "38", "58", "self" ]
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": "twoolie/NBT/nbt/chunk.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_blocks_byte_array(self, buffer = False) : 'Return a list of all blocks in this chunk.' if buffer : length = len (self.blocksList) return BytesIO ((pack ('>i', length) + self.get_blocks_byte_array ())) else : return array.array ('B', self.blocksList).tostring () Is there a bug in the code above?
No
547
[ "#NEWLINE#", "def _install_component(", "self", ",", "component", ",", "destdir", ",", "release", "=", "True", ")", ":", "#NEWLINE#", "#INDENT#", "installed_files", "=", "list", "(", ")", "#NEWLINE#", "manifest_name", "=", "(", "'install_manifest_%s.txt'", "%", "c...
false
0
[ "8", "33", "112", "release", "15", "297", "307", "installed_files", "21", "48", "69", "manifest_name", "2", "65", "104", "120", "177", "208", "266", "self", "183", "185", "filter_fun", "235", "246", "lines", "258", "292", "src", "244", "250", "252", "2...
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "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": "aldebaran/qibuild/python/qitoolchain/qipackage.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 _install_component(self, component, destdir, release = True) : installed_files = list () manifest_name = ('install_manifest_%s.txt' % component) if ((not release) and sys.platform.startswith ('win')) : manifest_name = ('install_manifest_%s_debug.txt' % component) manifest_path = os.path.join (self.path, manifest_name) if (not os.path.exists (manifest_path)) : if (component == 'test') : return list () mask = self._read_install_mask (component) if release : mask.extend (self._read_install_mask ('release')) if ((not mask) and (component == 'runtime')) : def filter_fun(x) : return (qisys.sh.is_runtime (x) and (x != 'package.xml')) return qisys.sh.install (self.path, destdir, filter_fun = filter_fun) else : mask.append ('exclude .*\\.mask') mask.append ('exclude package\\.xml') return self._install_with_mask (destdir, mask) else : with open (manifest_path, 'r') as fp : lines = fp.readlines () for line in lines : line = line.strip () src = os.path.join (self.path, line) dest = os.path.join (destdir, line) qisys.sh.install (src, dest) installed_files.append (line) return installed_files Is there a bug in the code above?
No
548
[ "#NEWLINE#", "def _read_install_mask(", "self", ",", "mask_name", ")", ":", "#NEWLINE#", "#INDENT#", "mask_path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "path", ",", "(", "mask_name", "+", "'.mask'", ")", ")", "#NEWLINE#", "if", "(", "not",...
false
0
[ "143", "151", "159", "170", "mess", "2", "17", "self", "120", "129", "154", "line", "61", "69", "80", "83", "90", "99", "106", "122", "176", "mask", "72", "78", "86", "88", "93", "102", "104", "110", "x", "9", "37", "52", "148", "mask_path", "5...
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 28, "after_index": 30...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "aldebaran/qibuild/python/qitoolchain/qipackage.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 _read_install_mask(self, mask_name) : mask_path = os.path.join (self.path, (mask_name + '.mask')) if (not os.path.exists (mask_path)) : return list () with open (mask_path, 'r') as fp : mask = fp.readlines () mask = [x.strip () for x in mask] mask = [x for x in mask if (x != '')] mask = [x for x in mask if (not x.startswith ('#'))] for line in mask : if (not line.startswith (('include ', 'exclude '))) : mess = ('Bad mask in %s ' % mask_path) mess += (line + ' ') mess += "line should start with 'include' or 'exclude'" raise qisys.error.Error (mess) return mask Is there a bug in the code above?
No
549
[ "#NEWLINE#", "def set_fill(", "self", ",", "fill", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "_attributes", "[", "'fill'", "]", "=", "fill" ]
false
0
[ "4", "16", "fill", "2", "9", "self" ]
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": 12, "after_index": 10...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ofermend/medicare-demo/socialite/jython/Lib/site-packages/pysvg/animate.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 set_fill(self, fill) : self._attributes ['fill'] = fill Is there a bug in the code above?
No
550
[ "#NEWLINE#", "def authenticate(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "self", ".", "auth_strategy", "==", "'keystone'", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "_authenticate_keystone", "(", ")", "#NEWLINE#", "#UNINDENT#", "else", ":", ...
false
0
[ "51", "71", "err_msg", "2", "9", "18", "31", "40", "59", "self" ]
0
NONE
[]
[ [ { "before_index": 7, "after_index": 12, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/python-neutronclient/neutronclient/client.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) : if (self.auth_strategy == 'keystone') : self._authenticate_keystone () else : if (self.auth_strategy == 'noauth') : self._authenticate_noauth () else : err_msg = (_ ('Unknown auth strategy: %s') % self.auth_strategy) raise exceptions.Unauthorized (message = err_msg) Is there a bug in the code above?
No
551
[ "#NEWLINE#", "def get_jids(", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Return a dict mapping all job ids to job information\\n '", "#NEWLINE#", "ret", "=", "{", "#NEWLINE#", "#INDENT#", "#NEWLINE#", "#UNINDENT#", "}", "#NEWLINE#", "for", "(", "jid", ",", "job", ",",...
false
0
[ "65", "73", "85", "endtime", "19", "39", "46", "50", "69", "79", "jid", "8", "37", "77", "91", "ret", "23", "25", "_", "21", "52", "job" ]
0
NONE
[]
[ [ { "before_index": 5, "after_index": 6, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 7, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 20...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "saltstack/salt/salt/returners/local_cache.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 get_jids() : ' Return a dict mapping all job ids to job information ' ret = { } for (jid, job, _, _) in _walk_through (_job_dir ()) : ret [jid] = salt.utils.jid.format_jid_instance (jid, job) if __opts__.get ('job_cache_store_endtime') : endtime = get_endtime (jid) if endtime : ret [jid] ['EndTime'] = endtime return ret Is there a bug in the code above?
No
552
[ "#NEWLINE#", "def get_height(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "not", "self", ".", "parent", ".", "children", ")", ":", "#NEWLINE#", "#INDENT#", "return", "0", "#NEWLINE#", "#UNINDENT#", "self", ".", "_default_positions", "(", ")", "#NEW...
false
0
[ "2", "10", "23", "47", "self", "36", "40", "45", "c" ]
0
NONE
[]
[ [ { "before_index": 7, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 22, "after_index": 26, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 29, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ardekantur/pyglet/contrib/wydget/wydget/layouts.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 get_height(self) : if (not self.parent.children) : return 0 self._default_positions () return intceil (max (((c.y + c.min_height) for c in self.getChildren ()))) Is there a bug in the code above?
No
553
[ "#NEWLINE#", "def test_error(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n A script that raises an exception exits, logging the error as an\\n ``eliot` message.\\n '", "#NEWLINE#", "d", "=", "self", ".", "run_script", "(", "FailScript", ")", "#NEWLINE#", ...
false
0
[ "2", "11", "26", "50", "68", "self", "91", "got_messages", "9", "87", "95", "d" ]
0
NONE
[]
[ [ { "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": 86, "after_index": 90...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ClusterHQ/flocker/flocker/common/functional/test_script.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_error(self) : ' A script that raises an exception exits, logging the error as an ``eliot` message. ' d = self.run_script (FailScript) def got_messages(messages) : assertContainsFields (self, messages [1], { 'message_type' : 'twisted:log', 'error' : True, }) self.assertTrue (messages [1] ['message'].startswith ('Unhandled Error Traceback (most recent call last): ')) self.assertTrue (messages [1] ['message'].endswith ('ZeroDivisionError: ono ')) d.addCallback (got_messages) return d Is there a bug in the code above?
No
554
[ "#NEWLINE#", "def reset_password(", "request", ")", ":", "#NEWLINE#", "#INDENT#", "response_data", "=", "{", "#NEWLINE#", "#INDENT#", "'status'", ":", "'failure'", ",", "#NEWLINE#", "'message'", ":", "'unknown error occured'", ",", "#NEWLINE#", "#UNINDENT#", "}", "#NE...
false
0
[ "2", "26", "36", "49", "65", "request", "72", "85", "new_password", "45", "55", "109", "form", "63", "76", "83", "email", "7", "79", "93", "128", "response_data" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 25, "after_index": 29, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 121, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "AcademicsToday/py-academicstoday/academicstoday_project/landpage/views/forgot_password.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 reset_password(request) : response_data = { 'status' : 'failure', 'message' : 'unknown error occured', } if request.is_ajax () : if (request.method == 'POST') : form = ForgotPasswordForm (request.POST) if form.is_valid () : email = request.POST ['email'] new_password = create_random_password (email) response_data = send_email (email, new_password) else : response_data = { 'status' : 'failed', 'message' : json.dumps (form.errors), } return HttpResponse (json.dumps (response_data), content_type = 'application/json') Is there a bug in the code above?
No
555
[ "#NEWLINE#", "def showRevolution(", "self", ",", "revId", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "reader", ".", "GetDataForRevolution", "(", "revId", ",", "self", ".", "revPolyData", ")", "#NEWLINE#", "self", ".", "displayedRevolution", "=", "revId", "#...
false
0
[ "2", "9", "17", "22", "29", "35", "44", "49", "64", "71", "79", "88", "99", "self", "4", "15", "26", "revId" ]
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": 21, "after_index": 26...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "RobotLocomotion/director/src/python/director/perception.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 showRevolution(self, revId) : self.reader.GetDataForRevolution (revId, self.revPolyData) self.displayedRevolution = revId if self.showRevolutionCallback : self.showRevolutionCallback () if (self.colorizeCallback and (self.polyDataObj.getPropertyEnumValue ('Color By') == 'rgb')) : self.colorizeCallback () self.polyDataObj._updateColorByProperty () self.polyDataObj._updateColorBy () if self.polyDataObj.getProperty ('Visible') : self.view.render () Is there a bug in the code above?
No
556
[ "#NEWLINE#", "def partition(", "self", ",", "sep", ",", "reverse", "=", "False", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Similar to split, but always creates a tuple with three items:\\n\\n 1. The part before the separator\\n 2. The separator itself.\\n 3. The ...
false
0
[ "71", "84", "112", "result", "78", "96", "107", "section", "39", "55", "80", "parent_result", "6", "35", "reverse", "67", "89", "92", "103", "current_index", "4", "18", "25", "27", "47", "63", "sep", "2", "41", "57", "87", "self" ]
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": 15, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "evennia/evennia/evennia/utils/ansi.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 partition(self, sep, reverse = False) : ' Similar to split, but always creates a tuple with three items: 1. The part before the separator 2. The separator itself. 3. The part after. We use the same techniques we used in split() to make sure each are colored. ' if hasattr (sep, '_clean_string') : sep = sep.clean () if reverse : parent_result = self._clean_string.rpartition (sep) else : parent_result = self._clean_string.partition (sep) current_index = 0 result = tuple () for section in parent_result : result += (self [current_index : (current_index + len (section))],) current_index += len (section) return result Is there a bug in the code above?
No
557
[ "#NEWLINE#", "def __init__(", "self", ",", "email", "=", "None", ",", "password", "=", "None", ",", "source", "=", "None", ",", "server", "=", "'base.google.com'", ",", "api_key", "=", "None", ",", "additional_headers", "=", "None", ",", "handler", "=", "N...
false
0
[ "24", "65", "67", "additional_headers", "12", "57", "59", "source", "4", "45", "47", "email", "28", "69", "71", "handler", "16", "61", "63", "server", "2", "43", "74", "self", "8", "49", "51", "password", "20", "76", "78", "api_key" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 34, "after_index": 44, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 73, "after_index": 7...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "bradfitz/addressbooker/gdata/base/service.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, email = None, password = None, source = None, server = 'base.google.com', api_key = None, additional_headers = None, handler = None) : gdata.service.GDataService.__init__ (self, email = email, password = password, service = 'gbase', source = source, server = server, additional_headers = additional_headers, handler = handler) self.api_key = api_key Is there a bug in the code above?
No
558
[ "#NEWLINE#", "def handle(", "self", ",", "request", ",", "context", ")", ":", "#NEWLINE#", "#INDENT#", "url", "=", "reverse", "(", "'horizon:project:network_services:index'", ")", "#NEWLINE#", "try", ":", "#NEWLINE#", "#INDENT#", "try", ":", "#NEWLINE#", "#INDENT#",...
false
0
[ "2", "self", "4", "124", "185", "request", "11", "149", "url", "130", "141", "160", "178", "187", "msg", "6", "27", "33", "39", "53", "62", "69", "78", "87", "95", "104", "113", "127", "context", "156", "170", "e" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/group-based-policy-ui/gbpui/panels/network_services/forms.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(self, request, context) : url = reverse ('horizon:project:network_services:index') try : try : del context ['template_string'] del context ['template_file'] del context ['config_type'] except KeyError : pass context ['config'] = json.dumps (context ['config']) if context.get ('name') : context ['name'] = html.escape (context ['name']) if context.get ('description') : context ['description'] = html.escape (context ['description']) client.create_servicechain_node (request, ** context) msg = _ ('Service Chain Node Created Successfully!') LOG.debug (msg) return http.HttpResponseRedirect (url) except Exception as e : msg = (_ ('Failed to create Service Chain Node. %s') % str (e)) LOG.error (msg) exceptions.handle (request, msg, redirect = shortcuts.redirect) Is there a bug in the code above?
No
559
[ "#NEWLINE#", "def take_action(", "self", ",", "parsed_args", ")", ":", "#NEWLINE#", "#INDENT#", "for", "obj", "in", "parsed_args", ".", "objects", ":", "#NEWLINE#", "#INDENT#", "self", ".", "app", ".", "client_manager", ".", "object_store", ".", "object_delete", ...
false
0
[ "2", "18", "self", "4", "12", "30", "parsed_args", "10", "36", "obj" ]
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": 13,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "dtroyer/python-openstackclient/openstackclient/object/v1/object.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 take_action(self, parsed_args) : for obj in parsed_args.objects : self.app.client_manager.object_store.object_delete (container = parsed_args.container, object = obj) Is there a bug in the code above?
No
560
[ "#NEWLINE#", "@", "classmethod", "#NEWLINE#", "def find_one(", "cls", ",", "*", "args", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "'Same as ``collection.find_one``, return model object instead of simple dict.'", "#NEWLINE#", "d", "=", "cls", ".", "collection", "...
false
0
[ "8", "26", "args", "17", "33", "41", "d", "29", "kwargs", "5", "19", "38", "cls" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 6, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 6, "after_index": 8, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 15,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "tevino/mongu/mongu.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] }}
@ classmethod def find_one(cls, * args, **kwargs) : 'Same as ``collection.find_one``, return model object instead of simple dict.' d = cls.collection.find_one (* args, ** kwargs) if d : return cls (** d) Is there a bug in the code above?
No
561
[ "#NEWLINE#", "def get_default_output(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "'Returns the first output option that is found in the list of options\\n that has a non-null value. If no output option is found, a\\n ``LookupError`` is raised\\n\\n :returns: the default output o...
false
0
[ "2", "12", "46", "self", "10", "23", "28", "39", "44", "56", "opt" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 7, "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": 15,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "thasso/pyjip/jip/options.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 get_default_output(self) : 'Returns the first output option that is found in the list of options that has a non-null value. If no output option is found, a ``LookupError`` is raised :returns: the default output option :rtype: :class:`Option` :raises LookupError: if no default option was found ' for opt in self.get_by_type (TYPE_OUTPUT) : if (opt._value or (opt.default is not None)) : return opt for opt in self.get_by_type (TYPE_OUTPUT) : return opt raise LookupError ('No default output option found') Is there a bug in the code above?
No
562
[ "#NEWLINE#", "def __init__(", "self", ",", "cache_manager", ",", "options", ")", ":", "#NEWLINE#", "#INDENT#", "BaseStorage", ".", "__init__", "(", "self", ",", "cache_manager", ",", "options", ")", "#NEWLINE#", "self", ".", "url", "=", "options", ".", "get", ...
false
0
[ "6", "19", "26", "39", "52", "options", "2", "15", "22", "35", "48", "62", "66", "70", "77", "81", "85", "self", "4", "17", "cache_manager" ]
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": 21, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "limodou/uliweb/uliweb/lib/weto/backends/database_storage.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, cache_manager, options) : BaseStorage.__init__ (self, cache_manager, options) self.url = options.get ('url', 'sqlite:///') self.tablename = options.get ('table_name', 'session') self.auto_create = options.get ('auto_create', True) (self.db, self.meta, self.table) = create_table (self.url, self.tablename, self.auto_create) Is there a bug in the code above?
No
563
[ "#NEWLINE#", "def getOperationByName(", "self", ",", "name", ")", ":", "#NEWLINE#", "#INDENT#", "'Return a named content item.'", "#NEWLINE#", "for", "item", "in", "self", ".", "operations", ":", "#NEWLINE#", "#INDENT#", "if", "(", "item", ".", "name", "==", "name...
false
0
[ "2", "14", "self", "12", "22", "32", "item", "4", "24", "26", "42", "name" ]
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": 12,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "geopython/OWSLib/owslib/feature/wfs110.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 getOperationByName(self, name) : 'Return a named content item.' for item in self.operations : if (item.name == name) : return item raise KeyError (('No operation named %s' % name)) Is there a bug in the code above?
No
564
[ "#NEWLINE#", "@", "test", ".", "idempotent_id", "(", "'cd8afa5e-3f57-4e43-8185-beb83d3c9015'", ")", "#NEWLINE#", "def test_list_nodestates(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "(", "_", ",", "nodestates", ")", "=", "self", ".", "client", ".", "list_nodestat...
true
46
[ "10", "21", "27", "42", "51", "36", "46", "48", "55", "16", "18", "38" ]
1
VARIABLE_MISUSE
[ 18, 38 ]
[ [ { "before_index": 14, "after_index": 26, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 35, "after_index": 36, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 35, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/ironic/ironic_tempest_plugin/tests/api/admin/test_nodestates.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] }}
@ test.idempotent_id ('cd8afa5e-3f57-4e43-8185-beb83d3c9015') def test_list_nodestates(self) : (_, nodestates) = self.client.list_nodestates (self.node ['uuid']) for key in nodestates : self.assertEqual (key [key], self.node [key]) Is there a bug in the code above?
Yes
565
[ "#NEWLINE#", "@", "classmethod", "#NEWLINE#", "def resolve(", "self", ",", "accept", ",", "provide", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Resolves a list of accepted MediaTypes and available renderers to the preferred renderer.\\n\\n Call as MediaType.resolve([MediaType...
true
206
[ "145", "165", "9", "158", "206", "153", "177", "40", "86", "100", "118", "147", "7", "20", "33", "42", "48", "58", "69", "75", "5", "73", "82", "110", "123", "163", "181", "130", "187", "155", "172", "191", "198", "132", "174", "194" ]
1
VARIABLE_MISUSE
[ 130, 187 ]
[ [ { "before_index": 1, "after_index": 6, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 16, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "mollyproject/mollyproject/molly/utils/http.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] }}
@ classmethod def resolve(self, accept, provide) : ' Resolves a list of accepted MediaTypes and available renderers to the preferred renderer. Call as MediaType.resolve([MediaType], [(MediaType, renderer)]). ' if (len (accept) == 0) : return [] accept.sort () (eq_classes, accept) = ([[accept [(- 1)]]], accept [: (- 1)]) while accept : imt = accept.pop () if imt.equivalent (eq_classes [0] [(- 1)]) : eq_classes [(- 1)].append (imt) else : eq_classes.append ([imt]) (renderers, seen_renderers) = ([], set ()) for imts in eq_classes : for (provide_type, renderer) in provide : for imt in imts : if ((renderer not in seen_renderers) and provide_type.provides (imt)) : renderers.append (renderer) seen_renderers.add (renderer) return provide Is there a bug in the code above?
Yes
566
[ "#NEWLINE#", "def setUp(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "super", "(", "TestServerRebuild", ",", "self", ")", ".", "setUp", "(", ")", "#NEWLINE#", "self", ".", "image", "=", "image_fakes", ".", "FakeImage", ".", "create_one_image", "(", ")", "#N...
true
38
[ "2", "11", "18", "30", "71", "113", "132", "140", "144", "152", "42", "59", "107", "52", "123", "125", "38", "100", "127", "129" ]
1
VARIABLE_MISUSE
[ 2, 11, 18, 30, 71, 113, 132, 140, 144, 152 ]
[ [ { "before_index": 6, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 27, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 29, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "dtroyer/python-openstackclient/openstackclient/tests/compute/v2/test_server.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 setUp(self) : super (TestServerRebuild, self).setUp () self.image = image_fakes.FakeImage.create_one_image () self.cimages_mock.get.return_value = methods.image new_server = compute_fakes.FakeServer.create_one_server () attrs = { 'id' : new_server.id, 'image' : { 'id' : self.image.id, }, 'networks' : { }, 'adminPass' : 'passw0rd', } methods = { 'rebuild' : new_server, } self.server = compute_fakes.FakeServer.create_one_server (attrs = attrs, methods = methods) self.servers_mock.get.return_value = self.server self.cmd = server.RebuildServer (self.app, None) Is there a bug in the code above?
Yes
567
[ "#NEWLINE#", "def it_provides_access_to_the_data_labels(", "self", ",", "data_labels_fixture", ")", ":", "#NEWLINE#", "#INDENT#", "(", "plot", ",", "data_labels_", ",", "DataLabels_", ",", "dLbls", ")", "=", "data_labels_fixture", "#NEWLINE#", "data_labels", "=", "plot"...
true
36
[ "2", "36", "12", "38", "21", "25", "4", "19", "16", "31", "14", "27", "10", "23" ]
1
VARIABLE_MISUSE
[ 21, 25 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 19, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 20, "after_index": 24...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "scanny/python-pptx/tests/chart/test_plot.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 it_provides_access_to_the_data_labels(self, data_labels_fixture) : (plot, data_labels_, DataLabels_, dLbls) = data_labels_fixture data_labels = plot.data_labels DataLabels_.assert_called_once_with (dLbls) assert (self is data_labels_) Is there a bug in the code above?
Yes
568
[ "#NEWLINE#", "@", "pytest", ".", "fixture", "(", "params", "=", "[", "(", "'c:barChart'", ",", "False", ")", ",", "(", "'c:barChart/c:dLbls'", ",", "True", ")", ",", "(", "'c:lineChart'", ",", "False", ")", ",", "(", "'c:lineChart/c:dLbls'", ",", "True", ...
true
79
[ "48", "56", "71", "79", "50", "61", "58", "81", "65" ]
1
VARIABLE_MISUSE
[ 65 ]
[ [ { "before_index": 1, "after_index": 49, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 54, "after_index": 62, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 64, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "scanny/python-pptx/tests/chart/test_plot.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] }}
@ pytest.fixture (params = [('c:barChart', False), ('c:barChart/c:dLbls', True), ('c:lineChart', False), ('c:lineChart/c:dLbls', True), ('c:pieChart', False), ('c:pieChart/c:dLbls', True)]) def has_data_labels_get_fixture(self, request) : (xChart_cxml, expected_value) = request.param plot = Plot (element (xChart_cxml), None) return (xChart_cxml, expected_value) Is there a bug in the code above?
Yes
569
[ "#NEWLINE#", "def testFloatRange(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "script", "=", "Gaffer", ".", "ScriptNode", "(", ")", "#NEWLINE#", "script", "[", "'writer'", "]", "=", "GafferDispatchTest", ".", "TextWriter", "(", ")", "#NEWLINE#", "script", "[", ...
true
163
[ "7", "15", "26", "47", "60", "71", "84", "93", "115", "128", "141", "2", "37", "154", "163", "170", "181", "194", "204", "214", "224", "234", "245", "254", "268", "277", "291", "300", "314", "323", "337", "346" ]
1
VARIABLE_MISUSE
[ 7, 15, 26, 47, 60, 71, 84, 93, 115, 128, 141 ]
[ [ { "before_index": 6, "after_index": 12, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 23, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 25, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ImageEngine/gaffer/python/GafferDispatchTest/WedgeTest.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 testFloatRange(self) : script = Gaffer.ScriptNode () script ['writer'] = GafferDispatchTest.TextWriter () script ['writer'] ['fileName'].setValue ((self.temporaryDirectory () + '/${wedge:index}.txt')) script ['writer'] ['text'].setValue ('${wedge:value}') script ['wedge'] = GafferDispatch.Wedge () script ['wedge'] ['preTasks'] [0].setInput (script ['writer'] ['task']) script ['wedge'] ['mode'].setValue (int (GafferDispatch.Wedge.Mode.FloatRange)) script ['wedge'] ['floatMin'].setValue (0) script ['wedge'] ['floatMax'].setValue (1) script ['wedge'] ['floatSteps'].setValue (5) self.__dispatcher ().dispatch ([self ['wedge']]) self.assertEqual (set (glob.glob ((self.temporaryDirectory () + '/*.txt'))), { (self.temporaryDirectory () + '/0.txt'), (self.temporaryDirectory () + '/1.txt'), (self.temporaryDirectory () + '/2.txt'), (self.temporaryDirectory () + '/3.txt'), (self.temporaryDirectory () + '/4.txt') }) self.assertEqual (next (open ((self.temporaryDirectory () + '/0.txt'))), '0') self.assertEqual (next (open ((self.temporaryDirectory () + '/1.txt'))), '0.25') self.assertEqual (next (open ((self.temporaryDirectory () + '/2.txt'))), '0.5') self.assertEqual (next (open ((self.temporaryDirectory () + '/3.txt'))), '0.75') self.assertEqual (next (open ((self.temporaryDirectory () + '/4.txt'))), '1') Is there a bug in the code above?
Yes
570
[ "#NEWLINE#", "def test_pretty_enabled_by_default(", "self", ",", "httpbin", ")", ":", "#NEWLINE#", "#INDENT#", "env", "=", "TestEnvironment", "(", "colors", "=", "256", ")", "#NEWLINE#", "r", "=", "http", "(", "'GET'", ",", "(", "httpbin", ".", "url", "+", "...
true
41
[ "9", "32", "34", "18", "2", "4", "25", "41" ]
1
VARIABLE_MISUSE
[ 18 ]
[ [ { "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": 17, "after_index": 23...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "jkbrzt/httpie/tests/test_output.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_pretty_enabled_by_default(self, httpbin) : env = TestEnvironment (colors = 256) r = http ('GET', (httpbin.url + '/get'), env = env) assert (COLOR in httpbin) Is there a bug in the code above?
Yes
571
[ "#NEWLINE#", "def testDeleteAttribute(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "'Modify & commit should write the right data to the server.'", "#NEWLINE#", "client", "=", "LDAPClientTestDriver", "(", "[", "pureldap", ".", "LDAPModifyResponse", "(", "resultCode", "=", "0"...
true
134
[ "130", "134", "9", "39", "41", "96", "82", "126", "2", "33", "72", "84" ]
1
VARIABLE_MISUSE
[ 82, 126 ]
[ [ { "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": 32, "after_index": 42...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "twisted/ldaptor/ldaptor/test/test_ldapsyntax.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 testDeleteAttribute(self) : 'Modify & commit should write the right data to the server.' client = LDAPClientTestDriver ([pureldap.LDAPModifyResponse (resultCode = 0, matchedDN = '', errorMessage = '')]) o = ldapsyntax.LDAPEntry (client = client, dn = 'cn=foo,dc=example,dc=com', attributes = { 'objectClass' : ['a', 'b'], 'aValue' : ['a'], }) o ['aValue'].remove ('a') d = o.commit () def cb(dummy) : client.assertSent (delta.ModifyOp ('cn=foo,dc=example,dc=com', [delta.Delete ('aValue', ['a'])]).asLDAP ()) d.addCallback (cb) return cb Is there a bug in the code above?
Yes
572
[ "#NEWLINE#", "def generate_collection(", "addon", ",", "app", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Generate a Collection, a CollectionAddon and a FeaturedCollection\\n for the given `addon` related to the optional `app`.\\n\\n '", "#NEWLINE#", "if", "(", "app"...
true
49
[ "22", "31", "42", "44", "82", "84", "38", "64", "88", "4", "15", "33", "69", "2", "49", "58", "60" ]
1
VARIABLE_MISUSE
[ 38, 64, 88 ]
[ [ { "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": "mozilla/addons-server/src/olympia/landfill/collection.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 generate_collection(addon, app = None) : ' Generate a Collection, a CollectionAddon and a FeaturedCollection for the given `addon` related to the optional `app`. ' if (app is None) : application = None else : application = app.id c = create_collection (application = application) generate_translations (addon) CollectionAddon.objects.create (addon = addon, collection = c) if (app is not None) : FeaturedCollection.objects.create (application = application, collection = c) Is there a bug in the code above?
Yes
573
[ "#NEWLINE#", "def get_as_elem(", "self", ",", "slice", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Get the PlanetLabNetwork as ElementTree element so it can be added\\n to the RSpec and dumped as XML.\\n \\n @keyword slice: Optional. Slice for which we are...
true
245
[ "13", "80", "91", "352", "128", "148", "66", "99", "305", "338", "55", "71", "75", "198", "206", "212", "64", "88", "303", "327", "40", "57", "136", "176", "224", "245", "288", "166", "200", "311", "188", "204", "229", "274", "297", "319", "330...
1
VARIABLE_MISUSE
[ 13, 80, 91, 352 ]
[ [ { "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": "fp7-ofelia/ocf/expedient/src/python/expedient_geni/planetlab/sfa-models.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 get_as_elem(self, slice = None) : ' Get the PlanetLabNetwork as ElementTree element so it can be added to the RSpec and dumped as XML. @keyword slice: Optional. Slice for which we are producing this RSpec. Specifying the slice will set the <sliver /> tag for PlanetLab nodes that are part of the slice. @type slice: L{expedient.clearinghouse.slice.models.Slice}. @return: the NetSpec element @rtype: C{xml.etree.ElementTree.Element} ' netspec = et.Element ('NetSpec', dict (name = self.name)) if slice : try : sliver = slice.sliver_set.get (resource__pk = self.pk) net_sliver = sliver.as_leaf_class () (stime, duration) = get_start_duration (net_sliver.start_time, net_sliver.end_time) netspec ['start_time'] = ('%s' % stime) netspec ['duration'] = ('%s' % duration) except Sliver.DoesNotExist : pass for rsc_type in ['node'] : if slice : filter_key = ('planetlab%s__network' % rsc_type) rsc_ids = slice.resource_set.filter (** { filter_key : self, }).values_list ('pk', flat = True) sliver_info_tuples = slice.sliver_set.filter (resource__pk__in = rsc_ids).values_list ('resource_id', 'start_time', 'end_time') sliver_info = { } for t in sliver_info_tuples : sliver_info [t [0]] = t [1 :] else : rsc_ids = [] sliver_info = { } rsc_set_elem = et.SubElement (rsc_ids, ('%ss' % rsc_type)) for rsc in getattr (self, ('%ss' % rsc_type)).all () : rsc_elem = rsc.get_as_elem () if (rsc.pk in rsc_ids) : et.SubElement (rsc_elem, 'sliver') (stime, duration) = get_start_duration (* sliver_info_tuples [rsc.pk]) rsc_elem ['start_time'] = ('%s' % stime) rsc_elem ['duration'] = ('%s' % duration) rsc_set_elem.append (rsc_elem) return netspec Is there a bug in the code above?
Yes
574
[ "#NEWLINE#", "def test_try_finally(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "x", "=", "1", "#NEWLINE#", "try", ":", "#NEWLINE#", "#INDENT#", "assert", "(", "self", "==", "0", ")", "#NEWLINE#", "#UNINDENT#", "finally", ":", "#NEWLINE#", "#INDENT#", "x", "=...
true
17
[ "7", "27", "2", "17" ]
1
VARIABLE_MISUSE
[ 7, 27 ]
[ [ { "before_index": 6, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 15, "after_index": 18, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pytest-dev/pytest/doc/en/example/assertion/failure_demo.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_try_finally(self) : x = 1 try : assert (self == 0) finally : x = 0 Is there a bug in the code above?
Yes
575
[ "#NEWLINE#", "def _coerce_resource(", "self", ",", "data", ")", ":", "#NEWLINE#", "#INDENT#", "resource", "=", "Resource", "(", "**", "resource", ")", "#NEWLINE#", "return", "resource" ]
true
14
[ "2", "9", "14", "18", "4" ]
1
VARIABLE_MISUSE
[ 4 ]
[ [ { "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": 17, "after_index": 18...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "xively/xively-python/xively/managers.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 _coerce_resource(self, data) : resource = Resource (** resource) return resource Is there a bug in the code above?
Yes
576
[ "#NEWLINE#", "@", "classmethod", "#NEWLINE#", "def create(", "cls", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n :API: public\\n '", "#NEWLINE#", "options", "=", "cls", ".", "global_instance", "(", ")", ".", "get_options", "(", ")", "#NEWLINE#", "return", "Bin...
true
35
[ "5", "14", "35", "12", "27", "31", "39" ]
1
VARIABLE_MISUSE
[ 12, 27, 31, 39 ]
[ [ { "before_index": 9, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 21, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 24, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pantsbuild/pants/src/python/pants/binaries/binary_util.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] }}
@ classmethod def create(cls) : ' :API: public ' options = cls.global_instance ().get_options () return BinaryUtil (options.baseurls, options.fetch_timeout_secs, cls.pants_bootstrapdir, options.path_by_id) Is there a bug in the code above?
Yes
577
[ "#NEWLINE#", "def test_compat_allocation_ratios_default_values(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "compute_dict", "=", "fake_compute_node", ".", "copy", "(", ")", "#NEWLINE#", "compute_dict", "[", "'cpu_allocation_ratio'", "]", "=", "0.0", "#NEWLINE#", "compute...
true
87
[ "2", "48", "59", "70", "81", "36", "44", "52", "87", "42", "65", "76", "7", "15", "22", "29", "56" ]
1
VARIABLE_MISUSE
[ 42, 65, 76 ]
[ [ { "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": 21, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/objects/test_compute_node.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_compat_allocation_ratios_default_values(self) : compute_dict = fake_compute_node.copy () compute_dict ['cpu_allocation_ratio'] = 0.0 compute_dict ['ram_allocation_ratio'] = 0.0 compute_dict ['disk_allocation_ratio'] = 0.0 cls = objects.ComputeNode compute = cls._from_db_object (self.context, cls (), compute_dict) self.assertEqual (16.0, compute.cpu_allocation_ratio) self.assertEqual (1.5, compute.ram_allocation_ratio) self.assertEqual (1.0, cls.disk_allocation_ratio) Is there a bug in the code above?
Yes
578
[ "#NEWLINE#", "def synchronizerUpdateTest(", "self", ",", "computedGraphTestHarness", ")", ":", "#NEWLINE#", "#INDENT#", "synchronizer", "=", "self", ".", "createSynchronizer", "(", ")", "#NEWLINE#", "def updateValueInSharedState(", "self", ",", "key", ",", "view", ")", ...
true
46
[ "50", "72", "4", "46", "74", "98", "9", "56", "91", "2", "11", "18", "36", "42", "77", "83", "87", "94", "103" ]
1
VARIABLE_MISUSE
[ 2, 11, 18, 36, 42, 77, 83, 87, 94, 103 ]
[ [ { "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": 17, "after_index": 19...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ufora/ufora/ufora/distributed/SharedState/tests/ComputedGraphSharedState_test.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 synchronizerUpdateTest(self, computedGraphTestHarness) : synchronizer = self.createSynchronizer () def updateValueInSharedState(self, key, view) : view [key] = JsonPickle.toJson (self.keyValue) self.runInTransaction (computedGraphKey.keyName, updateValueInSharedState, False) with synchronizer : assert (SharedStateSynchronizer.getView () is not None) (computedGraphKeyspace, computedGraphKey) = self.createKey () self.synchronizerWaitForKey (self.keyName, synchronizer) self.assertEqual (computedGraphKey.value, (self.keyValue,)) Is there a bug in the code above?
Yes
579
[ "#NEWLINE#", "def __init__(", "self", ",", "signature", ")", ":", "#NEWLINE#", "#INDENT#", "super", "(", "self", ".", "__class__", ",", "self", ")", ".", "__init__", "(", "'Syntax error in type signature'", ")", "#NEWLINE#", "if", "(", "not", "isinstance", "(", ...
true
83
[ "2", "11", "15", "79", "83", "4", "28", "41", "59", "36", "47" ]
1
VARIABLE_MISUSE
[ 4, 28, 41, 59 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 19, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": 25...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "billpmurphy/hask/hask/lang/syntax.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, signature) : super (self.__class__, self).__init__ ('Syntax error in type signature') if (not isinstance (signature, __signature__)) : msg = ('Signature expected in sig(); found %s' % signature) raise SyntaxError (msg) else : if (len (signature.sig.args) < 2) : raise SyntaxError ('Not enough type arguments in signature') self.sig = self.sig return Is there a bug in the code above?
Yes
580
[ "#NEWLINE#", "def test_graph_dependencies(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "a", "=", "test_utils", ".", "ProvidesRequiresTask", "(", "'a'", ",", "provides", "=", "[", "'x'", "]", ",", "requires", "=", "[", "]", ")", "#NEWLINE#", "b", "=", "test_...
true
58
[ "7", "63", "87", "95", "171", "186", "2", "79", "91", "163", "178", "47", "58", "71", "27", "60" ]
1
VARIABLE_MISUSE
[ 7 ]
[ [ { "before_index": 6, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": 34, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 46, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/taskflow/taskflow/tests/unit/action_engine/test_compile.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_graph_dependencies(self) : a = test_utils.ProvidesRequiresTask ('a', provides = ['x'], requires = []) b = test_utils.ProvidesRequiresTask ('b', provides = [], requires = ['x']) flo = gf.Flow ('test').add (flo, b) g = _replicate_graph_with_names (compiler.PatternCompiler (flo).compile ()) self.assertEqual (4, len (g)) self.assertItemsEqual (g.edges (data = True), [('test', 'a', { 'invariant' : True, }), ('a', 'b', { 'reasons' : set (['x']), }), ('b', 'test[$]', { 'invariant' : True, })]) self.assertItemsEqual (['test'], g.no_predecessors_iter ()) self.assertItemsEqual (['test[$]'], g.no_successors_iter ()) Is there a bug in the code above?
Yes
581
[ "#NEWLINE#", "def test_graph_nested_requires(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "a", "=", "test_utils", ".", "ProvidesRequiresTask", "(", "'a'", ",", "provides", "=", "[", "'x'", "]", ",", "requires", "=", "[", "]", ")", "#NEWLINE#", "b", "=", "te...
true
95
[ "7", "93", "98", "122", "130", "259", "277", "2", "114", "126", "249", "267", "66", "82", "106", "27", "77", "46", "79", "95" ]
1
VARIABLE_MISUSE
[ 66 ]
[ [ { "before_index": 6, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": 34, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 45, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/taskflow/taskflow/tests/unit/action_engine/test_compile.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_graph_nested_requires(self) : a = test_utils.ProvidesRequiresTask ('a', provides = ['x'], requires = []) b = test_utils.ProvidesRequiresTask ('b', provides = [], requires = []) c = test_utils.ProvidesRequiresTask ('c', provides = [], requires = ['x']) inner_flo = lf.Flow ('test2').add (b, c) flo = gf.Flow ('test').add (a, c) g = _replicate_graph_with_names (compiler.PatternCompiler (flo).compile ()) self.assertEqual (7, len (g)) self.assertItemsEqual (g.edges (data = True), [('test', 'a', { 'invariant' : True, }), ('test2', 'b', { 'invariant' : True, }), ('a', 'test2', { 'reasons' : set (['x']), }), ('b', 'c', { 'invariant' : True, }), ('c', 'test2[$]', { 'invariant' : True, }), ('test2[$]', 'test[$]', { 'invariant' : True, })]) self.assertItemsEqual (['test'], list (g.no_predecessors_iter ())) self.assertItemsEqual (['test[$]'], list (g.no_successors_iter ())) Is there a bug in the code above?
Yes
582
[ "#NEWLINE#", "def test_get_basic(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "set_text", "(", "self", ".", "text_javascript", "(", ")", ")", "#NEWLINE#", "self", ".", "set_settings", "(", "{", "#NEWLINE#", "#INDENT#", "'level_char'", ":", "'>'", ...
true
91
[ "2", "7", "11", "18", "36", "73", "84", "52", "66", "42", "68", "91", "34", "44" ]
1
VARIABLE_MISUSE
[ 52, 66 ]
[ [ { "before_index": 6, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 21, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 33, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "kizza/Table-of-comments/tests/test_get_comment_titles.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_get_basic(self) : self.set_text (self.text_javascript ()) self.set_settings ({ 'level_char' : '>', }) toc = self.get_plugin () titles = toc.get_comment_titles ('string') for title in ['Heading 1', '- Heading 2', '-- Heading 3'] : if (title in titles) : self.ok () else : self.error (('Missing title ' + titles)) Is there a bug in the code above?
Yes
583
[ "#NEWLINE#", "def __init__(", "self", ",", "**kw", ")", ":", "#NEWLINE#", "#INDENT#", "'Initialization method for instance.'", "#NEWLINE#", "super", "(", "FiatStart", ",", "self", ")", ".", "__init__", "(", "**", "self", ")" ]
true
21
[ "2", "15", "21" ]
1
VARIABLE_MISUSE
[]
[ [ { "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": 19,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ioflo/ioflo/ioflo/base/fiating.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, **kw) : 'Initialization method for instance.' super (FiatStart, self).__init__ (** self) Is there a bug in the code above?
Yes
584
[ "#NEWLINE#", "def test_upgrade_head(", "self", ",", "migration", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "migrate", ".", "upgrade", "(", "'head'", ")", "#NEWLINE#", "migration", ".", "db_sync", ".", "assert_called_once_with", "(", "migration", ".", "migrat...
true
24
[ "2", "9", "30", "4", "18", "24" ]
1
VARIABLE_MISUSE
[ 2, 9, 30 ]
[ [ { "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": 17, "after_index": 29...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/oslo.db/oslo_db/tests/sqlalchemy/test_migrate_cli.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_upgrade_head(self, migration) : self.migrate.upgrade ('head') migration.db_sync.assert_called_once_with (migration.migrate.engine, self.migrate.repository, None, init_version = 0) Is there a bug in the code above?
Yes
585
[ "#NEWLINE#", "@", "jit", ".", "elidable", "#NEWLINE#", "def _lookup(", "self", ",", "sym", ",", "version", ")", ":", "#NEWLINE#", "#INDENT#", "try", ":", "#NEWLINE#", "#INDENT#", "return", "self", ".", "bindings", "[", "version", "]", "#NEWLINE#", "#UNINDENT#"...
true
25
[ "9", "40", "11", "25", "7", "21" ]
1
VARIABLE_MISUSE
[ 9, 40 ]
[ [ { "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": 20, "after_index": 24,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "samth/pycket/pycket/env.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] }}
@ jit.elidable def _lookup(self, sym, version) : try : return self.bindings [version] except KeyError : raise SchemeException (('toplevel variable %s not found' % sym.variable_name ())) Is there a bug in the code above?
Yes
586
[ "#NEWLINE#", "def test_streaming_hdu_write_file_like(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "'Test streaming an HDU to an open file-like object.'", "#NEWLINE#", "arr", "=", "np", ".", "zeros", "(", "(", "5", ",", "5", ")", ",", "dtype", "=", "np", ".", "int32...
true
51
[ "51", "71", "84", "92", "34", "43", "57", "28", "40", "64", "77", "9", "47", "99", "2", "36" ]
1
VARIABLE_MISUSE
[ 34, 43, 57 ]
[ [ { "before_index": 6, "after_index": 7, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 27, "after_index": 31...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "spacetelescope/PyFITS/pyfits/tests/test_core.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_streaming_hdu_write_file_like(self) : 'Test streaming an HDU to an open file-like object.' arr = np.zeros ((5, 5), dtype = np.int32) sf = BytesIO () shdu = self._make_streaming_hdu (sf) shdu.write (arr) assert hdul.writecomplete assert (shdu.size == 100) sf.seek (0) hdul = fits.open (sf) assert (len (hdul) == 1) assert (hdul [0].data == arr).all () Is there a bug in the code above?
Yes
587
[ "#NEWLINE#", "def __init__(", "self", ",", "tau1", ",", "tau0", ")", ":", "#NEWLINE#", "#INDENT#", "tau1", "=", "np", ".", "atleast_1d", "(", "tau0", ")", "#NEWLINE#", "tau0", "=", "np", ".", "atleast_1d", "(", "tau0", ")", "#NEWLINE#", "gamma", "=", "np...
true
17
[ "6", "17", "20", "26", "45", "4", "11", "36", "29", "72", "2", "67" ]
1
VARIABLE_MISUSE
[ 4, 11, 36 ]
[ [ { "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": 19, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "slinderman/pyhawkes/pyhawkes/internals/distributions.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, tau1, tau0) : tau1 = np.atleast_1d (tau0) tau0 = np.atleast_1d (tau0) gamma = np.concatenate ((tau1 [(..., None)], tau0 [(..., None)]), axis = (- 1)) super (Beta, self).__init__ (gamma) Is there a bug in the code above?
Yes
588
[ "#NEWLINE#", "def main(", ")", ":", "#NEWLINE#", "#INDENT#", "flock", "=", "FlockManager", "(", "match_found", ",", "config", "[", "'BLEET_TIMEOUT'", "]", ",", "config", "[", "'SERVICE_TIMEOUT'", "]", ")", "#NEWLINE#", "logger", ".", "info", "(", "'Shepherd star...
true
747
[ "186", "198", "228", "238", "262", "283", "315", "320", "111", "196", "219", "226", "253", "260", "306", "313", "333", "728", "795", "803", "125", "149", "716", "738", "831", "741", "756", "779", "788", "799", "329", "381", "414", "422", "428", "...
1
VARIABLE_MISUSE
[ 414, 422, 428, 439, 483, 524, 641, 659, 682, 706, 720, 853 ]
[ [ { "before_index": 5, "after_index": 11, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 22, "after_index": 26, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 30, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ucrcsedept/galah/galah/shepherd/shepherd.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 main() : flock = FlockManager (match_found, config ['BLEET_TIMEOUT'], config ['SERVICE_TIMEOUT']) logger.info ('Shepherd starting.') while True : zmq.select ([public, sheep], [], [], timeout = 5) while ((public.getsockopt (zmq.EVENTS) & zmq.POLLIN) != 0) : request = public.recv_json () logger.debug ('Raw test request: %s', str (request)) request = TestRequest.from_dict (request) try : submission = Submission.objects.get (id = ObjectId (request.submission_id)) except Submission.DoesNotExist as e : logger.warning ('Received test request for non-existant submission [%s].', str (request.submission_id)) continue except bson.errors.InvalidId as e : logger.warning ('Received malformed test request. %s', str (e)) continue try : assignment = Assignment.objects.get (id = submission.assignment) except Assignment.DoesNotExist as e : logger.error ('Received test request for a submission [%s] referencing an invalid assignment [%s].', str (submission.id), str (submission.assignment)) continue if (not assignment.test_harness) : logger.warning ('Received test request for a submission [%s] referencing an assignment [%s] that does not have a test harness associated with it.', str (submission.id), str (submission.assignment)) continue try : test_harness = TestHarness.objects.get (id = assignment.test_harness) except TestHarness.DoesNotExit as e : logger.error ('Received test request for a submission [%s] referencing an assignment [%s] that references a non-existant test harness [%s].', str (submission.id), str (submission.assignment), str (assignment.test_harness)) continue processed_request = InternalTestRequest (submission.id, test_harness.config.get ('galah/timeout', config ['BLEET_TIMEOUT'].seconds), test_harness.config.get ('galah/environment', { })) logger.info ('Received test request.') flock.received_request (processed_request) while ((sheep.getsockopt (zmq.EVENTS) & zmq.POLLIN) != 0) : try : (sheep_identity, sheep_message) = router_recv_json (sheep) sheep_message = FlockMessage.from_dict (sheep_message) logger.debug ('Received message from sheep: %s', str (sheep_message)) except ValueError as e : logger.error ("Could not decode sheep's message: %s", str (e)) logger.debug ("Exception thrown while decoding sheep's message...", exc_info = sys.exc_info ()) continue if (sheep_message.type == 'distress') : logger.warn ('Received distress message. Sending bloot.') router_send_json (sheep, sheep_identity, FlockMessage ('bloot', '').to_dict ()) else : if (sheep_message.type == 'bleet') : logger.debug ('Sheep [%s] bleeted. Sending bloot.', repr (sheep_identity)) result = flock.sheep_bleeted (sheep_identity) if (result is FlockManager.IGNORE) : logger.debug ('Ignoring bleet.') continue if (not result) : router_send_json (sheep, sheep_identity, FlockMessage ('identify', '').to_dict ()) logger.info ('Unrecognized sheep [%s] connected, identify sent.', repr (sheep_identity)) continue router_send_json (sheep, sheep_identity, FlockMessage ('bloot', '').to_dict ()) else : if (sheep_message.type == 'environment') : if (not flock.manage_sheep (sheep_identity, sheep_message.body)) : logger.warn ('Received environment from an already-recognized sheep.') else : if (sheep_message.type == 'result') : logger.info ('Received test result from sheep.') logger.debug ('Received test result from sheep: %s', str (sheep_message.body)) try : submission_id = ObjectId (sheep_message.body ['id']) submission = Submission.objects.get (id = submission_id) test_result = TestResult.from_dict (result.body) try : test_result.save () except InvalidDocument : logger.warn ('Test result is too large for the database.', exc_info = True) test_result = TestResult (failed = True) test_result.save () submission.test_results = test_result.id submission.save () except (InvalidId, Submission.DoesNotExist) as e : logger.warn ('Could not retrieve submission [%s] for test result received from sheep [%s].', str (submission_id), repr (sheep_identity)) continue router_send_json (sheep, sheep_identity, FlockMessage ('bloot', sheep_message.body ['id']).to_dict ()) if (not flock.sheep_finished (sheep_identity)) : logger.info ('Got result from sheep [%s] who was not processing a test request.', repr (sheep_identity)) (lost_sheep, killed_sheep) = flock.cleanup () if lost_sheep : logger.warn ('%d sheep lost due to bleet timeout: %s', len (lost_sheep), str ([repr (i) for i in lost_sheep])) if killed_sheep : logger.warn ('%d sheep lost due to request timeout: %s', len (killed_sheep), str ([repr (i) for i in killed_sheep])) Is there a bug in the code above?
Yes
589
[ "#NEWLINE#", "def get_network_attach_config_spec(", "client_factory", ",", "vif_info", ",", "index", ")", ":", "#NEWLINE#", "#INDENT#", "'Builds the vif attach config spec.'", "#NEWLINE#", "config_spec", "=", "client_factory", ".", "create", "(", "'ns0:VirtualMachineConfigSpec'...
true
36
[ "6", "65", "2", "15", "26", "58", "13", "31", "36", "51", "71", "22", "4", "28", "41", "60" ]
1
VARIABLE_MISUSE
[ 22 ]
[ [ { "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": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/nova/nova/virt/vmwareapi/vm_util.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_network_attach_config_spec(client_factory, vif_info, index) : 'Builds the vif attach config spec.' config_spec = client_factory.create ('ns0:VirtualMachineConfigSpec') vif_spec = _create_vif_spec (client_factory, vif_info) config_spec.deviceChange = [config_spec] if (vif_info ['iface_id'] is not None) : config_spec.extraConfig = [_iface_id_option_value (client_factory, vif_info ['iface_id'], index)] return config_spec Is there a bug in the code above?
Yes
590
[ "#NEWLINE#", "def testCompletion(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "\"Tests '[[]]' syntax replacement.\"", "#NEWLINE#", "indx", "=", "clitable", ".", "CliTable", "(", ")", "#NEWLINE#", "self", ".", "failUnlessEqual", "(", "'abc'", ",", "re", ".", "sub", ...
true
49
[ "2", "17", "37", "49", "57", "9", "29", "69" ]
1
VARIABLE_MISUSE
[ 9, 29, 69 ]
[ [ { "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": 22...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "google/textfsm/clitable_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 testCompletion(self) : "Tests '[[]]' syntax replacement." indx = clitable.CliTable () self.failUnlessEqual ('abc', re.sub ('(\\[\\[.+?\\]\\])', indx._Completion, 'abc')) self.failUnlessEqual ('a(b(c)?)?', re.sub ('(\\[\\[.+?\\]\\])', self._Completion, 'a[[bc]]')) self.failUnlessEqual ('a(b(c)?)? de(f)?', re.sub ('(\\[\\[.+?\\]\\])', indx._Completion, 'a[[bc]] de[[f]]')) Is there a bug in the code above?
Yes
591
[ "#NEWLINE#", "def testKeyValue(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "'Tests retrieving row value that corresponds to the key.'", "#NEWLINE#", "self", ".", "clitable", ".", "_TemplateNamesToFiles", "=", "(", "lambda", "t", ":", "[", "self", ".", "template_file", ...
true
176
[ "144", "164", "176", "142", "2", "9", "20", "26", "32", "50", "54", "67", "75", "79", "92", "100", "111", "115", "130", "149", "160" ]
1
VARIABLE_MISUSE
[ 142 ]
[ [ { "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": 25, "after_index": 35...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "google/textfsm/clitable_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 testKeyValue(self) : 'Tests retrieving row value that corresponds to the key.' self.clitable._TemplateNamesToFiles = (lambda t : [self.template_file]) self.clitable.ParseCmd (self.input_data, attributes = { 'Command' : 'sh ver', }) self.failUnlessEqual (self.clitable.KeyValue (), ['a']) self.clitable.row_index = 2 self.failUnlessEqual (self.clitable.KeyValue (), ['d']) self.clitable.row_index = 1 self.clitable.AddKeys (['Col3']) self.failUnlessEqual (self.clitable.KeyValue (), ['a', 'c']) self.clitable._keys = set () for (rownum, row) in enumerate (self.clitable, start = 1) : self.failUnlessEqual (row.table.KeyValue (), [('%s' % row)]) Is there a bug in the code above?
Yes
592
[ "#NEWLINE#", "def create(", "self", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "\"Create a resource.\\n\\n The default implementation is overridden so that the dictionary is\\n passed 'as is' without any wrapping.\\n \"", "#NEWLINE#", "kwargs", "=", "self", ...
true
30
[ "11", "17", "33", "2", "13", "21", "25", "30" ]
1
VARIABLE_MISUSE
[ 11, 17, 33 ]
[ [ { "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": 16,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack-infra/python-storyboardclient/storyboardclient/base.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 create(self, **kwargs) : "Create a resource. The default implementation is overridden so that the dictionary is passed 'as is' without any wrapping. " kwargs = self._filter_kwargs (kwargs) return self._post (self.build_url (** self), kwargs) Is there a bug in the code above?
Yes
593
[ "#NEWLINE#", "def _add_details(", "self", ",", "info", ")", ":", "#NEWLINE#", "#INDENT#", "for", "(", "field", ",", "value", ")", "in", "six", ".", "iteritems", "(", "info", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "not", "hasattr", "(", "self", ","...
true
32
[ "11", "45", "13", "32", "47", "2", "30", "43", "4", "20" ]
1
VARIABLE_MISUSE
[ 11, 45 ]
[ [ { "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": 9, "after_index": 19,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack-infra/python-storyboardclient/storyboardclient/base.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 _add_details(self, info) : for (field, value) in six.iteritems (info) : if (not hasattr (self, value)) : continue setattr (self, field, value) Is there a bug in the code above?
Yes
594
[ "#NEWLINE#", "def _append_config(", "mappings", ",", "analysis", ",", "doc_type", ",", "type_mappings", ",", "type_analysis", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Append config for the named type to pre-existing config.\\n\\n This function takes a mappings dict and an analysi...
true
75
[ "35", "54", "75", "90", "6", "24", "8", "26", "10", "40", "4", "50", "48", "103", "65", "73", "92", "2", "17", "84", "98", "37", "42", "67", "107", "80", "86" ]
1
VARIABLE_MISUSE
[ 48, 103 ]
[ [ { "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": 16, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "hypothesis/h/h/api/search/config.py", "license": "bsd-2-clause", "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 _append_config(mappings, analysis, doc_type, type_mappings, type_analysis) : ' Append config for the named type to pre-existing config. This function takes a mappings dict and an analysis dict which may contain prior data, and attempts to update them with mappings and analysis settings for the named type. ' mappings.update ({ doc_type : type_mappings, }) for (section, items) in type_analysis.items () : existing_items = analysis.setdefault (section, { }) for name in items : if (name in section) : fmt = "Duplicate definition of 'index.analysis.{}.{}'." msg = fmt.format (section, name) raise RuntimeError (msg) existing_items.update (items) Is there a bug in the code above?
Yes
595
[ "#NEWLINE#", "def xstr(", "s", ",", "encoding", "=", "'utf-8'", ")", ":", "#NEWLINE#", "#INDENT#", "' Convert argument to string type returned by __str__.\\n '", "#NEWLINE#", "return", "ustr", "(", "s", ",", "s", ")" ]
true
18
[ "4", "2", "16", "18" ]
1
VARIABLE_MISUSE
[ 4 ]
[ [ { "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": "nigelsmall/httpstream/httpstream/util.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 xstr(s, encoding = 'utf-8') : ' Convert argument to string type returned by __str__. ' return ustr (s, s) Is there a bug in the code above?
Yes
596
[ "#NEWLINE#", "def test_group_disabled(", ")", ":", "#NEWLINE#", "#INDENT#", "group", "=", "logbook", ".", "LoggerGroup", "(", ")", "#NEWLINE#", "logger1", "=", "logbook", ".", "Logger", "(", "'testlogger1'", ")", "#NEWLINE#", "logger2", "=", "logbook", ".", "Log...
true
36
[ "6", "32", "39", "46", "86", "134", "191", "248", "299", "14", "63", "103", "140", "157", "211", "265", "319", "59", "81", "99", "119", "127", "153", "173", "183", "207", "229", "240", "261", "283", "292", "315", "335", "343", "23", "36", "43",...
1
VARIABLE_MISUSE
[ 14, 63, 103, 140, 157, 211, 265, 319 ]
[ [ { "before_index": 5, "after_index": 11, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 19, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 22, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "getlogbook/logbook/tests/test_groups.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 test_group_disabled() : group = logbook.LoggerGroup () logger1 = logbook.Logger ('testlogger1') logger2 = logbook.Logger ('testlogger2') group.add_logger (logger2) group.add_logger (logger2) group.disable () with logbook.TestHandler () as handler : logger1.warn ('Warning 1') logger2.warn ('Warning 2') assert (not handler.has_warnings) group.enable () with logbook.TestHandler () as handler : logger1.warn ('Warning 1') logger2.warn ('Warning 2') assert handler.has_warning ('Warning 1') assert handler.has_warning ('Warning 2') group.disable () logger1.enable () with logbook.TestHandler () as handler : logger1.warn ('Warning 1') logger2.warn ('Warning 2') assert handler.has_warning ('Warning 1') assert (not handler.has_warning ('Warning 2')) group.disable (force = True) with logbook.TestHandler () as handler : logger1.warn ('Warning 1') logger2.warn ('Warning 2') assert (not handler.has_warning ('Warning 1')) assert (not handler.has_warning ('Warning 2')) group.enable () with logbook.TestHandler () as handler : logger1.warn ('Warning 1') logger2.warn ('Warning 2') assert (not handler.has_warning ('Warning 1')) assert handler.has_warning ('Warning 2') group.enable (force = True) with logbook.TestHandler () as handler : logger1.warn ('Warning 1') logger2.warn ('Warning 2') assert handler.has_warning ('Warning 1') assert handler.has_warning ('Warning 2') Is there a bug in the code above?
Yes
597
[ "#NEWLINE#", "def draw(", "self", ",", "equation", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "not", "self", ".", "parent", ".", "x_data", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "parent", ".", "x_data", "=", "equation", ".", "dataCache", ".", ...
true
89
[ "121", "193", "2", "12", "21", "43", "52", "74", "83", "112", "129", "138", "156", "165", "176", "182", "228", "234", "251", "279", "283", "294", "300", "306", "312", "341", "347", "353", "359", "366", "375", "384", "393", "148", "195", "89", "...
1
VARIABLE_MISUSE
[ 4, 27, 58, 200, 204, 214, 242, 248, 257, 261, 265, 272 ]
[ [ { "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": 40, "after_index": 42...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "zunzun/pyeq2/Examples/GUI/guifiles/CustomDialogs.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 draw(self, equation) : if (not self.parent.x_data) : self.parent.x_data = equation.dataCache.allDataCacheDictionary ['IndependentData'] [0] if (not self.parent.y_data) : self.parent.y_data = equation.dataCache.allDataCacheDictionary ['IndependentData'] [1] if (not self.parent.z_data) : self.parent.z_data = tempcache.dataCache.allDataCacheDictionary ['DependentData'] from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm if (not self.parent.Z) : xModel = numpy.linspace (min (self.parent.x_data), max (self.parent.x_data), 20) yModel = numpy.linspace (min (self.parent.y_data), max (self.parent.y_data), 20) (self.parent.X, self.parent.Y) = numpy.meshgrid (xModel, yModel) tempcache = equation.dataCache equation.dataCache = pyeq2.dataCache () equation.dataCache.allDataCacheDictionary ['IndependentData'] = numpy.array ([self.parent.X, self.parent.Y]) equation.dataCache.FindOrCreateAllDataCache (equation) self.parent.Z = equation.CalculateModelPredictions (equation.solvedCoefficients, equation.dataCache.allDataCacheDictionary) equation.dataCache = tempcache self.axes = self.figure.gca (projection = '3d') self.axes.plot_surface (self.parent.X, self.parent.Y, self.parent.Z, rstride = 1, cstride = 1, cmap = cm.coolwarm, linewidth = 1, antialiased = True) self.axes.scatter (self.parent.x_data, self.parent.y_data, self.parent.z_data) self.axes.set_title ('Surface Plot (click-drag with mouse)') self.axes.set_xlabel ('X Data') self.axes.set_ylabel ('Y Data') self.axes.set_zlabel ('Z Data') Is there a bug in the code above?
Yes
598
[ "#NEWLINE#", "def generateHeaderInstance(", "self", ",", "serializer", ")", ":", "#NEWLINE#", "#INDENT#", "assert", "isinstance", "(", "serializer", ",", "programSerializer", ".", "ProgramSerializer", ")", "#NEWLINE#", "serializer", ".", "emitIndent", "(", ")", "#NEWL...
true
31
[ "2", "35", "4", "12", "19", "25", "31" ]
1
VARIABLE_MISUSE
[ 2, 35 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 22...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "iovisor/bcc/src/cc/frontends/p4/compiler/ebpfProgram.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 generateHeaderInstance(self, serializer) : assert isinstance (serializer, programSerializer.ProgramSerializer) serializer.emitIndent () serializer.appendFormat ('struct {0} {1}', serializer.headersStructTypeName, self.headerStructName) Is there a bug in the code above?
Yes
599
[ "#NEWLINE#", "def getConditional(", "self", ",", "name", ")", ":", "#NEWLINE#", "#INDENT#", "assert", "isinstance", "(", "name", ",", "str", ")", "#NEWLINE#", "for", "c", "in", "self", ".", "conditionals", ":", "#NEWLINE#", "#INDENT#", "if", "(", "c", ".", ...
true
38
[ "4", "12", "30", "32", "38", "49", "2", "20", "18", "28" ]
1
VARIABLE_MISUSE
[ 18, 28 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 18...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "iovisor/bcc/src/cc/frontends/p4/compiler/ebpfProgram.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 getConditional(self, name) : assert isinstance (name, str) for c in self.conditionals : if (c.name == name) : return name raise CompilationException (True, 'Could not locate conditional named {0}', name) Is there a bug in the code above?
Yes