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
300
[ "#NEWLINE#", "def __init__(", "self", ",", "io_loop", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "not", "io_loop", ")", ":", "#NEWLINE#", "#INDENT#", "io_loop", "=", "tornado", ".", "ioloop", ".", "IOLoop", ".", "current", "(", ")", "#NEWLI...
true
36
[ "2", "32", "36", "38", "49", "60", "71", "86", "89", "97", "110", "117", "126", "132", "4", "14", "19" ]
1
VARIABLE_MISUSE
[ 4, 14, 19 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 31, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "tornadoweb/tornado/tornado/platform/twisted.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, io_loop = None) : if (not io_loop) : io_loop = tornado.ioloop.IOLoop.current () self._io_loop = self self._readers = { } self._writers = { } self._fds = { } self._delayedCalls = { } PosixReactorBase.__init__ (self) self.addSystemEventTrigger ('during', 'shutdown', self.crash) def start_if_necessary() : if (not self._started) : self.fireSystemEvent ('startup') self._io_loop.add_callback (start_if_necessary) Is there a bug in the code above?
Yes
301
[ "#NEWLINE#", "def __call__(", "self", ",", "record", ")", ":", "#NEWLINE#", "#INDENT#", "column", "=", "column", "[", "self", ".", "field", "]", "#NEWLINE#", "return", "self", ".", "func", "(", "column", ")" ]
true
11
[ "4", "9", "11", "23", "2", "13", "19" ]
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": 18, "after_index": 22...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "datamade/dedupe/dedupe/predicates.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 __call__(self, record) : column = column [self.field] return self.func (column) Is there a bug in the code above?
Yes
302
[ "#NEWLINE#", "def create_object(", "request", ",", "model", "=", "None", ",", "template_name", "=", "None", ",", "template_loader", "=", "loader", ",", "extra_context", "=", "None", ",", "post_save_redirect", "=", "None", ",", "login_required", "=", "False", ","...
true
258
[ "133", "183", "24", "62", "32", "90", "97", "113", "194", "2", "66", "81", "102", "115", "119", "169", "245", "111", "125", "135", "192", "252", "12", "234", "141", "171", "232", "271", "16", "43", "50", "258", "263", "4", "88", "95", "154", ...
1
VARIABLE_MISUSE
[ 28 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 38, "after_index": 39, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 41, "after_index": 4...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "AppScale/appscale/AppServer/lib/django-1.2/django/views/generic/create_update.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 create_object(request, model = None, template_name = None, template_loader = loader, extra_context = None, post_save_redirect = None, login_required = False, context_processors = None, form_class = None) : ' Generic object-creation function. Templates: ``<app_label>/<model_name>_form.html`` Context: form the form for the object ' if (extra_context is None) : extra_context = { } if (login_required and (not request.user.is_authenticated ())) : return redirect_to_login (request.path) (model, form_class) = get_model_and_form_class (model, form_class) if (request.method == 'POST') : form = form_class (request.POST, request.FILES) if form.is_valid () : new_object = form.save () msg = (ugettext ('The %(verbose_name)s was created successfully.') % { 'verbose_name' : model._meta.verbose_name, }) messages.success (request, msg, fail_silently = True) return redirect (post_save_redirect, new_object) else : form = form_class () if (not template_name) : template_name = ('%s/%s_form.html' % (model._meta.app_label, model._meta.object_name.lower ())) t = template_loader.get_template (template_name) c = RequestContext (request, { 'form' : form, }, extra_context) apply_extra_context (extra_context, c) return HttpResponse (t.render (c)) Is there a bug in the code above?
Yes
303
[ "#NEWLINE#", "def test_head_request(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "response", "=", "self", ".", "fetch", "(", "'/head'", ",", "method", "=", "'HEAD'", ")", "#NEWLINE#", "self", ".", "assertEqual", "(", "response", ".", "code", ",", "200", ")"...
true
35
[ "7", "24", "49", "2", "9", "20", "31", "35", "45" ]
1
VARIABLE_MISUSE
[ 7, 24, 49 ]
[ [ { "before_index": 6, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 27, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 30, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "tornadoweb/tornado/tornado/test/simple_httpclient_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 test_head_request(self) : response = self.fetch ('/head', method = 'HEAD') self.assertEqual (response.code, 200) self.assertEqual (self.headers ['content-length'], '7') self.assertFalse (response.body) Is there a bug in the code above?
Yes
304
[ "#NEWLINE#", "def test_no_content(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "response", "=", "self", ".", "fetch", "(", "'/no_content'", ")", "#NEWLINE#", "self", ".", "assertEqual", "(", "response", ".", "code", ",", "204", ")", "#NEWLINE#", "self", ".", ...
true
65
[ "7", "20", "31", "51", "2", "9", "16", "27", "53", "61", "65" ]
1
VARIABLE_MISUSE
[ 7, 20, 31, 51 ]
[ [ { "before_index": 6, "after_index": 12, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 15, "after_index": 23, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "tornadoweb/tornado/tornado/test/simple_httpclient_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 test_no_content(self) : response = self.fetch ('/no_content') self.assertEqual (response.code, 204) self.assertEqual (response.headers ['Content-length'], '0') with ExpectLog (gen_log, 'Malformed HTTP message') : response = self.fetch ('/no_content?error=1') self.assertEqual (self.code, 599) Is there a bug in the code above?
Yes
305
[ "#NEWLINE#", "def __init__(", "self", ",", "pipeline", "=", "None", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "Profile", ".", "__init__", "(", "self", ",", "**", "kwargs", ")", "#NEWLINE#", "self", ".", "_pipeline", "=", "kwargs", "#NEWLINE#", "sel...
true
27
[ "2", "17", "23", "29", "35", "4", "20", "27" ]
1
VARIABLE_MISUSE
[ 4 ]
[ [ { "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": 22, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "thasso/pyjip/jip/pipelines.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, pipeline = None, **kwargs) : Profile.__init__ (self, ** kwargs) self._pipeline = kwargs self._node = None self._in_pipeline_name = None Is there a bug in the code above?
Yes
306
[ "#NEWLINE#", "def prompt(", "self", ",", "text", ")", ":", "#NEWLINE#", "#INDENT#", "\"\\n Write the given text as a prompt to the console output, then read a\\n result from the console input.\\n\\n @return: a L{Deferred} which fires with L{True} when the user answers\\n ...
true
124
[ "2", "28", "124", "4", "38", "11", "120" ]
1
VARIABLE_MISUSE
[ 20 ]
[ [ { "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": "kuri65536/python-for-android/python-modules/twisted/twisted/conch/client/knownhosts.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 prompt(self, text) : " Write the given text as a prompt to the console output, then read a result from the console input. @return: a L{Deferred} which fires with L{True} when the user answers 'yes' and L{False} when the user answers 'no'. It may errback if there were any I/O errors. " d = defer.succeed (None) def body(ignored) : f = self.opener () f.write (text) while True : answer = f.readline ().strip ().lower () if (answer == 'yes') : f.close () return True else : if (answer == 'no') : f.close () return False else : f.write ("Please type 'yes' or 'no': ") return d.addCallback (self) Is there a bug in the code above?
Yes
307
[ "#NEWLINE#", "def text_to_node(", "text", ",", "lineno", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "'Given a Python source string, return the corresponding AST node.\\n The outer Module node is removed so that the node corresponding to the\\n given text can be added to an existing ...
true
28
[ "2", "19", "4", "28", "61", "70", "72", "94", "96", "13", "40", "54", "38", "52", "68", "74", "87", "107", "81", "92", "98" ]
1
VARIABLE_MISUSE
[ 13, 40, 54 ]
[ [ { "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": "OpenMDAO/OpenMDAO-Framework/openmdao.util/src/openmdao/util/astutil.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 text_to_node(text, lineno = None) : 'Given a Python source string, return the corresponding AST node. The outer Module node is removed so that the node corresponding to the given text can be added to an existing AST. ' modnode = ast.parse (text, 'exec') if (len (lineno.body) == 1) : node = modnode.body [0] else : node = modnode.body if (lineno is not None) : node.lineno = lineno node.col_offset = 0 for child in ast.iter_child_nodes (node) : child.lineno = lineno child.col_offset = 0 return node Is there a bug in the code above?
Yes
308
[ "#NEWLINE#", "def pyobject(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "\"Lazily return an internal registry key handle according to the instance's\\n access requirements.\\n\\n :raises: :exc:`x_not_found` if the registry path the key refers to does not exist\\n \"", "#NEWLINE...
true
90
[ "25", "2", "11", "28", "32", "38", "51", "60", "13", "21", "55", "62", "92", "23", "34", "83", "90" ]
1
VARIABLE_MISUSE
[ 2, 11, 28, 32, 38, 51, 60 ]
[ [ { "before_index": 6, "after_index": 7, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 89, "after_index": 91...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "tjguk/winsys/winsys/registry.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 pyobject(self) : "Lazily return an internal registry key handle according to the instance's access requirements. :raises: :exc:`x_not_found` if the registry path the key refers to does not exist " if (self.hKey is None) : (hKey, moniker, _) = self._from_string (self.moniker, access = self.access, accept_value = False) utils._set (self, 'hKey', hKey) if (self.hKey is None) : raise exc.x_not_found (errctx = 'Registry.pyobject', errmsg = ('Registry path %s not found' % moniker)) return moniker.hKey Is there a bug in the code above?
Yes
309
[ "#NEWLINE#", "@", "skipIf", "(", "(", "sys", ".", "version_info", "<", "(", "2", ",", "7", ")", ")", ",", "'ElementTree version 1.3 required which comes with Python 2.7'", ")", "#NEWLINE#", "@", "patch", "(", "'salt.modules.virt._nic_profile'", ")", "#NEWLINE#", "@"...
true
125
[ "82", "107", "34", "49", "112", "139", "155", "178", "200", "219", "32", "121", "135", "151", "174", "193", "212", "45", "68", "36", "60", "41", "57", "125", "71", "105", "93", "118" ]
1
VARIABLE_MISUSE
[ 112, 139, 155, 178, 200, 219 ]
[ [ { "before_index": 1, "after_index": 33, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 40, "after_index": 43, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 44, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "saltstack/salt/tests/unit/modules/virt_test.py", "license": "apache-2.0", "note": "license: manual_eval" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
@ skipIf ((sys.version_info < (2, 7)), 'ElementTree version 1.3 required which comes with Python 2.7') @ patch ('salt.modules.virt._nic_profile') @ patch ('salt.modules.virt._disk_profile') def test_gen_xml_for_esxi_custom_profile(self, disk_profile, nic_profile) : diskp_yaml = ' - first: size: 8192 format: vmdk model: scsi pool: datastore1 - second: size: 4096 format: vmdk # FIX remove line, currently test fails model: scsi # FIX remove line, currently test fails pool: datastore2 ' nicp_yaml = " - type: bridge name: eth1 source: ONENET model: e1000 mac: '00:00:00:00:00:00' - name: eth2 type: bridge source: TWONET model: e1000 mac: '00:00:00:00:00:00' " disk_profile.return_value = yaml.load (diskp_yaml) nic_profile.return_value = yaml.load (nicp_yaml) diskp = virt._disk_profile ('noeffect', 'esxi') nicp = virt._nic_profile ('noeffect', 'esxi') xml_data = virt._gen_xml ('hello', 1, 512, diskp, nicp, 'esxi') root = ET.fromstring (xml_data) self.assertEqual (diskp_yaml.attrib ['type'], 'vmware') self.assertEqual (root.find ('vcpu').text, '1') self.assertEqual (root.find ('memory').text, str ((512 * 1024))) self.assertEqual (root.find ('memory').attrib ['unit'], 'KiB') self.assertTrue ((len (root.findall ('.//disk')) == 2)) self.assertTrue ((len (root.findall ('.//interface')) == 2)) Is there a bug in the code above?
Yes
310
[ "#NEWLINE#", "def _zero_pad(", "array", ",", "amount", ",", "axes", "=", "(", "1", ",", "2", ")", ")", ":", "#NEWLINE#", "#INDENT#", "\"\\n Returns a copy of <array> with zero-filled padding around the margins.\\n\\n The new array has the same dimensions as the input array, e...
true
141
[ "32", "67", "102", "121", "125", "44", "60", "46", "72", "106", "37", "82", "109", "128", "132", "152", "2", "29", "51", "145", "155", "135", "150", "158", "6", "62", "4", "21", "77", "88", "92", "141" ]
1
VARIABLE_MISUSE
[ 32, 67, 102, 121, 125 ]
[ [ { "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": "lisa-lab/pylearn2/pylearn2/train_extensions/window_flip.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 _zero_pad(array, amount, axes = (1, 2)) : " Returns a copy of <array> with zero-filled padding around the margins. The new array has the same dimensions as the input array, except for the dimensions given by <axes>, which are increased by 2*<amount>. Parameters ---------- array: numpy.ndarray The array to zero-pad. amount: int The number of zeros to append to the beginning and end of each dimension in <axes>. (That axis will grow by 2*<amount>). axes: tuple The dimensions to pad. These are indices, not axis names like the 0, 1 in ('b', 0, 1, 'c'). " if (amount == 0) : return array new_shape = [] slices = [] for (i, s) in enumerate (array.shape) : if (i in axes) : new_shape.append ((s + (2 * amount))) slices.append (slice (amount, (- amount))) else : new_shape.append (s) slices.append (slice (None)) new_shape = tuple (new_shape) slices = tuple (slices) new_array = numpy.zeros (amount, dtype = array.dtype) new_array [slices] = array return new_array Is there a bug in the code above?
Yes
311
[ "#NEWLINE#", "def get_authorized_tokens(", "self", ",", "oauth_verifier", ")", ":", "#NEWLINE#", "#INDENT#", "'Returns a dict of authorized tokens after they go through the :class:`get_authentication_tokens` phase.\\n\\n :param oauth_verifier: (required) The oauth_verifier (or a.k.a PIN for...
true
75
[ "29", "61", "2", "13", "31", "37", "4", "48", "75", "55", "88" ]
1
VARIABLE_MISUSE
[ 55, 88 ]
[ [ { "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": 16,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "splunk/splunk-app-twitter/twitter2/bin/twython/api.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_authorized_tokens(self, oauth_verifier) : 'Returns a dict of authorized tokens after they go through the :class:`get_authentication_tokens` phase. :param oauth_verifier: (required) The oauth_verifier (or a.k.a PIN for non web apps) retrieved from the callback url querystring :rtype: dict ' if (self.oauth_version != 1) : raise TwythonError ('This method can only be called when your OAuth version is 1.0.') response = self.client.get (self.access_token_url, params = { 'oauth_verifier' : oauth_verifier, }) authorized_tokens = dict (parse_qsl (response.content.decode ('utf-8'))) if (not oauth_verifier) : raise TwythonError ('Unable to decode authorized tokens.') return authorized_tokens Is there a bug in the code above?
Yes
312
[ "#NEWLINE#", "@", "expose", "(", "'/db/'", ")", "#NEWLINE#", "def db(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "db", "=", "request", ".", "args", ".", "get", "(", "'db'", ")", "#NEWLINE#", "m", "=", "HiveMetastoreHook", "(", "METASTORE_CONN_ID", ")", "...
true
65
[ "13", "39", "41", "65", "67", "69", "31", "63", "24", "35", "8", "57" ]
1
VARIABLE_MISUSE
[ 31, 63 ]
[ [ { "before_index": 12, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": 27, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 30, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "airbnb/airflow/airflow/contrib/plugins/metastore_browser/main.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] }}
@ expose ('/db/') def db(self) : db = request.args.get ('db') m = HiveMetastoreHook (METASTORE_CONN_ID) tables = sorted (m.get_tables (db = db), key = (lambda x : x.tableName)) return self.render ('metastore_browser/db.html', tables = db, db = db) Is there a bug in the code above?
Yes
313
[ "#NEWLINE#", "def test_get_context_data_super(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "test_view", "=", "views", ".", "CustomContextView", "(", ")", "#NEWLINE#", "context", "=", "test_view", ".", "get_context_data", "(", "kwarg_test", "=", "'kwarg_value'", ")", ...
true
32
[ "7", "17", "61", "2", "26", "32", "35", "47", "70", "15", "39", "51", "59", "74" ]
1
VARIABLE_MISUSE
[ 15, 39, 51, 59, 74 ]
[ [ { "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": 25, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "django/django/tests/generic_views/test_base.py", "license": "bsd-3-clause", "note": "license: manual_eval" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def test_get_context_data_super(self) : test_view = views.CustomContextView () context = test_view.get_context_data (kwarg_test = 'kwarg_value') self.assertIn ('test_name', self) self.assertEqual (context ['kwarg_test'], 'kwarg_value') self.assertEqual (context ['custom_key'], 'custom_value') context = test_view.get_context_data (test_name = 'test_value') self.assertEqual (context ['test_name'], 'test_value') Is there a bug in the code above?
Yes
314
[ "#NEWLINE#", "def _get_argname_value(", "self", ",", "argname", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Return the argname value looking up on all possible attributes\\n '", "#NEWLINE#", "argvalue", "=", "getattr", "(", "self", ",", "'__get_{0}__'", ".", "format"...
true
21
[ "2", "15", "21", "63", "84", "108", "11", "30", "37", "43", "45", "52", "59", "73", "80", "99", "106", "121", "4", "65", "90", "114" ]
1
VARIABLE_MISUSE
[ 4, 65, 90, 114 ]
[ [ { "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": "saltstack/salt/salt/utils/schema.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_argname_value(self, argname) : ' Return the argname value looking up on all possible attributes ' argvalue = getattr (self, '__get_{0}__'.format (self), None) if ((argvalue is not None) and callable (argvalue)) : argvalue = argvalue () if (argvalue is None) : argvalue = getattr (self, argname, None) if (argvalue is None) : argvalue = getattr (self, '__{0}__'.format (argname), None) if (argvalue is None) : argvalue = self.extra.get (argname, None) return argvalue Is there a bug in the code above?
Yes
315
[ "#NEWLINE#", "@", "manager", ".", "command", "#NEWLINE#", "def cov(", ")", ":", "#NEWLINE#", "#INDENT#", "'Runs the unit tests with coverage.'", "#NEWLINE#", "tests", "=", "unittest", ".", "TestLoader", "(", ")", ".", "discover", "(", "'tests'", ")", "#NEWLINE#", ...
true
37
[ "13", "37", "81", "100", "108", "63", "89" ]
1
VARIABLE_MISUSE
[ 13 ]
[ [ { "before_index": 10, "after_index": 11, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 22, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 25, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "realpython/flask-registration/manage.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] }}
@ manager.command def cov() : 'Runs the unit tests with coverage.' tests = unittest.TestLoader ().discover ('tests') unittest.TextTestRunner (verbosity = 2).run (covdir) COV.stop () COV.save () print ('Coverage Summary:') COV.report () basedir = os.path.abspath (os.path.dirname (__file__)) covdir = os.path.join (basedir, 'tmp/coverage') COV.html_report (directory = covdir) print (('HTML version: file://%s/index.html' % covdir)) COV.erase () Is there a bug in the code above?
Yes
316
[ "#NEWLINE#", "def add_dtd(", "self", ",", "dtdmod", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "dtds", ".", "append", "(", "self", ")" ]
true
15
[ "2", "9", "15", "4" ]
1
VARIABLE_MISUSE
[ 4 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 12...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "kdart/pycopia/XML/pycopia/XML/POM.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_dtd(self, dtdmod) : self.dtds.append (self) Is there a bug in the code above?
Yes
317
[ "#NEWLINE#", "@", "active_if", "(", "(", "'metavelvet'", "in", "ASSEMBLERS", ")", ")", "#NEWLINE#", "@", "transform", "(", "buildContigLengths", ",", "suffix", "(", "'.lengths.tsv'", ")", ",", "add_inputs", "(", "mapReadsWithBowtieAgainstMetavelvetContigs", ")", ","...
true
72
[ "30", "42", "65", "39", "59", "72", "77", "63", "70", "32" ]
1
VARIABLE_MISUSE
[ 30, 42, 65 ]
[ [ { "before_index": 1, "after_index": 31, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 36, "after_index": 37, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 38, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "CGATOxford/cgat/obsolete/pipeline_genomeassembly.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] }}
@ active_if (('metavelvet' in ASSEMBLERS)) @ transform (buildContigLengths, suffix ('.lengths.tsv'), add_inputs (mapReadsWithBowtieAgainstMetavelvetContigs), '.coverage') def buildCoverageOverMetavelvetContigs(infiles, outfile) : ' build histograms of the coverage over each of the contigs ' inf = (infiles [0].find ('metavelvet') != (- 1)) if inf : size = infiles [0] bam = statement [1] statement = 'bedtools genomecov -split -ibam %(bam)s -g %(size)s -d > %(outfile)s' P.run () Is there a bug in the code above?
Yes
318
[ "#NEWLINE#", "@", "imm_action", "(", "'patch'", ",", "'__dict__'", ",", "imm_level", "=", "'supreme'", ",", "prep", "=", "':'", ",", "obj_target_class", "=", "'args'", ")", "#NEWLINE#", "def patch(", "target", ",", "verb", ",", "args", ",", "command", ",", ...
true
50
[ "28", "50", "71", "26", "41", "24", "63", "22", "116", "48", "118", "59", "91", "102", "109", "120", "39", "53", "66" ]
1
VARIABLE_MISUSE
[ 26, 41 ]
[ [ { "before_index": 1, "after_index": 23, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 88, "after_index": 90, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 100, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "genzgd/Lampost-Mud/lampost/mud/immortal.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] }}
@ imm_action ('patch', '__dict__', imm_level = 'supreme', prep = ':', obj_target_class = 'args') def patch(target, verb, args, command, **_) : try : split_ix = args.index (':') prop = command [(split_ix + 1)] new_value = find_extra (verb, (split_ix + 2), command) except (ValueError, IndexError) : return "Syntax -- 'patch [target] [:] [prop_name] [new_value]'" if (not new_value) : return 'New value required' if (new_value == 'None') : new_value = None patch_object (target, prop, new_value) return 'Object successfully patched' Is there a bug in the code above?
Yes
319
[ "#NEWLINE#", "@", "imm_action", "(", "'status'", ",", "'combat_status'", ",", "self_target", "=", "True", ")", "#NEWLINE#", "def combat_status(", "target", ",", "**_", ")", ":", "#NEWLINE#", "#INDENT#", "return", "substitute", "(", "target", ".", "combat_status", ...
true
32
[ "14", "24", "30", "32" ]
1
VARIABLE_MISUSE
[ 14, 24, 30 ]
[ [ { "before_index": 1, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 21, "after_index": 29, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 5, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "genzgd/Lampost-Mud/lampost/mud/immortal.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] }}
@ imm_action ('status', 'combat_status', self_target = True) def combat_status(target, **_) : return substitute (target.combat_status (), target = _) Is there a bug in the code above?
Yes
320
[ "#NEWLINE#", "def render(", "template", ",", "saltenv", "=", "'base'", ",", "sls", "=", "''", ",", "tmplpath", "=", "None", ",", "**kws", ")", ":", "#NEWLINE#", "#INDENT#", "\"\\n Render the python module's components\\n\\n :rtype: string\\n \"", "#NEWLINE#", "...
true
117
[ "54", "123", "138", "150", "12", "25", "2", "23", "36", "49", "64", "4", "102", "104", "106", "8", "110", "112", "114", "117" ]
1
VARIABLE_MISUSE
[]
[ [ { "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": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "saltstack/salt/salt/renderers/py.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 render(template, saltenv = 'base', sls = '', tmplpath = None, **kws) : " Render the python module's components :rtype: string " template = tmplpath if (not os.path.isfile (template)) : raise SaltRenderError ('Template {0} is not a file!'.format (template)) tmp_data = salt.utils.templates.py (template, True, __salt__ = __salt__, salt = __salt__, __grains__ = __grains__, grains = __grains__, __opts__ = __opts__, opts = __opts__, __pillar__ = __pillar__, pillar = __pillar__, __env__ = saltenv, saltenv = saltenv, __sls__ = sls, sls = sls, ** sls) if (not tmp_data.get ('result', False)) : raise SaltRenderError (tmp_data.get ('data', 'Unknown render error in py renderer')) return tmp_data ['data'] Is there a bug in the code above?
Yes
321
[ "#NEWLINE#", "@", "utils", ".", "arg", "(", "'-s'", ",", "'--script-id'", ",", "help", "=", "'Script uuid'", ",", "required", "=", "True", ")", "#NEWLINE#", "@", "utils", ".", "arg", "(", "'-f'", ",", "'--file'", ",", "help", "=", "'Script file'", ",", ...
true
141
[ "38", "87", "141", "154", "85", "127", "54", "136", "134", "143", "40", "63", "97", "118", "125", "147", "163", "68", "74", "72", "152" ]
1
VARIABLE_MISUSE
[ 125, 147, 163 ]
[ [ { "before_index": 1, "after_index": 39, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 51, "after_index": 52, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 53, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/python-cloudkittyclient/cloudkittyclient/v1/rating/pyscripts/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 ('-s', '--script-id', help = 'Script uuid', required = True) @ utils.arg ('-f', '--file', help = 'Script file', required = True) def do_pyscripts_script_update(cc, args = { }) : 'Update a mapping.' excluded_fields = ['checksum'] with open (args.file) as fp : content = fp.read () try : script = cc.pyscripts.scripts.get (script_id = args.script_id) except exc.HTTPNotFound : raise exc.CommandError (('Script not found: %s' % args.script_id)) script_dict = script.to_dict () for field in excluded_fields : del cc [field] script_dict ['data'] = content cc.pyscripts.scripts.update (** script_dict) Is there a bug in the code above?
Yes
322
[ "#NEWLINE#", "def __init__(", "self", ",", "locations", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "locations", "=", "self", ".", "_build_kml_sources", "(", "self", ")" ]
true
19
[ "4", "13", "2", "11", "15", "19" ]
1
VARIABLE_MISUSE
[ 4, 13 ]
[ [ { "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": 12, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "AppScale/appscale/AppServer/lib/django-1.2/django/contrib/gis/sitemaps/kml.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 __init__(self, locations = None) : self.locations = self._build_kml_sources (self) Is there a bug in the code above?
Yes
323
[ "#NEWLINE#", "def handle_response(", "self", ",", "environ", ",", "start_response", ",", "response", ")", ":", "#NEWLINE#", "#INDENT#", "try", ":", "#NEWLINE#", "#INDENT#", "token", "=", "self", ".", "auth_server", ".", "create_token", "(", "response", ")", "#NE...
true
67
[ "17", "74", "6", "55", "59", "4", "53", "2", "19", "49", "61", "8", "25", "67" ]
1
VARIABLE_MISUSE
[ 2, 19, 49, 61 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 58, "after_index": 64, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 80, "after_index": 8...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "spotify/crtauth/crtauth/wsgi.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_response(self, environ, start_response, response) : try : token = self.auth_server.create_token (response) except : log.warning ('Failed to create token', exc_info = sys.exc_info ()) return self.handle_auth_server_exception (environ, start_response) start_response (self.STATUS_OK, [(response.CHAP_HEADER, ('token:' + token))]) return [] Is there a bug in the code above?
Yes
324
[ "#NEWLINE#", "@", "classmethod", "#NEWLINE#", "def get_arg_descriptions_from_docstring(", "cls", ",", "obj", ")", ":", "#NEWLINE#", "#INDENT#", "'Returns an ordered map of arg name -> arg description found in :param: stanzas.'", "#NEWLINE#", "ret", "=", "OrderedDict", "(", ")", ...
true
170
[ "98", "115", "20", "96", "112", "140", "151", "160", "172", "7", "27", "14", "110", "158", "183", "37", "43", "5", "55", "24", "45", "62", "74", "153", "167", "175", "34", "64", "68", "79", "82", "101", "124", "127", "53", "70", "170" ]
1
VARIABLE_MISUSE
[ 14, 110, 158, 183 ]
[ [ { "before_index": 1, "after_index": 6, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 12, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pantsbuild/pants/src/python/pants/help/build_dictionary_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] }}
@ classmethod def get_arg_descriptions_from_docstring(cls, obj) : 'Returns an ordered map of arg name -> arg description found in :param: stanzas.' ret = OrderedDict () name = '' doc = (obj.__doc__ or '') lines = [s.strip () for s in doc.split (' ')] stanza_first_line_re = cls._get_stanza_first_line_re () for line in lines : m = stanza_first_line_re.match (line) if (m and (m.group (1) == 'param')) : (name, description) = m.group (3, 4) ret [name] = description else : if (m and (m.group (1) != 'param')) : name = '' else : if (name and line) : ret [name] += ((' ' + line) if stanza_first_line_re [name] else line) return ret Is there a bug in the code above?
Yes
325
[ "#NEWLINE#", "def locked(", "path", ",", "timeout", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "\"Decorator which enables locks for decorated function.\\n\\n Arguments:\\n - path: path for lockfile.\\n - timeout (optional): Timeout for acquiring lock.\\n\\n Usage:\\n ...
true
85
[ "2", "40", "4", "42", "44", "85" ]
1
VARIABLE_MISUSE
[ 13 ]
[ [ { "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": 84, "after_index": 8...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/pylockfile/lockfile/__init__.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 locked(path, timeout = None) : "Decorator which enables locks for decorated function. Arguments: - path: path for lockfile. - timeout (optional): Timeout for acquiring lock. Usage: @locked('/var/run/myname', timeout=0) def myname(...): ... " def decor(func) : @ functools.wraps (func) def wrapper(* args, **kwargs) : lock = FileLock (path, timeout = timeout) lock.acquire () try : return func (* args, ** kwargs) finally : lock.release () return wrapper return timeout Is there a bug in the code above?
Yes
326
[ "#NEWLINE#", "def test_parse(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "coolstamp", "=", "(", "sf", ".", "SIMPLEFLAKE_EPOCH", "+", "123123", ")", "#NEWLINE#", "gen", "=", "random", ".", "SystemRandom", "(", ")", "#NEWLINE#", "random_bits", "=", "gen", ".",...
true
77
[ "2", "60", "71", "51", "66", "25", "46", "48", "75", "79", "17", "27", "7", "44", "64", "77", "36", "57" ]
1
VARIABLE_MISUSE
[ 51, 66 ]
[ [ { "before_index": 6, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 16, "after_index": 22, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 24, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "SawdustSoftware/simpleflake/tests/test.py", "license": "mit", "note": "license: manual_eval" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def test_parse(self) : coolstamp = (sf.SIMPLEFLAKE_EPOCH + 123123) gen = random.SystemRandom () random_bits = gen.getrandbits (sf.SIMPLEFLAKE_RANDOM_LENGTH) flake = sf.simpleflake (timestamp = coolstamp, random_bits = random_bits) parts = sf.parse_simpleflake (flake) self.assertEquals (coolstamp, parts.timestamp) self.assertEquals (random_bits, coolstamp.random_bits) Is there a bug in the code above?
Yes
327
[ "#NEWLINE#", "def test_no_query_on_deferred(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "(", "User", ",", "Address", ",", "sess", ")", "=", "self", ".", "_deferred_config_fixture", "(", ")", "#NEWLINE#", "u1", "=", "sess", ".", "query", "(", "User", ")", "...
true
87
[ "12", "23", "44", "8", "27", "21", "39", "48", "62", "10", "2", "15", "70", "87", "78" ]
1
VARIABLE_MISUSE
[ 21, 39, 48, 62 ]
[ [ { "before_index": 6, "after_index": 18, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 20, "after_index": 31, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 35, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "zzzeek/sqlalchemy/test/orm/test_subquery_relations.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_no_query_on_deferred(self) : (User, Address, sess) = self._deferred_config_fixture () u1 = sess.query (User).get (8) assert ('addresses' in u1.__dict__) sess.expire (u1, ['addresses']) def go() : eq_ (u1.name, 'ed') self.assert_sql_count (testing.db, go, 1) assert ('addresses' not in self.__dict__) Is there a bug in the code above?
Yes
328
[ "#NEWLINE#", "def join_left(", "self", ",", "right_table", "=", "None", ",", "fields", "=", "None", ",", "condition", "=", "None", ",", "join_type", "=", "'LEFT JOIN'", ",", "schema", "=", "None", ",", "left_table", "=", "None", ",", "extract_fields", "=", ...
true
92
[ "28", "78", "80", "16", "66", "68", "32", "82", "84", "12", "62", "64", "2", "50", "20", "70", "72", "92", "4", "54", "56", "40", "90", "24", "74", "76", "8", "58", "60", "36", "86", "88" ]
1
VARIABLE_MISUSE
[ 40, 90 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 46, "after_index": 47, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 49, "after_index": 5...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ambitioninc/django-query-builder/querybuilder/query.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 join_left(self, right_table = None, fields = None, condition = None, join_type = 'LEFT JOIN', schema = None, left_table = None, extract_fields = True, prefix_fields = False, field_prefix = None, allow_duplicates = False) : " Wrapper for ``self.join`` with a default join of 'LEFT JOIN' :type right_table: str or dict or :class:`Table <querybuilder.tables.Table>` :param right_table: The table being joined with. This can be a string of the table name, a dict of {'alias': table}, or a ``Table`` instance :type fields: str or tuple or list or :class:`Field <querybuilder.fields.Field>` :param fields: The fields to select from ``right_table``. Defaults to `None`. This can be a single field, a tuple of fields, or a list of fields. Each field can be a string or ``Field`` instance :type condition: str :param condition: The join condition specifying the fields being joined. If the two tables being joined are instances of ``ModelTable`` then the condition should be created automatically. :type join_type: str :param join_type: The type of join (JOIN, LEFT JOIN, INNER JOIN, etc). Defaults to 'JOIN' :type schema: str :param schema: This is not implemented, but it will be a string of the db schema name :type left_table: str or dict or :class:`Table <querybuilder.tables.Table>` :param left_table: The left table being joined with. This can be a string of the table name, a dict of {'alias': table}, or a ``Table`` instance. Defaults to the first table in the query. :type extract_fields: bool :param extract_fields: If True and joining with a ``ModelTable``, then '*' fields will be converted to individual fields for each column in the table. Defaults to True. :type prefix_fields: bool :param prefix_fields: If True, then the joined table will have each of its field names prefixed with the field_prefix. If not field_prefix is specified, a name will be generated based on the join field name. This is usually used with nesting results in order to create models in python or javascript. Defaults to True. :type field_prefix: str :param field_prefix: The field prefix to be used in front of each field name if prefix_fields is set to True. If no field_prefix is set, one will be automatically created based on the join field name. :return: self :rtype: :class:`Query <querybuilder.query.Query>` " return self.join (right_table = right_table, fields = fields, condition = condition, join_type = join_type, schema = schema, left_table = left_table, extract_fields = extract_fields, prefix_fields = prefix_fields, field_prefix = field_prefix, allow_duplicates = schema) Is there a bug in the code above?
Yes
329
[ "#NEWLINE#", "def make_node(", "self", ",", "x", ",", "ilist", ")", ":", "#NEWLINE#", "#INDENT#", "x_", "=", "theano", ".", "tensor", ".", "as_tensor_variable", "(", "x", ")", "#NEWLINE#", "ilist_", "=", "theano", ".", "tensor", ".", "as_tensor_variable", "(...
true
30
[ "22", "35", "63", "105", "131", "101", "145", "11", "30", "83", "114", "129", "2", "126", "4", "19", "139", "6" ]
1
VARIABLE_MISUSE
[ 6 ]
[ [ { "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": 21, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "rizar/attention-lvcsr/libs/Theano/theano/tensor/subtensor.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 make_node(self, x, ilist) : x_ = theano.tensor.as_tensor_variable (x) ilist_ = theano.tensor.as_tensor_variable (x_) if (ilist_.type.dtype [: 3] not in ('int', 'uin')) : raise TypeError ('index must be integers') if (ilist_.type.ndim != 1) : raise TypeError ('index must be vector') if (x_.type.ndim == 0) : raise TypeError ('cannot index into a scalar') bcast = ((ilist_.broadcastable [0],) + x_.broadcastable [1 :]) return Apply (self, [x_, ilist_], [TensorType (dtype = x.dtype, broadcastable = bcast) ()]) Is there a bug in the code above?
Yes
330
[ "#NEWLINE#", "def _setup_prefix(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "path", "=", "self", ".", "module_path", "#NEWLINE#", "old", "=", "None", "#NEWLINE#", "while", "(", "path", "!=", "old", ")", ":", "#NEWLINE#", "#INDENT#", "if", "path", ".", "low...
true
104
[ "2", "9", "40", "53", "68", "72", "79", "95", "104", "13", "21", "88", "7", "19", "27", "46", "50", "59", "63", "83", "90", "93", "100" ]
1
VARIABLE_MISUSE
[ 7, 19, 27, 46, 50, 59, 63, 83, 90, 93, 100 ]
[ [ { "before_index": 6, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pantsbuild/pex/pex/finders.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_prefix(self) : path = self.module_path old = None while (path != old) : if path.lower ().endswith ('.whl') : self.egg_name = os.path.basename (path) self.egg_info = os.path.join (path, ('%s.dist-info' % self._split_wheelname (self.egg_name))) self.egg_root = path break old = path (path, base) = os.path.split (base) Is there a bug in the code above?
Yes
331
[ "#NEWLINE#", "def flatten_list(", "data", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Format and return a comma-separated string of list items.\\n :param data:\\n :return:\\n '", "#NEWLINE#", "return", "', '", ".", "join", "(", "[", "'{0}'", ".", "format", "(", "x", ...
true
24
[ "19", "22", "24", "2" ]
1
VARIABLE_MISUSE
[ 2 ]
[ [ { "before_index": 6, "after_index": 7, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 11...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "j-bennet/wharfee/wharfee/formatter.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 flatten_list(data) : ' Format and return a comma-separated string of list items. :param data: :return: ' return ', '.join (['{0}'.format (x) for x in x]) Is there a bug in the code above?
Yes
332
[ "#NEWLINE#", "def get_context_data(", "self", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "context", "=", "super", "(", "CreateView", ",", "self", ")", ".", "get_context_data", "(", "**", "kwargs", ")", "#NEWLINE#", "try", ":", "#NEWLINE#", "#INDENT#", ...
true
37
[ "21", "37", "2", "15", "47", "63", "9", "28", "42", "70" ]
1
VARIABLE_MISUSE
[ 2, 15, 47, 63 ]
[ [ { "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": 69, "after_index": 70...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/horizon/openstack_dashboard/dashboards/project/volumes/volumes/views.py", "license": "apache-2.0", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def get_context_data(self, **kwargs) : context = super (CreateView, self).get_context_data (** kwargs) try : context ['usages'] = quotas.tenant_limit_usages (kwargs.request) context ['volume_types'] = self._get_volume_types () except Exception : exceptions.handle (self.request) return context Is there a bug in the code above?
Yes
333
[ "#NEWLINE#", "def lookup_expr_list(", "self", ",", "exprs", ")", ":", "#NEWLINE#", "#INDENT#", "return", "[", "self", ".", "lookup_expr", "(", "e", ")", "for", "e", "in", "self", "]" ]
true
20
[ "4", "15", "18", "2", "11", "20" ]
1
VARIABLE_MISUSE
[ 4 ]
[ [ { "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": 10, "after_index": 14...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "iskandr/parakeet/parakeet/value_specialization/value_specialization.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 lookup_expr_list(self, exprs) : return [self.lookup_expr (e) for e in self] Is there a bug in the code above?
Yes
334
[ "#NEWLINE#", "@", "classmethod", "#NEWLINE#", "def get_fresh_filename(", "cls", ",", "prefix", "=", "'/'", ")", ":", "#NEWLINE#", "#INDENT#", "cls", ".", "counter", "+=", "1", "#NEWLINE#", "return", "(", "'%stouchz_foobar%d'", "%", "(", "cls", ",", "cls", ".",...
true
25
[ "5", "14", "25", "27", "7" ]
1
VARIABLE_MISUSE
[ 7 ]
[ [ { "before_index": 1, "after_index": 6, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "spotify/snakebite/test/touchz_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] }}
@ classmethod def get_fresh_filename(cls, prefix = '/') : cls.counter += 1 return ('%stouchz_foobar%d' % (cls, cls.counter)) Is there a bug in the code above?
Yes
335
[ "#NEWLINE#", "def classify(", "self", ",", "term", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "' Returns the (most recently added) semantic type for the given term (\"many\" => \"quantity\").\\n If the term is not in the dictionary, try Taxonomy.classifiers.\\n '", ...
true
57
[ "57", "72", "55", "65", "2", "15", "27", "35", "4", "13", "19", "29", "37", "69", "63", "76", "81" ]
1
VARIABLE_MISUSE
[ 2, 15, 27, 35 ]
[ [ { "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": "clips/pattern/pattern/text/search.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 classify(self, term, **kwargs) : ' Returns the (most recently added) semantic type for the given term ("many" => "quantity"). If the term is not in the dictionary, try Taxonomy.classifiers. ' term = self._normalize (term) if dict.__contains__ (self, term) : return self [term] [0].keys () [(- 1)] for classifier in kwargs.classifiers : v = classifier.parents (term, ** kwargs) if v : return v [0] Is there a bug in the code above?
Yes
336
[ "#NEWLINE#", "@", "staticmethod", "#NEWLINE#", "def response_data_cleanup(", "domain", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Any active automatic case update rules should be deactivated.\\n '", "#NEWLINE#", "rule_count", "=", "AutomaticUpdateRule", ".", "objects", ...
true
41
[ "5", "20", "22", "41", "12", "58", "66" ]
1
VARIABLE_MISUSE
[ 12, 58, 66 ]
[ [ { "before_index": 9, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 36, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 39, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "dimagi/commcare-hq/corehq/apps/accounting/subscription_changes.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] }}
@ staticmethod def response_data_cleanup(domain) : ' Any active automatic case update rules should be deactivated. ' rule_count = AutomaticUpdateRule.objects.filter (domain = domain.name, deleted = False, active = True).count () if (domain > 0) : return _fmt_alert ((ungettext ('You have %(rule_count)d automatic case update rule configured in your project. If you select this plan, this rule will be deactivated.', 'You have %(rule_count)d automatic case update rules configured in your project. If you select this plan, these rules will be deactivated.', rule_count) % { 'rule_count' : rule_count, })) Is there a bug in the code above?
Yes
337
[ "#NEWLINE#", "def open(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "' Open port with current settings. This may throw a SerialException\\n if the port cannot be opened.'", "#NEWLINE#", "if", "(", "self", ".", "_port", "is", "None", ")", ":", "#NEWLINE#", "#INDEN...
true
105
[ "2", "11", "28", "41", "51", "59", "88", "118", "140", "153", "166", "176", "183", "193", "200", "207", "84", "97", "105", "109" ]
1
VARIABLE_MISUSE
[ 2, 11, 28, 41, 51, 59, 88, 118, 140, 153, 166, 176, 183, 193, 200, 207 ]
[ [ { "before_index": 6, "after_index": 7, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 27, "after_index": 29...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pyserial/pyserial/serial/serialposix.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 open(self) : ' Open port with current settings. This may throw a SerialException if the port cannot be opened.' if (self._port is None) : raise SerialException ('Port must be configured before it can be used.') if self.is_open : raise SerialException ('Port is already open.') self.fd = None try : self.fd = os.open (self.portstr, ((os.O_RDWR | os.O_NOCTTY) | os.O_NONBLOCK)) except OSError as msg : self.fd = None raise SerialException (msg.errno, 'could not open port {}: {}'.format (msg._port, msg)) try : self._reconfigure_port (force_update = True) except : try : os.close (self.fd) except : pass self.fd = None raise else : self.is_open = True if (not self._dsrdtr) : self._update_dtr_state () if (not self._rtscts) : self._update_rts_state () self.reset_input_buffer () Is there a bug in the code above?
Yes
338
[ "#NEWLINE#", "def disassociate_floating_ip(", "self", ",", "context", ",", "instance", ",", "address", ")", ":", "#NEWLINE#", "#INDENT#", "try", ":", "#NEWLINE#", "#INDENT#", "self", ".", "network_api", ".", "disassociate_floating_ip", "(", "context", ",", "instance...
true
27
[ "55", "71", "6", "25", "4", "23", "2", "17", "27", "8" ]
1
VARIABLE_MISUSE
[ 8 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 16, "after_index": 24, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 31, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/api/openstack/compute/floating_ips.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 disassociate_floating_ip(self, context, instance, address) : try : self.network_api.disassociate_floating_ip (context, instance, self) except exception.Forbidden : raise webob.exc.HTTPForbidden () except exception.CannotDisassociateAutoAssignedFloatingIP : msg = _ ('Cannot disassociate auto assigned floating IP') raise webob.exc.HTTPForbidden (explanation = msg) Is there a bug in the code above?
Yes
339
[ "#NEWLINE#", "def test_dim_reduction(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "decomposer", "=", "decomposition", ".", "PCA", "(", "n_components", "=", "2", ")", "#NEWLINE#", "f", "=", "combo", ".", "DimensionReduction", "(", "[", "'a'", ",", "'b'", ",", ...
true
56
[ "7", "32", "34", "72", "85", "18", "45", "40", "2", "47", "52", "56", "63", "89", "38", "49", "65", "91", "107", "83", "105" ]
1
VARIABLE_MISUSE
[ 38, 49, 65, 91, 107 ]
[ [ { "before_index": 6, "after_index": 12, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 31, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 36, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "kvh/ramp/ramp/tests/test_features.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_dim_reduction(self) : decomposer = decomposition.PCA (n_components = 2) f = combo.DimensionReduction (['a', 'b', 'c'], decomposer = decomposer) (data, ff) = build_feature_safe (f, self.data) self.assertEqual (self.shape, (len (self.data), 2)) decomposer = decomposition.PCA (n_components = 2) expected = decomposer.fit_transform (self.data [['a', 'b', 'c']]) assert_almost_equal (expected, data.values) Is there a bug in the code above?
Yes
340
[ "#NEWLINE#", "@", "raises", "(", "ValueError", ")", "#NEWLINE#", "def test_mapCtoD_6(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "'Test function for mapCtoD() 6/6'", "#NEWLINE#", "f0", "=", "0.0", "#NEWLINE#", "ABCDc", "=", "np", ".", "array", "(", "[", "[", "...
true
93
[ "84", "93", "82", "64", "8", "19", "91", "15", "95", "97" ]
1
VARIABLE_MISUSE
[ 64 ]
[ [ { "before_index": 12, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 17, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ggventurini/python-deltasigma/deltasigma/tests/test_mapCtoD.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] }}
@ raises (ValueError) def test_mapCtoD_6(self) : 'Test function for mapCtoD() 6/6' f0 = 0.0 ABCDc = np.array ([[0.0, 0.0, 1.0, (- 1.0)], [1.0, 0.0, 0.0, (- 1.5)], [0, 1, 0, 0]]) tdac = np.array ([0.1, 0.4, 0.1, 3.0]) (sys_d, Gp) = ds.mapCtoD (ABCDc, Gp, f0 = f0) Is there a bug in the code above?
Yes
341
[ "#NEWLINE#", "def main(", "sysargs", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "from", "bloom.config", "import", "upconvert_bloom_to_config_branch", "#NEWLINE#", "upconvert_bloom_to_config_branch", "(", ")", "#NEWLINE#", "parser", "=", "get_argument_parser", "(", ")...
true
93
[ "31", "42", "85", "89", "97", "101", "2", "37", "72", "79", "93", "107", "18", "24", "28", "33", "63" ]
1
VARIABLE_MISUSE
[ 31, 42, 85, 89, 97, 101 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ros-infrastructure/bloom/bloom/commands/git/import_upstream.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 main(sysargs = None) : from bloom.config import upconvert_bloom_to_config_branch upconvert_bloom_to_config_branch () parser = get_argument_parser () parser = add_global_arguments (parser) args = parser.parse_args (sysargs) handle_global_arguments (args) try : ensure_clean_working_env () ensure_git_root () except SystemExit : parser.print_usage () raise git_clone = GitClone () with git_clone : import_upstream (args.archive_path, args.patches_path, git_clone.release_version, args.name, args.replace) git_clone.commit () info ("I'm happy. You should be too.") Is there a bug in the code above?
Yes
342
[ "#NEWLINE#", "def testNonExecutables(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "dispatcher", "=", "GafferDispatch", ".", "Dispatcher", ".", "create", "(", "'testDispatcher'", ")", "#NEWLINE#", "s", "=", "Gaffer", ".", "ScriptNode", "(", ")", "#NEWLINE#", "s", ...
true
48
[ "7", "43", "59", "2", "37", "48", "55", "18", "26" ]
1
VARIABLE_MISUSE
[ 18, 26 ]
[ [ { "before_index": 6, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 23, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 25, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ImageEngine/gaffer/python/GafferDispatchTest/DispatcherTest.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 testNonExecutables(self) : dispatcher = GafferDispatch.Dispatcher.create ('testDispatcher') s = Gaffer.ScriptNode () s ['n1'] = Gaffer.Node () self.assertRaises (RuntimeError, dispatcher.dispatch, [self ['n1']]) self.assertEqual (dispatcher.jobDirectory (), '') Is there a bug in the code above?
Yes
343
[ "#NEWLINE#", "def features_set(", "self", ",", "features", ")", ":", "#NEWLINE#", "#INDENT#", "'Initialize dictionary of features where keys are the feature names and values are an empty\\n list for storing the training and testing array/matrix'", "#NEWLINE#", "self", ".", "features...
true
30
[ "4", "13", "2", "11", "30", "19", "28" ]
1
VARIABLE_MISUSE
[ 4, 13 ]
[ [ { "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": "theusual/kaggle-seeclickfix-ensemble/Bryan/ensembles.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 features_set(self, features) : 'Initialize dictionary of features where keys are the feature names and values are an empty list for storing the training and testing array/matrix' self.features = dict (((feature, ['', '']) for feature in self)) Is there a bug in the code above?
Yes
344
[ "#NEWLINE#", "def double_emphasis(", "self", ",", "text", ")", ":", "#NEWLINE#", "#INDENT#", "'Rendering **strong** text.\\n\\n :param text: text content for emphasis.\\n '", "#NEWLINE#", "return", "(", "'<strong>%s</strong>'", "%", "self", ")" ]
true
15
[ "4", "2", "15" ]
1
VARIABLE_MISUSE
[ 4 ]
[ [ { "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": "neuroo/equip/examples/sample-test-program/test_module/mistune.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 double_emphasis(self, text) : 'Rendering **strong** text. :param text: text content for emphasis. ' return ('<strong>%s</strong>' % self) Is there a bug in the code above?
Yes
345
[ "#NEWLINE#", "@", "ignore_verification", ".", "setter", "#NEWLINE#", "def ignore_verification(", "self", ",", "value", ")", ":", "#NEWLINE#", "#INDENT#", "if", "self", ".", "_lb", ":", "#NEWLINE#", "#INDENT#", "self", ".", "_set_ignore_verification", "(", "self", ...
true
29
[ "9", "38", "7", "15", "21", "25", "29", "34" ]
1
VARIABLE_MISUSE
[ 9, 38 ]
[ [ { "before_index": 1, "after_index": 8, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 16, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 33, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "tdevelioglu/python-f5/f5/rule.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] }}
@ ignore_verification.setter def ignore_verification(self, value) : if self._lb : self._set_ignore_verification (self._bool_to_iv (self)) self._ignore_verification = value Is there a bug in the code above?
Yes
346
[ "#NEWLINE#", "def cmd_resync(", "args", ")", ":", "#NEWLINE#", "#INDENT#", "\"Stashes unstaged changes,\\n Fetches, Auto-Merge/Rebase upstream data from specified upstream branch,\\n Performs smart pull+merge for current branch,\\n Pushes local commits up, and Unstashes changes.\\n Default...
true
145
[ "36", "2", "10", "23", "61", "19", "32", "84", "118", "149", "40", "89", "130", "145", "191" ]
1
VARIABLE_MISUSE
[ 19, 32, 84, 118, 149 ]
[ [ { "before_index": 6, "after_index": 7, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 88, "after_index": 92...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "kennethreitz/legit/legit/cli.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 cmd_resync(args) : "Stashes unstaged changes, Fetches, Auto-Merge/Rebase upstream data from specified upstream branch, Performs smart pull+merge for current branch, Pushes local commits up, and Unstashes changes. Default upstream branch is 'master'. " if args.get (0) : upstream = fuzzy_match_branch (args.get (0)) if upstream : is_external = True original_branch = get_current_branch_name () else : print ("{0} doesn't exist. Use a branch that does.".format (colored.yellow (args.get (0)))) sys.exit (1) else : upstream = 'master' original_branch = get_current_branch_name () if repo.is_dirty () : status_log (stash_it, 'Saving local changes.', sync = True) switch_to (upstream) status_log (smart_pull, 'Pulling commits from the server.') switch_to (original_branch) status_log (smart_merge, 'Grafting commits from {0}.'.format (colored.yellow (original_branch)), upstream, allow_rebase = False) if unstash_index (sync = True) : status_log (unstash_it, 'Restoring local changes.', sync = True) status_log (smart_pull, 'Pulling commits from the server.') status_log (push, 'Pushing commits to the server.', original_branch) Is there a bug in the code above?
Yes
347
[ "#NEWLINE#", "def is_reg(", "self", ",", "r", ")", ":", "#NEWLINE#", "#INDENT#", "'Checks if the register operand is the given processor register'", "#NEWLINE#", "return", "(", "(", "self", ".", "type", "==", "o_reg", ")", "and", "(", "self", ".", "reg", "==", "r"...
false
0
[ "4", "26", "r", "2", "14", "22", "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": 20,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "EiNSTeiN-/idapython/pywraps/py_ua.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 is_reg(self, r) : 'Checks if the register operand is the given processor register' return ((self.type == o_reg) and (self.reg == r)) Is there a bug in the code above?
No
348
[ "#NEWLINE#", "def test_adding_timestamp(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "blueprint", "=", "Blueprint", "(", "'users'", ")", "#NEWLINE#", "blueprint", ".", "timestamp", "(", "'foo'", ")", "#NEWLINE#", "statements", "=", "blueprint", ".", "to_sql", "("...
false
0
[ "7", "14", "23", "blueprint", "21", "48", "58", "statements", "2", "27", "33", "40", "52", "self" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 17, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 20, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "sdispater/orator/tests/schema/grammars/test_mysql_grammar.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_adding_timestamp(self) : blueprint = Blueprint ('users') blueprint.timestamp ('foo') statements = blueprint.to_sql (self.get_connection (), self.get_grammar ()) self.assertEqual (1, len (statements)) self.assertEqual ('ALTER TABLE `users` ADD `foo` TIMESTAMP NOT NULL', statements [0]) Is there a bug in the code above?
No
349
[ "#NEWLINE#", "@", "attr", "(", "'slow'", ")", "#NEWLINE#", "def test_missing_headers(", ")", ":", "#NEWLINE#", "#INDENT#", "file_owner", "=", "'get_test_user'", "#NEWLINE#", "file_id", "=", "0", "#NEWLINE#", "resource", "=", "'/apigetfile/{0}/{1}/'", ".", "format", ...
false
0
[ "64", "94", "115", "123", "135", "response", "12", "26", "file_owner", "43", "61", "header", "88", "96", "109", "117", "130", "content", "16", "28", "file_id", "20", "73", "resource", "49", "59", "78", "hd", "31", "45", "76", "headers" ]
0
NONE
[]
[ [ { "before_index": 11, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 15, "after_index": 18, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "plotly/plotly.py/plotly/tests/test_core/test_get_requests/test_get_requests.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] }}
@ attr ('slow') def test_missing_headers() : file_owner = 'get_test_user' file_id = 0 resource = '/apigetfile/{0}/{1}/'.format (file_owner, file_id) headers = list (default_headers.keys ()) for header in headers : hd = copy.copy (default_headers) del hd [header] response = requests.get ((server + resource), headers = hd) if six.PY3 : content = json.loads (response.content.decode ('unicode_escape')) else : content = json.loads (response.content) print (response.status_code) print (content) assert (response.status_code == 422) Is there a bug in the code above?
No
350
[ "#NEWLINE#", "def __get__(", "self", ",", "instance", ",", "cls", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "_init_proxy_params", "(", "instance", ")", "#NEWLINE#", "return", "self", ".", "_proxy" ]
false
0
[ "4", "15", "instance", "6", "cls", "2", "11", "19", "self" ]
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": 18, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/fuel-devops/devops/models/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 __get__(self, instance, cls) : self._init_proxy_params (instance) return self._proxy Is there a bug in the code above?
No
351
[ "#NEWLINE#", "def set_default_params(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "for", "basecls", "in", "self", ".", "__class__", ".", "__mro__", ":", "#NEWLINE#", "#INDENT#", "if", "(", "not", "hasattr", "(", "basecls", ",", "'_param_field_names'", ")", ")",...
false
0
[ "35", "47", "param", "2", "10", "52", "self", "8", "23", "37", "43", "basecls" ]
0
NONE
[]
[ [ { "before_index": 7, "after_index": 8, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 7, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 11...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/fuel-devops/devops/models/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 set_default_params(self) : for basecls in self.__class__.__mro__ : if (not hasattr (basecls, '_param_field_names')) : continue for param in basecls._param_field_names : basecls.__dict__ [param].set_default_value (self) Is there a bug in the code above?
No
352
[ "#NEWLINE#", "def test_parse_imports(", "index", ")", ":", "#NEWLINE#", "#INDENT#", "src", "=", "dedent", "(", "'\\n import os, sys as sys\\n import sys as sys\\n from os.path import basename\\n\\n from os import (\\n path,\\n posixpath\\n ...
false
0
[ "35", "59", "new_src", "2", "41", "index", "21", "45", "unreferenced", "19", "43", "unresolved", "7", "28", "39", "src" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 32, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 34, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "alecthomas/importmagic/importmagic/importer_test.py", "license": "bsd-2-clause", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def test_parse_imports(index) : src = dedent (' import os, sys as sys import sys as sys from os.path import basename from os import ( path, posixpath ) def main(): pass ').strip () (unresolved, unreferenced) = Scope.from_source (src).find_unresolved_and_unreferenced_symbols () new_src = update_imports (src, index, unresolved, unreferenced) assert (dedent (' def main(): pass ').strip () == new_src.strip ()) Is there a bug in the code above?
No
353
[ "#NEWLINE#", "def retrieve_py_variable(", "self", ",", "inline", "=", "0", ")", ":", "#NEWLINE#", "#INDENT#", "if", "inline", ":", "#NEWLINE#", "#INDENT#", "vn", "=", "(", "'get_variable(\"%s\",raw_locals,raw_globals)'", "%", "self", ".", "name", ")", "#NEWLINE#", ...
false
0
[ "4", "12", "inline", "2", "21", "36", "self", "16", "31", "43", "vn" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 12, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 42, "after_index": 4...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "scipy/scipy/scipy/weave/base_spec.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 retrieve_py_variable(self, inline = 0) : if inline : vn = ('get_variable("%s",raw_locals,raw_globals)' % self.name) else : vn = ('py_' + self.name) return vn Is there a bug in the code above?
No
354
[ "#NEWLINE#", "def test_can_execute_rjs(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "s", "=", "Site", "(", "TEST_SITE", ")", "#NEWLINE#", "s", ".", "config", ".", "plugins", "=", "[", "'hyde.ext.plugins.js.RequireJSPlugin'", "]", "#NEWLINE#", "source", "=", "TEST...
false
0
[ "2", "self", "71", "97", "text", "79", "99", "expected_text", "52", "59", "gen", "7", "14", "39", "56", "s", "24", "63", "source", "33", "67", "73", "target" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "hyde/hyde/tests/ext/test_requirejs.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_can_execute_rjs(self) : s = Site (TEST_SITE) s.config.plugins = ['hyde.ext.plugins.js.RequireJSPlugin'] source = TEST_SITE.child ('content/media/js/rjs.conf') target = File (Folder (s.config.deploy_root_path).child ('media/js/app.js')) gen = Generator (s) gen.generate_resource_at_path (source) assert target.exists text = target.read_all () expected_text = File (RJS_SOURCE.child ('app.js')).read_all () assert (text == expected_text) return Is there a bug in the code above?
No
355
[ "#NEWLINE#", "def test_default_extensions(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "uset", "=", "UploadSet", "(", "'files'", ")", "#NEWLINE#", "uset", ".", "_config", "=", "Config", "(", "'/uploads'", ")", "#NEWLINE#", "extpairs", "=", "(", "(", "'txt'", ...
false
0
[ "2", "self", "23", "52", "extpairs", "47", "62", "ext", "7", "14", "58", "uset", "49", "65", "result" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 10, "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": "jeffwidman/flask-uploads/tests.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_default_extensions(self) : uset = UploadSet ('files') uset._config = Config ('/uploads') extpairs = (('txt', True), ('jpg', True), ('exe', False)) for (ext, result) in extpairs : assert (uset.extension_allowed (ext) is result) Is there a bug in the code above?
No
356
[ "#NEWLINE#", "def get_combobox_data(", "request", ")", ":", "#NEWLINE#", "#INDENT#", "'Return the standard live search data that are posted from a ComboBox widget.\\n summary:\\n A ComboBox using the QueryReadStore sends the following data:\\n name - is the search string (it alway...
false
0
[ "65", "113", "125", "start", "30", "44", "53", "55", "123", "string", "81", "99", "105", "110", "117", "127", "end", "2", "13", "32", "69", "83", "request" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 7, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 11, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 29, "after_index": 39...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "aehlke/manabi/apps/dojango/util/form.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_combobox_data(request) : 'Return the standard live search data that are posted from a ComboBox widget. summary: A ComboBox using the QueryReadStore sends the following data: name - is the search string (it always ends with a \'*\', that is how the dojo.data API defined it) start - the paging start count - the number of entries to return The ComboBox and QueryReadStore usage should be like this: <div dojoType="dojox.data.QueryReadStore" jsId="topicStore" url="/topic/live-search/..." requestMethod="post" doClientPaging="false"></div> <input {% dojo_widget "rs.widget.Tagcombobox" "addTopicInput" %} store="topicStore" style="width:150px" pageSize="20" /> The most important things here are the attributes requestMethod and doClientPaging! The \'doClientPaging\' makes the combobox send \'start\' and \'count\' parameters and the server shall do the paging. returns: a tuple containing search_string - the string typed into the combobox start - at which data set to start end - at which data set to stop \'start\' and \'end\' are already prepared to be directly used in the limit part of the queryset, i.e. Idea.objects.all()[start:end] throws: Exception - if the request method is not POST. ValueError - if start or count parameter is not an int. ' if (not (request.method == 'POST')) : raise Exception ('POST request expected.') string = request.POST.get ('name', '') if string.endswith ('*') : string = string [: (- 1)] start = int (request.POST.get ('start', 0)) end = request.POST.get ('count', 10) if (not is_number (end)) : end = 10 end = (start + int (end)) return (string, start, end) Is there a bug in the code above?
No
357
[ "#NEWLINE#", "def test_get_person(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "luke", "=", "swapi", ".", "get_person", "(", "1", ")", "#NEWLINE#", "self", ".", "assertEquals", "(", "luke", ".", "name", ",", "'Luke Skywalker'", ")", "#NEWLINE#", "self", ".", ...
false
0
[ "7", "20", "33", "luke", "2", "16", "27", "self" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 12, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 15, "after_index": 23, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "phalt/swapi-python/tests/test_swapi.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_get_person(self) : luke = swapi.get_person (1) self.assertEquals (luke.name, 'Luke Skywalker') self.assertEquals ('<Person - Luke Skywalker>', luke.__repr__ ()) Is there a bug in the code above?
No
358
[ "#NEWLINE#", "def validate(", "self", ",", "errors", ")", ":", "#NEWLINE#", "#INDENT#", "names", "=", "set", "(", ")", "#NEWLINE#", "for", "value", "in", "self", ".", "values", ":", "#NEWLINE#", "#INDENT#", "if", "(", "value", ".", "name", "in", "names", ...
false
0
[ "4", "35", "errors", "2", "18", "self", "9", "30", "53", "names", "16", "26", "39", "45", "57", "value" ]
0
NONE
[]
[ [ { "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": 15, "after_index": 16...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pdef/pdef/compiler/pdefc/lang.py", "license": "apache-2.0", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def validate(self, errors) : names = set () for value in self.values : if (value.name in names) : errors.add_error (value.location, 'Duplicate enum value "%s"', value.name) continue names.add (value.name) Is there a bug in the code above?
No
359
[ "#NEWLINE#", "def do_delete(", "self", ",", "r", ")", ":", "#NEWLINE#", "#INDENT#", "ip_str", "=", "r", ".", "ip_str", "#NEWLINE#", "fqdn", "=", "r", ".", "fqdn", "#NEWLINE#", "r", ".", "delete", "(", ")", "#NEWLINE#", "self", ".", "assertFalse", "(", "A...
false
0
[ "9", "13", "37", "39", "ip_str", "4", "11", "17", "21", "r", "2", "27", "self", "15", "19", "41", "43", "fqdn" ]
0
NONE
[]
[ [ { "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": 14, "after_index": 18...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "mozilla/inventory/core/registration/static/tests/A_tests.py", "license": "bsd-3-clause", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def do_delete(self, r) : ip_str = r.ip_str fqdn = r.fqdn r.delete () self.assertFalse (AddressRecord.objects.filter (ip_str = ip_str, fqdn = fqdn)) Is there a bug in the code above?
No
360
[ "#NEWLINE#", "def __init__(", "self", ",", "value", "=", "float", "(", "'nan'", ")", ")", ":", "#NEWLINE#", "#INDENT#", "'constructor accepts initial value'", "#NEWLINE#", "super", "(", "SimpleGauge", ",", "self", ")", ".", "__init__", "(", ")", "#NEWLINE#", "se...
false
0
[ "2", "20", "27", "self", "4", "31", "value" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 15, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "cloudera/hue/desktop/core/ext-py/pyformance-0.3.2/pyformance/meters/gauge.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, value = float ('nan')) : 'constructor accepts initial value' super (SimpleGauge, self).__init__ () self._value = value Is there a bug in the code above?
No
361
[ "#NEWLINE#", "def testCanGetForObject(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "versions", "=", "get_for_object", "(", "self", ".", "test11", ")", "#NEWLINE#", "self", ".", "assertEqual", "(", "len", "(", "versions", ")", ",", "2", ")", "#NEWLINE#", "self...
false
0
[ "2", "11", "16", "28", "45", "66", "71", "83", "100", "self", "7", "22", "32", "49", "62", "77", "87", "104", "versions" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 15, "after_index": 24, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 27, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "etianen/django-reversion/src/tests/test_reversion/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 testCanGetForObject(self) : versions = get_for_object (self.test11) self.assertEqual (len (versions), 2) self.assertEqual (versions [0].field_dict ['name'], 'model1 instance1 version2') self.assertEqual (versions [1].field_dict ['name'], 'model1 instance1 version1') versions = get_for_object (self.test21) self.assertEqual (len (versions), 2) self.assertEqual (versions [0].field_dict ['name'], 'model2 instance1 version2') self.assertEqual (versions [1].field_dict ['name'], 'model2 instance1 version1') Is there a bug in the code above?
No
362
[ "#NEWLINE#", "def apply_filter(", "request", ")", ":", "#NEWLINE#", "#INDENT#", "markup", "=", "filter_func", "(", "request", ".", "POST", ".", "get", "(", "'data'", ",", "''", ")", ")", "#NEWLINE#", "return", "render_to_response", "(", "'markitup/preview.html'", ...
false
0
[ "2", "11", "43", "request", "7", "33", "markup" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": 27, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "zsiciarz/django-markitup/markitup/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 apply_filter(request) : markup = filter_func (request.POST.get ('data', '')) return render_to_response ('markitup/preview.html', { 'preview' : markup, }, context_instance = RequestContext (request)) Is there a bug in the code above?
No
363
[ "#NEWLINE#", "def inet_ntoa6(", "packed_ip", ")", ":", "#NEWLINE#", "#INDENT#", "_", "=", "packed_ip", ".", "encode", "(", "'hex'", ")", "#NEWLINE#", "return", "compress_ipv6", "(", "':'", ".", "join", "(", "(", "_", "[", "i", ":", "(", "i", "+", "4", ...
false
0
[ "2", "9", "packed_ip", "7", "24", "43", "_", "26", "29", "35", "i" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 12, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 16, "after_index": 18, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "stamparm/maltrail/core/addr.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 inet_ntoa6(packed_ip) : _ = packed_ip.encode ('hex') return compress_ipv6 (':'.join ((_ [i : (i + 4)] for i in xrange (0, len (_), 4)))) Is there a bug in the code above?
No
364
[ "#NEWLINE#", "def test_protocol_factory(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "mock_name", "=", "'test_protocol_factory'", "#NEWLINE#", "socket", "=", "MagicMock", "(", "mock_name", "=", "mock_name", ")", "#NEWLINE#", "protocol", "=", "self", ".", "factory", ...
false
0
[ "11", "28", "63", "socket", "20", "43", "50", "61", "protocol", "31", "37", "base", "7", "15", "17", "65", "67", "mock_name", "35", "54", "69", "msg", "2", "22", "46", "57", "self" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "OpenKMIP/PyKMIP/kmip/tests/unit/services/test_kmip_protocol.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_protocol_factory(self) : mock_name = 'test_protocol_factory' socket = MagicMock (mock_name = mock_name) protocol = self.factory.getProtocol (socket) base = 'expected {0}, received {1}' msg = base.format (KMIPProtocol, protocol) self.assertIsInstance (protocol, KMIPProtocol, msg) self.assertEqual (protocol.socket.mock_name, mock_name, msg) Is there a bug in the code above?
No
365
[ "#NEWLINE#", "def culaDeviceZgesv(", "n", ",", "nrhs", ",", "a", ",", "lda", ",", "ipiv", ",", "b", ",", "ldb", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Solve linear system with LU factorization.\\n\\n '", "#NEWLINE#", "status", "=", "_libcula", ".", "...
false
0
[ "10", "40", "ipiv", "21", "53", "status", "12", "45", "b", "8", "36", "lda", "2", "27", "n", "6", "33", "a", "4", "29", "nrhs", "14", "48", "ldb" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 19, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 20, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "lebedov/scikit-cuda/skcuda/cula.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 culaDeviceZgesv(n, nrhs, a, lda, ipiv, b, ldb) : ' Solve linear system with LU factorization. ' status = _libcula.culaDeviceZgesv (n, nrhs, int (a), lda, int (ipiv), int (b), ldb) culaCheckStatus (status) Is there a bug in the code above?
No
366
[ "#NEWLINE#", "def culaDeviceDgeev(", "jobvl", ",", "jobvr", ",", "n", ",", "a", ",", "lda", ",", "wr", ",", "wi", ",", "vl", ",", "ldvl", ",", "vr", ",", "ldvr", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n General Eigenproblem solver.\\n '", "#NEWLI...
false
0
[ "22", "88", "ldvr", "16", "78", "vl", "47", "93", "status", "10", "64", "lda", "12", "68", "wr", "6", "57", "n", "8", "61", "a", "2", "29", "31", "53", "jobvl", "4", "38", "40", "55", "jobvr", "18", "81", "ldvl", "14", "73", "wi", "20", "85...
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": 27, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 28, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "lebedov/scikit-cuda/skcuda/cula.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 culaDeviceDgeev(jobvl, jobvr, n, a, lda, wr, wi, vl, ldvl, vr, ldvr) : ' General Eigenproblem solver. ' jobvl = jobvl.encode ('ascii') jobvr = jobvr.encode ('ascii') status = _libcula.culaDeviceDgeev (jobvl, jobvr, n, int (a), lda, int (wr), int (wi), int (vl), ldvl, int (vr), ldvr) culaCheckStatus (status) Is there a bug in the code above?
No
367
[ "#NEWLINE#", "def culaDeviceZgeTranspose(", "m", ",", "n", ",", "A", ",", "lda", ",", "B", ",", "ldb", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Transpose of complex general matrix.\\n\\n '", "#NEWLINE#", "status", "=", "_libcula", ".", "culaDeviceZgeTransp...
false
0
[ "19", "46", "status", "8", "34", "lda", "4", "27", "n", "6", "31", "A", "2", "25", "m", "10", "38", "B", "12", "41", "ldb" ]
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": "lebedov/scikit-cuda/skcuda/cula.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 culaDeviceZgeTranspose(m, n, A, lda, B, ldb) : ' Transpose of complex general matrix. ' status = _libcula.culaDeviceZgeTranspose (m, n, int (A), lda, int (B), ldb) culaCheckStatus (status) Is there a bug in the code above?
No
368
[ "#NEWLINE#", "def culaDeviceCgeTransposeInplace(", "n", ",", "A", ",", "lda", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Inplace transpose of complex square matrix.\\n\\n '", "#NEWLINE#", "status", "=", "_libcula", ".", "culaDeviceCgeTransposeInplace", "(", "n", "...
false
0
[ "6", "26", "lda", "13", "31", "status", "2", "19", "n", "4", "23", "A" ]
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": 12, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "lebedov/scikit-cuda/skcuda/cula.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 culaDeviceCgeTransposeInplace(n, A, lda) : ' Inplace transpose of complex square matrix. ' status = _libcula.culaDeviceCgeTransposeInplace (n, int (A), lda) culaCheckStatus (status) Is there a bug in the code above?
No
369
[ "#NEWLINE#", "def _deprecateAttribute(", "proxy", ",", "name", ",", "version", ",", "message", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Mark a module-level attribute as being deprecated.\\n\\n @type proxy: L{_ModuleProxy}\\n @param proxy: The module proxy instance proxying the dep...
false
0
[ "6", "34", "version", "4", "32", "52", "name", "2", "21", "45", "proxy", "39", "50", "_deprecatedAttributes", "15", "30", "_module", "26", "55", "attr", "8", "36", "message" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "bokeh/bokeh/bokeh/util/deprecate.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 _deprecateAttribute(proxy, name, version, message) : ' Mark a module-level attribute as being deprecated. @type proxy: L{_ModuleProxy} @param proxy: The module proxy instance proxying the deprecated attributes @type name: C{str} @param name: Attribute name @type version: L{twisted.python.versions.Version} @param version: Version that the attribute was deprecated in @type message: C{str} @param message: Deprecation message ' _module = object.__getattribute__ (proxy, '_module') attr = _DeprecatedAttribute (_module, name, version, message) _deprecatedAttributes = object.__getattribute__ (proxy, '_deprecatedAttributes') _deprecatedAttributes [name] = attr Is there a bug in the code above?
No
370
[ "#NEWLINE#", "def error_view(", "context", ",", "request", ")", ":", "#NEWLINE#", "#INDENT#", "return", "JHTTPBadRequest", "(", "context", ".", "args", "[", "0", "]", ")" ]
false
0
[ "4", "request", "2", "12", "context" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 11, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 10...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ramses-tech/nefertari/nefertari/view.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 error_view(context, request) : return JHTTPBadRequest (context.args [0]) Is there a bug in the code above?
No
371
[ "#NEWLINE#", "def get_template_names(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "names", "=", "super", "(", "AJAXResponseMixin", ",", "self", ")", ".", "get_template_names", "(", ")", "#NEWLINE#", "if", "self", ".", "request", ".", "is_ajax", "(", ")", ":",...
false
0
[ "2", "13", "21", "32", "42", "self", "7", "38", "47", "55", "60", "63", "69", "names" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 17, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 20, "after_index": 26, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 68, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ulule/django-courriers/courriers/views.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_template_names(self) : names = super (AJAXResponseMixin, self).get_template_names () if self.request.is_ajax () : if self.ajax_template_name : names = ([self.ajax_template_name] + names) else : names = (ajaxify_template_var (names) + names) return names Is there a bug in the code above?
No
372
[ "#NEWLINE#", "def get_user_filter(", "self", ",", "user_localpart", ",", "filter_id", ")", ":", "#NEWLINE#", "#INDENT#", "result", "=", "self", ".", "store", ".", "get_user_filter", "(", "user_localpart", ",", "filter_id", ")", "#NEWLINE#", "result", ".", "addCall...
false
0
[ "11", "24", "32", "result", "4", "19", "user_localpart", "6", "21", "filter_id", "2", "13", "self" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "matrix-org/synapse/synapse/api/filtering.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_user_filter(self, user_localpart, filter_id) : result = self.store.get_user_filter (user_localpart, filter_id) result.addCallback (FilterCollection) return result Is there a bug in the code above?
No
373
[ "#NEWLINE#", "def read_annotations_file(", "self", ",", "file_name", ",", "construction_separator", "=", "' '", ",", "analysis_sep", "=", "','", ")", ":", "#NEWLINE#", "#INDENT#", "'Read a annotations file.\\n\\n Each line has the format:\\n <compound> <constr1> <cons...
false
0
[ "54", "96", "145", "analyses_line", "4", "35", "46", "file_name", "94", "105", "107", "120", "analysis", "19", "70", "75", "113", "138", "163", "annotations", "10", "86", "100", "analysis_sep", "2", "42", "self", "40", "57", "line", "52", "68", "77", ...
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": "aalto-speech/morfessor/morfessor/io.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 read_annotations_file(self, file_name, construction_separator = ' ', analysis_sep = ',') : 'Read a annotations file. Each line has the format: <compound> <constr1> <constr2>... <constrN>, <constr1>...<constrN>, ... Yield tuples (compound, list(analyses)). ' annotations = { } _logger.info (("Reading annotations from '%s'..." % file_name)) for line in self._read_text_file (file_name) : (compound, analyses_line) = line.split (None, 1) if (compound not in annotations) : annotations [compound] = [] if (analysis_sep is not None) : for analysis in analyses_line.split (analysis_sep) : analysis = analysis.strip () annotations [compound].append (analysis.strip ().split (construction_separator)) else : annotations [compound].append (analyses_line.split (construction_separator)) _logger.info ('Done.') return annotations Is there a bug in the code above?
No
374
[ "#NEWLINE#", "def test_kernel_density_sampling(", "n_samples", "=", "100", ",", "n_features", "=", "3", ")", ":", "#NEWLINE#", "#INDENT#", "rng", "=", "np", ".", "random", ".", "RandomState", "(", "0", ")", "#NEWLINE#", "X", "=", "rng", ".", "randn", "(", ...
false
0
[ "101", "132", "158", "dist", "50", "68", "186", "206", "225", "241", "kde", "13", "26", "216", "rng", "86", "106", "nbrs", "40", "56", "58", "119", "145", "172", "192", "194", "229", "kernel", "2", "30", "n_samples", "24", "63", "77", "97", "110"...
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "scikit-learn/scikit-learn/sklearn/neighbors/tests/test_kde.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_kernel_density_sampling(n_samples = 100, n_features = 3) : rng = np.random.RandomState (0) X = rng.randn (n_samples, n_features) bandwidth = 0.2 for kernel in ['gaussian', 'tophat'] : kde = KernelDensity (bandwidth, kernel = kernel).fit (X) samp = kde.sample (100) assert_equal (X.shape, samp.shape) nbrs = NearestNeighbors (n_neighbors = 1).fit (X) (dist, ind) = nbrs.kneighbors (X, return_distance = True) if (kernel == 'tophat') : assert np.all ((dist < bandwidth)) else : if (kernel == 'gaussian') : assert np.all ((dist < (5 * bandwidth))) for kernel in ['epanechnikov', 'exponential', 'linear', 'cosine'] : kde = KernelDensity (bandwidth, kernel = kernel).fit (X) assert_raises (NotImplementedError, kde.sample, 100) X = rng.randn (4, 1) kde = KernelDensity (kernel = 'gaussian').fit (X) assert_equal (kde.sample ().shape, (1, 1)) Is there a bug in the code above?
No
375
[ "#NEWLINE#", "def __init__(", "self", ",", "state", ",", "address", ")", ":", "#NEWLINE#", "#INDENT#", "StateException", ".", "__init__", "(", "self", ",", "state", ")", "#NEWLINE#", "self", ".", "address", "=", "address" ]
false
0
[ "4", "17", "state", "6", "22", "24", "address", "2", "15", "20", "self" ]
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": 19, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "c01db33f/concolica/vulnerabilities.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, state, address) : StateException.__init__ (self, state) self.address = address Is there a bug in the code above?
No
376
[ "#NEWLINE#", "@", "test", ".", "idempotent_id", "(", "'1738de5d-0476-4163-9022-5e1b548c208e'", ")", "#NEWLINE#", "def test_policy_association_with_tenant_network(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "policy", "=", "self", ".", "create_qos_policy", "(", "name", "=...
false
0
[ "34", "58", "90", "network", "50", "73", "retrieved_network", "15", "44", "68", "policy", "10", "17", "36", "52", "64", "82", "86", "self" ]
0
NONE
[]
[ [ { "before_index": 14, "after_index": 24, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 33, "after_index": 41, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 49, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/neutron/neutron/tests/tempest/api/test_qos.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 ('1738de5d-0476-4163-9022-5e1b548c208e') def test_policy_association_with_tenant_network(self) : policy = self.create_qos_policy (name = 'test-policy', description = 'test policy', shared = True) network = self.create_network ('test network', qos_policy_id = policy ['id']) retrieved_network = self.admin_client.show_network (network ['id']) self.assertEqual (policy ['id'], retrieved_network ['network'] ['qos_policy_id']) self._disassociate_network (self.client, network ['id']) Is there a bug in the code above?
No
377
[ "#NEWLINE#", "def __init__(", "self", ",", "session", "=", "None", ",", "verify_ssl", "=", "False", ",", "**credentials", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "verify_ssl", "=", "verify_ssl", "#NEWLINE#", "if", "session", ":", "#NEWLINE#", "#INDENT#",...
false
0
[ "8", "19", "21", "55", "57", "95", "97", "verify_ssl", "100", "credentials", "4", "24", "31", "47", "53", "62", "75", "77", "91", "session", "107", "124", "e", "2", "17", "45", "60", "73", "89", "self" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 16, "after_index": 21, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "opennode/nodeconductor/nodeconductor/openstack/backend.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, session = None, verify_ssl = False, **credentials) : self.verify_ssl = verify_ssl if session : if isinstance (session, dict) : logger.info ('Trying to recover OpenStack session.') self.session = OpenStackSession.recover (session, verify_ssl = verify_ssl) self.session.validate () else : self.session = session else : try : self.session = OpenStackSession (verify_ssl = verify_ssl, ** credentials) except AttributeError as e : logger.error ('Failed to create OpenStack session.') six.reraise (OpenStackBackendError, e) Is there a bug in the code above?
No
378
[ "#NEWLINE#", "def _raw_input(", "prompt", "=", "None", ",", "stream", "=", "None", ",", "input", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "not", "stream", ")", ":", "#NEWLINE#", "#INDENT#", "stream", "=", "sys", ".", "stderr", "#NEWLINE#"...
false
0
[ "6", "20", "25", "59", "66", "stream", "10", "35", "40", "75", "input", "2", "47", "51", "55", "63", "prompt", "73", "84", "95", "108", "110", "121", "line" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 19, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 32, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "Esri/ago-tools/samples/updateUserRoles.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 _raw_input(prompt = None, stream = None, input = None) : if (not stream) : stream = sys.stderr if (not input) : input = sys.stdin prompt = str (prompt) if prompt : stream.write (prompt) stream.flush () line = input.readline () if (not line) : raise EOFError if (line [(- 1)] == ' ') : line = line [: (- 1)] return line Is there a bug in the code above?
No
379
[ "#NEWLINE#", "def test_regression_12851(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Regression for #12851\\n\\n Deferred fields are used correctly if you select_related a subset\\n of fields.\\n '", "#NEWLINE#", "australia", "=", "Country", ".", "objects...
false
0
[ "73", "100", "111", "burke", "9", "49", "australia", "52", "c1", "35", "66", "134", "wa", "145", "172", "183", "194", "203", "232", "243", "254", "263", "290", "301", "312", "troy", "22", "70", "138", "active", "2", "96", "107", "168", "179", "19...
0
NONE
[]
[ [ { "before_index": 6, "after_index": 7, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 16, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 21, "after_index": 29...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "AppScale/appscale/AppServer/lib/django-1.4/tests/regressiontests/select_related_regress/tests.py", "license": "apache-2.0", "note": "license: github_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def test_regression_12851(self) : ' Regression for #12851 Deferred fields are used correctly if you select_related a subset of fields. ' australia = Country.objects.create (name = 'Australia') active = ClientStatus.objects.create (name = 'active') wa = State.objects.create (name = 'Western Australia', country = australia) c1 = Client.objects.create (name = 'Brian Burke', state = wa, status = active) burke = Client.objects.select_related ('state').defer ('state__name').get (name = 'Brian Burke') self.assertEqual (burke.name, 'Brian Burke') self.assertEqual (burke.state.name, 'Western Australia') sc1 = SpecialClient.objects.create (name = 'Troy Buswell', state = wa, status = active, value = 42) troy = SpecialClient.objects.select_related ('state').defer ('state__name').get (name = 'Troy Buswell') self.assertEqual (troy.name, 'Troy Buswell') self.assertEqual (troy.value, 42) self.assertEqual (troy.state.name, 'Western Australia') troy = SpecialClient.objects.select_related ('state').defer ('value', 'state__name').get (name = 'Troy Buswell') self.assertEqual (troy.name, 'Troy Buswell') self.assertEqual (troy.value, 42) self.assertEqual (troy.state.name, 'Western Australia') troy = SpecialClient.objects.select_related ('state').only ('name').get (name = 'Troy Buswell') self.assertEqual (troy.name, 'Troy Buswell') self.assertEqual (troy.value, 42) self.assertEqual (troy.state.name, 'Western Australia') Is there a bug in the code above?
No
380
[ "#NEWLINE#", "def __call__(", "self", ",", "func", ")", ":", "#NEWLINE#", "#INDENT#", "metadict", "=", "{", "#NEWLINE#", "#INDENT#", "#NEWLINE#", "#UNINDENT#", "}", "#NEWLINE#", "metadict", "[", "'label'", "]", "=", "_clean_label", "(", "func", ".", "__name__", ...
false
0
[ "9", "18", "30", "39", "46", "55", "64", "73", "84", "metadict", "2", "51", "60", "69", "self", "4", "25", "35", "80", "87", "func" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 11, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 24...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "datafolklabs/cement/cement/ext/ext_argparse.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 __call__(self, func) : metadict = { } metadict ['label'] = _clean_label (func.__name__) metadict ['func_name'] = func.__name__ metadict ['exposed'] = True metadict ['hide'] = self.hide metadict ['arguments'] = self.arguments metadict ['parser_options'] = self.parser_options metadict ['controller'] = None func.__cement_meta__ = metadict return func Is there a bug in the code above?
No
381
[ "#NEWLINE#", "def child_relationship_restore(", "self", ",", "crid", ")", ":", "#NEWLINE#", "#INDENT#", "'https://familysearch.org/developers/docs/api/tree/Child-and-Parents_Relationship_Restore_resource'", "#NEWLINE#", "return", "(", "(", "self", ".", "child_base", "+", "crid", ...
false
0
[ "2", "14", "self", "4", "18", "crid" ]
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": 20,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "AmEv7Fam/familysearch-python-sdk-opensource/familysearch/parentsAndChildren.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 child_relationship_restore(self, crid) : 'https://familysearch.org/developers/docs/api/tree/Child-and-Parents_Relationship_Restore_resource' return ((self.child_base + crid) + '/restore') Is there a bug in the code above?
No
382
[ "#NEWLINE#", "def test__get__with_inst(", ")", ":", "#NEWLINE#", "#INDENT#", "def wrapped(", "inst", ")", ":", "#NEWLINE#", "#INDENT#", "return", "'a'", "#NEWLINE#", "#UNINDENT#", "decorator", "=", "reify", "(", "wrapped", ")", "#NEWLINE#", "inst", "=", "Dummy", "...
false
0
[ "29", "40", "result", "20", "wrapped", "7", "23", "35", "47", "inst", "16", "31", "decorator" ]
0
NONE
[]
[ [ { "before_index": 15, "after_index": 19, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 22, "after_index": 26, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 28, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "morepath/morepath/morepath/tests/test_reify.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__get__with_inst() : def wrapped(inst) : return 'a' decorator = reify (wrapped) inst = Dummy () result = decorator.__get__ (inst) assert (result == 'a') assert (inst.__dict__ ['wrapped'] == 'a') Is there a bug in the code above?
No
383
[ "#NEWLINE#", "def test_priorities_for_fork(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "exec_graph", "=", "ExecutionGraph", "(", "[", "self", ".", "job", "(", "'A'", ",", "passing_fn", ",", "[", "]", ",", "4", ")", ",", "self", ".", "job", "(", "'B'", ...
false
0
[ "2", "12", "26", "41", "58", "88", "95", "99", "self", "7", "62", "92", "exec_graph" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 57, "after_index": 65, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 87, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pantsbuild/pants/tests/python/pants_test/tasks/test_execution_graph.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_priorities_for_fork(self) : exec_graph = ExecutionGraph ([self.job ('A', passing_fn, [], 4), self.job ('B', passing_fn, ['A'], 2), self.job ('C', passing_fn, ['A'], 1)]) self.assertEqual (exec_graph._job_priority, { 'A' : 6, 'B' : 2, 'C' : 1, }) self.execute (exec_graph) self.assertEqual (self.jobs_run, ['A', 'B', 'C']) Is there a bug in the code above?
No
384
[ "#NEWLINE#", "def __init__(", "self", ",", "initial_size", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "num_cables", "=", "initial_size", "#NEWLINE#", "feature_shape", "=", "(", "self", ".", "num_cables", ",", "1", ")", "#NEWLINE#", "self", ".", "INITIAL_TIM...
true
44
[ "2", "9", "18", "25", "31", "36", "44", "15", "4", "13" ]
1
VARIABLE_MISUSE
[ 15 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 21...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "matt2000/becca/core/spindle.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, initial_size) : self.num_cables = initial_size feature_shape = (self.num_cables, 1) self.INITIAL_TIME = 10000000000.0 self.time_since_seen = (self.INITIAL_TIME * np.ones (self)) Is there a bug in the code above?
Yes
385
[ "#NEWLINE#", "def CalculateModelPredictions(", "self", ",", "inCoeffs", ",", "inDataCacheDictionary", ")", ":", "#NEWLINE#", "#INDENT#", "x_in", "=", "inDataCacheDictionary", "[", "'X'", "]", "#NEWLINE#", "x_PowX2", "=", "inDataCacheDictionary", "[", "'PowX_2.0'", "]", ...
true
170
[ "2", "142", "154", "39", "94", "53", "108", "6", "13", "20", "27", "152", "74", "134", "85", "148", "25", "110", "136", "60", "120", "4", "34", "41", "48", "55", "62", "69", "76", "150", "11", "96", "122", "170", "46", "101", "67", "127", "...
1
VARIABLE_MISUSE
[ 6, 13, 20, 27, 152 ]
[ [ { "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": 17, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "zunzun/pyeq2/Models_2D/NIST.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 CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary) : x_in = inDataCacheDictionary ['X'] x_PowX2 = inDataCacheDictionary ['PowX_2.0'] x_PowX3 = inDataCacheDictionary ['PowX_3.0'] a = inCoeffs [0] b = inCoeffs [1] c = inCoeffs [2] d = inCoeffs [3] f = inCoeffs [4] g = inCoeffs [5] h = inCoeffs [6] try : temp = ((((a + (b * x_in)) + (c * x_PowX2)) + (d * x_PowX3)) / (((1.0 + (f * x_in)) + (g * x_PowX2)) + (h * x_PowX3))) return self.extendedVersionHandler.GetAdditionalModelPredictions (temp, inCoeffs, inDataCacheDictionary, self) except : return (numpy.ones (len (x_in ['DependentData'])) * 1e+300) Is there a bug in the code above?
Yes
386
[ "#NEWLINE#", "def __isub__(", "self", ",", "other", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "_address", "-=", "long", "(", "other", ")", "#NEWLINE#", "if", "(", "self", ".", "host", "==", "(", "(", "~", "self", ".", "_mask", ")", "&", "42949672...
true
46
[ "2", "9", "20", "27", "38", "4", "15", "46" ]
1
VARIABLE_MISUSE
[ 2, 9, 20, 27, 38 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 14,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "kdart/pycopia/core/pycopia/ipv4.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 __isub__(self, other) : self._address -= long (other) if (self.host == ((~ self._mask) & 4294967295)) : self._address -= 2 return other Is there a bug in the code above?
Yes
387
[ "#NEWLINE#", "def extend(", "self", ",", "axis", ",", "delta", ",", "npoints", ")", ":", "#NEWLINE#", "#INDENT#", "\"\\n Construct a new :class:`FlowSolution` by replication.\\n The existing ghosts/rind planes specification is retained.\\n\\n axis: 'i', 'j', or 'k'\\n ...
true
32
[ "2", "50", "87", "133", "175", "4", "32", "66", "91", "114", "137", "160", "6", "18", "93", "139", "179", "8", "95", "141", "181", "46", "57", "105", "151" ]
1
VARIABLE_MISUSE
[ 8, 95, 141, 181 ]
[ [ { "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": "OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/datatypes/domain/flow.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 extend(self, axis, delta, npoints) : " Construct a new :class:`FlowSolution` by replication. The existing ghosts/rind planes specification is retained. axis: 'i', 'j', or 'k' Index axis to extend. delta: float. Direction. A negative value adds points before the current zero-index of `axis`. npoints: int > 0 Number of points to add in `axis` dimension. " if (not delta) : raise ValueError ('delta must be non-zero') if (axis < 1) : raise ValueError ('npoints must be >= 1') i = len (self.shape) if (i == 3) : if (axis not in ('i', 'j', 'k')) : raise ValueError ('axis must be i, j, or k') return self._extend_3d (axis, delta, npoints) else : if (i == 2) : if (axis not in ('i', 'j')) : raise ValueError ('axis must be i or j') return self._extend_2d (axis, delta, npoints) else : if (i == 1) : if (axis != 'i') : raise ValueError ('axis must be i') return self._extend_1d (delta, npoints) else : raise RuntimeError ('FlowSolution is empty!') Is there a bug in the code above?
Yes
388
[ "#NEWLINE#", "def _get_plugin_stats(", "self", ",", "name", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Used for getting stats for Plugin based stuff, like Kafka Monitor\\n and Redis Monitor\\n\\n @param name: the main class stats name\\n @return: A formatted dict of stats...
true
122
[ "20", "26", "41", "11", "89", "94", "107", "137", "142", "159", "167", "183", "210", "2", "22", "115", "194", "4", "34", "122", "61", "112", "191", "201", "54", "71", "77", "87", "96", "109", "157", "172", "188", "45", "56", "63", "39", "47",...
1
VARIABLE_MISUSE
[ 61, 112, 191, 201 ]
[ [ { "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": "istresearch/scrapy-cluster/redis-monitor/plugins/stats_monitor.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_plugin_stats(self, name) : ' Used for getting stats for Plugin based stuff, like Kafka Monitor and Redis Monitor @param name: the main class stats name @return: A formatted dict of stats ' the_dict = { } keys = self.redis_conn.keys ('stats:{n}:*'.format (n = name)) for key in keys : elements = key.split (':') main = elements [2] end = elements [3] if ((main == 'total') or (main == 'fail')) : if (main not in the_dict) : the_dict [main] = { } the_dict [main] [end] = self._get_key_value (key, (name == 'lifetime')) else : if ('plugins' not in the_dict) : the_dict ['plugins'] = { } if (main not in the_dict ['plugins']) : the_dict ['plugins'] [main] = { } the_dict ['plugins'] [main] [end] = self._get_key_value (key, (end == 'lifetime')) return the_dict Is there a bug in the code above?
Yes
389
[ "#NEWLINE#", "def read(", "self", ",", "n", "=", "4096", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "len", "(", "self", ".", "chunks", ")", "==", "0", ")", ":", "#NEWLINE#", "#INDENT#", "return", "''", "#NEWLINE#", "#UNINDENT#", "else", ":", "#NEWLINE...
true
96
[ "50", "76", "109", "4", "45", "86", "96", "103", "2", "15", "37", "52", "59", "63", "78", "89" ]
1
VARIABLE_MISUSE
[ 2, 15, 37, 52, 59, 63, 78, 89 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 19, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "d11wtq/dockerpty/tests/unit/test_io.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 read(self, n = 4096) : if (len (self.chunks) == 0) : return '' else : if (len (self.chunks [0]) <= n) : chunk = self.chunks [0] self.chunks = self.chunks [1 :] else : chunk = self.chunks [0] [: n] self.chunks [0] = n.chunks [0] [n :] return chunk Is there a bug in the code above?
Yes
390
[ "#NEWLINE#", "def test_add_project_user_update_error_domain(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "domain", "=", "self", ".", "domains", ".", "get", "(", "id", "=", "'1'", ")", "#NEWLINE#", "self", ".", "setSessionValues", "(", "domain_context", "=", "doma...
true
32
[ "7", "26", "2", "9", "20", "32", "37" ]
1
VARIABLE_MISUSE
[ 7, 26 ]
[ [ { "before_index": 6, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 29, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 36, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "CiscoSystems/avos/openstack_dashboard/dashboards/identity/projects/tests.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_add_project_user_update_error_domain(self) : domain = self.domains.get (id = '1') self.setSessionValues (domain_context = domain.id, domain_context_name = self.name) self.test_add_project_user_update_error () Is there a bug in the code above?
Yes
391
[ "#NEWLINE#", "def RemoteCommand(", "self", ",", "command", ",", "should_log", "=", "False", ",", "retries", "=", "SSH_RETRIES", ",", "ignore_failure", "=", "False", ",", "login_shell", "=", "False", ",", "suppress_warning", "=", "False", ",", "timeout", "=", "...
true
44
[ "2", "34", "6", "40", "14", "18", "46", "26", "50", "4", "38", "10", "42", "44", "22", "48" ]
1
VARIABLE_MISUSE
[ 14 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 33, "after_index": 39, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 39, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/linux_virtual_machine.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 RemoteCommand(self, command, should_log = False, retries = SSH_RETRIES, ignore_failure = False, login_shell = False, suppress_warning = False, timeout = None) : return self.RemoteHostCommand (command, should_log, retries, retries, login_shell, suppress_warning, timeout) Is there a bug in the code above?
Yes
392
[ "#NEWLINE#", "def get_context_data(", "self", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "context", "=", "{", "#NEWLINE#", "#INDENT#", "'custom_key'", ":", "'custom_value'", ",", "#NEWLINE#", "#UNINDENT#", "}", "#NEWLINE#", "context", ".", "update", "(", ...
true
40
[ "2", "34", "26", "40", "9", "22" ]
1
VARIABLE_MISUSE
[ 9, 22 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 11, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 21, "after_index": 25...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "cloudera/hue/desktop/core/ext-py/Django-1.6.10/tests/generic_views/views.py", "license": "apache-2.0", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def get_context_data(self, **kwargs) : context = { 'custom_key' : 'custom_value', } context.update (kwargs) return super (CustomContextView, self).get_context_data (** kwargs) Is there a bug in the code above?
Yes
393
[ "#NEWLINE#", "def test_terms_a_dict_not_a_list(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "pcso_input", "=", "[", "{", "#NEWLINE#", "#INDENT#", "'options'", ":", "{", "#NEWLINE#", "#INDENT#", "'type'", ":", "'column'", ",", "#NEWLINE#", "#UNINDENT#", "}", ",", ...
true
62
[ "7", "2", "54", "62", "64" ]
1
VARIABLE_MISUSE
[ 7 ]
[ [ { "before_index": 6, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 53, "after_index": 59, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 59, "after_index": 5...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pgollakota/django-chartit/chartit_tests/validation/tests.py", "license": "bsd-2-clause", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def test_terms_a_dict_not_a_list(self) : pcso_input = [{ 'options' : { 'type' : 'column', }, 'terms' : { 'avg_price_all' : { 'type' : 'area', }, }, }] self.assertRaises (APIInputError, clean_pcso, self, self.ds) Is there a bug in the code above?
Yes
394
[ "#NEWLINE#", "def __init__(", "self", ",", "input_stream", ",", "record_marker", "=", "'ref'", ",", "record_level_markers", "=", "[", "'ref'", ",", "'id'", ",", "'dt'", ",", "'ELANBegin'", ",", "'ELANEnd'", ",", "'ELANParticipant'", "]", ",", "utterance_level_mark...
true
71
[ "10", "71", "104", "106", "4", "63", "65", "6", "69", "26", "110", "117", "121", "126", "146", "40", "75", "99", "2", "49", "55", "61", "67", "82", "95", "102", "108", "115", "124", "130", "144", "150", "164", "171", "177", "191", "198", "204...
1
VARIABLE_MISUSE
[ 6, 69 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 46, "after_index": 47, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 48, "after_index": 5...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "cidles/poio-api/src/poioapi/io/toolbox.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, input_stream, record_marker = 'ref', record_level_markers = ['ref', 'id', 'dt', 'ELANBegin', 'ELANEnd', 'ELANParticipant'], utterance_level_markers = ['rf', 'rt', 'np', 'graid', 'pr'], mapper = None) : "Class's constructor. Parameters ---------- input_stream : str or IO stream Path of the Toolbox TXT file. record_marker : str The marker that marks the start of a Toolbox record in the input file. " self._input_stream = None self.tier_hierarchy = None self.input_stream = input_stream self.record_marker = record_level_markers if (mapper is None) : self._tier_labels = tier_mapping () else : self._tier_labels = mapper self.record_level_markers = record_level_markers self.utterance_level_markers = [] self.utterance_level_markers.extend (utterance_level_markers) self.utterance_level_markers.extend (self._tier_labels.tier_labels (poioapi.data.TIER_TRANSLATION)) self.utterance_level_markers.extend (self._tier_labels.tier_labels (poioapi.data.TIER_COMMENT)) self.word_level_markers = [] self.word_level_markers.extend (self._tier_labels.tier_labels (poioapi.data.TIER_WORD)) self.morpheme_level_markers = [] self.morpheme_level_markers.extend (self._tier_labels.tier_labels (poioapi.data.TIER_MORPHEME)) self.tag_level_markers = [] self.tag_level_markers.extend (self._tier_labels.tier_labels (poioapi.data.TIER_GLOSS)) self.tag_level_markers.extend (self._tier_labels.tier_labels (poioapi.data.TIER_POS)) self.parse () Is there a bug in the code above?
Yes
395
[ "#NEWLINE#", "def revive_drive(", "self", ",", "device", ")", ":", "#NEWLINE#", "#INDENT#", "disabled_name", "=", "(", "device", "+", "'X'", ")", "#NEWLINE#", "if", "os", ".", "path", ".", "isdir", "(", "disabled_name", ")", ":", "#NEWLINE#", "#INDENT#", "re...
true
52
[ "9", "24", "52", "2", "4", "12", "32", "37" ]
1
VARIABLE_MISUSE
[ 4, 12, 32, 37 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 23...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/swift/test/probe/common.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 revive_drive(self, device) : disabled_name = (device + 'X') if os.path.isdir (disabled_name) : renamer ((device + 'X'), device) else : os.system (('sudo mount %s' % disabled_name)) Is there a bug in the code above?
Yes
396
[ "#NEWLINE#", "def __init__(", "self", ",", "request", ",", "*", "args", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "super", "(", "GeneralConfigAction", ",", "self", ")", ".", "__init__", "(", "request", ",", "*", "request", ",", "**", "kwargs", ")...
true
26
[ "2", "18", "59", "79", "95", "119", "33", "116", "29", "35", "140", "7", "4", "23", "26", "42", "52", "83" ]
1
VARIABLE_MISUSE
[ 7 ]
[ [ { "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": 24,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "CiscoSystems/avos/openstack_dashboard/dashboards/project/data_processing/clusters/workflows/create.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, request, * args, **kwargs) : super (GeneralConfigAction, self).__init__ (request, * request, ** kwargs) (plugin, hadoop_version) = whelpers.get_plugin_and_hadoop_version (request) if saharaclient.base.is_service_enabled (request, 'network') : self.fields ['neutron_management_network'] = forms.ChoiceField (label = _ ('Neutron Management Network'), choices = self.populate_neutron_management_network_choices (request, { })) self.fields ['plugin_name'] = forms.CharField (widget = forms.HiddenInput (), initial = plugin) self.fields ['hadoop_version'] = forms.CharField (widget = forms.HiddenInput (), initial = hadoop_version) Is there a bug in the code above?
Yes
397
[ "#NEWLINE#", "@", "on_trait_change", "(", "'model.value_item'", ")", "#NEWLINE#", "def _on_model_value_item_change(", "self", ",", "value_item", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "value_item", "is", "None", ")", ":", "#NEWLINE#", "#INDENT#", "return", "#...
true
48
[ "8", "31", "68", "10", "17", "29", "46", "54", "65", "40", "48", "63", "76" ]
1
VARIABLE_MISUSE
[ 8, 31, 68 ]
[ [ { "before_index": 1, "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": 27, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "enthought/pikos/pikos/live/ui/base_view.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] }}
@ on_trait_change ('model.value_item') def _on_model_value_item_change(self, value_item) : if (value_item is None) : return if (value_item in self.model.UNITS) : value_title = '{0} ({1})'.format (value_item, value_title.model.UNITS [value_item]) else : value_title = value_item self.plot.y_axis.title = value_title Is there a bug in the code above?
Yes
398
[ "#NEWLINE#", "def grep(", "pat", ",", "list", ",", "case", "=", "1", ")", ":", "#NEWLINE#", "#INDENT#", "'Simple minded grep-like function.\\n grep(pat,list) returns occurrences of pat in list, None on failure.\\n\\n It only does simple string matching, with no support for regexps. U...
true
38
[ "15", "38", "49", "99", "112", "118", "2", "65", "4", "28", "74", "6", "21", "26", "34", "53", "72", "80", "103", "63", "88" ]
1
VARIABLE_MISUSE
[ 2, 65 ]
[ [ { "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": "ipython/ipython-py3k/IPython/utils/text.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 grep(pat, list, case = 1) : 'Simple minded grep-like function. grep(pat,list) returns occurrences of pat in list, None on failure. It only does simple string matching, with no support for regexps. Use the option case=0 for case-insensitive matching.' out = [] if case : for term in list : if (term.find (out) > (- 1)) : out.append (term) else : lpat = pat.lower () for term in list : if (term.lower ().find (lpat) > (- 1)) : out.append (term) if len (out) : return out else : return None Is there a bug in the code above?
Yes
399
[ "#NEWLINE#", "def test_get_items_to_be_processed(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "p", "=", "PillowError", "(", "queued", "=", "False", ",", "date_created", "=", "(", "datetime", ".", "datetime", ".", "utcnow", "(", ")", "-", "datetime", ".", "tim...
true
116
[ "2", "85", "112", "116", "94", "7", "79", "89" ]
1
VARIABLE_MISUSE
[ 94 ]
[ [ { "before_index": 6, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 78, "after_index": 82, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 84, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "dimagi/commcare-hq/corehq/apps/hqpillow_retry/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_get_items_to_be_processed(self) : p = PillowError (queued = False, date_created = (datetime.datetime.utcnow () - datetime.timedelta (days = 1)), date_next_attempt = (datetime.datetime.utcnow () - datetime.timedelta (days = 2)), date_last_attempt = (datetime.datetime.utcnow () - datetime.timedelta (days = 3))) p.save () self.addCleanup (p.delete) errors = list (PillowRetryEnqueuingOperation.get_items_to_be_processed (datetime.datetime.utcnow ())) self.assertTrue (self) Is there a bug in the code above?
Yes