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
800
[ "#NEWLINE#", "def common_params(", "task_instance", ",", "task_cls", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Grab all the values in task_instance that are found in task_cls.\\n '", "#NEWLINE#", "if", "(", "not", "isinstance", "(", "task_cls", ",", "task", ".", "Registe...
true
113
[ "87", "98", "102", "119", "123", "33", "73", "4", "16", "52", "91", "48", "78", "63", "104", "125", "83", "137", "2", "37", "115", "133", "107", "142", "113", "129", "147" ]
1
VARIABLE_MISUSE
[ 87, 98, 102, 119, 123 ]
[ [ { "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": 13,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "spotify/luigi/luigi/util.py", "license": "apache-2.0", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def common_params(task_instance, task_cls) : ' Grab all the values in task_instance that are found in task_cls. ' if (not isinstance (task_cls, task.Register)) : raise TypeError ('task_cls must be an uninstantiated Task') task_instance_param_names = dict (task_instance.get_params ()).keys () task_cls_param_names = dict (task_cls.get_params ()).keys () common_param_names = list (set.intersection (set (task_instance_param_names), set (task_cls_param_names))) common_param_vals = [(key, dict (task_cls.get_params ()) [key]) for key in common_param_names] common_kwargs = dict ([(vals, task_instance.param_kwargs [key]) for key in common_param_names]) vals = dict (task_instance.get_param_values (common_param_vals, [], common_kwargs)) return vals Is there a bug in the code above?
Yes
801
[ "#NEWLINE#", "@", "validate", "(", "name", "=", "IN_FILTER", ")", "#NEWLINE#", "def validate_in_filters(", "filters", ")", ":", "#NEWLINE#", "#INDENT#", "return", "[", "valid_filter", "(", "filters", ")", "for", "filter_", "in", "filters", "]" ]
true
19
[ "22", "10", "19", "24" ]
1
VARIABLE_MISUSE
[ 22 ]
[ [ { "before_index": 15, "after_index": 16, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 3, "after_index": 2, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 16, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "osrg/ryu/ryu/services/protocols/bgp/rtconf/neighbors.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] }}
@ validate (name = IN_FILTER) def validate_in_filters(filters) : return [valid_filter (filters) for filter_ in filters] Is there a bug in the code above?
Yes
802
[ "#NEWLINE#", "def unpack_args(", "args", ")", ":", "#NEWLINE#", "#INDENT#", "try", ":", "#NEWLINE#", "#INDENT#", "(", "f", ",", "idx", ",", "nmax", ",", "k", ",", "i", ",", "j", ",", "Qt", ",", "base", ",", "hdry", ")", "=", "args", "#NEWLINE#", "#UN...
true
109
[ "28", "111", "62", "95", "109", "16", "99", "24", "107", "20", "103", "26", "14", "97", "54", "65", "22", "105", "18", "101", "2", "31", "12", "93" ]
1
VARIABLE_MISUSE
[ 26 ]
[ [ { "before_index": 92, "after_index": 96, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 31, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 53, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "modflowpy/flopy/examples/groundwater_paper/scripts/uspb_capture_par.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 unpack_args(args) : try : (f, idx, nmax, k, i, j, Qt, base, hdry) = args except : sys.stdout.write ('could not unpack args ') raise try : current = mp.current_process () imod = (current._identity [0] - 1) except : sys.stdout.write ('could not get current process ') raise return f (imod, idx, nmax, k, i, j, Qt, imod, hdry) Is there a bug in the code above?
Yes
803
[ "#NEWLINE#", "def get_plan(", "self", ",", "code", ")", ":", "#NEWLINE#", "#INDENT#", "response", "=", "self", ".", "client", ".", "make_request", "(", "path", "=", "'plans/get'", ",", "params", "=", "{", "#NEWLINE#", "#INDENT#", "'code'", ":", "code", ",", ...
true
58
[ "4", "28", "61", "2", "11", "58", "41", "63", "52", "67", "9", "47", "35", "43" ]
1
VARIABLE_MISUSE
[ 61 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 34, "after_index": 38...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "SeanOC/sharpy/sharpy/product.py", "license": "bsd-3-clause", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def get_plan(self, code) : response = self.client.make_request (path = 'plans/get', params = { 'code' : code, }) plans_parser = PlansParser () plans_data = plans_parser.parse_xml (response.content) plans = [PricingPlan (** self) for plan_data in plans_data] return plans [0] Is there a bug in the code above?
Yes
804
[ "#NEWLINE#", "def create(", "kernel", ")", ":", "#NEWLINE#", "#INDENT#", "result", "=", "Tangible", "(", ")", "#NEWLINE#", "result", ".", "template", "=", "'object/tangible/instrument/shared_organ_max_rebo.iff'", "#NEWLINE#", "result", ".", "attribute_template_id", "=", ...
true
38
[ "7", "13", "19", "28", "2", "38" ]
1
VARIABLE_MISUSE
[ 7, 13, 19, 28 ]
[ [ { "before_index": 6, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 17, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "anhstudios/swganh/data/scripts/templates/object/tangible/instrument/shared_organ_max_rebo.py", "license": "mit", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def create(kernel) : result = Tangible () result.template = 'object/tangible/instrument/shared_organ_max_rebo.iff' result.attribute_template_id = (- 1) result.stfName ('obj_n', 'obj_nalargon') return kernel Is there a bug in the code above?
Yes
805
[ "#NEWLINE#", "@", "pytest", ".", "mark", ".", "parametrize", "(", "'headers'", ",", "(", "example_request_headers", ",", "bytes_example_request_headers", ")", ")", "#NEWLINE#", "@", "pytest", ".", "mark", ".", "parametrize", "(", "'cookie_header'", ",", "unsecured...
true
117
[ "43", "102", "106", "30", "53", "109", "128", "34", "49", "61", "70", "32", "46", "56", "115", "36", "111", "117", "78", "88", "94", "100", "122" ]
1
VARIABLE_MISUSE
[ 53 ]
[ [ { "before_index": 1, "after_index": 31, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 40, "after_index": 41, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 42, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "python-hyper/hyper-h2/test/test_header_indexing.py", "license": "mit", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
@ pytest.mark.parametrize ('headers', (example_request_headers, bytes_example_request_headers)) @ pytest.mark.parametrize ('cookie_header', unsecured_cookie_headers) def test_long_cookie_headers_can_be_indexed(self, headers, cookie_header, frame_factory) : ' Longer cookie headers can be indexed. ' send_headers = (headers + [cookie_header]) expected_headers = (headers + [HeaderTuple (cookie_header [0].lower (), cookie_header [1])]) c = h2.connection.H2Connection () c.initiate_connection () c.clear_outbound_data_buffer () c.send_headers (1, send_headers) f = frame_factory.build_headers_frame (headers = frame_factory) assert (c.data_to_send () == f.serialize ()) Is there a bug in the code above?
Yes
806
[ "#NEWLINE#", "def get(", "self", ",", "*", "args", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "return", "(", "200", ",", "{", "#NEWLINE#", "#INDENT#", "'test'", ":", "{", "#NEWLINE#", "#INDENT#", "'extra_data'", ":", "self", ".", "serialize_extra_data...
true
30
[ "5", "30", "2", "26" ]
1
VARIABLE_MISUSE
[ 2, 26 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 3, "after_index": 5, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 15,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "reviewboard/reviewboard/reviewboard/extensions/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 get(self, * args, **kwargs) : return (200, { 'test' : { 'extra_data' : self.serialize_extra_data_field (args), }, }) Is there a bug in the code above?
Yes
807
[ "#NEWLINE#", "@", "mock", ".", "patch", ".", "object", "(", "conductor_utils", ",", "'_get_cleaning_steps'", ")", "#NEWLINE#", "def test__validate_user_clean_steps_missing_required_arg(", "self", ",", "mock_steps", ")", ":", "#NEWLINE#", "#INDENT#", "node", "=", "obj_ut...
true
116
[ "16", "32", "119", "46", "21", "91", "14", "27", "37", "41", "87", "100", "96", "114", "116", "123" ]
1
VARIABLE_MISUSE
[ 46 ]
[ [ { "before_index": 1, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 20, "after_index": 26, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 31, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/ironic/ironic/tests/unit/conductor/test_utils.py", "license": "apache-2.0", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
@ mock.patch.object (conductor_utils, '_get_cleaning_steps') def test__validate_user_clean_steps_missing_required_arg(self, mock_steps) : node = obj_utils.create_test_node (self.context) mock_steps.return_value = [self.power_update, self.deploy_raid] user_steps = [{ 'step' : 'update_firmware', 'interface' : 'power', }, { 'step' : 'build_raid', 'interface' : 'deploy', }] with task_manager.acquire (self.context, node.uuid) as task : self.assertRaisesRegexp (exception.InvalidParameterValue, 'build_raid.*missing.*arg1', conductor_utils._validate_user_clean_steps, task, task) mock_steps.assert_called_once_with (task, enabled = False, sort = False) Is there a bug in the code above?
Yes
808
[ "#NEWLINE#", "def write(", "self", ",", "ostream", ")", ":", "#NEWLINE#", "#INDENT#", "tstream", "=", "BytearrayStream", "(", ")", "#NEWLINE#", "self", ".", "private_key_uuid", ".", "write", "(", "tstream", ")", "#NEWLINE#", "self", ".", "public_key_uuid", ".", ...
true
71
[ "9", "21", "30", "50", "79", "101", "4", "71", "94", "97", "2", "15", "24", "35", "44", "56", "65", "75", "89" ]
1
VARIABLE_MISUSE
[ 9, 21, 30, 50, 79, 101 ]
[ [ { "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": 20...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "OpenKMIP/PyKMIP/kmip/core/messages/payloads/create_key_pair.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 write(self, ostream) : tstream = BytearrayStream () self.private_key_uuid.write (tstream) self.public_key_uuid.write (tstream) if (self.private_key_template_attribute is not None) : self.private_key_template_attribute.write (tstream) if (self.public_key_template_attribute is not None) : self.public_key_template_attribute.write (ostream) self.length = tstream.length () super (CreateKeyPairResponsePayload, self).write (ostream) ostream.write (tstream.buffer) Is there a bug in the code above?
Yes
809
[ "#NEWLINE#", "def __init__(", "self", ",", "db_object", "=", "None", ",", "deployment_uuid", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "if", "db_object", ":", "#NEWLINE#", "#INDENT#", "self", ".", "db_object", "=", "self", "#NEWLINE#", "#UNINDENT#", "else"...
true
24
[ "8", "39", "2", "20", "24", "31", "4", "16", "22", "33" ]
1
VARIABLE_MISUSE
[ 4, 16, 22, 33 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 15, "after_index": 16, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/rally/rally/common/objects/verification.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, db_object = None, deployment_uuid = None) : if db_object : self.db_object = self else : self.db_object = db.verification_create (deployment_uuid) Is there a bug in the code above?
Yes
810
[ "#NEWLINE#", "def test_file_wrapper_no_sendfile(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "env", "=", "{", "#NEWLINE#", "#INDENT#", "'SERVER_PROTOCOL'", ":", "'HTTP/1.0'", ",", "#NEWLINE#", "#UNINDENT#", "}", "#NEWLINE#", "handler", "=", "FileWrapperHandler", "(", ...
false
0
[ "7", "34", "env", "2", "44", "53", "78", "self", "20", "37", "48", "57", "82", "handler" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 25, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 36, "after_index": 4...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "django/django/tests/builtin_server/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_file_wrapper_no_sendfile(self) : env = { 'SERVER_PROTOCOL' : 'HTTP/1.0', } handler = FileWrapperHandler (None, BytesIO (), BytesIO (), env) handler.run (wsgi_app) self.assertFalse (handler._used_sendfile) self.assertEqual (handler.stdout.getvalue ().splitlines () [(- 1)], b'Hello World!') self.assertEqual (handler.stderr.getvalue (), b'') Is there a bug in the code above?
No
811
[ "#NEWLINE#", "@", "classmethod", "#NEWLINE#", "def name_matches_object(", "cls", ",", "name", ",", "task_id", "=", "None", ",", "exact", "=", "True", ")", ":", "#NEWLINE#", "#INDENT#", "\"Determine if a resource name could have been created by this class.\\n\\n :param ...
false
0
[ "43", "118", "143", "152", "168", "190", "subst", "5", "24", "30", "93", "123", "cls", "13", "176", "exact", "7", "201", "name", "181", "197", "name_re", "22", "28", "37", "199", "match", "35", "54", "67", "80", "103", "131", "159", "parts", "9",...
0
NONE
[]
[ [ { "before_index": 1, "after_index": 6, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 21, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/rally/rally/common/utils.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 name_matches_object(cls, name, task_id = None, exact = True) : "Determine if a resource name could have been created by this class. :param name: The resource name to check against this class's RESOURCE_NAME_FORMAT. :param task_id: The task ID that must match the task portion of the random name :param exact: If False, then additional information may follow the expected name. (For instance, this is useful when bulk creating instances, since Nova automatically appends a UUID to each instance created thusly.) :returns: bool " match = cls._resource_name_placeholder_re.match (cls.RESOURCE_NAME_FORMAT) parts = match.groupdict () subst = { 'prefix' : re.escape (parts ['prefix']), 'sep' : re.escape (parts ['sep']), 'suffix' : re.escape (parts ['suffix']), 'chars' : re.escape (cls.RESOURCE_NAME_ALLOWED_CHARACTERS), 'rand_length' : len (parts ['rand']), } if task_id : subst ['task_id'] = cls._generate_task_id_part (task_id, len (parts ['task'])) else : subst ['task_id'] = ('[%s]{%s}' % (subst ['chars'], len (parts ['task']))) subst ['extra'] = ('' if exact else '.*') name_re = re.compile (('%(prefix)s%(task_id)s%(sep)s[%(chars)s]{%(rand_length)s}%(suffix)s%(extra)s$' % subst)) return bool (name_re.match (name)) Is there a bug in the code above?
No
812
[ "#NEWLINE#", "def build_BinOp(", "self", ",", "o", ")", ":", "#NEWLINE#", "#INDENT#", "(", "left", ",", "op", ",", "right", ")", "=", "map", "(", "self", ".", "build", ",", "[", "o", ".", "left", ",", "o", ".", "op", ",", "o", ".", "right", "]", ...
false
0
[ "14", "34", "43", "right", "4", "24", "28", "32", "o", "12", "30", "39", "op", "2", "19", "self", "10", "26", "41", "left" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 22, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 38, "after_index": 42...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "AppScale/appscale/AppServer/lib/cherrypy/cherrypy/lib/reprconf.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 build_BinOp(self, o) : (left, op, right) = map (self.build, [o.left, o.op, o.right]) return op (left, right) Is there a bug in the code above?
No
813
[ "#NEWLINE#", "def on_message(", "self", ",", "body", ",", "message", ")", ":", "#NEWLINE#", "#INDENT#", "event", "=", "body", "[", "'event'", "]", "#NEWLINE#", "self", ".", "handlers", "[", "event", "]", "(", "**", "body", ")", "#NEWLINE#", "self", ".", ...
false
0
[ "6", "message", "11", "22", "event", "2", "18", "29", "40", "self", "4", "13", "26", "body" ]
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": 17, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "celery/cell/cell/presence.py", "license": "bsd-3-clause", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def on_message(self, body, message) : event = body ['event'] self.handlers [event] (** body) self.debug ('agents after event recv: %s', promise ((lambda : self.agents))) Is there a bug in the code above?
No
814
[ "#NEWLINE#", "@", "mock", ".", "patch", "(", "'oslo_utils.timeutils.is_older_than'", ")", "#NEWLINE#", "@", "mock", ".", "patch", "(", "'oslo_utils.timeutils.parse_strtime'", ")", "#NEWLINE#", "def test_shelved_poll_filters_task_state(", "self", ",", "mock_parse", ",", "m...
false
0
[ "22", "36", "mock_older", "97", "105", "111", "119", "129", "144", "224", "instance2", "42", "50", "58", "66", "76", "91", "instance1", "20", "mock_parse", "150", "165", "229", "data", "197", "fake_soi", "18", "27", "44", "70", "99", "123", "182", "1...
0
NONE
[]
[ [ { "before_index": 1, "after_index": 19, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": 30, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 35, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/compute/test_shelve.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] }}
@ mock.patch ('oslo_utils.timeutils.is_older_than') @ mock.patch ('oslo_utils.timeutils.parse_strtime') def test_shelved_poll_filters_task_state(self, mock_parse, mock_older) : self.flags (shelved_offload_time = 1) mock_older.return_value = True instance1 = self._create_fake_instance_obj () instance1.task_state = task_states.SPAWNING instance1.vm_state = vm_states.SHELVED instance1.host = self.compute.host instance1.system_metadata = { 'shelved_at' : '', } instance1.save () instance2 = self._create_fake_instance_obj () instance2.task_state = None instance2.vm_state = vm_states.SHELVED instance2.host = self.compute.host instance2.system_metadata = { 'shelved_at' : '', } instance2.save () data = [] def fake_soi(context, instance, **kwargs) : data.append (instance.uuid) with mock.patch.object (self.compute, 'shelve_offload_instance') as soi : soi.side_effect = fake_soi self.compute._poll_shelved_instances (self.context) self.assertTrue (soi.called) self.assertEqual ([instance2.uuid], data) Is there a bug in the code above?
No
815
[ "#NEWLINE#", "def check_plausibility(", "args", "=", "[", "]", ",", "fix", "=", "True", ")", ":", "#NEWLINE#", "#INDENT#", "'Called by :manage:`check_plausibility`. See there.'", "#NEWLINE#", "Problem", "=", "rt", ".", "modules", ".", "plausibility", ".", "Problem", ...
false
0
[ "7", "180", "fix", "137", "183", "193", "207", "212", "231", "sums", "102", "123", "154", "qs", "160", "172", "chk", "112", "134", "220", "226", "msg", "2", "31", "args", "148", "176", "obj", "16", "24", "76", "Problem", "167", "190", "todo", "26...
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": "lsaffre/lino/lino/modlib/plausibility/management/commands/checkdata.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 check_plausibility(args = [], fix = True) : 'Called by :manage:`check_plausibility`. See there.' Problem = rt.modules.plausibility.Problem mc = get_checkable_models (* args) with translation.override ('en') : for (m, checkers) in mc.items () : ct = rt.modules.contenttypes.ContentType.objects.get_for_model (m) Problem.objects.filter (owner_type = ct).delete () name = unicode (m._meta.verbose_name_plural) qs = m.objects.all () msg = 'Running {0} plausibility checkers on {1} {2}...'.format (len (checkers), qs.count (), name) puts (msg) sums = [0, 0, name] for obj in progress.bar (qs) : for chk in checkers : (todo, done) = chk.update_problems (obj, False, fix) sums [0] += len (todo) sums [1] += len (done) if (sums [0] or sums [1]) : msg = 'Found {0} and fixed {1} plausibility problems in {2}.' puts (msg.format (* sums)) else : puts ('No plausibility problems found in {0}.'.format (name)) Is there a bug in the code above?
No
816
[ "#NEWLINE#", "def _write_segment_data(", "self", ",", "i", ",", "j", ",", "f_sfr", ")", ":", "#NEWLINE#", "#INDENT#", "cols", "=", "[", "'nseg'", ",", "'icalc'", ",", "'outseg'", ",", "'iupseg'", ",", "'iprior'", ",", "'nstrpts'", ",", "'flow'", ",", "'run...
false
0
[ "90", "308", "roughbk", "82", "243", "runoff", "86", "247", "pptsw", "92", "344", "cdpth", "70", "153", "195", "256", "289", "318", "icalc", "76", "185", "iprior", "78", "214", "nstrpts", "4", "57", "122", "369", "402", "i", "88", "279", "roughch", ...
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 48, "after_index": 5...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "modflowpy/flopy/flopy/modflow/mfsfr2.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 _write_segment_data(self, i, j, f_sfr) : cols = ['nseg', 'icalc', 'outseg', 'iupseg', 'iprior', 'nstrpts', 'flow', 'runoff', 'etsw', 'pptsw', 'roughch', 'roughbk', 'cdpth', 'fdpth', 'awdth', 'bwdth'] fmts = _fmt_string_list (self.segment_data [i] [cols] [j]) (nseg, icalc, outseg, iupseg, iprior, nstrpts, flow, runoff, etsw, pptsw, roughch, roughbk, cdpth, fdpth, awdth, bwdth) = [(0 if (v == self.default_value) else v) for v in self.segment_data [i] [cols] [j]] f_sfr.write ((' '.join (fmts [0 : 4]).format (nseg, icalc, outseg, iupseg) + ' ')) if (iupseg != 0) : f_sfr.write ((fmts [4].format (iprior) + ' ')) if (icalc == 4) : f_sfr.write ((fmts [5].format (nstrpts) + ' ')) f_sfr.write ((' '.join (fmts [6 : 10]).format (flow, runoff, etsw, pptsw) + ' ')) if (icalc in [1, 2]) : f_sfr.write ((fmts [10].format (roughch) + ' ')) if (icalc == 2) : f_sfr.write ((fmts [11].format (roughbk) + ' ')) if (icalc == 3) : f_sfr.write ((' '.join (fmts [12 : 16]).format (cdpth, fdpth, awdth, bwdth) + ' ')) f_sfr.write (' ') self._write_6bc (i, j, f_sfr, cols = ['hcond1', 'thickm1', 'elevup', 'width1', 'depth1', 'thts1', 'thti1', 'eps1', 'uhc1']) self._write_6bc (i, j, f_sfr, cols = ['hcond2', 'thickm2', 'elevdn', 'width2', 'depth2', 'thts2', 'thti2', 'eps2', 'uhc2']) Is there a bug in the code above?
No
817
[ "#NEWLINE#", "def test_filter_with_failing_queryset(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "\"\\n Ensure that when a filter's queryset method fails, it fails loudly and\\n the corresponding exception doesn't get swallowed (#17828).\\n \"", "#NEWLINE#", "modeladmin", "...
false
0
[ "18", "50", "request", "9", "54", "modeladmin", "2", "20", "37", "46", "self" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 7, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 27...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "django/django/tests/admin_filters/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_filter_with_failing_queryset(self) : " Ensure that when a filter's queryset method fails, it fails loudly and the corresponding exception doesn't get swallowed (#17828). " modeladmin = DecadeFilterBookAdminWithFailingQueryset (Book, site) request = self.request_factory.get ('/', { }) with self.assertRaises (ZeroDivisionError) : self.get_changelist (request, Book, modeladmin) Is there a bug in the code above?
No
818
[ "#NEWLINE#", "def find_packages(", "path", "=", "'.'", ",", "base", "=", "''", ",", "exclude", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "'Find all packages in path'", "#NEWLINE#", "if", "(", "not", "exclude", ")", ":", "#NEWLINE#", "#INDENT#", "exclude", ...
false
0
[ "10", "22", "27", "77", "exclude", "43", "64", "98", "100", "110", "item", "2", "49", "58", "62", "path", "6", "84", "94", "96", "base", "54", "71", "75", "118", "126", "dir", "33", "113", "120", "135", "packages", "88", "108", "115", "128", "m...
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 16, "after_index": 17, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "uwescience/raco/setup.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 find_packages(path = '.', base = '', exclude = None) : 'Find all packages in path' if (not exclude) : exclude = [] packages = { } for item in os.listdir (path) : dir = os.path.join (path, item) if (is_package (dir) and (dir not in exclude)) : if base : module_name = '{base}.{item}'.format (base = base, item = item) else : module_name = item packages [module_name] = dir packages.update (find_packages (dir, module_name)) return packages Is there a bug in the code above?
No
819
[ "#NEWLINE#", "def test_empty_response_is_false(", "dummy_response", ")", ":", "#NEWLINE#", "#INDENT#", "dummy_response", "[", "'hits'", "]", "[", "'hits'", "]", "=", "[", "]", "#NEWLINE#", "res", "=", "result", ".", "Response", "(", "dummy_response", ")", "#NEWLIN...
false
0
[ "18", "30", "res", "2", "7", "24", "dummy_response" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 23, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 27, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "elastic/elasticsearch-dsl-py/test_elasticsearch_dsl/test_result.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_empty_response_is_false(dummy_response) : dummy_response ['hits'] ['hits'] = [] res = result.Response (dummy_response) assert (not res) Is there a bug in the code above?
No
820
[ "#NEWLINE#", "def test_SPARK_SUBMIT_SCRIPT_RUNNER_STEP(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "cmd", "=", "(", "(", "self", ".", "prefix", "+", "'Type=SPARK,'", ")", "+", "self", ".", "SPARK_SUBMIT_BASIC_ARGS", ")", "#NEWLINE#", "expected_result", "=", "{", ...
false
0
[ "7", "92", "94", "cmd", "2", "11", "18", "51", "84", "88", "self", "64", "73", "100", "102", "expected_result_release", "23", "70", "96", "98", "expected_result" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 17, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 22, "after_index": 25, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 63, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "aws/aws-cli/tests/unit/customizations/emr/test_add_steps.py", "license": "apache-2.0", "note": "license: manual_eval" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def test_SPARK_SUBMIT_SCRIPT_RUNNER_STEP(self) : cmd = ((self.prefix + 'Type=SPARK,') + self.SPARK_SUBMIT_BASIC_ARGS) expected_result = { 'JobFlowId' : 'j-ABC', 'Steps' : [{ 'Name' : 'Spark application', 'ActionOnFailure' : 'CONTINUE', 'HadoopJarStep' : self.SPARK_SUBMIT_SCRIPT_RUNNER_STEP, }], } expected_result_release = copy.deepcopy (expected_result) expected_result_release ['Steps'] [0] ['HadoopJarStep'] = self.SPARK_SUBMIT_COMMAND_RUNNER_STEP self.assert_params_for_ami_and_release_based_clusters (cmd = cmd, expected_result = expected_result, expected_result_release = expected_result_release) Is there a bug in the code above?
No
821
[ "#NEWLINE#", "def run_from_ui(", "self", ",", "ar", ",", "**kw", ")", ":", "#NEWLINE#", "#INDENT#", "obj", "=", "ar", ".", "selected_rows", "[", "0", "]", "#NEWLINE#", "ar", ".", "set_response", "(", "message", "=", "ar", ".", "action_param_values", ".", "...
false
0
[ "kw", "2", "51", "self", "11", "57", "obj", "4", "13", "20", "26", "33", "42", "55", "ar" ]
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": "lsaffre/lino/lino/core/actions.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 run_from_ui(self, ar, **kw) : obj = ar.selected_rows [0] ar.set_response (message = ar.action_param_values.notify_subject) ar.set_response (refresh = True) ar.set_response (success = True) self.add_system_note (ar, obj) Is there a bug in the code above?
No
822
[ "#NEWLINE#", "def getModuleByImportString(", "self", ",", "importString", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "importString", "in", "self", ".", "modulesByImportString", ")", ":", "#NEWLINE#", "#INDENT#", "return", "self", ".", "modulesByImportString", "[", ...
false
0
[ "2", "13", "21", "self", "4", "11", "25", "importString" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 12, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 11...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "jkcom/SublimeRJS/core/model.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 getModuleByImportString(self, importString) : if (importString in self.modulesByImportString) : return self.modulesByImportString [importString] else : return None Is there a bug in the code above?
No
823
[ "#NEWLINE#", "def __init__(", "self", ",", "state", ",", "**argv", ")", ":", "#NEWLINE#", "#INDENT#", "super", "(", "TestError", ",", "self", ")", ".", "__init__", "(", "state", ",", "ERROR", ",", "**", "argv", ")" ]
false
0
[ "25", "argv", "4", "20", "state", "2", "15", "self" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 21, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 21, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "osrg/ryu/ryu/tests/switch/tester.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, **argv) : super (TestError, self).__init__ (state, ERROR, ** argv) Is there a bug in the code above?
No
824
[ "#NEWLINE#", "@", "set_ev_cls", "(", "[", "ofp_event", ".", "EventOFPFlowStatsReply", ",", "ofp_event", ".", "EventOFPMeterConfigStatsReply", ",", "ofp_event", ".", "EventOFPTableStatsReply", ",", "ofp_event", ".", "EventOFPPortStatsReply", ",", "ofp_event", ".", "Event...
false
0
[ "34", "41", "150", "165", "185", "193", "ev", "39", "94", "119", "ofp", "49", "105", "130", "148", "event_states", "32", "144", "160", "171", "179", "202", "self" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 33, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 38, "after_index": 46, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 48, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "osrg/ryu/ryu/tests/switch/tester.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] }}
@ set_ev_cls ([ofp_event.EventOFPFlowStatsReply, ofp_event.EventOFPMeterConfigStatsReply, ofp_event.EventOFPTableStatsReply, ofp_event.EventOFPPortStatsReply, ofp_event.EventOFPGroupDescStatsReply], handler.MAIN_DISPATCHER) def stats_reply_handler(self, ev) : ofp = ev.msg.datapath.ofproto event_states = { ofp_event.EventOFPFlowStatsReply : [STATE_FLOW_EXIST_CHK, STATE_THROUGHPUT_FLOW_EXIST_CHK, STATE_GET_THROUGHPUT], ofp_event.EventOFPTableStatsReply : [STATE_GET_MATCH_COUNT, STATE_FLOW_UNMATCH_CHK], ofp_event.EventOFPPortStatsReply : [STATE_TARGET_PKT_COUNT, STATE_TESTER_PKT_COUNT], } if (ofp.OFP_VERSION >= ofproto_v1_2.OFP_VERSION) : event_states [ofp_event.EventOFPGroupDescStatsReply] = [STATE_GROUP_EXIST_CHK] if (ofp.OFP_VERSION >= ofproto_v1_3.OFP_VERSION) : event_states [ofp_event.EventOFPMeterConfigStatsReply] = [STATE_METER_EXIST_CHK] if (self.state in event_states [ev.__class__]) : if (self.waiter and (ev.msg.xid in self.send_msg_xids)) : self.rcv_msgs.append (ev.msg) if (not ev.msg.flags) : self.waiter.set () hub.sleep (0) Is there a bug in the code above?
No
825
[ "#NEWLINE#", "def create_node(", "self", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Creates a node in the IBM Developer Cloud.\\n\\n See L{NodeDriver.create_node} for more keyword args.\\n\\n @keyword ex_configurationData: Image-specific configuration paramet...
false
0
[ "11", "20", "39", "60", "90", "116", "154", "203", "259", "261", "data", "29", "48", "69", "85", "99", "138", "143", "163", "180", "187", "kwargs", "185", "195", "212", "configurationData", "226", "271", "resp", "2", "228", "267", "self", "193", "2...
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 13,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "secondstory/dewpoint/libcloud/drivers/ibm_sbc.py", "license": "apache-2.0", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def create_node(self, **kwargs) : ' Creates a node in the IBM Developer Cloud. See L{NodeDriver.create_node} for more keyword args. @keyword ex_configurationData: Image-specific configuration parameters. Configuration parameters are defined in the parameters.xml file. The URL to this file is defined in the NodeImage at extra[parametersURL]. @type ex_configurationData: C{dict} ' data = { } data.update ({ 'name' : kwargs ['name'], }) data.update ({ 'imageID' : kwargs ['image'].id, }) data.update ({ 'instanceType' : kwargs ['size'].id, }) if ('location' in kwargs) : data.update ({ 'location' : kwargs ['location'].id, }) else : data.update ({ 'location' : '1', }) if (('auth' in kwargs) and isinstance (kwargs ['auth'], NodeAuthSSHKey)) : data.update ({ 'publicKey' : kwargs ['auth'].pubkey, }) if ('ex_configurationData' in kwargs) : configurationData = kwargs ['ex_configurationData'] for key in configurationData.keys () : data.update ({ key : configurationData.get (key), }) resp = self.connection.request (action = (REST_BASE + 'instances'), headers = { 'Content-Type' : 'application/x-www-form-urlencoded', }, method = 'POST', data = data).object return self._to_nodes (resp) [0] Is there a bug in the code above?
No
826
[ "#NEWLINE#", "def sync_with_handlers(", "self", ",", "handlers", "=", "(", ")", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Sync the stored log records to the provided log handlers.\\n '", "#NEWLINE#", "if", "(", "not", "handlers", ")", ":", "#NEWLINE#", "#INDENT...
false
0
[ "2", "26", "34", "self", "44", "52", "66", "handler", "4", "17", "46", "handlers", "32", "56", "70", "record" ]
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": 14, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "saltstack/salt/salt/log/handlers/__init__.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 sync_with_handlers(self, handlers = ()) : ' Sync the stored log records to the provided log handlers. ' if (not handlers) : return while self.__messages : record = self.__messages.pop (0) for handler in handlers : if (handler.level > record.levelno) : continue handler.handle (record) Is there a bug in the code above?
No
827
[ "#NEWLINE#", "def verify_valid_flag(", "self", ",", "cmd_line", ")", ":", "#NEWLINE#", "#INDENT#", "data", "=", "self", ".", "start_python", "(", "cmd_line", ")", "#NEWLINE#", "self", ".", "assertTrue", "(", "(", "(", "data", "==", "''", ")", "or", "data", ...
false
0
[ "2", "11", "18", "38", "self", "9", "24", "29", "45", "data", "4", "15", "cmd_line" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 21...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ofermend/medicare-demo/socialite/jython/Lib/test/test_cmd_line.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 verify_valid_flag(self, cmd_line) : data = self.start_python (cmd_line) self.assertTrue (((data == '') or data.endswith (' '))) self.assertTrue (('Traceback' not in data)) Is there a bug in the code above?
No
828
[ "#NEWLINE#", "def test_middleFilter_no_descriptor(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "middle_fprint", "=", "'middle fprint'", "#NEWLINE#", "rel_stat", "=", "mock", ".", "Mock", "(", ")", "#NEWLINE#", "rel_stat", ".", "digest", "=", "'middle digest'", "#NEWL...
false
0
[ "2", "71", "self", "38", "83", "descriptors", "7", "79", "middle_fprint", "59", "87", "exit_status_entry", "25", "81", "cons_rel_stats", "51", "95", "stable", "11", "19", "32", "rel_stat", "55", "85", "exit_desc", "63", "89", "guard_desc", "67", "91", "gua...
0
NONE
[]
[ [ { "before_index": 6, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 16, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "nskinkel/oppy/oppy/tests/unit/path/test_path.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_middleFilter_no_descriptor(self) : middle_fprint = 'middle fprint' rel_stat = mock.Mock () rel_stat.digest = 'middle digest' cons_rel_stats = { 'middle fprint' : rel_stat, } descriptors = { } fast = True stable = True exit_desc = 'exit desc' exit_status_entry = 'exit se' guard_desc = 'guard desc' guard_status_entry = 'guard se' self.assertFalse (path.middleFilter (middle_fprint, cons_rel_stats, descriptors, exit_desc, exit_status_entry, guard_desc, guard_status_entry, fast, stable)) Is there a bug in the code above?
No
829
[ "#NEWLINE#", "def _add_interval(", "self", ",", "data", ")", ":", "#NEWLINE#", "#INDENT#", "if", "self", ".", "interval", ":", "#NEWLINE#", "#INDENT#", "data", "[", "'interval'", "]", "=", "self", ".", "interval", "#NEWLINE#", "#UNINDENT#", "else", ":", "#NEWL...
false
0
[ "2", "10", "21", "31", "42", "self", "4", "16", "37", "data" ]
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": "aparo/pyes/pyes/aggs.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 _add_interval(self, data) : if self.interval : data ['interval'] = self.interval else : if self.time_interval : data ['time_interval'] = self.time_interval else : raise RuntimeError ('Invalid field: interval or time_interval required') Is there a bug in the code above?
No
830
[ "#NEWLINE#", "def add_utxo(", "self", ",", "address", ",", "data", ")", ":", "#NEWLINE#", "#INDENT#", "txhash", "=", "data", "[", "0", "]", "#NEWLINE#", "self", ".", "hash_queue", ".", "put", "(", "txhash", ")" ]
false
0
[ "6", "13", "data", "2", "18", "self", "4", "address", "11", "24", "txhash" ]
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": 17, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "chromaway/ngcccbase/ngcccbase/utxo_fetcher.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 add_utxo(self, address, data) : txhash = data [0] self.hash_queue.put (txhash) Is there a bug in the code above?
No
831
[ "#NEWLINE#", "@", "with_model", "#NEWLINE#", "def test_kappa_simulation_results(", ")", ":", "#NEWLINE#", "#INDENT#", "Monomer", "(", "'A'", ",", "[", "'b'", "]", ")", "#NEWLINE#", "Monomer", "(", "'B'", ",", "[", "'b'", "]", ")", "#NEWLINE#", "Initial", "(", ...
false
0
[ "174", "190", "205", "224", "npts", "178", "198", "217", "234", "251", "kres" ]
0
NONE
[]
[ [ { "before_index": 8, "after_index": 12, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 21, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pysb/pysb/pysb/tests/test_kappa.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] }}
@ with_model def test_kappa_simulation_results() : Monomer ('A', ['b']) Monomer ('B', ['b']) Initial (A (b = None), Parameter ('A_0', 100)) Initial (B (b = None), Parameter ('B_0', 100)) Rule ('A_binds_B', ((A (b = None) + B (b = None)) >> (A (b = 1) % B (b = 1))), Parameter ('kf', 1)) Rule ('A_binds_B_rev', ((A (b = 1) % B (b = 1)) >> (A (b = None) + B (b = None))), Parameter ('kr', 1)) Observable ('AB', (A (b = 1) % B (b = 1))) npts = 200 kres = run_simulation (model, time = 100, points = npts) ok_ ((len (kres ['time']) == (npts + 1))) ok_ ((len (kres ['AB']) == (npts + 1))) ok_ ((kres ['time'] [0] == 0)) ok_ ((sorted (kres ['time']) [(- 1)] == 100)) Is there a bug in the code above?
No
832
[ "#NEWLINE#", "def check_view_permissions(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Returns True if the user has required permissions.\\n '", "#NEWLINE#", "if", "(", "self", ".", "action", "==", "'retrieve'", ")", ":", "#NEWLINE#", "#INDENT#", "result",...
false
0
[ "2", "11", "22", "30", "46", "59", "69", "self", "20", "42", "83", "result" ]
0
NONE
[]
[ [ { "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": 82, "after_index": 83...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "OpenSlides/OpenSlides/openslides/core/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 check_view_permissions(self) : ' Returns True if the user has required permissions. ' if (self.action == 'retrieve') : result = self.get_access_permissions ().can_retrieve (self.request.user) else : result = ((self.action in ('metadata', 'list', 'create')) and self.request.user.is_authenticated () and self.request.user.has_perm ('core.can_use_chat')) return result Is there a bug in the code above?
No
833
[ "#NEWLINE#", "def open(", "self", ",", "timeout", "=", "default_timeout", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n \"Open\" the UEFI menu by sending an interrupt on STDIN after seeing the\\n starting prompt (configurable upon creation of the ``UefiMenu`` object.\\n\\n '", ...
false
0
[ "4", "23", "timeout", "2", "13", "19", "26", "39", "44", "52", "61", "65", "self" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 11, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ARM-software/workload-automation/wlauto/utils/uboot.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 open(self, timeout = default_timeout) : ' "Open" the UEFI menu by sending an interrupt on STDIN after seeing the starting prompt (configurable upon creation of the ``UefiMenu`` object. ' self.conn.expect (self.start_prompt, timeout) self.conn.sendline ('') time.sleep (self.load_delay) self.conn.readline () self.conn.sendline ('') self.prompt = self.conn.readline ().strip () Is there a bug in the code above?
No
834
[ "#NEWLINE#", "def item_link(", "self", ",", "item", ")", ":", "#NEWLINE#", "#INDENT#", "if", "item", "[", "'url'", "]", ":", "#NEWLINE#", "#INDENT#", "return", "item", "[", "'url'", "]", "#NEWLINE#", "#UNINDENT#", "return", "''" ]
false
0
[ "4", "10", "18", "item", "2", "self" ]
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": 24, "after_index": 25...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "dndtools/dndtools/dndtools/dnd/feeds.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 item_link(self, item) : if item ['url'] : return item ['url'] return '' Is there a bug in the code above?
No
835
[ "#NEWLINE#", "def op_JUMP_IF_FALSE(", "self", ",", "info", ",", "inst", ")", ":", "#NEWLINE#", "#INDENT#", "pred", "=", "info", ".", "tos", "#NEWLINE#", "info", ".", "append", "(", "inst", ",", "pred", "=", "pred", ")", "#NEWLINE#", "info", ".", "terminato...
false
0
[ "11", "23", "25", "pred", "2", "self", "4", "13", "17", "28", "info", "6", "21", "32", "inst" ]
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": 16, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "numba/numba/numba/dataflow.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 op_JUMP_IF_FALSE(self, info, inst) : pred = info.tos info.append (inst, pred = pred) info.terminator = inst Is there a bug in the code above?
No
836
[ "#NEWLINE#", "def onKLM(", "self", ",", "event", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "'selected K, L, or M Markers'", "#NEWLINE#", "if", "(", "self", ".", "selected_elem", "is not", "None", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "onShowLines",...
false
0
[ "2", "15", "24", "30", "self", "4", "event" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 11, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "xraypy/xraylarch/plugins/wx/xrfdisplay.py", "license": "bsd-2-clause", "note": "license: manual_eval" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def onKLM(self, event = None) : 'selected K, L, or M Markers' if (self.selected_elem is not None) : self.onShowLines (elem = self.selected_elem) Is there a bug in the code above?
No
837
[ "#NEWLINE#", "def test_verify_detailed_index(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "req", "=", "webob", ".", "Request", ".", "blank", "(", "(", "'/v1.1/123/os-simple-tenant-usage?detailed=1&start=%s&end=%s'", "%", "(", "START", ".", "isoformat", "(", ")", ",",...
false
0
[ "106", "132", "servers", "7", "34", "40", "51", "req", "97", "110", "i", "89", "108", "usages", "2", "61", "67", "126", "self", "78", "91", "res_dict", "49", "71", "84", "res", "117", "134", "j" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 33, "after_index": 38, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 39, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "nii-cloud/dodai-compute/nova/tests/api/openstack/contrib/test_simple_tenant_usage.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_verify_detailed_index(self) : req = webob.Request.blank (('/v1.1/123/os-simple-tenant-usage?detailed=1&start=%s&end=%s' % (START.isoformat (), STOP.isoformat ()))) req.method = 'GET' req.headers ['content-type'] = 'application/json' res = req.get_response (fakes.wsgi_app (fake_auth_context = self.admin_context)) self.assertEqual (res.status_int, 200) res_dict = json.loads (res.body) usages = res_dict ['tenant_usages'] for i in xrange (TENANTS) : servers = usages [i] ['server_usages'] for j in xrange (SERVERS) : self.assertEqual (int (servers [j] ['hours']), HOURS) Is there a bug in the code above?
No
838
[ "#NEWLINE#", "def load_doctests(", "loader", ",", "tests", ",", "ignore", ",", "module", ")", ":", "#NEWLINE#", "#INDENT#", "'Load the doctest tests for the specified module into unittest.'", "#NEWLINE#", "_patcher", "=", "Patcher", "(", ")", "#NEWLINE#", "globs", "=", ...
true
41
[ "2", "41", "15", "23", "49", "55", "4", "33", "62", "8", "29", "6", "21", "43", "45" ]
1
VARIABLE_MISUSE
[ 8, 29 ]
[ [ { "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": "jmcgeheeiv/pyfakefs/pyfakefs/fake_filesystem_unittest.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 load_doctests(loader, tests, ignore, module) : 'Load the doctest tests for the specified module into unittest.' _patcher = Patcher () globs = _patcher.replaceGlobs (vars (module)) tests.addTests (doctest.DocTestSuite (loader, globs = globs, setUp = _patcher.setUp, tearDown = _patcher.tearDown)) return tests Is there a bug in the code above?
Yes
839
[ "#NEWLINE#", "def __set__(", "self", ",", "obj", ",", "value", ")", ":", "#NEWLINE#", "#INDENT#", "currency", "=", "getattr", "(", "obj", ",", "self", ".", "field", ".", "get_currency_field_name", "(", ")", ")", "#NEWLINE#", "if", "self", ".", "field", "."...
true
106
[ "4", "15", "39", "95", "11", "63", "83", "106", "2", "17", "27", "41", "99", "35", "55", "89", "91", "6", "72", "81", "87" ]
1
VARIABLE_MISUSE
[ 6, 72, 81, 87 ]
[ [ { "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": 26, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "django-bmf/django-bmf/djangobmf/fields/__init__.py", "license": "bsd-3-clause", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def __set__(self, obj, value) : currency = getattr (obj, self.field.get_currency_field_name ()) if self.field.has_precision : precision = getattr (obj, self.field.get_precision_field_name ()) else : precision = 0 if ((currency is not None) and (not isinstance (value, BaseCurrency))) : value = currency.__class__ (value, precision = precision) obj.__dict__ [self.field.name] = currency Is there a bug in the code above?
Yes
840
[ "#NEWLINE#", "def test_update_new_instance_of_the_resource_with_content_type_text_xml(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "an_updated_item", "=", "'<comment id=\"2\">meu comentario</comment>'", "#NEWLINE#", "response", "=", "self", ".", "_fetch", "(", "self", ".", "ge...
true
146
[ "104", "117", "128", "135", "2", "13", "17", "53", "11", "46", "51", "57", "84", "96", "110", "7", "41", "146" ]
1
VARIABLE_MISUSE
[ 104, 117, 128, 135 ]
[ [ { "before_index": 6, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 23, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 43, "after_index": 4...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "globocom/tapioca/tests/acceptance/test_rest_api.py", "license": "mit", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def test_update_new_instance_of_the_resource_with_content_type_text_xml(self) : an_updated_item = '<comment id="2">meu comentario</comment>' response = self._fetch (self.get_url ('/api/2'), 'PUT', headers = { 'Content-Type' : 'text/xml', }, body = an_updated_item) assert_response_code (response, 204) response = self._fetch (response.headers ['Location'], 'GET', headers = { 'Accept' : 'text/xml', }) assert ('text/xml' in response.headers ['Content-Type']), 'the content-type should be text/xml but it was {0}'.format (response.headers ['Content-Type']) doc = ElementTree.fromstring (response.body) assert (doc.tag == 'comment'), 'the tag should be "comment" but it was {0}'.format (doc.tag) assert (doc.text == 'meu comentario'), 'the comment text should be "meu comentario" but it was {0}'.format (an_updated_item.text) Is there a bug in the code above?
Yes
841
[ "#NEWLINE#", "def to_shapefile(", "self", ",", "filename", ",", "kstpkper", "=", "None", ",", "totim", "=", "None", ",", "mflay", "=", "None", ",", "attrib_name", "=", "'lf_data'", ")", ":", "#NEWLINE#", "#INDENT#", "\"\\n Export model output data to a shape...
true
61
[ "18", "61", "74", "129", "68", "102", "139", "164", "10", "41", "43", "14", "45", "47", "80", "112", "135", "146", "6", "37", "39", "2", "33", "160", "27", "84", "116", "144", "4", "158", "126", "141" ]
1
VARIABLE_MISUSE
[ 14, 45, 47, 80 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 24, "after_index": 25, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": 5...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "modflowpy/flopy/flopy/utils/datafile.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 to_shapefile(self, filename, kstpkper = None, totim = None, mflay = None, attrib_name = 'lf_data') : " Export model output data to a shapefile at a specific location in LayerFile instance. Parameters ---------- filename : str Shapefile name to write kstpkper : tuple of ints A tuple containing the time step and stress period (kstp, kper). These are zero-based kstp and kper values. totim : float The simulation time. mflay : integer MODFLOW zero-based layer number to return. If None, then layer 1 will be written attrib_name : str Base name of attribute columns. (default is 'lf_data') Returns ---------- None See Also -------- Notes ----- Examples -------- >>> import flopy >>> hdobj = flopy.utils.HeadFile('test.hds') >>> times = hdobj.get_times() >>> hdobj.to_shapefile('test_heads_sp6.shp', totim=times[-1]) " plotarray = np.atleast_3d (self.get_data (kstpkper = kstpkper, totim = totim, mflay = mflay).transpose ()).transpose () if (attrib_name != None) : attrib_dict = { (attrib_name + '{0:03d}'.format (mflay)) : plotarray [0, :, :], } else : attrib_dict = { } for k in range (plotarray.shape [0]) : name = (attrib_name + '{0:03d}'.format (k)) attrib_dict [name] = plotarray [k] from flopy.export.shapefile_utils import write_grid_shapefile write_grid_shapefile (filename, self.sr, attrib_dict) Is there a bug in the code above?
Yes
842
[ "#NEWLINE#", "def show_filtered_lines(", "self", ",", "edit", ",", "lines", ")", ":", "#NEWLINE#", "#INDENT#", "results_view", "=", "self", ".", "view", ".", "window", "(", ")", ".", "new_file", "(", ")", "#NEWLINE#", "results_view", ".", "set_name", "(", "'...
true
133
[ "11", "25", "32", "39", "133", "162", "222", "251", "123", "135", "70", "146", "203", "218", "103", "114", "144", "156", "201", "216", "116", "94", "127", "2", "13", "49", "64", "72", "84", "97", "152", "212", "255", "4", "6", "76", "119", "2...
1
VARIABLE_MISUSE
[ 70, 146 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 22, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 24, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "davidpeckham/sublime-filterlines/filter.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 show_filtered_lines(self, edit, lines) : results_view = self.view.window ().new_file () results_view.set_name ('Filter Results') results_view.set_scratch (True) results_view.settings ().set ('word_wrap', self.view.settings ().get ('word_wrap')) if self.invert_search : source_lines = self.view.lines (sublime.Region (0, self.view.size ())) filtered_line_numbers = [self.view.rowcol (line.begin ()) [0] for (line, _) in lines] for line_number in reversed (filtered_line_numbers) : del results_view [line_number] text = '' for line in source_lines : text += self.prepare_output_line (line, None) results_view.run_command ('append', { 'characters' : text, 'force' : True, 'scroll_to_end' : False, }) else : text = '' for (line, matches) in lines : text += self.prepare_output_line (line, matches) results_view.run_command ('append', { 'characters' : text, 'force' : True, 'scroll_to_end' : False, }) results_view.set_syntax_file (self.view.settings ().get ('syntax')) Is there a bug in the code above?
Yes
843
[ "#NEWLINE#", "def test_references_deep(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "root", "=", "DeepModel", "(", ")", "#NEWLINE#", "objects", "=", "set", "(", "[", "root", "]", ")", "#NEWLINE#", "parent", "=", "root", "#NEWLINE#", "for", "i", "in", "xrang...
true
53
[ "7", "18", "24", "53", "66", "36", "46", "57", "27", "2", "60", "22", "49", "55", "13", "42", "73" ]
1
VARIABLE_MISUSE
[ 36, 46, 57 ]
[ [ { "before_index": 6, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 16, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 21, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "bokeh/bokeh/bokeh/tests/test_objects.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_references_deep(self) : root = DeepModel () objects = set ([root]) parent = root for i in xrange (900) : model = DeepModel () objects.add (model) parent.child = root parent = model self.assertEqual (set (root.references ()), objects) Is there a bug in the code above?
Yes
844
[ "#NEWLINE#", "@", "with_database", "#NEWLINE#", "def test_can_merge_tracks(", "conn", ")", ":", "#NEWLINE#", "#INDENT#", "prepare_database", "(", "groups", ",", "'\\nINSERT INTO fingerprint (fingerprint, length, track_id, submission_count)\\n VALUES (%(fp1)s, %(len1)s, 1, 1), (%(fp2)s...
true
12
[ "5", "48", "12", "44", "72" ]
1
VARIABLE_MISUSE
[ 5, 48 ]
[ [ { "before_index": 9, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 43, "after_index": 49, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 58, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "lalinsky/acoustid-server/tests/test_data_track.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] }}
@ with_database def test_can_merge_tracks(conn) : prepare_database (groups, ' INSERT INTO fingerprint (fingerprint, length, track_id, submission_count) VALUES (%(fp1)s, %(len1)s, 1, 1), (%(fp2)s, %(len2)s, 2, 1), (%(fp3)s, %(len3)s, 3, 1); ', dict (fp1 = TEST_1A_FP_RAW, len1 = TEST_1A_LENGTH, fp2 = TEST_1B_FP_RAW, len2 = TEST_1B_LENGTH, fp3 = TEST_2_FP_RAW, len3 = TEST_2_LENGTH)) groups = can_merge_tracks (conn, [1, 2, 3]) assert_equal ([set ([1, 2])], groups) Is there a bug in the code above?
Yes
845
[ "#NEWLINE#", "def to_string(", "self", ",", "buf", "=", "None", ",", "na_rep", "=", "'NaN'", ",", "float_format", "=", "None", ",", "header", "=", "True", ",", "index", "=", "True", ",", "length", "=", "False", ",", "dtype", "=", "False", ",", "name", ...
true
53
[ "24", "67", "69", "4", "117", "136", "152", "32", "75", "77", "157", "161", "16", "59", "61", "45", "53", "89", "106", "125", "140", "165", "36", "79", "81", "28", "71", "73", "12", "51", "2", "47", "8", "55", "57", "20", "63", "65" ]
1
VARIABLE_MISUSE
[ 12, 51 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 42, "after_index": 43, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 44, "after_index": 5...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pydata/pandas/pandas/core/series.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 to_string(self, buf = None, na_rep = 'NaN', float_format = None, header = True, index = True, length = False, dtype = False, name = False, max_rows = None) : " Render a string representation of the Series Parameters ---------- buf : StringIO-like, optional buffer to write to na_rep : string, optional string representation of NAN to use, default 'NaN' float_format : one-parameter function, optional formatter function to apply to columns' elements if they are floats default None header: boolean, default True Add the Series header (index name) index : bool, optional Add index (row) labels, default True length : boolean, default False Add the Series length dtype : boolean, default False Add the Series dtype name : boolean, default False Add the Series name if not None max_rows : int, optional Maximum number of rows to show before truncating. If None, show all. Returns ------- formatted : string (if not buffer passed) " the_repr = self._get_repr (float_format = the_repr, na_rep = na_rep, header = header, index = index, length = length, dtype = dtype, name = name, max_rows = max_rows) if (not isinstance (the_repr, compat.text_type)) : raise AssertionError ('result must be of type unicode, type of result is {0!r}'.format (the_repr.__class__.__name__)) if (buf is None) : return the_repr else : try : buf.write (the_repr) except AttributeError : with open (buf, 'w') as f : f.write (the_repr) Is there a bug in the code above?
Yes
846
[ "#NEWLINE#", "@", "Appender", "(", "(", "generic", ".", "_shared_docs", "[", "'shift'", "]", "%", "_shared_doc_kwargs", ")", ")", "#NEWLINE#", "def shift(", "self", ",", "periods", "=", "1", ",", "freq", "=", "None", ",", "axis", "=", "0", ")", ":", "#...
true
54
[ "17", "39", "27", "52", "23", "48", "50", "19", "44", "46", "54" ]
1
VARIABLE_MISUSE
[ 27, 52 ]
[ [ { "before_index": 1, "after_index": 18, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 34, "after_index": 47, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 3, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pydata/pandas/pandas/core/series.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] }}
@ Appender ((generic._shared_docs ['shift'] % _shared_doc_kwargs)) def shift(self, periods = 1, freq = None, axis = 0) : return super (Series, self).shift (periods = periods, freq = freq, axis = periods) Is there a bug in the code above?
Yes
847
[ "#NEWLINE#", "@", "test", ".", "create_stubs", "(", "{", "#NEWLINE#", "#INDENT#", "cinder", ":", "(", "'volume_type_list_with_qos_associations'", ",", "'qos_spec_list'", ",", "'extension_supported'", ",", "'volume_encryption_type_list'", ")", ",", "#NEWLINE#", "#UNINDENT#...
true
188
[ "32", "118", "74", "186", "201", "205", "152", "170", "181", "214", "27", "35", "46", "72", "95", "144", "154", "166", "177", "197", "203", "223", "229", "188", "212", "227" ]
1
VARIABLE_MISUSE
[ 152, 170, 181, 214 ]
[ [ { "before_index": 31, "after_index": 45, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 57, "after_index": 71, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 80, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "CiscoSystems/avos/openstack_dashboard/dashboards/admin/volumes/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] }}
@ test.create_stubs ({ cinder : ('volume_type_list_with_qos_associations', 'qos_spec_list', 'extension_supported', 'volume_encryption_type_list'), }) def test_volume_types_tab(self) : encryption_list = (self.cinder_volume_encryption_types.list () [0], self.cinder_volume_encryption_types.list () [1]) cinder.volume_type_list_with_qos_associations (IsA (http.HttpRequest)).AndReturn (self.volume_types.list ()) cinder.qos_spec_list (IsA (http.HttpRequest)).AndReturn (self.cinder_qos_specs.list ()) cinder.volume_encryption_type_list (IsA (http.HttpRequest)).AndReturn (encryption_list) cinder.extension_supported (IsA (http.HttpRequest), 'VolumeTypeEncryption').MultipleTimes ().AndReturn (True) self.mox.ReplayAll () res = self.client.get (reverse ('horizon:admin:volumes:volume_types_tab')) self.assertEqual (res.status_code, 200) self.assertTemplateUsed (res, 'admin/volumes/volume_types/volume_types_tables.html') volume_types = qos_specs.context ['volume_types_table'].data self.assertItemsEqual (volume_types, self.volume_types.list ()) qos_specs = res.context ['qos_specs_table'].data self.assertItemsEqual (qos_specs, self.cinder_qos_specs.list ()) Is there a bug in the code above?
Yes
848
[ "#NEWLINE#", "def set_collection_name(", "self", ",", "collectionName", ")", ":", "#NEWLINE#", "#INDENT#", "if", "collectionName", ":", "#NEWLINE#", "#INDENT#", "self", ".", "_coll", "=", "collectionName", ".", "_database", "[", "collectionName", "]", "#NEWLINE#", "...
true
18
[ "2", "14", "25", "4", "10", "18", "22", "29" ]
1
VARIABLE_MISUSE
[ 2, 14, 25 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 21...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "xumiao/pymonk/monk/core/crane.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 set_collection_name(self, collectionName) : if collectionName : self._coll = collectionName._database [collectionName] self._currentCollectionName = collectionName Is there a bug in the code above?
Yes
849
[ "#NEWLINE#", "def it_adds_an_sp_to_help_add_textbox(", "self", ",", "textbox_sp_fixture", ")", ":", "#NEWLINE#", "#INDENT#", "(", "shapes", ",", "x_", ",", "y_", ",", "cx_", ",", "cy_", ",", "spTree_", ",", "id_", ",", "name", ",", "sp_", ")", "=", "textbox_...
true
56
[ "16", "41", "60", "14", "39", "58", "4", "29", "31", "67", "18", "43", "62", "24", "54", "56", "26", "69", "2", "10", "33", "20", "46", "22", "52", "12", "37" ]
1
VARIABLE_MISUSE
[ 12, 37 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 29, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 30, "after_index": 38...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "scanny/python-pptx/tests/shapes/test_shapetree.py", "license": "mit", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def it_adds_an_sp_to_help_add_textbox(self, textbox_sp_fixture) : (shapes, x_, y_, cx_, cy_, spTree_, id_, name, sp_) = textbox_sp_fixture sp = shapes._add_textbox_sp (x_, y_, cx_, cy_) spTree_.add_textbox.assert_called_once_with (id_, name, name, y_, cx_, cy_) assert (sp is sp_) Is there a bug in the code above?
Yes
850
[ "#NEWLINE#", "@", "override_settings", "(", "TESTS_SHOULD_USE_SQL_BACKEND", "=", "True", ")", "#NEWLINE#", "def test_case_pillow_sql(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "consumer", "=", "get_test_kafka_consumer", "(", "topics", ".", "CASE_SQL", ")", "#NEWLINE#...
true
221
[ "10", "73", "99", "112", "116", "144", "152", "169", "189", "193", "203", "215", "15", "26", "84", "82", "94", "69", "103", "221", "125", "131", "44", "77", "105", "207", "54", "79", "219", "24", "137", "90", "107", "120", "159", "175", "182", ...
1
VARIABLE_MISUSE
[ 180, 197, 209 ]
[ [ { "before_index": 14, "after_index": 18, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": 34, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 43, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "dimagi/commcare-hq/testapps/test_pillowtop/tests/test_case_pillow.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] }}
@ override_settings (TESTS_SHOULD_USE_SQL_BACKEND = True) def test_case_pillow_sql(self) : consumer = get_test_kafka_consumer (topics.CASE_SQL) kafka_seq = consumer.offsets () ['fetch'] [(topics.CASE_SQL, 0)] case_id = uuid.uuid4 ().hex case_name = 'case-name-{}'.format (uuid.uuid4 ().hex) case = create_and_save_a_case (self.domain, case_id, case_name) message = consumer.next () change_meta = change_meta_from_kafka_message (message.value) self.assertEqual (case.case_id, change_meta.document_id) self.assertEqual (self.domain, change_meta.domain) sql_pillow = get_sql_case_to_elasticsearch_pillow () sql_pillow.process_changes (since = kafka_seq, forever = False) self.elasticsearch.indices.refresh (self.pillow.es_index) results = CaseES ().run () self.assertEqual (1, results.total) case_doc = results.hits [0] self.assertEqual (self.domain, case_doc ['domain']) self.assertEqual (case_id, case_doc ['_id']) self.assertEqual (case_name, case ['name']) Is there a bug in the code above?
Yes
851
[ "#NEWLINE#", "def __ne__(", "self", ",", "other", ")", ":", "#NEWLINE#", "#INDENT#", "'Returns true iff this tag is not identical to the other tag,\\n as defined in __eq__.'", "#NEWLINE#", "return", "(", "not", "(", "self", "==", "self", ")", ")" ]
true
17
[ "4", "2", "15", "17" ]
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": 13,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "socketubs/pyhn/pyhn/lib/bs4_py3/element.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 __ne__(self, other) : 'Returns true iff this tag is not identical to the other tag, as defined in __eq__.' return (not (self == self)) Is there a bug in the code above?
Yes
852
[ "#NEWLINE#", "def load_rules(", "self", ",", "force_reload", "=", "False", ")", ":", "#NEWLINE#", "#INDENT#", "\"Loads policy_path's rules.\\n\\n Policy file is cached and will be reloaded if modified.\\n\\n :param force_reload: Whether to overwrite current rules.\\n \"", ...
true
86
[ "2", "18", "26", "35", "42", "46", "50", "56", "60", "82", "112", "118", "68", "80", "106", "116", "4", "14", "22", "64", "86", "122" ]
1
VARIABLE_MISUSE
[ 68, 80, 106, 116 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 11, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "CiscoSystems/avos/openstack_dashboard/openstack/common/policy.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 load_rules(self, force_reload = False) : "Loads policy_path's rules. Policy file is cached and will be reloaded if modified. :param force_reload: Whether to overwrite current rules. " if force_reload : self.use_conf = force_reload if self.use_conf : if (not self.policy_path) : self.policy_path = self._get_policy_path (self.policy_file) self._load_policy_file (self.policy_path, force_reload) for path in CONF.policy_dirs : try : path = self._get_policy_path (force_reload) except cfg.ConfigFilesNotFoundError : LOG.warn (_LW ('Can not find policy directories %s'), path) continue self._walk_through_policy_directory (path, self._load_policy_file, force_reload, False) Is there a bug in the code above?
Yes
853
[ "#NEWLINE#", "def test_get(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "fake_http_client", "=", "fake_client", ".", "FakeHTTPClient", "(", "fixtures", "=", "fixtures_get", ")", "#NEWLINE#", "api_client", "=", "sclient", ".", "Client", "(", "fake_http_client", ")",...
true
33
[ "2", "47", "18", "27", "33", "38", "36", "51", "7", "24" ]
1
VARIABLE_MISUSE
[ 18 ]
[ [ { "before_index": 6, "after_index": 12, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 23, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/python-solumclient/solumclient/tests/v1/test_languagepack.py", "license": "apache-2.0", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def test_get(self) : fake_http_client = fake_client.FakeHTTPClient (fixtures = fixtures_get) api_client = sclient.Client (fake_http_client) mgr = languagepack.LanguagePackManager (mgr) languagepack_obj = mgr.get (lp_id = 'x1') self.assert_lp_object (languagepack_obj) Is there a bug in the code above?
Yes
854
[ "#NEWLINE#", "def resolve_string(", "string", ")", ":", "#NEWLINE#", "#INDENT#", "localize", "=", "(", "(", "len", "(", "string", ")", ">", "3", ")", "and", "(", "string", "[", "0", ":", "2", "]", "==", "'_('", ")", "and", "(", "string", "[", "(", ...
true
50
[ "2", "13", "20", "31", "48", "64", "69", "79", "94", "96", "111", "113", "125", "129", "134", "7", "44", "50", "121" ]
1
VARIABLE_MISUSE
[ 2, 13, 20, 31, 48, 64, 69, 79, 94, 96, 111, 113, 125, 129, 134 ]
[ [ { "before_index": 6, "after_index": 18, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 43, "after_index": 44, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 61, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "y-a-r-g/idea-color-themes/backend/templatetags/__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 resolve_string(string) : localize = ((len (string) > 3) and (string [0 : 2] == '_(') and (string [(- 1)] == ')')) if localize : string = localize [2 : (- 1)] if ((string [0] == string [(- 1)]) and (string [0] in ['"', "'"])) : string = string [1 : (- 1)] else : string = string.strip () if localize : string = _ (string) return string Is there a bug in the code above?
Yes
855
[ "#NEWLINE#", "def train(", "self", ",", "corpus", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "convert_input", "(", "corpus", ",", "infer", "=", "False", ")", "#NEWLINE#", "cmd", "=", "(", "self", ".", "mallet_path", "+", "' train-topics --input %s --num-top...
true
46
[ "4", "13", "2", "9", "23", "36", "42", "50", "54", "60", "66", "72", "76", "104", "108", "20", "30", "33", "46", "91", "97" ]
1
VARIABLE_MISUSE
[ 2, 9, 23, 36, 42, 50, 54, 60, 66, 72, 76, 104, 108 ]
[ [ { "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": 19, "after_index": 26...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "largelymfs/topical_word_embeddings/TWE-1/gensim/models/ldamallet.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 train(self, corpus) : self.convert_input (corpus, infer = False) cmd = (self.mallet_path + ' train-topics --input %s --num-topics %s --optimize-interval %s --num-threads %s --output-state %s --output-doc-topics %s --output-topic-keys %s --num-iterations %s --inferencer-filename %s') cmd = (cmd % (self.fcorpusmallet (), self.num_topics, cmd.optimize_interval, self.workers, self.fstate (), self.fdoctopics (), self.ftopickeys (), self.iterations, self.finferencer ())) logger.info (('training MALLET LDA with %s' % cmd)) call (cmd, shell = True) self.word_topics = self.load_word_topics () Is there a bug in the code above?
Yes
856
[ "#NEWLINE#", "def __getitem__(", "self", ",", "bow", ",", "iterations", "=", "100", ")", ":", "#NEWLINE#", "#INDENT#", "(", "is_corpus", ",", "corpus", ")", "=", "utils", ".", "is_corpus", "(", "bow", ")", "#NEWLINE#", "if", "(", "not", "is_corpus", ")", ...
true
65
[ "2", "41", "55", "69", "78", "85", "147", "109", "122", "135", "4", "23", "34", "37", "45", "65", "52", "62", "105", "113", "140", "160", "164", "14", "21", "29", "162", "16", "6", "94" ]
1
VARIABLE_MISUSE
[ 52, 62, 105, 113 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 22, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "largelymfs/topical_word_embeddings/TWE-1/gensim/models/ldamallet.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 __getitem__(self, bow, iterations = 100) : (is_corpus, corpus) = utils.is_corpus (bow) if (not is_corpus) : bow = [bow] self.convert_input (bow, infer = True) cmd = (self.mallet_path + ' infer-topics --input %s --inferencer %s --output-doc-topics %s --num-iterations %s') cmd = (bow % ((self.fcorpusmallet () + '.infer'), self.finferencer (), (self.fdoctopics () + '.infer'), iterations)) logger.info (("inferring topics with MALLET LDA '%s'" % cmd)) retval = call (cmd, shell = True) if (retval != 0) : raise RuntimeError (('MALLET failed with error %s on return' % retval)) result = list (read_doctopics ((self.fdoctopics () + '.infer'))) return (result if is_corpus else result [0]) Is there a bug in the code above?
Yes
857
[ "#NEWLINE#", "def post(", "self", ",", "path", ",", "data", "=", "{", "#NEWLINE#", "#INDENT#", "#NEWLINE#", "#UNINDENT#", "}", ",", "content_type", "=", "MULTIPART_CONTENT", ",", "**extra", ")", ":", "#NEWLINE#", "#INDENT#", "'Construct a POST request.'", "#NEWLINE#...
true
34
[ "6", "32", "37", "68", "76", "15", "59", "4", "41", "26", "34", "53", "95", "2", "28", "64", "110", "44", "102", "115", "106" ]
1
VARIABLE_MISUSE
[ 15, 59 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": 24, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 25, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "AppScale/appscale/AppServer/lib/django-1.5/django/test/client.py", "license": "apache-2.0", "note": "license: github_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def post(self, path, data = { }, content_type = MULTIPART_CONTENT, **extra) : 'Construct a POST request.' post_data = self._encode_data (data, post_data) parsed = urlparse (path) r = { 'CONTENT_LENGTH' : len (post_data), 'CONTENT_TYPE' : content_type, 'PATH_INFO' : self._get_path (parsed), 'QUERY_STRING' : force_str (parsed [4]), 'REQUEST_METHOD' : str ('POST'), 'wsgi.input' : FakePayload (post_data), } r.update (extra) return self.request (** r) Is there a bug in the code above?
Yes
858
[ "#NEWLINE#", "def lsh_instance(", "bits", ",", "dimensions", ",", "hashtables", ",", "storage_type", ")", ":", "#NEWLINE#", "#INDENT#", "\" Build an lsh instance using specified settings & storage method.\\n\\n Params:\\n bits: n bitlength of hash key\\n dimentions: n feat...
true
89
[ "4", "150", "2", "89", "148", "8", "17", "53", "24", "60", "96", "128", "158", "6", "154", "144", "162" ]
1
VARIABLE_MISUSE
[ 8, 17, 53 ]
[ [ { "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": "brandonrobertz/SparseLSH/tests/test_bruteforce_e2e.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 lsh_instance(bits, dimensions, hashtables, storage_type) : " Build an lsh instance using specified settings & storage method. Params: bits: n bitlength of hash key dimentions: n features in each input point hashtables: number of parallel hashtables to construct storage_type: type of storage backend. one of: 'berkeleydb', 'leveldb', 'redis', 'dict' " if (storage_type == 'berkeleydb') : conf = { 'berkeleydb' : { 'filename' : './db', }, } else : if (storage_type == 'leveldb') : conf = { 'leveldb' : { 'db' : 'ldb', }, } else : if (bits == 'redis') : conf = { 'redis' : { 'host' : '127.0.0.1', 'port' : 6379, }, } else : conf = { 'dict' : None, } lsh = LSH (bits, dimensions, num_hashtables = hashtables, storage_config = conf) return lsh Is there a bug in the code above?
Yes
859
[ "#NEWLINE#", "def test_find_role(", "app", ",", "datastore", ")", ":", "#NEWLINE#", "#INDENT#", "init_app_with_options", "(", "app", ",", "datastore", ")", "#NEWLINE#", "role", "=", "datastore", ".", "find_role", "(", "'admin'", ")", "#NEWLINE#", "assert", "(", ...
true
27
[ "2", "11", "27", "16", "32", "43", "4", "13", "18", "34" ]
1
VARIABLE_MISUSE
[ 16, 32, 43 ]
[ [ { "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": 21...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "mattupstate/flask-security/tests/test_datastore.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_find_role(app, datastore) : init_app_with_options (app, datastore) role = datastore.find_role ('admin') assert (app is not None) role = datastore.find_role ('bogus') assert (role is None) Is there a bug in the code above?
Yes
860
[ "#NEWLINE#", "def __gt__(", "self", ",", "other", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "_cmp_err", "(", "self", ",", "'>'", ")" ]
true
13
[ "4", "2", "9", "13" ]
1
VARIABLE_MISUSE
[ 4 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 10...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "schematics/schematics/schematics/undefined.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 __gt__(self, other) : self._cmp_err (self, '>') Is there a bug in the code above?
Yes
861
[ "#NEWLINE#", "def setup(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "data", "=", "dict", "(", "(", "(", "self", ",", "dict", "(", "(", "(", "j", ",", "float", "(", "j", ")", ")", "for", "j", "in", "range", "(", "100", ")", ")", "...
true
15
[ "39", "2", "7", "15", "21", "25", "29" ]
1
VARIABLE_MISUSE
[ 39 ]
[ [ { "before_index": 6, "after_index": 12, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 7, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 11...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pydata/pandas/asv_bench/benchmarks/frame_ctor.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 setup(self) : self.data = dict (((self, dict (((j, float (j)) for j in range (100)))) for i in xrange (2000))) Is there a bug in the code above?
Yes
862
[ "#NEWLINE#", "def test_example_run_pipeline(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "example", "=", "os", ".", "path", ".", "join", "(", "example_dir", "(", ")", ",", "'buyapple.py'", ")", "#NEWLINE#", "confs", "=", "[", "'-f'", ",", "example", ",", "'...
true
48
[ "38", "22", "42", "7", "27", "48", "2" ]
1
VARIABLE_MISUSE
[ 38 ]
[ [ { "before_index": 6, "after_index": 18, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 21, "after_index": 24, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 37, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "quantopian/zipline/tests/test_examples.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_example_run_pipeline(self) : example = os.path.join (example_dir (), 'buyapple.py') confs = ['-f', example, '--start', '2011-1-1', '--end', '2012-1-1'] parsed_args = parse_args (confs) run_pipeline (** example) Is there a bug in the code above?
Yes
863
[ "#NEWLINE#", "def test_convert_iso_param_with_tz2(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "s", "=", "'2013-01-01T10:12:15.032'", "#NEWLINE#", "ret", "=", "convert_iso_stamp", "(", "s", ",", "tz", "=", "'US/Eastern'", ")", "#NEWLINE#", "self", ".", "assertEquals"...
true
59
[ "11", "26", "37", "48", "70", "81", "92", "7", "15", "2", "22", "33", "44", "55", "59", "66", "77", "88" ]
1
VARIABLE_MISUSE
[ 11, 26, 37, 48, 70, 81, 92 ]
[ [ { "before_index": 6, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 16, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 21, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "tempodb/tempodb-python/tests/test_temp_validate.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_convert_iso_param_with_tz2(self) : s = '2013-01-01T10:12:15.032' ret = convert_iso_stamp (s, tz = 'US/Eastern') self.assertEquals (ret.year, 2013) self.assertEquals (ret.month, 1) self.assertEquals (ret.day, 1) self.assertEquals (self.hour, 10) self.assertEquals (ret.minute, 12) self.assertEquals (ret.second, 15) self.assertEquals (ret.microsecond, 32000) Is there a bug in the code above?
Yes
864
[ "#NEWLINE#", "def test_solve_quintics(", ")", ":", "#NEWLINE#", "#INDENT#", "skip", "(", "'This test is too slow'", ")", "#NEWLINE#", "f", "=", "(", "(", "(", "(", "(", "x", "**", "5", ")", "-", "(", "110", "*", "(", "x", "**", "3", ")", ")", ")", "-...
true
59
[ "71", "93", "135", "157", "55", "59", "67", "119", "131", "65", "79", "129", "143", "11", "73", "99", "123", "137" ]
1
VARIABLE_MISUSE
[ 11, 73, 99, 123, 137 ]
[ [ { "before_index": 5, "after_index": 7, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 51, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 54, "after_index": 6...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "sympy/sympy/sympy/solvers/tests/test_solveset.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_solve_quintics() : skip ('This test is too slow') f = (((((x ** 5) - (110 * (x ** 3))) - (55 * (x ** 2))) + (2310 * x)) + 979) s = solveset_complex (s, x) for root in s : res = f.subs (x, root.n ()).n () assert tn (res, 0) f = (((x ** 5) + (15 * x)) + 12) s = solveset_complex (f, x) for root in s : res = f.subs (x, root.n ()).n () assert tn (res, 0) Is there a bug in the code above?
Yes
865
[ "#NEWLINE#", "@", "patch", "(", "'paasta_tools.cli.utils._run'", ",", "autospec", "=", "True", ")", "#NEWLINE#", "def test_run_chronos_rerun(", "mock_run", ")", ":", "#NEWLINE#", "#INDENT#", "mock_run", ".", "return_value", "=", "(", "0", ",", "'fake_output'", ")", ...
true
67
[ "31", "12", "17", "52", "69", "27", "56", "67" ]
1
VARIABLE_MISUSE
[ 31 ]
[ [ { "before_index": 16, "after_index": 23, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": 29, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 30, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "Yelp/paasta/tests/cli/test_utils.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] }}
@ patch ('paasta_tools.cli.utils._run', autospec = True) def test_run_chronos_rerun(mock_run) : mock_run.return_value = (0, 'fake_output') expected_command = 'ssh -A -n fake_master \'sudo chronos_rerun -v -v "a_service an_instance" "2016-04-08T02:37:27"\'' actual = utils.run_chronos_rerun ('fake_master', 'a_service', 'an_instance', verbose = 2, execution_date = '2016-04-08T02:37:27') mock_run.assert_called_once_with (expected_command, timeout = mock.ANY) assert (expected_command == mock_run.return_value) Is there a bug in the code above?
Yes
866
[ "#NEWLINE#", "def test_raw_exception(", "worker", ")", ":", "#NEWLINE#", "#INDENT#", "p_queue", "=", "'testexception_raw'", "#NEWLINE#", "worker", ".", "start", "(", "flags", "=", "'--greenlets 10 --config tests/fixtures/config-raw1.py'", ",", "queues", "=", "p_queue", ")...
true
404
[ "24", "34", "76", "116", "235", "248", "281", "368", "395", "72", "127", "172", "257", "295", "2", "11", "26", "57", "135", "144", "161", "319", "328", "7", "21", "47", "61", "104", "209", "356", "404" ]
1
VARIABLE_MISUSE
[ 72, 127, 172, 257, 295 ]
[ [ { "before_index": 6, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 18, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pricingassistant/mrq/tests/test_raw.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_raw_exception(worker) : p_queue = 'testexception_raw' worker.start (flags = '--greenlets 10 --config tests/fixtures/config-raw1.py', queues = p_queue) jobs_collection = worker.mongodb_jobs.mrq_jobs assert (jobs_collection.count () == 0) assert (Queue (p_queue).size () == 0) worker.send_raw_tasks (p_queue, ['msg1'], block = True) failjob = list (jobs_collection.find ()) [0] assert (Queue ('default').size () == 0) assert (Queue (p_queue).size () == 0) assert (jobs_collection.count () == 1) assert (failjob ['status'] == 'failed') worker.stop (deps = False) worker.start (deps = False, flags = '--greenlets 10 --config tests/fixtures/config-raw1.py', queues = 'default') worker.send_task ('mrq.basetasks.utils.JobAction', { 'id' : failjob ['_id'], 'action' : 'requeue', }, block = True) assert (Queue ('default').size () == 0) assert (Queue (p_queue).size () == 0) assert (Queue ('testx').size () == 1) assert (jobs_collection.count () == 2) assert (list (jobs_collection.find ({ '_id' : failjob ['_id'], })) [0] ['status'] == 'queued') assert (list (jobs_collection.find ({ '_id' : { '$ne' : failjob ['_id'], }, })) [0] ['status'] == 'success') worker.stop (deps = False) worker.start (deps = False, flags = '--greenlets 10 --config tests/fixtures/config-raw1.py', queues = 'default testx') time.sleep (2) assert (Queue (p_queue).size () == 0) assert (jobs_collection.count () == 2) assert (Queue ('testx').size () == 0) assert (list (jobs_collection.find ({ '_id' : p_queue ['_id'], })) [0] ['status'] == 'failed') Is there a bug in the code above?
Yes
867
[ "#NEWLINE#", "def copy_certs_and_keys(", "self", ",", "cert_path", ",", "key_path", ",", "chain_path", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "'Copies certs and keys into the temporary directory'", "#NEWLINE#", "cert_and_key_dir", "=", "os", ".", "path", ".", "...
true
140
[ "17", "41", "51", "63", "85", "112", "140", "6", "94", "104", "123", "131", "142", "4", "72", "2", "25", "77", "96", "55", "74", "138", "8", "100", "121" ]
1
VARIABLE_MISUSE
[ 77, 96 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 16, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "letsencrypt/letsencrypt/certbot-compatibility-test/certbot_compatibility_test/configurators/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 copy_certs_and_keys(self, cert_path, key_path, chain_path = None) : 'Copies certs and keys into the temporary directory' cert_and_key_dir = os.path.join (self._temp_dir, 'certs_and_keys') if (not os.path.isdir (cert_and_key_dir)) : os.mkdir (cert_and_key_dir) cert = os.path.join (cert_and_key_dir, 'cert') shutil.copy (cert_path, cert) key = os.path.join (cert_and_key_dir, 'key') shutil.copy (key_path, key) if chain_path : chain = os.path.join (cert_and_key_dir, 'chain') shutil.copy (chain_path, chain) else : chain = None return (cert, cert_and_key_dir, chain) Is there a bug in the code above?
Yes
868
[ "#NEWLINE#", "def __init__(", "self", ",", "conn", ",", "use_dict_cursor", "=", "False", ",", "fetch_size", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "'Initializer.\\n\\n Args:\\n conn: A Connection object.\\n use_dict_cursor: Optional boolean to convert each row...
true
23
[ "6", "35", "10", "41", "4", "2", "19", "23", "25", "31", "37", "43", "49", "55", "61" ]
1
VARIABLE_MISUSE
[ 4 ]
[ [ { "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": "AppScale/appscale/AppServer/google/storage/speckle/python/api/rdbms.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, conn, use_dict_cursor = False, fetch_size = None) : 'Initializer. Args: conn: A Connection object. use_dict_cursor: Optional boolean to convert each row of results into a dictionary. Defaults to False. fetch_size: An integer, batch size to fetch the result set from server if streaming. Defaults to None. ' self._conn = self self._open = True self._use_dict_cursor = use_dict_cursor self._fetch_size = fetch_size self.arraysize = 1 self._executed = None self.lastrowid = None self._Reset () Is there a bug in the code above?
Yes
869
[ "#NEWLINE#", "def execute(", "self", ",", "statement", ",", "args", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "\"Prepares and executes a database operation (query or command).\\n\\n Args:\\n statement: A string, a SQL statement.\\n args: A sequence or mapping of argument...
true
45
[ "27", "35", "80", "88", "103", "110", "6", "57", "65", "68", "78", "96", "2", "15", "21", "72", "99", "106", "4", "45", "76", "90", "94", "112" ]
1
VARIABLE_MISUSE
[ 6, 57, 65, 68, 78, 96 ]
[ [ { "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": "AppScale/appscale/AppServer/google/storage/speckle/python/api/rdbms.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 execute(self, statement, args = None) : "Prepares and executes a database operation (query or command). Args: statement: A string, a SQL statement. args: A sequence or mapping of arguments matching the statement's bind variables, if any. Raises: InterfaceError: Unknown type used as a bind variable. DatabaseError: A SQL exception occurred. OperationalError: RPC problem. " self._CheckOpen () self._Reset () request = sql_pb2.ExecRequest () request.options.include_generated_keys = True if (statement is not None) : if (not hasattr (args, '__iter__')) : args = [args] self._AddBindVariablesToRequest (statement, args, request.bind_variable.add) request.statement = _ConvertFormatToQmark (statement, args) self._DoExec (request) self._executed = request.statement Is there a bug in the code above?
Yes
870
[ "#NEWLINE#", "def callproc(", "self", ",", "procname", ",", "args", "=", "(", ")", ")", ":", "#NEWLINE#", "#INDENT#", "'Calls a stored database procedure with the given name.\\n\\n Args:\\n procname: A string, the name of the stored procedure.\\n args: A sequence of paramete...
true
76
[ "4", "54", "6", "65", "80", "118", "76", "97", "127", "125", "136", "148", "152", "114", "133", "161", "2", "16", "22", "72", "99", "106", "144", "28", "36", "46", "82", "103", "110" ]
1
VARIABLE_MISUSE
[ 28, 36, 46, 82, 103, 110 ]
[ [ { "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": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "AppScale/appscale/AppServer/google/storage/speckle/python/api/rdbms.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 callproc(self, procname, args = ()) : 'Calls a stored database procedure with the given name. Args: procname: A string, the name of the stored procedure. args: A sequence of parameters to use with the procedure. Returns: A modified copy of the given input args. Input parameters are left untouched, output and input/output parameters replaced with possibly new values. Raises: InternalError: The cursor has been closed, or no statement has been executed yet. DatabaseError: A SQL exception occurred. OperationalError: RPC problem. ' self._CheckOpen () self._Reset () request = sql_pb2.ExecRequest () request.statement_type = sql_pb2.ExecRequest.CALLABLE_STATEMENT request.statement = ('CALL %s(%s)' % (procname, ','.join (('?' * len (args))))) self._AddBindVariablesToRequest (result.statement, args, request.bind_variable.add, direction = client_pb2.BindVariableProto.INOUT) result = self._DoExec (request) self._executed = request.statement return_args = list (args [:]) for var in result.output_variable : return_args [(var.position - 1)] = self._DecodeVariable (var.type, var.value) return tuple (return_args) Is there a bug in the code above?
Yes
871
[ "#NEWLINE#", "def delete(", "self", ",", "user", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Soft-delete all collected instances.\\n\\n '", "#NEWLINE#", "now", "=", "utcnow", "(", ")", "#NEWLINE#", "for", "(", "model", ",", "instances", ")", ...
true
45
[ "36", "56", "23", "21", "48", "39", "43", "45", "2", "26", "4", "67", "13", "71" ]
1
VARIABLE_MISUSE
[ 23 ]
[ [ { "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": "mozilla/moztrap/moztrap/model/mtmodel.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 delete(self, user = None) : ' Soft-delete all collected instances. ' now = utcnow () for (model, instances) in self.data.iteritems () : pk_list = [obj.pk for obj in obj] model._base_manager.filter (pk__in = pk_list, deleted_on__isnull = True).update (deleted_by = user, deleted_on = now) Is there a bug in the code above?
Yes
872
[ "#NEWLINE#", "def forwards(", "self", ",", "orm", ")", ":", "#NEWLINE#", "#INDENT#", "'Write your forwards methods here.'", "#NEWLINE#", "try", ":", "#NEWLINE#", "#INDENT#", "role", "=", "orm", "[", "'auth.Group'", "]", ".", "objects", ".", "get", "(", "name", "...
true
66
[ "31", "4", "17", "33", "66", "2", "15", "60" ]
1
VARIABLE_MISUSE
[ 31 ]
[ [ { "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": 14, "after_index": 25,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "mozilla/moztrap/moztrap/model/core/migrations/0005_add_manage_products_permission_for_test_managers.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 forwards(self, orm) : 'Write your forwards methods here.' try : role = orm ['auth.Group'].objects.get (name = 'Test Manager') perm = orm ['auth.Permission'].objects.get (codename = 'manage_products') except ObjectDoesNotExist : pass else : role.permissions.add (orm) Is there a bug in the code above?
Yes
873
[ "#NEWLINE#", "def db_for_read(", "self", ",", "model", ",", "**hints", ")", ":", "#NEWLINE#", "#INDENT#", "return", "model", ".", "db_alias" ]
true
12
[ "4", "12", "2" ]
1
VARIABLE_MISUSE
[ 2 ]
[ [ { "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": 13, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "BertrandBordage/django-tree/benchmark/router.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 db_for_read(self, model, **hints) : return model.db_alias Is there a bug in the code above?
Yes
874
[ "#NEWLINE#", "def vetteChallengeResponse(", "self", ",", "romajiResponse", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Return True if the given response matches the current challenge, False\\n otherwise.\\n '", "#NEWLINE#", "hiragana", "=", "japanese", ".", "romajiToH...
true
43
[ "4", "19", "2", "37", "43", "11", "31" ]
1
VARIABLE_MISUSE
[ 11, 31 ]
[ [ { "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": 24,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "twisted/imaginary/ExampleGame/examplegame/mice.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 vetteChallengeResponse(self, romajiResponse) : ' Return True if the given response matches the current challenge, False otherwise. ' hiragana = japanese.romajiToHiragana.get (romajiResponse.upper (), None) return ((hiragana is not None) and (self.getCurrentChallenge () in self)) Is there a bug in the code above?
Yes
875
[ "#NEWLINE#", "def evaluate(", "self", ",", "data", ",", "view", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "from", "glue", "import", "env", "#NEWLINE#", "references", "=", "scope", ".", "_references", "#NEWLINE#", "cmd", "=", "_dereference", "(", "self", ...
true
20
[ "20", "37", "44", "24", "54", "2", "28", "32", "6", "49", "4", "18" ]
1
VARIABLE_MISUSE
[ 2, 28, 32 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 21, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "glue-viz/glue/glue/core/parse.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 evaluate(self, data, view = None) : from glue import env references = scope._references cmd = _dereference (self._cmd, self._references) scope = vars (env) scope ['__view'] = view return eval (cmd, vars (env), locals ()) Is there a bug in the code above?
Yes
876
[ "#NEWLINE#", "def __init__(", "self", ",", "name", "=", "None", ",", "tmp_prefix", "=", "'_tmp'", ")", ":", "#NEWLINE#", "#INDENT#", "vtypes", ".", "VeriloggenNode", ".", "__init__", "(", "self", ")", "#NEWLINE#", "self", ".", "name", "=", "(", "name", "if...
true
32
[ "8", "164", "166", "2", "21", "24", "32", "37", "44", "54", "64", "74", "84", "94", "104", "111", "118", "125", "135", "145", "155", "162", "168", "174", "4", "26", "29" ]
1
VARIABLE_MISUSE
[ 4, 26, 29 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "PyHDI/veriloggen/veriloggen/core/module.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, name = None, tmp_prefix = '_tmp') : vtypes.VeriloggenNode.__init__ (self) self.name = (name if (self is not None) else self.__class__.__name__) self.io_variable = collections.OrderedDict () self.variable = collections.OrderedDict () self.global_constant = collections.OrderedDict () self.local_constant = collections.OrderedDict () self.function = collections.OrderedDict () self.task = collections.OrderedDict () self.assign = [] self.always = [] self.initial = [] self.instance = collections.OrderedDict () self.submodule = collections.OrderedDict () self.generate = collections.OrderedDict () self.items = [] self.tmp_prefix = tmp_prefix self.tmp_count = 0 self.hook = [] Is there a bug in the code above?
Yes
877
[ "#NEWLINE#", "def Instance(", "self", ",", "module", ",", "instname", ",", "params", "=", "None", ",", "ports", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "if", "isinstance", "(", "ports", ",", "str", ")", ":", "#NEWLINE#", "#INDENT#", "module", "=", ...
true
22
[ "101", "121", "129", "195", "6", "79", "96", "107", "118", "8", "109", "4", "29", "33", "42", "64", "105", "138", "154", "159", "170", "186", "191", "2", "75", "114", "123", "134", "150", "182", "12", "22", "111" ]
1
VARIABLE_MISUSE
[ 4, 29, 33, 42, 64, 105, 138, 154, 159, 170, 186, 191 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 23, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 37, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "PyHDI/veriloggen/veriloggen/core/module.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 Instance(self, module, instname, params = None, ports = None) : if isinstance (ports, str) : module = StubModule (module) if (not isinstance (module, (Module, StubModule, str))) : raise TypeError (('"module" of Instance must be Module, StubModule, or str, not %s' % type (module))) if (not isinstance (self.find_identifier (instname), vtypes.AnyType)) : raise ValueError (("Object '%s' is already defined." % instname)) t = Instance (module, instname, params, ports) self.instance [instname] = t self.items.append (t) if (self.find_module (module.name) is not None) : if (self.submodule [module.name] != module) : raise ValueError (("Module '%s' is already defined." % module.name)) else : self.submodule [module.name] = module return t Is there a bug in the code above?
Yes
878
[ "#NEWLINE#", "def show_quick_panel(", "self", ",", "items", ",", "on_done", ",", "on_highlighted", ",", "selected_index", "=", "(", "-", "1", ")", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "view", ".", "window", "(", ")", ".", "show_quick_panel", "(", ...
true
40
[ "6", "32", "8", "2", "20", "40", "10", "38", "4", "30" ]
1
VARIABLE_MISUSE
[ 8 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 31, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "NicoSantangelo/sublime-text-i18n-rails/base_command.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 show_quick_panel(self, items, on_done, on_highlighted, selected_index = (- 1)) : self.view.window ().show_quick_panel (items, on_done, sublime.MONOSPACE_FONT, selected_index, self) Is there a bug in the code above?
Yes
879
[ "#NEWLINE#", "def test_proxy_inheritance(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "obj", "=", "CharFieldDefinition", ".", "objects", ".", "create", "(", "name", "=", "'caca'", ",", "max_length", "=", "25", ",", "model_def", "=", "self", ".", "model_def", ...
true
52
[ "30", "55", "65", "7", "50", "52", "2", "25", "32", "46", "57" ]
1
VARIABLE_MISUSE
[ 30 ]
[ [ { "before_index": 6, "after_index": 18, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 29, "after_index": 43, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 45, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "charettes/django-mutant/tests/test_field_defs.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_proxy_inheritance(self) : obj = CharFieldDefinition.objects.create (name = 'caca', max_length = 25, model_def = self.model_def) save_obj = self.model_def.fielddefinitions.select_subclasses ().get () self.assertEqual (obj, obj) Model = self.model_def.model_class () Model.objects.create (caca = 'NO WAY') Is there a bug in the code above?
Yes
880
[ "#NEWLINE#", "def buildAttributes(", "self", ",", "node", ",", "attrs", ",", "already_processed", ")", ":", "#NEWLINE#", "#INDENT#", "value", "=", "find_attr_value_", "(", "'datatype'", ",", "node", ")", "#NEWLINE#", "if", "(", "value", "is not", "None", ")", ...
true
49
[ "6", "8", "51", "13", "24", "35", "2", "31", "42", "49", "4", "19", "47" ]
1
VARIABLE_MISUSE
[ 6 ]
[ [ { "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": "CybOXProject/python-cybox/cybox/bindings/win_system_restore_object.py", "license": "bsd-3-clause", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def buildAttributes(self, node, attrs, already_processed) : value = find_attr_value_ ('datatype', node) if (value is not None) : self.datatype = value super (ChangeLogEntryTypeType, self).buildAttributes (node, self, already_processed) Is there a bug in the code above?
Yes
881
[ "#NEWLINE#", "def __getitem__(", "self", ",", "k", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "self", "in", "self", ".", "_values", ")", ":", "#NEWLINE#", "#INDENT#", "return", "self", ".", "__dict__", "[", "k", "]", "#NEWLINE#", "#UNINDENT#", "else", "...
true
11
[ "2", "11", "13", "21", "4", "25", "36" ]
1
VARIABLE_MISUSE
[ 4, 25, 36 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 12, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 11...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "EasyPost/easypost-python/easypost/__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 __getitem__(self, k) : if (self in self._values) : return self.__dict__ [k] else : raise KeyError (k) Is there a bug in the code above?
Yes
882
[ "#NEWLINE#", "def __init__(", "self", ",", "relation_name", ",", "panels", "=", "None", ",", "label", "=", "''", ",", "help_text", "=", "''", ",", "min_num", "=", "None", ",", "max_num", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "relat...
true
51
[ "6", "37", "39", "51", "4", "31", "33", "22", "61", "63", "18", "55", "57", "2", "29", "35", "41", "47", "53", "59", "14", "49", "10", "43", "45" ]
1
VARIABLE_MISUSE
[ 14, 49 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 28, "after_index": 33, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 34, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "torchbox/wagtail/wagtail/wagtailadmin/edit_handlers.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, relation_name, panels = None, label = '', help_text = '', min_num = None, max_num = None) : self.relation_name = relation_name self.panels = panels self.label = label self.help_text = panels self.min_num = min_num self.max_num = max_num Is there a bug in the code above?
Yes
883
[ "#NEWLINE#", "@", "pytest", ".", "mark", ".", "parametrize", "(", "'response,error,dead,reassign'", ",", "[", "(", "OffsetFetchResponse", "[", "0", "]", "(", "[", "(", "'foobar'", ",", "[", "(", "0", ",", "123", ",", "b''", ",", "14", ")", ",", "(", ...
true
308
[ "286", "370", "291", "301", "308", "318", "331", "339", "280", "303", "276", "297", "349", "364", "278", "343", "284", "356", "282", "322" ]
1
VARIABLE_MISUSE
[ 282, 322 ]
[ [ { "before_index": 1, "after_index": 277, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 290, "after_index": 294, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 296, "after_inde...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "dpkp/kafka-python/test/test_coordinator.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] }}
@ pytest.mark.parametrize ('response,error,dead,reassign', [(OffsetFetchResponse [0] ([('foobar', [(0, 123, b'', 14), (1, 234, b'', 14)])]), Errors.GroupLoadInProgressError, False, False), (OffsetFetchResponse [0] ([('foobar', [(0, 123, b'', 16), (1, 234, b'', 16)])]), Errors.NotCoordinatorForGroupError, True, False), (OffsetFetchResponse [0] ([('foobar', [(0, 123, b'', 25), (1, 234, b'', 25)])]), Errors.UnknownMemberIdError, False, True), (OffsetFetchResponse [0] ([('foobar', [(0, 123, b'', 22), (1, 234, b'', 22)])]), Errors.IllegalGenerationError, False, True), (OffsetFetchResponse [0] ([('foobar', [(0, 123, b'', 29), (1, 234, b'', 29)])]), Errors.TopicAuthorizationFailedError, False, False), (OffsetFetchResponse [0] ([('foobar', [(0, 123, b'', 0), (1, 234, b'', 0)])]), None, False, False)]) def test_handle_offset_fetch_response(patched_coord, offsets, response, error, dead, reassign) : future = Future () patched_coord._handle_offset_fetch_response (future, response) if (future is not None) : assert isinstance (future.exception, error) else : assert future.succeeded () assert (future.value == offsets) assert (patched_coord.coordinator_id is (None if dead else 0)) assert (patched_coord._subscription.needs_partition_assignment is reassign) Is there a bug in the code above?
Yes
884
[ "#NEWLINE#", "def fetchAllSources(", "self", ",", "refreshFilter", "=", "None", ",", "skipFilter", "=", "None", ",", "withEphemeral", "=", "True", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n returns a list of file locations for all the sources in\\n the package recip...
true
75
[ "8", "105", "107", "51", "53", "87", "182", "194", "204", "129", "141", "170", "186", "198", "2", "22", "36", "55", "81", "95", "34", "59", "12", "157", "4", "135", "28", "46", "75", "93", "115", "131", "151" ]
1
VARIABLE_MISUSE
[ 28, 46 ]
[ [ { "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": 21, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "sassoftware/conary/conary/build/recipe.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 fetchAllSources(self, refreshFilter = None, skipFilter = None, withEphemeral = True) : ' returns a list of file locations for all the sources in the package recipe ' if self.pathConflicts : errlist = [] for basepath in self.pathConflicts.keys () : errlist.extend ([x for x in self.pathConflicts [basepath]]) raise RecipeFileError (('The following file names conflict (cvc does not currently support multiple files with the same name from different locations): ' + ' '.join (src))) self.prepSources () files = [] for src in self.getSourcePathList () : if (skipFilter and skipFilter (os.path.basename (src.getPath ()))) : continue f = src.fetch (refreshFilter) if (not f) : continue if (src.ephemeral and (not withEphemeral)) : continue if (type (f) in (tuple, list)) : files.extend (f) else : files.append (f) return files Is there a bug in the code above?
Yes
885
[ "#NEWLINE#", "def single_column_table(", "column", ",", "align", "=", "None", ",", "style", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "table", "=", "'<table'", "#NEWLINE#", "if", "(", "align", "is not", "None", ")", ":", "#NEWLINE#", "#INDENT#", "table",...
true
33
[ "15", "28", "46", "55", "66", "78", "83", "4", "21", "60", "73", "2", "33", "62", "8", "39", "51" ]
1
VARIABLE_MISUSE
[ 4, 21 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 17, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pydata/pandas/pandas/formats/format.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 single_column_table(column, align = None, style = None) : table = '<table' if (align is not None) : table += (' align="%s"' % column) if (style is not None) : table += (' style="%s"' % style) table += '><tbody>' for i in column : table += ('<tr><td>%s</td></tr>' % str (i)) table += '</tbody></table>' return table Is there a bug in the code above?
Yes
886
[ "#NEWLINE#", "def test_product_which_doesnt_track_stock(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "product_class", "=", "models", ".", "ProductClass", ".", "objects", ".", "create", "(", "name", "=", "'Digital'", ",", "track_stock", "=", "False", ")", "#NEWLINE#...
true
56
[ "48", "63", "7", "32", "34", "26", "2", "50", "56", "59" ]
1
VARIABLE_MISUSE
[ 26 ]
[ [ { "before_index": 6, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 25, "after_index": 35, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 47, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "django-oscar/django-oscar/tests/integration/partner/strategy_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_product_which_doesnt_track_stock(self) : product_class = models.ProductClass.objects.create (name = 'Digital', track_stock = False) product = factories.create_product (product_class = product_class, price = D ('1.99'), num_in_stock = None) info = self.strategy.fetch_for_product (self) self.assertTrue (info.availability.is_available_to_buy) Is there a bug in the code above?
Yes
887
[ "#NEWLINE#", "@", "contextmanager", "#NEWLINE#", "def extra_context(", "self", ",", "connection", ",", "channel", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "send_online", "(", ")", "#NEWLINE#", "self", ".", "wakeup", "(", ")", "#NEWLINE#", "sleep", "(", ...
true
47
[ "7", "47", "9", "5", "14", "20", "32", "38", "51", "56", "68" ]
1
VARIABLE_MISUSE
[ 5, 14, 20, 32, 38, 51, 56, 68 ]
[ [ { "before_index": 1, "after_index": 6, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 17, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "celery/cell/cell/presence.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] }}
@ contextmanager def extra_context(self, connection, channel) : self.send_online () self.wakeup () sleep (1.0) if self.on_awake : self.on_awake () timer (connection.interval, self.send_heartbeat) self.agent.on_presence_ready () (yield) self.send_offline () Is there a bug in the code above?
Yes
888
[ "#NEWLINE#", "def __init__(", "self", ",", "account", "=", "None", ",", "name", "=", "None", ",", "region", "=", "None", ",", "config", "=", "{", "#NEWLINE#", "#INDENT#", "#NEWLINE#", "#UNINDENT#", "}", ")", ":", "#NEWLINE#", "#INDENT#", "super", "(", "IAM...
true
57
[ "12", "43", "45", "57", "8", "51", "53", "16", "2", "32", "4", "47", "49" ]
1
VARIABLE_MISUSE
[ 16 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 27, "after_index": 42, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 42, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "Netflix/security_monkey/security_monkey/watchers/iam/iam_ssl.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, account = None, name = None, region = None, config = { }) : super (IAMSSLItem, self).__init__ (index = IAMSSL.index, region = region, account = account, name = name, new_config = region) Is there a bug in the code above?
Yes
889
[ "#NEWLINE#", "@", "mock", ".", "patch", "(", "'nova.utils.get_image_from_system_metadata'", ")", "#NEWLINE#", "def test_unshelve_volume_backed(", "self", ",", "mock_image_meta", ")", ":", "#NEWLINE#", "#INDENT#", "instance", "=", "self", ".", "_create_fake_instance_obj", ...
true
567
[ "17", "53", "61", "184", "222", "232", "261", "274", "283", "292", "301", "310", "320", "349", "364", "394", "413", "428", "452", "492", "510", "530", "555", "40", "561", "563", "535", "539", "25", "565", "12", "89", "543", "31", "47", "415", "...
1
VARIABLE_MISUSE
[ 25, 565 ]
[ [ { "before_index": 1, "after_index": 11, "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": "BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/compute/test_shelve.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] }}
@ mock.patch ('nova.utils.get_image_from_system_metadata') def test_unshelve_volume_backed(self, mock_image_meta) : instance = self._create_fake_instance_obj () node = test_compute.NODENAME limits = { } filter_properties = { 'limits' : limits, } instance.task_state = task_states.UNSHELVING instance.save () image_meta = { 'properties' : { 'base_image_ref' : 'fake_id', }, } mock_image_meta.return_value = image_meta self.mox.StubOutWithMock (self.compute, '_notify_about_instance_usage') self.mox.StubOutWithMock (self.compute, '_prep_block_device') self.mox.StubOutWithMock (self.compute.driver, 'spawn') self.mox.StubOutWithMock (self.compute, '_get_power_state') self.mox.StubOutWithMock (self.rt, 'instance_claim') self.mox.StubOutWithMock (self.compute.network_api, 'setup_instance_network_on_host') tracking = { 'last_state' : instance.task_state, } def check_save(expected_task_state = None) : if (tracking ['last_state'] == task_states.UNSHELVING) : self.assertEqual (task_states.SPAWNING, instance.task_state) tracking ['last_state'] = instance.task_state else : if (tracking ['last_state'] == task_states.SPAWNING) : self.assertEqual (123, instance.power_state) self.assertEqual (vm_states.ACTIVE, instance.vm_state) self.assertIsNone (instance.task_state) self.assertIsNone (instance.key_data) self.assertFalse (instance.auto_disk_config) self.assertIsNone (instance.task_state) tracking ['last_state'] = instance.task_state else : self.fail ('Unexpected save!') self.compute._notify_about_instance_usage (self.context, instance, 'unshelve.start') self.compute._prep_block_device (self.context, instance, mox.IgnoreArg (), do_check_attach = False).AndReturn ('fake_bdm') self.compute.network_api.setup_instance_network_on_host (self.context, instance, self.compute.host) self.rt.instance_claim (self.context, instance, limits).AndReturn (claims.Claim (self.context, instance, self.rt, _fake_resources ())) self.compute.driver.spawn (self.context, instance, mox.IsA (objects.ImageMeta), injected_files = [], admin_password = None, network_info = [], block_device_info = 'fake_bdm') self.compute._get_power_state (self.context, instance).AndReturn (123) self.compute._notify_about_instance_usage (self.context, instance, 'unshelve.end') self.mox.ReplayAll () with mock.patch.object (instance, 'save') as mock_save : mock_save.side_effect = check_save self.compute.unshelve_instance (self.context, instance, image = None, filter_properties = filter_properties, node = self) Is there a bug in the code above?
Yes
890
[ "#NEWLINE#", "def _append_nonsingleton_leaf_node(", "Z", ",", "p", ",", "n", ",", "level", ",", "lvs", ",", "ivl", ",", "leaf_label_func", ",", "i", ",", "labels", ",", "show_leaf_counts", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "lvs", "is not", "None"...
true
47
[ "14", "55", "63", "8", "6", "100", "4", "10", "27", "34", "12", "59", "82", "119", "2", "47", "94", "20", "78", "18", "16", "40", "67", "98" ]
1
VARIABLE_MISUSE
[ 12, 59, 82, 119 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 25, "after_index": 28, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 45, "after_index": 4...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "scipy/scipy/scipy/cluster/hierarchy.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 _append_nonsingleton_leaf_node(Z, p, n, level, lvs, ivl, leaf_label_func, i, labels, show_leaf_counts) : if (lvs is not None) : lvs.append (int (i)) if (Z is not None) : if leaf_label_func : ivl.append (leaf_label_func (int (i))) else : if show_leaf_counts : ivl.append ((('(' + str (int (Z [((i - n), 3)]))) + ')')) else : ivl.append ('') Is there a bug in the code above?
Yes
891
[ "#NEWLINE#", "def __ne__(", "self", ",", "other", ")", ":", "#NEWLINE#", "#INDENT#", "return", "(", "self", ".", "bar", "!=", "self", ".", "bar", ")" ]
true
15
[ "4", "2", "11", "15" ]
1
VARIABLE_MISUSE
[ 4 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 12...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "jaimegildesagredo/expects/specs/matchers/built_in/equal_spec.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 __ne__(self, other) : return (self.bar != self.bar) Is there a bug in the code above?
Yes
892
[ "#NEWLINE#", "def __getslice__(", "self", ",", "i", ",", "j", ")", ":", "#NEWLINE#", "#INDENT#", "\"\\n Get a slice from :attr:`i` to :attr:`j`.\\n\\n Doesn't get called in Python 3, :meth:`__getitem__` is called instead\\n \"", "#NEWLINE#", "obj", "=", "super", ...
true
45
[ "2", "19", "33", "45", "6", "26", "41", "4", "24", "39", "13", "29" ]
1
VARIABLE_MISUSE
[ 13, 29 ]
[ [ { "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": "NeuralEnsemble/python-neo/neo/core/irregularlysampledsignal.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 __getslice__(self, i, j) : " Get a slice from :attr:`i` to :attr:`j`. Doesn't get called in Python 3, :meth:`__getitem__` is called instead " obj = super (IrregularlySampledSignal, self).__getslice__ (i, j) obj.times = self.times.__getslice__ (i, j) return self Is there a bug in the code above?
Yes
893
[ "#NEWLINE#", "def createMultiChannelListener(", "self", ",", "callbackScheduler", ",", "ports", ",", "address", ")", ":", "#NEWLINE#", "#INDENT#", "def makeChannelListener(", "cbScheduler", ",", "port", ",", "portScanIncrement", "=", "0", ")", ":", "#NEWLINE#", "#INDE...
false
0
[ "2", "26", "self", "4", "43", "callbackScheduler", "6", "45", "ports", "8", "32", "address", "47", "makeChannelListener" ]
0
NONE
[]
[ [ { "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": 38, "after_index": 4...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ufora/ufora/ufora/test/InMemoryCluster.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 createMultiChannelListener(self, callbackScheduler, ports, address) : def makeChannelListener(cbScheduler, port, portScanIncrement = 0) : return self.createChannelListener (cbScheduler, address, port) return MultiChannelListener.MultiChannelListener (callbackScheduler, ports, makeChannelListener) Is there a bug in the code above?
No
894
[ "#NEWLINE#", "def execute(", "self", ",", "request", "=", "''", ",", "root", "=", "None", ",", "args", "=", "None", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "kwargs", "=", "dict", "(", "kwargs", ",", "request", "=", "request", ",", "root", "...
false
0
[ "57", "69", "execute_kwargs", "8", "31", "33", "root", "2", "41", "47", "62", "self", "4", "27", "29", "request", "12", "35", "37", "args", "21", "25", "54", "kwargs" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 20, "after_index": 26, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "graphql-python/graphene/graphene/core/schema.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 execute(self, request = '', root = None, args = None, **kwargs) : kwargs = dict (kwargs, request = request, root = root, args = args, schema = self.schema) with self.plugins.context_execution (** kwargs) as execute_kwargs : return self.executor.execute (** execute_kwargs) Is there a bug in the code above?
No
895
[ "#NEWLINE#", "def __init__(", "self", ",", "config", ",", "path", "=", "None", ",", "bbb_config", "=", "False", ",", "plugins", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "ConfigSection", ".", "__init__", "(", "self", ")", "#NEWLINE#", "self", ".", "c...
false
0
[ "99", "112", "142", "153", "plugin", "14", "91", "101", "plugins", "2", "25", "28", "72", "78", "130", "147", "158", "self", "110", "134", "massager", "4", "30", "32", "47", "67", "config", "6", "36", "59", "63", "74", "76", "path", "10", "bbb_co...
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 20, "after_index": 24, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 27, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ployground/ploy/ploy/config.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, config, path = None, bbb_config = False, plugins = None) : ConfigSection.__init__ (self) self.config = config if (path is None) : if (getattr (config, 'read', None) is None) : path = os.path.dirname (config) self.path = path self.macro_cleaners = { } if (plugins is not None) : for plugin in plugins.values () : for massager in plugin.get ('get_massagers', (lambda : [])) () : self.add_massager (massager) if ('get_macro_cleaners' in plugin) : self.macro_cleaners.update (plugin ['get_macro_cleaners'] (self)) Is there a bug in the code above?
No
896
[ "#NEWLINE#", "def __init__(", "self", ",", "label", "=", "None", ",", "validators", "=", "None", ",", "save_as_list", "=", "False", ",", "coerce", "=", "text_type", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "'Initialization\\n\\n :param save_as_list...
false
0
[ "16", "35", "37", "coerce", "8", "50", "validators", "53", "kwargs", "2", "27", "33", "43", "self", "12", "29", "31", "save_as_list", "4", "48", "label" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 24, "after_index": 25, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "flask-admin/flask-admin/flask_admin/form/fields.py", "license": "bsd-3-clause", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def __init__(self, label = None, validators = None, save_as_list = False, coerce = text_type, **kwargs) : 'Initialization :param save_as_list: If `True` then populate ``obj`` using list else string ' self.save_as_list = save_as_list self.coerce = coerce super (Select2TagsField, self).__init__ (label, validators, ** kwargs) Is there a bug in the code above?
No
897
[ "#NEWLINE#", "def test_binary_ops(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "binary_ops", "=", "[", "eq", ",", "ge", ",", "gt", ",", "le", ",", "lt", ",", "ne", ",", "sub", ",", "and_", ",", "or_", ",", "xor", "]", "#NEWLINE#", "try", ":", "#NEWL...
false
0
[ "52", "62", "73", "86", "94", "105", "118", "126", "137", "150", "op", "7", "35", "54", "binary_ops", "2", "58", "64", "68", "75", "79", "90", "96", "100", "107", "111", "122", "128", "132", "139", "143", "155", "162", "168", "175", "self" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 51, "after_index": 52, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 51, "after_index": 5...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "awslabs/lambda-apigateway-twilio-tutorial/pytz/tests/test_lazy.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_binary_ops(self) : binary_ops = [eq, ge, gt, le, lt, ne, sub, and_, or_, xor] try : binary_ops.append (cmp) except NameError : pass for op in binary_ops : self.assertEqual (op (self.lazy, self.lazy), op (self.base, self.base), str (op)) self.assertEqual (op (self.lazy, self.base), op (self.base, self.base), str (op)) self.assertEqual (op (self.base, self.lazy), op (self.base, self.base), str (op)) self.assertTrue ((2 in self.lazy)) self.assertFalse ((42 in self.lazy)) Is there a bug in the code above?
No
898
[ "#NEWLINE#", "def read(", "self", ",", "iprot", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "(", "iprot", ".", "__class__", "==", "TBinaryProtocol", ".", "TBinaryProtocolAccelerated", ")", "and", "isinstance", "(", "iprot", ".", "trans", ",", "TTransport", "...
false
0
[ "87", "100", "123", "151", "164", "ftype", "2", "33", "53", "60", "64", "132", "self", "85", "fname", "89", "114", "fid", "4", "12", "23", "55", "73", "92", "136", "147", "160", "168", "175", "iprot" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 72, "after_index": 76...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "cloudera/impyla/impala/_thrift_gen/fb303/FacebookService.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, iprot) : if ((iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated) and isinstance (iprot.trans, TTransport.CReadableTransport) and (self.thrift_spec is not None) and (fastbinary is not None)) : fastbinary.decode_binary (self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin () while True : (fname, ftype, fid) = iprot.readFieldBegin () if (ftype == TType.STOP) : break if (fid == 1) : if (ftype == TType.STRING) : self.key = iprot.readString () else : iprot.skip (ftype) else : iprot.skip (ftype) iprot.readFieldEnd () iprot.readStructEnd () Is there a bug in the code above?
No
899
[ "#NEWLINE#", "def read(", "self", ",", "iprot", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "(", "iprot", ".", "__class__", "==", "TBinaryProtocol", ".", "TBinaryProtocolAccelerated", ")", "and", "isinstance", "(", "iprot", ".", "trans", ",", "TTransport", "...
false
0
[ "87", "100", "120", "ftype", "2", "33", "53", "60", "64", "self", "85", "fname", "89", "fid", "4", "12", "23", "55", "73", "92", "116", "124", "131", "iprot" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 72, "after_index": 76...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "cloudera/impyla/impala/_thrift_gen/fb303/FacebookService.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, iprot) : if ((iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated) and isinstance (iprot.trans, TTransport.CReadableTransport) and (self.thrift_spec is not None) and (fastbinary is not None)) : fastbinary.decode_binary (self, iprot.trans, (self.__class__, self.thrift_spec)) return iprot.readStructBegin () while True : (fname, ftype, fid) = iprot.readFieldBegin () if (ftype == TType.STOP) : break else : iprot.skip (ftype) iprot.readFieldEnd () iprot.readStructEnd () Is there a bug in the code above?
No