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
100
[ "#NEWLINE#", "def _CreateOutputFileHandles(", "self", ",", "output_type", ")", ":", "#NEWLINE#", "#INDENT#", "'Creates a new gzipped output tempfile for the output type.\\n\\n We write to JSON data to gzip_filehandle to get compressed data. We hold a\\n reference to the original filehandle (...
false
0
[ "22", "54", "56", "gzip_filehandle", "4", "19", "45", "50", "52", "68", "output_type", "11", "28", "38", "58", "60", "gzip_filehandle_parent", "2", "34", "41", "64", "self" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 16,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "google/grr/grr/lib/output_plugins/bigquery_plugin.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 _CreateOutputFileHandles(self, output_type) : 'Creates a new gzipped output tempfile for the output type. We write to JSON data to gzip_filehandle to get compressed data. We hold a reference to the original filehandle (gzip_filehandle_parent) so we can pass the gzip data to bigquery. Args: output_type: string of export type to be used in filename. e.g. ExportedFile Returns: A TempOutputTracker object ' gzip_filehandle_parent = tempfile.NamedTemporaryFile (suffix = output_type) gzip_filehandle = gzip.GzipFile (gzip_filehandle_parent.name, 'wb', self.GZIP_COMPRESSION_LEVEL, gzip_filehandle_parent) self.temp_output_trackers [output_type] = TempOutputTracker (output_type = output_type, gzip_filehandle = gzip_filehandle, gzip_filehandle_parent = gzip_filehandle_parent) return self.temp_output_trackers [output_type] Is there a bug in the code above?
No
101
[ "#NEWLINE#", "def test_failed_connect_and_then_successful_connect(", "t", "=", "Time", ",", "logic", "=", "DEFAULT_LOGIC", ",", "nid", "=", "NID", "(", "'kaamel:123'", ")", ")", ":", "#NEWLINE#", "#INDENT#", "(", "t", ",", "logic", ")", "=", "test_failed_connect",...
false
0
[ "2", "21", "28", "38", "48", "t", "10", "32", "34", "57", "59", "nid", "6", "23", "30", "40", "54", "logic" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 29, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 36, "after_index": 5...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "eallik/spinoff/spinoff/tests/hub_test.py", "license": "bsd-2-clause", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def test_failed_connect_and_then_successful_connect(t = Time, logic = DEFAULT_LOGIC, nid = NID ('kaamel:123')) : (t, logic) = test_failed_connect (t, logic, nid = nid) (t, logic) = test_successful_connect ((lambda : t), (lambda : logic), nid = nid) Is there a bug in the code above?
No
102
[ "#NEWLINE#", "def test_failed_connect_and_then_successful_connect(", "t", "=", "Time", ",", "logic", "=", "DEFAULT_LOGIC", ",", "nid", "=", "NID", "(", "'kaamel:123'", ")", ")", ":", "#NEWLINE#", "#INDENT#", "(", "t", ",", "logic", ")", "=", "test_failed_connect",...
false
0
[ "2", "21", "28", "38", "48", "t", "10", "32", "34", "57", "59", "nid", "6", "23", "30", "40", "54", "logic" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 29, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 36, "after_index": 5...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "eallik/spinoff/spinoff/tests/hub_test.py", "license": "bsd-2-clause", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def test_failed_connect_and_then_successful_connect(t = Time, logic = DEFAULT_LOGIC, nid = NID ('kaamel:123')) : (t, logic) = test_failed_connect (t, logic, nid = nid) (t, logic) = test_successful_connect ((lambda : t), (lambda : logic), nid = nid) Is there a bug in the code above?
No
103
[ "#NEWLINE#", "def test_ppf_ticket1131(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "vals", "=", "stats", ".", "truncnorm", ".", "ppf", "(", "[", "(", "-", "0.5", ")", ",", "0", ",", "0.0001", ",", "0.5", ",", "(", "1", "-", "0.0001", ")", ",", "1", ...
false
0
[ "7", "89", "vals", "2", "self", "60", "91", "expected" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 37, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 59, "after_index": 65, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 86, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "scipy/scipy/scipy/stats/tests/test_distributions.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_ppf_ticket1131(self) : vals = stats.truncnorm.ppf ([(- 0.5), 0, 0.0001, 0.5, (1 - 0.0001), 1, 2], (- 1.0), 1.0, loc = ([3] * 7), scale = 2) expected = np.array ([np.nan, 1, 1.00056419, 3, 4.99943581, 5, np.nan]) assert_array_almost_equal (vals, expected) Is there a bug in the code above?
No
104
[ "#NEWLINE#", "def test_gh_1489_trac_962_rvs(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "(", "low", ",", "high", ")", "=", "(", "10", ",", "15", ")", "#NEWLINE#", "x", "=", "stats", ".", "truncnorm", ".", "rvs", "(", "low", ",", "high", ",", "0", ","...
false
0
[ "8", "27", "43", "low", "2", "self", "19", "45", "51", "x", "10", "29", "57", "high" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 28, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 39, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "scipy/scipy/scipy/stats/tests/test_distributions.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_gh_1489_trac_962_rvs(self) : (low, high) = (10, 15) x = stats.truncnorm.rvs (low, high, 0, 1, size = 10) assert_ ((low < x.min () < x.max () < high)) Is there a bug in the code above?
No
105
[ "#NEWLINE#", "def test_logpdf_ticket_1866(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "(", "alpha", ",", "beta", ")", "=", "(", "267", ",", "1472", ")", "#NEWLINE#", "x", "=", "np", ".", "array", "(", "[", "0.2", ",", "0.5", ",", "0.6", "]", ")", "...
false
0
[ "19", "51", "70", "81", "x", "34", "47", "66", "77", "b", "10", "38", "42", "beta", "2", "self", "8", "40", "alpha" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 24, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 33, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "scipy/scipy/scipy/stats/tests/test_distributions.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_logpdf_ticket_1866(self) : (alpha, beta) = (267, 1472) x = np.array ([0.2, 0.5, 0.6]) b = stats.beta (alpha, beta) assert_allclose (b.logpdf (x).sum (), (- 1201.699061824062)) assert_allclose (b.pdf (x), np.exp (b.logpdf (x))) Is there a bug in the code above?
No
106
[ "#NEWLINE#", "def test_fix_fit_norm(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "x", "=", "np", ".", "arange", "(", "1", ",", "6", ")", "#NEWLINE#", "(", "loc", ",", "scale", ")", "=", "stats", ".", "norm", ".", "fit", "(", "x", ")", "#NEWLINE#", "...
false
0
[ "2", "self", "21", "42", "55", "80", "93", "118", "scale", "19", "35", "53", "73", "91", "111", "loc", "7", "30", "64", "102", "x" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 29, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 32, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "scipy/scipy/scipy/stats/tests/test_distributions.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_fix_fit_norm(self) : x = np.arange (1, 6) (loc, scale) = stats.norm.fit (x) assert_almost_equal (loc, 3) assert_almost_equal (scale, np.sqrt (2)) (loc, scale) = stats.norm.fit (x, floc = 2) assert_equal (loc, 2) assert_equal (scale, np.sqrt (3)) (loc, scale) = stats.norm.fit (x, fscale = 2) assert_almost_equal (loc, 3) assert_equal (scale, 2) Is there a bug in the code above?
No
107
[ "#NEWLINE#", "def export(", "self", ",", "location", ")", ":", "#NEWLINE#", "#INDENT#", "'Export the Bazaar repository at the url to the destination location'", "#NEWLINE#", "temp_dir", "=", "tempfile", ".", "mkdtemp", "(", "'-export'", ",", "'pip-'", ")", "#NEWLINE#", "s...
false
0
[ "4", "36", "43", "60", "location", "2", "22", "54", "69", "self", "11", "26", "65", "85", "temp_dir" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 18,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "balanced/status.balancedpayments.com/venv/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/vcs/bazaar.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 export(self, location) : 'Export the Bazaar repository at the url to the destination location' temp_dir = tempfile.mkdtemp ('-export', 'pip-') self.unpack (temp_dir) if os.path.exists (location) : rmtree (location) try : call_subprocess ([self.cmd, 'export', location], cwd = temp_dir, filter_stdout = self._filter, show_stdout = False) finally : rmtree (temp_dir) Is there a bug in the code above?
No
108
[ "#NEWLINE#", "def test_ReduceXOR(", "setup_sim", ")", ":", "#NEWLINE#", "#INDENT#", "model", "=", "ReduceXOR", "(", "4", ")", "#NEWLINE#", "(", "model", ",", "sim", ")", "=", "setup_sim", "(", "model", ")", "#NEWLINE#", "for", "(", "i", ",", "o", ")", "i...
false
0
[ "29", "113", "122", "o", "2", "20", "setup_sim", "17", "101", "sim", "27", "99", "i", "7", "15", "22", "93", "109", "118", "model" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 21, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 25, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "cornell-brg/pymtl/pymtl/tools/simulation/SimulationTool_comb_test.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_ReduceXOR(setup_sim) : model = ReduceXOR (4) (model, sim) = setup_sim (model) for (i, o) in zip ([15, 10, 5, 0, 9, 14, 13, 11, 7, 1, 2, 4, 8], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1]) : model.in_.value = i sim.eval_combinational () assert (model.out0 == o) assert (model.out1 == o) Is there a bug in the code above?
No
109
[ "#NEWLINE#", "def test_ListOfSubmodPortBundles(", "setup_sim", ")", ":", "#NEWLINE#", "#INDENT#", "model", "=", "ListOfSubmodPortBundles", "(", ")", "#NEWLINE#", "(", "model", ",", "sim", ")", "=", "setup_sim", "(", "model", ")", "#NEWLINE#", "model", ".", "in_", ...
false
0
[ "2", "19", "setup_sim", "7", "14", "21", "24", "37", "50", "63", "84", "98", "112", "126", "138", "151", "164", "177", "198", "212", "226", "240", "model", "16", "76", "190", "sim" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "cornell-brg/pymtl/pymtl/tools/simulation/SimulationTool_comb_test.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_ListOfSubmodPortBundles(setup_sim) : model = ListOfSubmodPortBundles () (model, sim) = setup_sim (model) model.in_ [0].a.value = 2 model.in_ [0].b.value = 3 model.in_ [1].a.value = 4 model.in_ [1].b.value = 5 sim.eval_combinational () assert (model.out [0].a == 3) assert (model.out [0].b == 2) assert (model.out [1].a == 5) assert (model.out [1].b == 4) model.in_ [0].a.value = 10 model.in_ [0].b.value = 4 model.in_ [1].a.value = 10 model.in_ [1].b.value = 4 sim.eval_combinational () assert (model.out [0].a == 4) assert (model.out [0].b == 10) assert (model.out [1].a == 4) assert (model.out [1].b == 10) Is there a bug in the code above?
No
110
[ "#NEWLINE#", "def E_log_pdf(", "self", ",", "Data", ")", ":", "#NEWLINE#", "#INDENT#", "' Calculate E[ log p( x_n | theta ) ] for each x_n in Data.X\\n \\n Args\\n -------\\n Data : bnpy XData object\\n with attribute Data.X, numpy 2D array of size nObs x...
false
0
[ "4", "57", "Data", "11", "65", "logPDFConst", "2", "21", "36", "53", "self", "45", "67", "logPDFData" ]
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": 28,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "daeilkim/refinery/refinery/bnpy/bnpy-dev/bnpy/distr/GaussGammaDistr.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 E_log_pdf(self, Data) : ' Calculate E[log p(x_n | theta)] for each x_n in Data.X Args ------- Data : bnpy XData object with attribute Data.X, numpy 2D array of size nObs x D Returns ------- logp : numpy 1D array, length nObs ' logPDFConst = ((((- 0.5) * self.D) * LOGTWOPI) + (0.5 * np.sum (self.E_logLam ()))) logPDFData = ((- 0.5) * self.E_distMahalanobis (Data.X)) return (logPDFConst + logPDFData) Is there a bug in the code above?
No
111
[ "#NEWLINE#", "@", "classmethod", "#NEWLINE#", "def validate_params(", "cls", ",", "params", ")", ":", "#NEWLINE#", "#INDENT#", "one_day", "=", "(", "(", "24", "*", "60", ")", "*", "60", ")", "#NEWLINE#", "if", "(", "int", "(", "params", "[", "'timestamp'",...
false
0
[ "7", "28", "56", "params", "12", "41", "one_day", "5", "52", "cls" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 6, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 24, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "Shopify/shopify_python_api/shopify/session.py", "license": "mit", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
@ classmethod def validate_params(cls, params) : one_day = ((24 * 60) * 60) if (int (params ['timestamp']) < (time.time () - one_day)) : return False return cls.validate_hmac (params) Is there a bug in the code above?
No
112
[ "#NEWLINE#", "def bind(", "self", ",", "*", "args", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "return", "type", "(", "self", ")", "(", "self", ",", "*", "args", ",", "**", "kwargs", ")" ]
false
0
[ "2", "15", "18", "self", "24", "kwargs", "5", "21", "args" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 3, "after_index": 5, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 19,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pytoolz/toolz/toolz/functoolz.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 bind(self, * args, **kwargs) : return type (self) (self, * args, ** kwargs) Is there a bug in the code above?
No
113
[ "#NEWLINE#", "def test_quo4(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "w", "=", "Grammar", "(", "\"root 'some\\\\''\"", ")", "#NEWLINE#", "g", "=", "w", ".", "generate", "(", ")", "#NEWLINE#", "self", ".", "assertEqual", "(", "g", ",", "\"some'\"", ")...
false
0
[ "7", "16", "31", "40", "w", "2", "22", "46", "self", "14", "26", "38", "50", "g" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 19, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 21, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "blackberry/ALF/alf/fuzz/grammr2_test.py", "license": "apache-2.0", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def test_quo4(self) : w = Grammar ("root 'some\\''") g = w.generate () self.assertEqual (g, "some'") w = Grammar ('root "some\\""') g = w.generate () self.assertEqual (g, 'some"') Is there a bug in the code above?
No
114
[ "#NEWLINE#", "def insert(", "self", ",", "value", ",", "pivot", ",", "where", ")", ":", "#NEWLINE#", "#INDENT#", "return", "self", ".", "database", ".", "linsert", "(", "self", ".", "key", ",", "where", ",", "pivot", ",", "value", ")" ]
false
0
[ "2", "14", "20", "self", "8", "24", "where", "6", "26", "pivot", "4", "28", "value" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 23, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "coleifer/walrus/walrus/containers.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 insert(self, value, pivot, where) : return self.database.linsert (self.key, where, pivot, value) Is there a bug in the code above?
No
115
[ "#NEWLINE#", "def __init__(", "self", ",", "*", "args", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "super", "(", "UserGenericPermsMixin", ",", "self", ")", ".", "__init__", "(", "*", "args", ",", "**", "kwargs", ")", "#NEWLINE#", "self", ".", "gro...
false
0
[ "2", "16", "28", "34", "self", "5", "22", "args", "25", "kwargs" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 3, "after_index": 5, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 23,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "grey0ne/django-protector/protector/models.py", "license": "mit", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def __init__(self, * args, **kwargs) : super (UserGenericPermsMixin, self).__init__ (* args, ** kwargs) self.groups = UserGroupManager (self) Is there a bug in the code above?
No
116
[ "#NEWLINE#", "def __eq__(", "self", ",", "other", ")", ":", "#NEWLINE#", "#INDENT#", "return", "(", "unicode", "(", "self", ")", "==", "unicode", "(", "other", ")", ")" ]
false
0
[ "2", "13", "self", "4", "18", "other" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 15, "after_index": 12...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "chrippa/livestreamer/src/livestreamer/packages/pbs.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 __eq__(self, other) : return (unicode (self) == unicode (other)) Is there a bug in the code above?
No
117
[ "#NEWLINE#", "@", "realname", ".", "setter", "#NEWLINE#", "def realname(", "self", ",", "val", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "val", ".", "connected", "or", "self", ".", "connecting", ")", ":", "#NEWLINE#", "#INDENT#", "raise", "IOError", "(",...
true
16
[ "9", "16", "38", "7", "20", "34" ]
1
VARIABLE_MISUSE
[ 7, 20, 34 ]
[ [ { "before_index": 1, "after_index": 8, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 19, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 33, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ecdavis/pants/pants/contrib/irc.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] }}
@ realname.setter def realname(self, val) : if (val.connected or self.connecting) : raise IOError ('Cannot change while connected to server.') self._realname = val Is there a bug in the code above?
Yes
118
[ "#NEWLINE#", "def addSuccess(", "self", ",", "test", ")", ":", "#NEWLINE#", "#INDENT#", "try", ":", "#NEWLINE#", "#INDENT#", "(", "rc_deltas", ",", "alloc_deltas", ")", "=", "self", ".", "_huntLeaks", "(", "test", ")", "#NEWLINE#", "#UNINDENT#", "except", "Ass...
true
175
[ "4", "23", "171", "242", "266", "204", "208", "244", "134", "158", "165", "195", "124", "184", "252", "151", "132", "230", "16", "147", "14", "139", "143", "46", "54", "59", "69", "79", "95", "130", "160", "173", "179", "232", "2", "19", "35", ...
1
VARIABLE_MISUSE
[ 132, 230 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 123, "after_index": 126, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 128, "after_index"...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "numba/llvmlite/llvmlite/tests/customize.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 addSuccess(self, test) : try : (rc_deltas, alloc_deltas) = self._huntLeaks (test) except AssertionError : assert (not self.wasSuccessful ()) return def check_rc_deltas(deltas) : return any (deltas) def check_alloc_deltas(deltas) : if ((3 * deltas.count (0)) < len (deltas)) : return True if (not (set (deltas) <= set ((1, 0, (- 1))))) : return True return False failed = False for (deltas, item_name, checker) in [(rc_deltas, 'references', check_rc_deltas), (alloc_deltas, 'memory blocks', check_alloc_deltas)] : if checker (deltas) : msg = ('%s leaked %s %s, sum=%s' % (test, deltas, self, sum (deltas))) failed = True try : raise ReferenceLeakError (msg) except Exception : exc_info = sys.exc_info () if self.showAll : self.stream.write (('%s = %r ' % (item_name, deltas))) self.addFailure (test, exc_info) if (not failed) : super (RefleakTestResult, self).addSuccess (test) Is there a bug in the code above?
Yes
119
[ "#NEWLINE#", "def Layout(", "self", ",", "request", ",", "response", ")", ":", "#NEWLINE#", "#INDENT#", "req_flow", "=", "request", ".", "REQ", ".", "get", "(", "'flow'", ")", "#NEWLINE#", "if", "req_flow", ":", "#NEWLINE#", "#INDENT#", "self", ".", "state",...
true
116
[ "37", "49", "60", "4", "13", "39", "77", "106", "116", "6", "95", "108", "2", "27", "53", "69", "86", "101", "112", "122", "11", "23", "34", "65", "73" ]
1
VARIABLE_MISUSE
[ 6, 95, 108 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 18, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 22, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "google/grr/grr/gui/plugins/flow_management.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 Layout(self, request, response) : req_flow = request.REQ.get ('flow') if req_flow : self.state ['flow'] = req_flow client_id = request.REQ.get ('client_id') if client_id : self.state ['client_id'] = client_id if (req_flow and (not self.IsOutputExportable (req_flow, token = request.token))) : self.disabled = ['FlowResultsExportView'] response = super (FlowTabView, self).Layout (request, response) return self.CallJavascript (request, 'FlowTabView.Layout', renderer = self.__class__.__name__) Is there a bug in the code above?
Yes
120
[ "#NEWLINE#", "def _create_ssh(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "'Create ssh connection'", "#NEWLINE#", "try", ":", "#NEWLINE#", "#INDENT#", "self", ".", "_client", "=", "paramiko", ".", "SSHClient", "(", ")", "#NEWLINE#", "self", ".", "_client", ".", ...
true
96
[ "65", "77", "96", "2", "13", "23", "36", "42", "81" ]
1
VARIABLE_MISUSE
[ 2, 13, 23, 36, 42, 81 ]
[ [ { "before_index": 6, "after_index": 7, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 87, "after_index": 91, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "nvbn/coviolations_web/nodes/utils.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_ssh(self) : 'Create ssh connection' try : self._client = paramiko.SSHClient () self._client.set_missing_host_key_policy (paramiko.AutoAddPolicy ()) self._client.connect (self._get_ip (), username = 'root', password = settings.PYRAX_PASSWORD) except paramiko.AuthenticationException as e : logger.info ('SSH connection wait:{}'.format (e)) self._create_ssh () logger.info ('SSH connection ready:{}'.format (e._name)) Is there a bug in the code above?
Yes
121
[ "#NEWLINE#", "@", "classmethod", "#NEWLINE#", "def isa(", "cls", ",", "filename", ")", ":", "#NEWLINE#", "#INDENT#", "basename", "=", "os", ".", "path", ".", "basename", "(", "filename", ")", "#NEWLINE#", "if", "basename", ".", "startswith", "(", "'.'", ")",...
true
40
[ "5", "38", "40", "51", "7", "20", "49", "12", "18", "24" ]
1
VARIABLE_MISUSE
[ 5 ]
[ [ { "before_index": 1, "after_index": 6, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 19, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "behave/behave/bin/make_localpi.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] }}
@ classmethod def isa(cls, filename) : basename = os.path.basename (filename) if basename.startswith ('.') : return False for pattern in pattern.PATTERNS : if fnmatch (filename, pattern) : return True return False Is there a bug in the code above?
Yes
122
[ "#NEWLINE#", "def test_strategy_restore_method_creates_new_instance(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "(", "new_instance", ",", "user_input", ",", "snapshot_ids", ",", "errors", ")", "=", "InstanceBackupStrategy", ".", "deserialize_instance", "(", "self", ".",...
true
75
[ "10", "29", "8", "49", "60", "2", "21", "27", "32", "45", "56", "64", "71", "79", "12", "75", "14", "36", "41" ]
1
VARIABLE_MISUSE
[ 8, 49, 60 ]
[ [ { "before_index": 6, "after_index": 26, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 31, "after_index": 37, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 44, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "opennode/nodeconductor/nodeconductor/iaas/tests/backup/test_instance_backup.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_strategy_restore_method_creates_new_instance(self) : (new_instance, user_input, snapshot_ids, errors) = InstanceBackupStrategy.deserialize_instance (self.backup.metadata, self.user_input) self.assertIsNone (errors, ('Deserialization errors: %s' % errors)) self.assertEqual (new_instance.name, 'new_name') self.assertNotEqual (new_instance.id, self.instance.id) self.assertEqual (snapshot_ids.agreed_sla, self.agreed_sla) Is there a bug in the code above?
Yes
123
[ "#NEWLINE#", "def user_get_object_permissions_as_choices(", "self", ",", "instance", ")", ":", "#NEWLINE#", "#INDENT#", "\"\\n Get a list of strings representing the user's permissions for this object\\n \"", "#NEWLINE#", "return", "self", ".", "get_object_perm", "(", "self", ...
true
16
[ "2", "12", "16", "4" ]
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": 17,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "callowayproject/django-objectpermissions/objectpermissions/registration.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 user_get_object_permissions_as_choices(self, instance) : " Get a list of strings representing the user's permissions for this object " return self.get_object_perm (self, 'choices') Is there a bug in the code above?
Yes
124
[ "#NEWLINE#", "def __init__(", "self", ",", "dtype", "=", "'floatX'", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "_dtype", "=", "self", ".", "_clean_dtype_arg", "(", "self", ")", "#NEWLINE#", "super", "(", "SequenceMaskSpace", ",", "self", ")", ".", "__i...
true
19
[ "2", "11", "15", "19", "26", "4", "31" ]
1
VARIABLE_MISUSE
[ 4, 31 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 18, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 21, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "lisa-lab/pylearn2/pylearn2/sandbox/rnn/space/__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 __init__(self, dtype = 'floatX') : self._dtype = self._clean_dtype_arg (self) super (SequenceMaskSpace, self).__init__ (dtype) Is there a bug in the code above?
Yes
125
[ "#NEWLINE#", "def evaluate(", "self", ",", "environment", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "'Evaluate a marker.\\n\\n Return the boolean from evaluating the given marker against the\\n environment. environment is an optional argument to override all or\\n pa...
true
43
[ "2", "39", "43", "13", "28", "4", "21", "32" ]
1
VARIABLE_MISUSE
[ 13, 28 ]
[ [ { "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": "pypa/pip/pip/_vendor/packaging/markers.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 evaluate(self, environment = None) : 'Evaluate a marker. Return the boolean from evaluating the given marker against the environment. environment is an optional argument to override all or part of the determined environment. The environment is determined from the current Python process. ' current_environment = default_environment () if (environment is not None) : current_environment.update (environment) return _evaluate_markers (self._markers, self) Is there a bug in the code above?
Yes
126
[ "#NEWLINE#", "def fetch(", "self", ",", "path", ")", ":", "#NEWLINE#", "#INDENT#", "body", "=", "self", ".", "get_object", "(", "path", ")", ".", "get", "(", ")", "[", "'Body'", "]", "#NEWLINE#", "data", "=", "bytes", "(", ")", "#NEWLINE#", "for", "chu...
true
58
[ "2", "11", "4", "15", "58", "32", "54", "9", "39", "25", "52" ]
1
VARIABLE_MISUSE
[ 25, 52 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 21, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 24, "after_index": 28...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "dcos/dcos/release/storage/aws.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 fetch(self, path) : body = self.get_object (path).get () ['Body'] data = bytes () for chunk in iter ((lambda : body.read (4096)), b'') : data += chunk return path Is there a bug in the code above?
Yes
127
[ "#NEWLINE#", "def upload(", "self", ",", "destination_path", ",", "blob", "=", "None", ",", "local_path", "=", "None", ",", "no_cache", "=", "None", ",", "content_type", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "extra_args", "=", "{", "#NEWLINE#", "#I...
true
136
[ "2", "62", "14", "35", "10", "72", "85", "92", "4", "66", "18", "48", "57", "97", "107", "136", "60", "101", "127", "25", "39", "52", "110", "6", "78", "122", "133" ]
1
VARIABLE_MISUSE
[ 25, 39, 52, 110 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 24, "after_index": 27, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 34, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "dcos/dcos/release/storage/aws.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 upload(self, destination_path, blob = None, local_path = None, no_cache = None, content_type = None) : extra_args = { } if no_cache : extra_args ['CacheControl'] = 'no-cache' if content_type : extra_args ['ContentType'] = content_type s3_object = self.get_object (destination_path) assert ((local_path is None) or (blob is None)) if local_path : with open (local_path, 'rb') as data : s3_object.put (Body = data, ** extra_args) else : assert isinstance (blob, bytes) s3_object.put (Body = blob, ** data) Is there a bug in the code above?
Yes
128
[ "#NEWLINE#", "def maxProduct(", "self", ",", "nums", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "not", "nums", ")", ":", "#NEWLINE#", "#INDENT#", "return", "0", "#NEWLINE#", "#UNINDENT#", "n", "=", "len", "(", "nums", ")", "#NEWLINE#", "smallest", "=", ...
true
127
[ "35", "91", "104", "146", "2", "127", "42", "140", "144", "154", "21", "56", "61", "75", "87", "100", "111", "123", "136", "28", "68", "78", "114", "50", "65", "70", "81", "94", "106", "117", "130", "148", "4", "12", "25", "32", "39", "44", ...
1
VARIABLE_MISUSE
[ 35, 91, 104, 146 ]
[ [ { "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": 20, "after_index": 24...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "algorhythms/LintCode/Maximum Product Subarray.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 maxProduct(self, nums) : if (not nums) : return 0 n = len (nums) smallest = list (nums) largest = list (nums) maxa = nums [0] for i in xrange (1, n) : v = nums [i] smallest [i] = min (v, (smallest [(i - 1)] * v), (largest [(i - 1)] * v)) largest [i] = max (v, (smallest [(i - 1)] * v), (self [(i - 1)] * v)) maxa = max (maxa, largest [i]) return maxa Is there a bug in the code above?
Yes
129
[ "#NEWLINE#", "def test_main(", "monkeypatch", ",", "capsys", ")", ":", "#NEWLINE#", "#INDENT#", "'Test if main commmand shows help when called without the subcommand.'", "#NEWLINE#", "monkeypatch", ".", "setattr", "(", "sys", ",", "'argv'", ",", "[", "'pytest-bdd'", "]", ...
true
60
[ "45", "60", "47", "67", "4", "50", "2", "11", "24" ]
1
VARIABLE_MISUSE
[ 47, 67 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 16,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pytest-dev/pytest-bdd/tests/scripts/test_main.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_main(monkeypatch, capsys) : 'Test if main commmand shows help when called without the subcommand.' monkeypatch.setattr (sys, 'argv', ['pytest-bdd']) monkeypatch.setattr (sys, 'exit', (lambda x : x)) main () (out, err) = capsys.readouterr () assert ('usage: pytest-bdd [-h]' in out) assert ('pytest-bdd: error:' in err) Is there a bug in the code above?
Yes
130
[ "#NEWLINE#", "def _get_single_external(", "self", ",", "index", ")", ":", "#NEWLINE#", "#INDENT#", "return", "GEOSGeometry", "(", "capi", ".", "geom_clone", "(", "self", ".", "_get_single_internal", "(", "self", ")", ")", ",", "srid", "=", "self", ".", "srid",...
true
20
[ "2", "16", "20", "26", "4" ]
1
VARIABLE_MISUSE
[ 4 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 23, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": 10...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "AppScale/appscale/AppServer/lib/django-1.2/django/contrib/gis/geos/polygon.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 _get_single_external(self, index) : return GEOSGeometry (capi.geom_clone (self._get_single_internal (self)), srid = self.srid) Is there a bug in the code above?
Yes
131
[ "#NEWLINE#", "def test_og_follow(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "return", "#NEWLINE#", "graph", "=", "self", ".", "thi", ".", "graph", "(", ")", "#NEWLINE#", "path", "=", "'me/og.follows'", "#NEWLINE#", "result", "=", "graph", ".", "set", "(", ...
true
63
[ "19", "29", "63", "9", "15", "25", "59", "50", "23", "44", "52", "57", "2", "11", "33", "40" ]
1
VARIABLE_MISUSE
[ 50 ]
[ [ { "before_index": 8, "after_index": 16, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 21, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 22, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "tschellenbach/Django-facebook/open_facebook/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_og_follow(self) : return graph = self.thi.graph () path = 'me/og.follows' result = graph.set (path, profile = self.guy.id) self.assertTrue (result ['id']) remove_path = result ['id'] deleted = graph.delete (path) Is there a bug in the code above?
Yes
132
[ "#NEWLINE#", "def get_color(", "self", ",", "raw_line", ")", ":", "#NEWLINE#", "#INDENT#", "color", "=", "color_map", "[", "'white'", "]", "#NEWLINE#", "line", "=", "raw_line", ".", "strip", "(", ")", "#NEWLINE#", "keywords", "=", "[", "'if'", ",", "'else'",...
true
53
[ "9", "64", "96", "120", "146", "170", "202", "226", "241", "16", "81", "113", "137", "163", "187", "219", "4", "18", "24", "221", "2", "53" ]
1
VARIABLE_MISUSE
[ 16, 81, 113, 137, 163, 187, 219 ]
[ [ { "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": "richrd/suplemon/suplemon/linelight/php.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_color(self, raw_line) : color = color_map ['white'] line = raw_line.strip () keywords = ['if', 'else', 'finally', 'try', 'catch', 'foreach', 'while', 'continue', 'pass', 'break'] if helpers.starts (self, ['include', 'require']) : color = color_map ['blue'] else : if helpers.starts (line, ['class', 'public', 'private', 'function']) : color = color_map ['green'] else : if helpers.starts (line, 'def') : color = color_map ['cyan'] else : if helpers.starts (line, ['return']) : color = color_map ['red'] else : if helpers.starts (line, '$') : color = color_map ['cyan'] else : if helpers.starts (line, ['#', '//', '/*', '*/']) : color = color_map ['magenta'] else : if helpers.starts (line, keywords) : color = color_map ['yellow'] return color Is there a bug in the code above?
Yes
133
[ "#NEWLINE#", "def make_request(", "self", ",", "action", ",", "body", "=", "''", ",", "callback", "=", "None", ",", "object_hook", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "'Make an asynchronous HTTP request to DynamoDB. Callback should\\n operate on the decoded j...
true
250
[ "23", "79", "266", "4", "33", "35", "160", "2", "29", "52", "57", "73", "131", "152", "156", "191", "210", "222", "228", "250", "256", "270", "141", "200", "202", "14", "45", "47", "276", "278", "184", "215", "234", "10", "41", "43", "260", "...
1
VARIABLE_MISUSE
[ 184, 215, 234 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 20, "after_index": 21, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 22, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "viewfinderco/viewfinder/backend/db/asyncdynamo.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 make_request(self, action, body = '', callback = None, object_hook = None) : 'Make an asynchronous HTTP request to DynamoDB. Callback should operate on the decoded json response (with object hook applied, of course). It should also accept an error argument, which will be a boto.exception.DynamoDBResponseError. If there is not a valid session token, this method will ensure that a new one is fetched and cache the request when it is retrieved. ' this_request = functools.partial (self.make_request, action = action, body = body, callback = callback, object_hook = object_hook) if (self.authenticate_requests and (self.provider.security_token in [None, PENDING_SESSION_TOKEN_UPDATE])) : self.pending_requests.appendleft (this_request) def cb_for_update(error = None) : if error : raise DynamoDBResponseError (error.status, error.reason, body = { 'message' : error.body, }) else : return self._update_session_token (cb_for_update) return headers = { 'X-Amz-Target' : ('%s_%s.%s' % (self.ServiceName, self.Version, action)), 'Content-Type' : 'application/x-amz-json-1.0', 'Content-Length' : str (len (body)), } request = HTTPRequest (('https://%s' % self.host), method = 'POST', headers = headers, body = body, validate_cert = self.validate_cert) request.path = '/' if self.authenticate_requests : self._auth_handler.add_auth (request) http_client = httpclient.AsyncHTTPClient () http_client.fetch (self, functools.partial (self._finish_make_request, callback = callback, orig_request = this_request, token_used = self.provider.security_token, object_hook = object_hook)) Is there a bug in the code above?
Yes
134
[ "#NEWLINE#", "def __init__(", "self", ",", "username", "=", "None", ",", "api_token", "=", "None", ",", "url_prefix", "=", "None", ",", "requests_per_second", "=", "None", ",", "access_token", "=", "None", ",", "cache", "=", "None", ",", "proxy_host", "=", ...
true
47
[ "24", "47", "205", "207", "244", "246", "2", "43", "49", "55", "61", "76", "87", "103", "114", "125", "143", "150", "155", "164", "171", "178", "197", "232", "250", "32", "229", "8", "51", "53", "28", "190", "227", "20", "57", "59", "36", "69...
1
VARIABLE_MISUSE
[ 4, 45 ]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 42, "after_index": 47, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 48, "after_index": 5...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ask/python-github2/github2/request.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, username = None, api_token = None, url_prefix = None, requests_per_second = None, access_token = None, cache = None, proxy_host = None, proxy_port = None, github_url = None) : self.username = cache self.api_token = api_token self.access_token = access_token self.url_prefix = url_prefix if (github_url is None) : self.github_url = DEFAULT_GITHUB_URL else : self.github_url = github_url if (requests_per_second is None) : self.delay = 0 else : self.delay = (1.0 / requests_per_second) self.last_request = datetime.datetime (1900, 1, 1) if (not self.url_prefix) : self.url_prefix = (self.url_format % { 'github_url' : self.github_url, 'api_version' : self.api_version, 'api_format' : self.api_format, }) if (proxy_host is None) : self._http = httplib2.Http (cache = cache) else : proxy_info = httplib2.ProxyInfo (httplib2.socks.PROXY_TYPE_HTTP, proxy_host, proxy_port) self._http = httplib2.Http (proxy_info = proxy_info, cache = cache) self._http.ca_certs = CA_CERTS if SYSTEM_CERTS : LOGGER.info ('Using system certificates in %r', CA_CERTS) else : if CURL_CERTS : LOGGER.info ("Using cURL's certificates in %r", CA_CERTS) else : LOGGER.warning ('Using bundled certificate for HTTPS connections') Is there a bug in the code above?
Yes
135
[ "#NEWLINE#", "def write_index(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "index", "=", "self", ".", "screenshot_root", ".", "child", "(", "'index.rst'", ")", "#NEWLINE#", "if", "self", ".", "ref", ":", "#NEWLINE#", "#INDENT#", "content", "=", "'.. _{0}:\\n\\n...
true
113
[ "90", "25", "41", "46", "59", "70", "79", "101", "105", "116", "133", "2", "9", "19", "31", "54", "64", "74", "95", "113", "86", "7", "129", "88", "92" ]
1
VARIABLE_MISUSE
[ 88 ]
[ [ { "before_index": 6, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 45, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "lsaffre/lino/lino/api/selenium.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 write_index(self) : index = self.screenshot_root.child ('index.rst') if self.ref : content = '.. _{0}: '.format (self.ref) else : content = '' content += rstgen.header (1, self.title) content += ' ' if self.intro : content += unindent (self.intro) content += ' ' for (name, caption, before, after) in self.screenshots : content += ' ' content += rstgen.header (2, self) content += ' {before} .. image:: {name} :alt: {caption} :width: 500 {after} '.format (** locals ()) index.write_file (content.encode ('utf-8')) Is there a bug in the code above?
Yes
136
[ "#NEWLINE#", "def Deserializer(", "object_list", ",", "**options", ")", ":", "#NEWLINE#", "#INDENT#", "\"\\n Deserialize simple Python objects back into Django ORM instances.\\n\\n It's expected that you pass the Python objects themselves (instead of a\\n stream or a string) to the constr...
false
0
[ "39", "59", "83", "129", "156", "data", "11", "48", "use_natural_keys", "2", "25", "object_list", "13", "options", "29", "85", "94", "125", "152", "doc_cls", "23", "33", "41", "53", "64", "78", "102", "114", "134", "d" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 18,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "zbyte64/django-dockit/dockit/core/serializers/python.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 Deserializer(object_list, **options) : " Deserialize simple Python objects back into Django ORM instances. It's expected that you pass the Python objects themselves (instead of a stream or a string) to the constructor " use_natural_keys = options.get ('use_natural_keys', True) for d in object_list : doc_cls = get_base_document (d ['collection']) data = d ['fields'] if (use_natural_keys and ('natural_key' in d)) : data ['@natural_key'] = d ['natural_key'] else : if ('pk' in d) : data [doc_cls._meta.pk.attname] = doc_cls._meta.pk.to_python (d ['pk']) if ('natural_key' in d) : (yield base.DeserializedObject (doc_cls.to_python (data), natural_key = d ['natural_key'])) else : (yield base.DeserializedObject (doc_cls.to_python (data))) Is there a bug in the code above?
No
137
[ "#NEWLINE#", "def test_has_module_perms(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "perms", "=", "[", "'permission.add_article'", ",", "'permission.change_article'", ",", "'permission.delete_article'", "]", "#NEWLINE#", "app_labels", "=", "[", "'permission'", "]", "#NE...
false
0
[ "7", "perms", "17", "40", "61", "app_labels", "76", "169", "backend", "2", "82", "93", "111", "129", "147", "165", "173", "181", "192", "210", "228", "246", "self" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 16, "after_index": 19, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 22, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "lambdalisue/django-permission/src/permission/tests/test_backends.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_has_module_perms(self) : perms = ['permission.add_article', 'permission.change_article', 'permission.delete_article'] app_labels = ['permission'] registry.get_handlers = MagicMock (return_value = [MagicMock (get_supported_app_labels = MagicMock (return_value = app_labels), has_module_perms = MagicMock (return_value = False)), MagicMock (get_supported_app_labels = MagicMock (return_value = app_labels), has_module_perms = MagicMock (return_value = True))]) backend = PermissionBackend () self.assertFalse (registry.get_handlers.called) self.assertFalse (registry.get_handlers () [0].get_supported_app_labels.called) self.assertFalse (registry.get_handlers () [1].get_supported_app_labels.called) self.assertFalse (registry.get_handlers () [0].has_module_perms.called) self.assertFalse (registry.get_handlers () [1].has_module_perms.called) self.assertTrue (backend.has_module_perms (self.user, 'permission')) self.assertTrue (registry.get_handlers.called) self.assertTrue (registry.get_handlers () [0].get_supported_app_labels.called) self.assertTrue (registry.get_handlers () [1].get_supported_app_labels.called) self.assertTrue (registry.get_handlers () [0].has_module_perms.called) self.assertTrue (registry.get_handlers () [1].has_module_perms.called) Is there a bug in the code above?
No
138
[ "#NEWLINE#", "@", "login_required", "#NEWLINE#", "def published_to_edited(", "request", ",", "id", ")", ":", "#NEWLINE#", "#INDENT#", "def transform(", "entry", ")", ":", "#NEWLINE#", "#INDENT#", "dict", "=", "entry", ".", "__dict__", ".", "copy", "(", ")", "#NE...
false
0
[ "13", "20", "80", "99", "116", "119", "entry", "114", "transform", "5", "request", "47", "55", "70", "92", "112", "131", "draft", "7", "109", "id" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 6, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 25, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 27, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "lethain/lifeflow/editor/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] }}
@ login_required def published_to_edited(request, id) : def transform(entry) : dict = entry.__dict__.copy () dict ['edited'] = True del dict ['body_html'] del dict ['id'] draft = Draft (** dict) draft.save () for field in MANY_TO_MANY_FIELDS : getattr (draft, field).add (* getattr (entry, field).all ()) return draft try : entry = Entry.objects.get (pk = id) draft = transform (entry) entry.delete () return HttpResponse (('%s' % draft.pk)) except : return HttpResponseServerError ('Update failed.') Is there a bug in the code above?
No
139
[ "#NEWLINE#", "def _find_app_protocol(", "self", ",", "function_name", ",", "candidates", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Return the first protocol in candidates whihc\\n is supported by this device. additionally, check\\n that the datatypes which are returned by t...
false
0
[ "40", "102", "133", "data_type_cls", "2", "17", "26", "130", "self", "13", "32", "62", "89", "115", "128", "cls", "4", "73", "95", "113", "148", "function_name", "49", "54", "nm", "6", "21", "75", "candidates", "24", "56", "93", "119", "data_types" ]
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": "braiden/python-ant-downloader/antd/garmin.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 _find_app_protocol(self, function_name, candidates) : ' Return the first protocol in candidates whihc is supported by this device. additionally, check that the datatypes which are returned by the give protocol are implented by this python module. If not a warning is logged. (but no excetpion is raised._ This allows raw data dump to succeed, but trx generation to fail. ' cls = get_proto_cls (self.protocol_array, candidates) data_types = self.data_types_by_protocol.get (cls.__name__, []) data_type_cls = [globals ().get (nm, DataType) for nm in data_types] if (not cls) : _log.warning ('Download may FAIL. Protocol unimplemented. %s:%s', function_name, candidates) else : _log.debug ('Using %s%s for: %s', cls.__name__, data_types, function_name) if (DataType in data_type_cls) : _log.warning ('Download may FAIL. DataType unimplemented. %s:%s%s', function_name, cls.__name__, data_types) try : return cls (self, * data_type_cls) except Exception : _log.warning ('Download may Fail. Failed to ceate protocol %s.', function_name, exc_info = True) Is there a bug in the code above?
No
140
[ "#NEWLINE#", "def decode_packet(", "self", ",", "pid", ",", "length", ",", "data", ")", ":", "#NEWLINE#", "#INDENT#", "data", "=", "super", "(", "DownloadProtocol", ",", "self", ")", ".", "decode_packet", "(", "pid", ",", "length", ",", "data", ")", "#NEWL...
false
0
[ "8", "13", "28", "54", "79", "106", "135", "data", "2", "19", "39", "48", "66", "73", "91", "100", "self", "4", "24", "37", "52", "64", "77", "89", "104", "pid", "6", "26", "length" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 25, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 25, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "braiden/python-ant-downloader/antd/garmin.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 decode_packet(self, pid, length, data) : data = super (DownloadProtocol, self).decode_packet (pid, length, data) try : if (pid == self.link_proto.PID_RECORDS) : self.on_start (pid, data) else : if (pid in self.pid_data) : self.on_data (pid, data) else : if (pid == self.link_proto.PID_XFER_CMPLT) : self.on_finish (pid, data) except Exception : _log.warning ('Caught exception sending notification of download status, ignoring error', exc_info = True) finally : return data Is there a bug in the code above?
No
141
[ "#NEWLINE#", "def find_arduino_sdks(", ")", ":", "#NEWLINE#", "#INDENT#", "\"Finds the SDK and return the path.\\n settings_versions is a version as string we want to find. EX: '1.0.5'\"", "#NEWLINE#", "paths_to_look", "=", "_get_all_arduino_sdk_paths", "(", ")", "#NEWLINE#", "valid_v...
false
0
[ "14", "38", "52", "valid_versions", "8", "22", "paths_to_look", "20", "30", "43", "sdk_path", "26", "34", "45", "version" ]
0
NONE
[]
[ [ { "before_index": 5, "after_index": 6, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 7, "after_index": 11, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 16...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "biicode/client/setups/finders/arduino_sdk_finder.py", "license": "mit", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def find_arduino_sdks() : "Finds the SDK and return the path. settings_versions is a version as string we want to find. EX: '1.0.5'" paths_to_look = _get_all_arduino_sdk_paths () valid_versions = [] for sdk_path in paths_to_look : version = valid_arduino_sdk_version (sdk_path) if version : valid_versions.append ((sdk_path, version)) return valid_versions Is there a bug in the code above?
No
142
[ "#NEWLINE#", "def assertResultSetEqual(", "self", ",", "actual", ",", "expected", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "assertEqual", "(", "set", "(", "actual", ")", ",", "set", "(", "expected", ")", ")" ]
false
0
[ "4", "17", "actual", "2", "11", "self", "6", "22", "expected" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 10, "after_index": 19, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "torchbox/wagtail/wagtail/wagtailcore/tests/test_permission_policies.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 assertResultSetEqual(self, actual, expected) : self.assertEqual (set (actual), set (expected)) Is there a bug in the code above?
No
143
[ "#NEWLINE#", "def __init__(", "self", ",", "root", ",", "encoding", "=", "'utf8'", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Construct a new TIMIT corpus reader in the given directory.\\n :param root: The root directory for this corpus.\\n '", "#NEWLINE#", "if", "...
false
0
[ "6", "18", "27", "39", "61", "63", "encoding", "4", "50", "54", "84", "104", "root", "115", "125", "u", "71", "80", "name", "2", "48", "56", "66", "86", "94", "100", "106", "127", "self" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 15, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "nltk/nltk/nltk/corpus/reader/timit.py", "license": "apache-2.0", "note": "license: manual_eval" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def __init__(self, root, encoding = 'utf8') : ' Construct a new TIMIT corpus reader in the given directory. :param root: The root directory for this corpus. ' if isinstance (encoding, compat.string_types) : encoding = [('.*\\.wav', None), ('.*', encoding)] CorpusReader.__init__ (self, root, find_corpus_fileids (root, self._FILE_RE), encoding = encoding) self._utterances = [name [: (- 4)] for name in find_corpus_fileids (root, self._UTTERANCE_RE)] 'A list of the utterance identifiers for all utterances in this corpus.' self._speakerinfo = None self._root = root self.speakers = sorted (set ((u.split ('/') [0] for u in self._utterances))) Is there a bug in the code above?
No
144
[ "#NEWLINE#", "def phones(", "self", ",", "utterances", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "return", "[", "line", ".", "split", "(", ")", "[", "(", "-", "1", ")", "]", "for", "fileid", "in", "self", ".", "_utterance_fileids", "(", "utterances...
false
0
[ "13", "36", "45", "line", "4", "31", "utterances", "2", "27", "38", "self", "25", "42", "fileid" ]
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": 12, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "nltk/nltk/nltk/corpus/reader/timit.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 phones(self, utterances = None) : return [line.split () [(- 1)] for fileid in self._utterance_fileids (utterances, '.phn') for line in self.open (fileid) if line.strip ()] Is there a bug in the code above?
No
145
[ "#NEWLINE#", "def startup(", "name", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Start Traffic Server on the local node.\\n\\n .. code-block:: yaml\\n\\n startup_ats:\\n trafficserver.startup\\n '", "#NEWLINE#", "ret", "=", "{", "#NEWLINE#", "#INDENT#", "'name'", ...
false
0
[ "2", "16", "name", "9", "50", "58", "68", "75", "83", "ret" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 7, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 11, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 42, "after_index": 44...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "saltstack/salt/salt/states/trafficserver.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 startup(name) : ' Start Traffic Server on the local node. .. code-block:: yaml startup_ats: trafficserver.startup ' ret = { 'name' : name, 'changes' : { }, 'result' : None, 'comment' : '', } if __opts__ ['test'] : ret ['comment'] = 'Starting up local node' return ret __salt__ ['trafficserver.startup'] () ret ['result'] = True ret ['comment'] = 'Starting up local node' return ret Is there a bug in the code above?
No
146
[ "#NEWLINE#", "def __init__(", "self", ",", "*", "args", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "super", "(", "_BaseImageServiceTests", ",", "self", ")", ".", "__init__", "(", "*", "args", ",", "**", "kwargs", ")", "#NEWLINE#", "self", ".", "se...
false
0
[ "25", "kwargs", "2", "16", "28", "34", "self", "5", "22", "args" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 3, "after_index": 5, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 23,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "nii-cloud/dodai-compute/nova/tests/api/openstack/test_images.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, * args, **kwargs) : super (_BaseImageServiceTests, self).__init__ (* args, ** kwargs) self.service = None self.context = None Is there a bug in the code above?
No
147
[ "#NEWLINE#", "def test_exit(", "self", ",", "space", ")", ":", "#NEWLINE#", "#INDENT#", "with", "self", ".", "raises", "(", "space", ",", "'SystemExit'", ")", ":", "#NEWLINE#", "#INDENT#", "space", ".", "execute", "(", "'Kernel.exit'", ")", "#NEWLINE#", "#UNIN...
false
0
[ "4", "14", "21", "34", "41", "space", "2", "10", "30", "self" ]
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": 40, "after_index": 4...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "topazproject/topaz/tests/modules/test_kernel.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_exit(self, space) : with self.raises (space, 'SystemExit') : space.execute ('Kernel.exit') with self.raises (space, 'SystemExit') : space.execute ('exit') Is there a bug in the code above?
No
148
[ "#NEWLINE#", "def fork_and_wait(", "self", ",", "space", ",", "capfd", ",", "code", ")", ":", "#NEWLINE#", "#INDENT#", "cpid", "=", "os", ".", "fork", "(", ")", "#NEWLINE#", "if", "(", "cpid", "==", "0", ")", ":", "#NEWLINE#", "#INDENT#", "try", ":", "...
false
0
[ "13", "23", "63", "cpid", "8", "38", "code", "71", "err", "4", "34", "space", "6", "74", "capfd", "2", "self", "69", "81", "out" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 18, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 21, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "topazproject/topaz/tests/modules/test_kernel.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 fork_and_wait(self, space, capfd, code) : cpid = os.fork () if (cpid == 0) : try : space.execute (code) finally : os._exit (0) else : os.waitpid (cpid, 0) (out, err) = capfd.readouterr () return out Is there a bug in the code above?
No
149
[ "#NEWLINE#", "def unseen(", "self", ",", "limit", "=", "10", ")", ":", "#NEWLINE#", "#INDENT#", "return", "self", ".", "listup", "(", "limit", ",", "'UNSEEN'", ")" ]
false
0
[ "2", "12", "self", "4", "16", "limit" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 17, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 17, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "keitaoouchi/easyimap/easyimap/easyimap.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 unseen(self, limit = 10) : return self.listup (limit, 'UNSEEN') Is there a bug in the code above?
No
150
[ "#NEWLINE#", "def solve_univariate_inequality(", "expr", ",", "gen", ",", "relational", "=", "True", ")", ":", "#NEWLINE#", "#INDENT#", "\"Solves a real univariate inequality.\\n\\n Examples\\n ========\\n\\n >>> from sympy.solvers.inequalities import solve_univariate_inequality\\...
false
0
[ "457", "512", "583", "630", "pt", "61", "83", "652", "671", "678", "rv", "212", "556", "include_x", "425", "510", "628", "valid", "344", "441", "462", "471", "523", "572", "589", "598", "603", "611", "614", "619", "641", "start", "403", "409", "464...
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 21, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "sympy/sympy/sympy/solvers/inequalities.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 solve_univariate_inequality(expr, gen, relational = True) : "Solves a real univariate inequality. Examples ======== >>> from sympy.solvers.inequalities import solve_univariate_inequality >>> from sympy.core.symbol import Symbol >>> x = Symbol('x') >>> solve_univariate_inequality(x**2 >= 4, x) Or(And(-oo < x, x <= -2), And(2 <= x, x < oo)) >>> solve_univariate_inequality(x**2 >= 4, x, relational=False) (-oo, -2] U [2, oo) " from sympy.solvers.solvers import solve, denoms d = Dummy (real = True) expr = expr.subs (gen, d) _gen = gen gen = d if (expr is S.true) : rv = S.Reals else : if (expr is S.false) : rv = S.EmptySet else : e = (expr.lhs - expr.rhs) parts = (n, d) = e.as_numer_denom () if all ((i.is_polynomial (gen) for i in parts)) : solns = solve (n, gen, check = False) singularities = solve (d, gen, check = False) else : solns = solve (e, gen, check = False) singularities = [] for d in denoms (e) : singularities.extend (solve (d, gen)) include_x = expr.func (0, 0) def valid(x) : v = e.subs (gen, x) try : r = expr.func (v, 0) except TypeError : r = S.false if (r in (S.true, S.false)) : return r if (v.is_real is False) : return S.false else : v = v.n (2) if v.is_comparable : return expr.func (v, 0) return S.false start = S.NegativeInfinity sol_sets = [S.EmptySet] try : reals = _nsort (set ((solns + singularities)), separated = True) [0] except NotImplementedError : raise NotImplementedError ('sorting of these roots is not supported') for x in reals : end = x if (end in [S.NegativeInfinity, S.Infinity]) : if valid (S (0)) : sol_sets.append (Interval (start, S.Infinity, True, True)) break pt = (((start + end) / 2) if (start is not S.NegativeInfinity) else ((end / 2) if end.is_positive else ((2 * end) if end.is_negative else (end - 1)))) if valid (pt) : sol_sets.append (Interval (start, end, True, True)) if (x in singularities) : singularities.remove (x) else : if include_x : sol_sets.append (FiniteSet (x)) start = end end = S.Infinity pt = (0 if (start is S.NegativeInfinity) else ((start / 2) if start.is_negative else ((2 * start) if start.is_positive else (start + 1)))) if valid (pt) : sol_sets.append (Interval (start, end, True, True)) rv = Union (* sol_sets).subs (gen, _gen) return (rv if (not relational) else rv.as_relational (_gen)) Is there a bug in the code above?
No
151
[ "#NEWLINE#", "@", "classmethod", "#NEWLINE#", "def define_tables(", "cls", ",", "metadata", ")", ":", "#NEWLINE#", "#INDENT#", "Table", "(", "'single'", ",", "metadata", ",", "Column", "(", "'id'", ",", "Integer", ",", "primary_key", "=", "True", ")", ",", "...
false
0
[ "5", "cls", "7", "16", "48", "80", "107", "metadata" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 6, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 43, "after_index": 4...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "zzzeek/sqlalchemy/test/ext/test_automap.py", "license": "mit", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
@ classmethod def define_tables(cls, metadata) : Table ('single', metadata, Column ('id', Integer, primary_key = True), Column ('type', String (10)), test_needs_fk = True) Table ('joined_base', metadata, Column ('id', Integer, primary_key = True), Column ('type', String (10)), test_needs_fk = True) Table ('joined_inh', metadata, Column ('id', Integer, ForeignKey ('joined_base.id'), primary_key = True), test_needs_fk = True) FixtureTest.define_tables (metadata) Is there a bug in the code above?
No
152
[ "#NEWLINE#", "def get_first(", "dct", ",", "*", "keys", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Given a dictionary, find the value for the first available key in the\\n list of keys. Otherwise, return none.\\n '", "#NEWLINE#", "for", "key", "in", "keys", ":", "#NEWLINE#",...
false
0
[ "13", "21", "31", "key", "5", "15", "keys", "2", "23", "29", "dct" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 3, "after_index": 5, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 10, ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "heiskr/sagefy/server/modules/util.py", "license": "apache-2.0", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def get_first(dct, * keys) : ' Given a dictionary, find the value for the first available key in the list of keys. Otherwise, return none. ' for key in keys : if (key in dct) : return dct [key] return None Is there a bug in the code above?
No
153
[ "#NEWLINE#", "def __init__(", "self", ",", "capacity", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "cap", "=", "capacity", "#NEWLINE#", "self", ".", "map", "=", "{", "#NEWLINE#", "#INDENT#", "#NEWLINE#", "#UNINDENT#", "}", "#NEWLINE#", "self", ".", "head",...
false
0
[ "4", "13", "capacity", "2", "9", "15", "26", "32", "self" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 19...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "algorhythms/LintCode/LRU Cache.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, capacity) : self.cap = capacity self.map = { } self.head = None self.tail = None Is there a bug in the code above?
No
154
[ "#NEWLINE#", "def register_json_consumer(", "self", ",", "queue_name", ",", "callback", ")", ":", "#NEWLINE#", "#INDENT#", "def wrapped_callback(", "ch", ",", "method", ",", "properties", ",", "body", ")", ":", "#NEWLINE#", "#INDENT#", "return", "callback", "(", "...
false
0
[ "6", "24", "callback", "4", "40", "queue_name", "2", "36", "self", "42", "wrapped_callback" ]
0
NONE
[]
[ [ { "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": 35, "after_index": 4...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "zulip/zulip/zerver/lib/queue.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 register_json_consumer(self, queue_name, callback) : def wrapped_callback(ch, method, properties, body) : return callback (ujson.loads (body)) return self.register_consumer (queue_name, wrapped_callback) Is there a bug in the code above?
No
155
[ "#NEWLINE#", "def configure(", "ctx", ")", ":", "#NEWLINE#", "#INDENT#", "ctx", ".", "env", ".", "has_mpi", "=", "False", "#NEWLINE#", "mpiccpath", "=", "ctx", ".", "find_program", "(", "'mpicc'", ")", "#NEWLINE#", "if", "mpiccpath", ":", "#NEWLINE#", "#INDENT...
false
0
[ "37", "53", "78", "envmpi", "76", "94", "envmpibld", "15", "25", "63", "73", "mpiccpath", "2", "7", "17", "29", "39", "47", "56", "66", "80", "88", "ctx" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 24, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "baudren/montepython_public/wrapper_wmap/waf_tools/mpicc_extra.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 configure(ctx) : ctx.env.has_mpi = False mpiccpath = ctx.find_program ('mpicc') if mpiccpath : ctx.env.has_mpi = True envmpi = ctx.env.copy () ctx.setenv ('mpi', envmpi) ctx.env.CC = [mpiccpath] ctx.env.LINK_CC = [mpiccpath] envmpibld = envmpi = ctx.env.copy () ctx.set_env_name ('mpibld', envmpibld) Is there a bug in the code above?
No
156
[ "#NEWLINE#", "def get_labels_turbine(", "self", ",", "turbine", ",", "feature_window", ",", "horizon", ",", "padding", "=", "0", ")", ":", "#NEWLINE#", "#INDENT#", "'Get labels for a given turbine, consisting of the values of the\\n corrected score for one turbine dependend ...
false
0
[ "4", "24", "88", "turbine", "8", "34", "77", "horizon", "10", "37", "60", "padding", "2", "self", "19", "48", "62", "timesteps", "67", "95", "offset", "44", "83", "100", "labels", "56", "72", "85", "t", "6", "32", "74", "feature_window" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 16, "after_index": 17, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "cigroup-ol/windml/windml/mapping/power_mapping.py", "license": "bsd-3-clause", "note": "license: manual_eval" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def get_labels_turbine(self, turbine, feature_window, horizon, padding = 0) : 'Get labels for a given turbine, consisting of the values of the corrected score for one turbine dependend on feature window, horizon and optionally a certain padding. Parameters ---------- turbine : Turbine Features of the given turbine. feature_window : int The amount of time steps of the feature window. horizon: int The amount of time steps of the horizon. Returns ------- numpy.array Label array for regression. ' timesteps = (len (turbine.measurements) - (((feature_window + horizon) + padding) - 1)) labels = zeros (timesteps, dtype = float32) for t in range (padding, timesteps) : offset = (((t + feature_window) + horizon) - 1) labels [t] = turbine.measurements [cs] [offset] return labels Is there a bug in the code above?
No
157
[ "#NEWLINE#", "def test_get_by_uuid(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "with", "mock", ".", "patch", ".", "object", "(", "db", ",", "'ec2_snapshot_get_by_uuid'", ")", "as", "get", ":", "#NEWLINE#", "#INDENT#", "get", ".", "return_value", "=", "fake_map...
false
0
[ "29", "52", "smap", "2", "37", "44", "48", "self", "19", "23", "get" ]
0
NONE
[]
[ [ { "before_index": 18, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 19, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 22, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/objects/test_ec2.py", "license": "apache-2.0", "note": "license: github_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def test_get_by_uuid(self) : with mock.patch.object (db, 'ec2_snapshot_get_by_uuid') as get : get.return_value = fake_map smap = ec2_obj.EC2SnapshotMapping.get_by_uuid (self.context, 'fake-uuid-2') self._compare (self, fake_map, smap) Is there a bug in the code above?
No
158
[ "#NEWLINE#", "def test_many_to_many_unsaved(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "source", "=", "ManyToManySource", "(", "name", "=", "'source-unsaved'", ")", "#NEWLINE#", "serializer", "=", "ManyToManySourceSerializer", "(", "source", ")", "#NEWLINE#", "expect...
false
0
[ "2", "48", "57", "self", "7", "20", "source", "23", "65", "expected", "16", "61", "serializer" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 15, "after_index": 19, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 22, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "tomchristie/django-rest-framework/tests/test_relations_pk.py", "license": "bsd-2-clause", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def test_many_to_many_unsaved(self) : source = ManyToManySource (name = 'source-unsaved') serializer = ManyToManySourceSerializer (source) expected = { 'id' : None, 'name' : 'source-unsaved', 'targets' : [], } with self.assertNumQueries (0) : self.assertEqual (serializer.data, expected) Is there a bug in the code above?
No
159
[ "#NEWLINE#", "def test_mon_help(", "self", ",", "capsys", ")", ":", "#NEWLINE#", "#INDENT#", "with", "pytest", ".", "raises", "(", "SystemExit", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "parser", ".", "parse_args", "(", "'mon --help'", ".", "split", "("...
false
0
[ "36", "err", "2", "19", "self", "34", "49", "56", "63", "out", "4", "39", "capsys" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 32, "after_index": 42, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 45, "after_index": 4...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ceph/ceph-deploy/ceph_deploy/tests/parser/test_mon.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_mon_help(self, capsys) : with pytest.raises (SystemExit) : self.parser.parse_args ('mon --help'.split ()) (out, err) = capsys.readouterr () assert ('usage: ceph-deploy mon' in out) assert ('positional arguments:' in out) assert ('optional arguments:' in out) Is there a bug in the code above?
No
160
[ "#NEWLINE#", "def addSkip(", "self", ",", "test", ",", "reason", ")", ":", "#NEWLINE#", "#INDENT#", "\"\\n Report that the given test was skipped.\\n\\n In Trial, tests can be 'skipped'. Tests are skipped mostly because\\n there is some platform or configuration issue that...
false
0
[ "6", "22", "reason", "2", "13", "self", "4", "20", "test" ]
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": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "twisted/twisted/twisted/trial/reporter.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 addSkip(self, test, reason) : " Report that the given test was skipped. In Trial, tests can be 'skipped'. Tests are skipped mostly because there is some platform or configuration issue that prevents them from being run correctly. @type test: L{pyunit.TestCase} @type reason: L{str} " self.skips.append ((test, reason)) Is there a bug in the code above?
No
161
[ "#NEWLINE#", "def _getPreludeSegments(", "self", ",", "testID", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Return a list of all non-leaf segments to display in the tree.\\n\\n Normally this is the module and class name.\\n '", "#NEWLINE#", "segments", "=", "testID", "....
false
0
[ "46", "48", "77", "seg", "2", "self", "11", "31", "40", "43", "55", "65", "85", "segments", "4", "13", "testID" ]
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": 19,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "twisted/twisted/twisted/trial/reporter.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 _getPreludeSegments(self, testID) : ' Return a list of all non-leaf segments to display in the tree. Normally this is the module and class name. ' segments = testID.split ('.') [: (- 1)] if (len (segments) == 0) : return segments segments = [seg for seg in ('.'.join (segments [: (- 1)]), segments [(- 1)]) if (len (seg) > 0)] return segments Is there a bug in the code above?
No
162
[ "#NEWLINE#", "def getLogger(", "name", ")", ":", "#NEWLINE#", "#INDENT#", "log", "=", "logging", ".", "getLogger", "(", "name", ")", "#NEWLINE#", "log", ".", "setLevel", "(", "logging", ".", "DEBUG", ")", "#NEWLINE#", "fh", "=", "logging", ".", "FileHandler"...
false
0
[ "2", "13", "name", "7", "16", "55", "63", "log", "25", "34", "43", "59", "fh" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 12, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 15, "after_index": 19, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 24, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "darknessomi/musicbox/NEMbox/logger.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 getLogger(name) : log = logging.getLogger (name) log.setLevel (logging.DEBUG) fh = logging.FileHandler (FILE_NAME) fh.setLevel (logging.DEBUG) fh.setFormatter (logging.Formatter ('%(asctime)s - %(levelname)s - %(name)s:%(lineno)s: %(message)s')) log.addHandler (fh) return log Is there a bug in the code above?
No
163
[ "#NEWLINE#", "def __init__(", "self", ",", "object", ",", "language_code", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "object", "=", "object", "#NEWLINE#", "self", ".", "language", "=", "(", "language_code", "or", "object", ".", "get_current_...
false
0
[ "2", "13", "19", "33", "41", "self", "6", "24", "language_code", "4", "15", "17", "26", "45", "object" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 17, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "edoburu/django-parler/parler/utils/context.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, object, language_code = None) : self.object = object self.language = (language_code or object.get_current_language ()) self.old_language = get_language () self.old_parler_language = object.get_current_language () Is there a bug in the code above?
No
164
[ "#NEWLINE#", "def __new__(", "cls", ",", "time", ",", "volume", ",", "fade_type", "=", "'exponential'", ")", ":", "#NEWLINE#", "#INDENT#", "return", "super", "(", "VolumeBreakpoint", ",", "cls", ")", ".", "__new__", "(", "cls", ",", "time", ",", "volume", ...
false
0
[ "2", "20", "25", "cls", "8", "31", "fade_type", "4", "27", "time", "6", "29", "volume" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 15, "after_index": 26, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ucbvislab/radiotool/radiotool/composer/volumebreakpoint.py", "license": "isc", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def __new__(cls, time, volume, fade_type = 'exponential') : return super (VolumeBreakpoint, cls).__new__ (cls, time, volume, fade_type) Is there a bug in the code above?
No
165
[ "#NEWLINE#", "@", "contextlib", ".", "contextmanager", "#NEWLINE#", "def get_backend(", "backend_uri", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "tmp_dir", "=", "None", "#NEWLINE#", "if", "(", "not", "backend_uri", ")", ":", "#NEWLINE#", "#INDENT#", "if", ...
false
0
[ "176", "180", "conn", "83", "138", "169", "189", "backend", "7", "21", "40", "56", "69", "91", "121", "146", "backend_uri", "101", "156", "e", "14", "61", "74", "108", "113", "126", "135", "198", "204", "tmp_dir" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 8, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 16, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/taskflow/taskflow/examples/example_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] }}
@ contextlib.contextmanager def get_backend(backend_uri = None) : tmp_dir = None if (not backend_uri) : if (len (sys.argv) > 1) : backend_uri = str (sys.argv [1]) if (not backend_uri) : tmp_dir = tempfile.mkdtemp () backend_uri = ('file:///%s' % tmp_dir) try : backend = backends.fetch (_make_conf (backend_uri)) except exceptions.NotFound as e : if (not tmp_dir) : tmp_dir = tempfile.mkdtemp () backend_uri = ('file:///%s' % tmp_dir) LOG.exception ('Falling back to file backend using temporary directory located at: %s', tmp_dir) backend = backends.fetch (_make_conf (backend_uri)) else : raise e try : with contextlib.closing (backend.get_connection ()) as conn : conn.upgrade () (yield backend) finally : if tmp_dir : rm_path (tmp_dir) Is there a bug in the code above?
No
166
[ "#NEWLINE#", "def _get_server_version_info(", "self", ",", "connection", ")", ":", "#NEWLINE#", "#INDENT#", "version", "=", "re", ".", "search", "(", "'Release ([\\\\d\\\\.]+)'", ",", "connection", ".", "connection", ".", "dbversion", ")", ".", "group", "(", "1", ...
false
0
[ "35", "38", "x", "4", "17", "19", "connection", "9", "40", "version", "2", "self" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 25, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 29, "after_index": 31...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "RoseOu/flasky/venv/lib/python2.7/site-packages/sqlalchemy/dialects/oracle/zxjdbc.py", "license": "mit", "note": "license: github_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def _get_server_version_info(self, connection) : version = re.search ('Release ([\\d\\.]+)', connection.connection.dbversion).group (1) return tuple ((int (x) for x in version.split ('.'))) Is there a bug in the code above?
No
167
[ "#NEWLINE#", "def make_meetup_blueprint(", "key", "=", "None", ",", "secret", "=", "None", ",", "scope", "=", "None", ",", "redirect_url", "=", "None", ",", "redirect_to", "=", "None", ",", "login_url", "=", "None", ",", "authorized_url", "=", "None", ",", ...
false
0
[ "10", "43", "46", "69", "71", "scope", "30", "101", "103", "session_class", "26", "97", "99", "authorized_url", "22", "93", "95", "login_url", "53", "110", "119", "129", "148", "154", "meetup_bp", "6", "67", "secret", "18", "89", "91", "redirect_to", "...
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "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": 4...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "singingwolfboy/flask-dance/flask_dance/contrib/meetup.py", "license": "mit", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def make_meetup_blueprint(key = None, secret = None, scope = None, redirect_url = None, redirect_to = None, login_url = None, authorized_url = None, session_class = None, backend = None) : ' Make a blueprint for authenticating with Meetup using OAuth 2. This requires an OAuth consumer from Meetup. You should either pass the key and secret to this constructor, or make sure that your Flask application config defines them, using the variables MEETUP_OAUTH_KEY and MEETUP_OAUTH_SECRET. Args: key (str): The OAuth consumer key for your application on Meetup secret (str): The OAuth consumer secret for your application on Meetup scope (str, optional): comma-separated list of scopes for the OAuth token redirect_url (str): the URL to redirect to after the authentication dance is complete redirect_to (str): if ``redirect_url`` is not defined, the name of the view to redirect to after the authentication dance is complete. The actual URL will be determined by :func:`flask.url_for` login_url (str, optional): the URL path for the ``login`` view. Defaults to ``/meetup`` authorized_url (str, optional): the URL path for the ``authorized`` view. Defaults to ``/meetup/authorized``. session_class (class, optional): The class to use for creating a Requests session. Defaults to :class:`~flask_dance.consumer.requests.OAuth2Session`. backend: A storage backend class, or an instance of a storage backend class, to use for this blueprint. Defaults to :class:`~flask_dance.consumer.backend.session.SessionBackend`. :rtype: :class:`~flask_dance.consumer.OAuth2ConsumerBlueprint` :returns: A :ref:`blueprint <flask:blueprints>` to attach to your Flask app. ' scope = (scope or ['basic']) meetup_bp = OAuth2ConsumerBlueprint ('meetup', __name__, client_id = key, client_secret = secret, scope = scope, base_url = 'https://api.meetup.com/2/', authorization_url = 'https://secure.meetup.com/oauth2/authorize', token_url = 'https://secure.meetup.com/oauth2/access', redirect_url = redirect_url, redirect_to = redirect_to, login_url = login_url, authorized_url = authorized_url, session_class = session_class, backend = backend) meetup_bp.from_config ['client_id'] = 'MEETUP_OAUTH_KEY' meetup_bp.from_config ['client_secret'] = 'MEETUP_OAUTH_SECRET' @ meetup_bp.before_app_request def set_applocal_session() : ctx = stack.top ctx.meetup_oauth = meetup_bp.session return meetup_bp Is there a bug in the code above?
No
168
[ "#NEWLINE#", "def test_hash_memory_storage_pcabp(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "train_vectors", "=", "numpy", ".", "random", ".", "randn", "(", "10", ",", "100", ")", "#NEWLINE#", "hash1", "=", "PCABinaryProjections", "(", "'testPCABPHash'", ",", "...
false
0
[ "105", "147", "158", "i", "2", "31", "55", "65", "78", "91", "138", "self", "40", "51", "73", "86", "99", "153", "hash2", "7", "28", "train_vectors", "122", "149", "160", "j", "20", "37", "69", "82", "95", "109", "126", "142", "hash1" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 16, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 25, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 30, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "pixelogik/NearPy/nearpy/tests/hash_storage_tests.py", "license": "mit", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def test_hash_memory_storage_pcabp(self) : train_vectors = numpy.random.randn (10, 100) hash1 = PCABinaryProjections ('testPCABPHash', 4, train_vectors) self.memory.store_hash_configuration (hash1) hash2 = PCABinaryProjections (None, None, None) hash2.apply_config (self.memory.load_hash_configuration ('testPCABPHash')) self.assertEqual (hash1.dim, hash2.dim) self.assertEqual (hash1.hash_name, hash2.hash_name) self.assertEqual (hash1.projection_count, hash2.projection_count) for i in range (hash1.components.shape [0]) : for j in range (hash1.components.shape [1]) : self.assertEqual (hash1.components [(i, j)], hash2.components [(i, j)]) Is there a bug in the code above?
No
169
[ "#NEWLINE#", "def test_export_one_network_none_specified(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "fname", "=", "os", ".", "path", ".", "join", "(", "TEMP_DIR", ",", "'test'", ")", "#NEWLINE#", "self", ".", "controller", ".", "clear", "(", ")", "#NEWLINE#",...
false
0
[ "2", "20", "45", "self", "7", "53", "68", "79", "fname" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 16, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 25, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 27, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "PMEAL/OpenPNM/test/unit/Base/ControllerTest.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_export_one_network_none_specified(self) : fname = os.path.join (TEMP_DIR, 'test') self.controller.clear () OpenPNM.Network.Cubic (shape = [3, 3, 3]) self.controller.export (filename = fname, fileformat = 'VTK') assert os.path.isfile ((fname + '.vtp')) os.remove ((fname + '.vtp')) Is there a bug in the code above?
No
170
[ "#NEWLINE#", "def testCumMin(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "v", "=", "numpy", ".", "array", "(", "[", "5", ",", "6", ",", "4", ",", "5", ",", "1", "]", ")", "#NEWLINE#", "u", "=", "Util", ".", "cumMin", "(", "v", ")", "#NEWLINE#", ...
false
0
[ "2", "self", "7", "32", "59", "84", "93", "96", "117", "v", "26", "39", "78", "91", "111", "124", "u" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 12, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 25, "after_index": 31, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 34, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "charanpald/APGL/apgl/util/test/UtilTest.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 testCumMin(self) : v = numpy.array ([5, 6, 4, 5, 1]) u = Util.cumMin (v) nptst.assert_array_equal (u, numpy.array ([5, 5, 4, 4, 1])) v = numpy.array ([5, 4, 3, 2, 1]) u = Util.cumMin (v) nptst.assert_array_equal (u, v) v = numpy.array ([1, 2, 3]) u = Util.cumMin (v) nptst.assert_array_equal (u, numpy.ones (3)) Is there a bug in the code above?
No
171
[ "#NEWLINE#", "def processBody(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Retrieve the body of the response, encoding it into a usuable\\n form based on the media-type (mime-type)\\n '", "#NEWLINE#", "handlerName", "=", "self", ".", "mangled_mtype", "(", ")...
false
0
[ "2", "11", "21", "25", "self", "17", "31", "handler", "9", "23", "handlerName" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 7, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 16, "after_index": 22...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "jpaugh/agithub/agithub/base.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 processBody(self) : ' Retrieve the body of the response, encoding it into a usuable form based on the media-type (mime-type) ' handlerName = self.mangled_mtype () handler = getattr (self, handlerName, self.application_octect_stream) return handler () Is there a bug in the code above?
No
172
[ "#NEWLINE#", "def run_cmd(", "cmd", ",", "attempts", "=", "1", ")", ":", "#NEWLINE#", "#INDENT#", "' Runs a command attempts times, logging its output. Returns True if it\\n succeeds once, or False if it never does. '", "#NEWLINE#", "try", ":", "#NEWLINE#", "#INDENT#", "for", ...
false
0
[ "111", "124", "e", "18", "i", "4", "22", "attempts", "27", "45", "55", "proc", "2", "33", "71", "88", "119", "cmd" ]
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": 17, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "CiscoCloud/mantl/testing/build-cluster.py", "license": "apache-2.0", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def run_cmd(cmd, attempts = 1) : ' Runs a command attempts times, logging its output. Returns True if it succeeds once, or False if it never does. ' try : for i in range (attempts) : proc = subprocess.Popen (cmd, stdin = open (devnull, 'r')) proc.wait () if (not (proc.returncode == 0)) : print ('Command ', str (cmd), ' failed') else : print ('Command ', str (cmd), ' succeeded.') return True sleep (3) return False except OSError as e : print ('Error while attempting to run command ', cmd) print (e) Is there a bug in the code above?
No
173
[ "#NEWLINE#", "def test_internal_symlinks_relative(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "dir_a_b", "=", "self", ".", "_create_directory", "(", "'a/b'", ")", "#NEWLINE#", "dir_p", "=", "self", ".", "_create_directory", "(", "'p'", ")", "#NEWLINE#", "os", "....
false
0
[ "16", "62", "dir_p", "7", "37", "dir_a_b", "2", "9", "18", "43", "50", "65", "self" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 12, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 15, "after_index": 21, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 24, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/tools/devappserver2/inotify_file_watcher_test.py", "license": "apache-2.0", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def test_internal_symlinks_relative(self) : dir_a_b = self._create_directory ('a/b') dir_p = self._create_directory ('p') os.symlink ('../../p', os.path.join (dir_a_b, 'p')) self._create_directory ('p/q/r') self._watcher.start () shutil.rmtree (dir_p) self._watcher.changes () Is there a bug in the code above?
No
174
[ "#NEWLINE#", "def _active_mounts_freebsd(", "ret", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n List active mounts on FreeBSD systems\\n '", "#NEWLINE#", "for", "line", "in", "__salt__", "[", "'cmd.run_stdout'", "]", "(", "'mount -p'", ")", ".", "split", "(", "'\\n'", ...
false
0
[ "27", "46", "57", "65", "75", "comps", "2", "44", "92", "ret", "10", "37", "line" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 7, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 21,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "saltstack/salt/salt/modules/mount.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 _active_mounts_freebsd(ret) : ' List active mounts on FreeBSD systems ' for line in __salt__ ['cmd.run_stdout'] ('mount -p').split (' ') : comps = re.sub ('\\s+', ' ', line).split () ret [comps [1]] = { 'device' : comps [0], 'fstype' : comps [2], 'opts' : _resolve_user_group_names (comps [3].split (',')), } return ret Is there a bug in the code above?
No
175
[ "#NEWLINE#", "def __init__(", "self", ",", "cfg_manager", ")", ":", "#NEWLINE#", "#INDENT#", "super", "(", "DigilentAdept", ",", "self", ")", ".", "__init__", "(", ")", "#NEWLINE#", "self", ".", "_cfg_manager", "=", "cfg_manager", "#NEWLINE#", "self", ".", "_l...
false
0
[ "4", "24", "cfg_manager", "2", "13", "20", "26", "36", "self" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 17, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 19, "after_index": 24...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "weblabdeusto/weblabdeusto/server/src/weblab/experiment/devices/xilinx/programmers/digilent_adept.py", "license": "bsd-2-clause", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def __init__(self, cfg_manager) : super (DigilentAdept, self).__init__ () self._cfg_manager = cfg_manager self._lock = threading.Lock () self._busy = False Is there a bug in the code above?
No
176
[ "#NEWLINE#", "def _create_tree_space(", "self", ",", "target_tree_id", ",", "num_trees", "=", "1", ")", ":", "#NEWLINE#", "#INDENT#", "'\\n Creates space for a new tree by incrementing all tree ids\\n greater than ``target_tree_id``.\\n '", "#NEWLINE#", "qs", "="...
false
0
[ "6", "42", "58", "num_trees", "15", "30", "qs", "2", "17", "26", "37", "46", "self", "4", "23", "53", "target_tree_id" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 14, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "django-mptt/django-mptt/mptt/managers.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 _create_tree_space(self, target_tree_id, num_trees = 1) : ' Creates space for a new tree by incrementing all tree ids greater than ``target_tree_id``. ' qs = self._mptt_filter (tree_id__gt = target_tree_id) self._mptt_update (qs, tree_id = (F (self.tree_id_attr) + num_trees)) self.tree_model._mptt_track_tree_insertions ((target_tree_id + 1), num_trees) Is there a bug in the code above?
No
177
[ "#NEWLINE#", "def load(", "self", ",", "irc", ",", "msg", ",", "args", ",", "optlist", ",", "name", ")", ":", "#NEWLINE#", "#INDENT#", "\"[--deprecated] <plugin>\\n\\n Loads the plugin <plugin> from any of the directories in\\n conf.supybot.directories.plugins; usuall...
false
0
[ "10", "30", "optlist", "2", "self", "4", "72", "81", "122", "160", "195", "207", "228", "250", "irc", "25", "36", "option", "103", "230", "module", "27", "argument", "143", "150", "189", "213", "e", "6", "msg", "222", "235", "cb", "19", "43", "11...
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 16, "after_index": 17, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ProgVal/Limnoria/plugins/Owner/plugin.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 load(self, irc, msg, args, optlist, name) : "[--deprecated] <plugin> Loads the plugin <plugin> from any of the directories in conf.supybot.directories.plugins; usually this includes the main installed directory and 'plugins' in the current directory. --deprecated is necessary if you wish to load deprecated plugins. " ignoreDeprecation = False for (option, argument) in optlist : if (option == 'deprecated') : ignoreDeprecation = True if name.endswith ('.py') : name = name [: (- 3)] if irc.getCallback (name) : irc.error (('%s is already loaded.' % name.capitalize ())) return try : module = plugin.loadPluginModule (name, ignoreDeprecation) except plugin.Deprecated : irc.error (('%s is deprecated. Use --deprecated to force it to load.' % name.capitalize ())) return except ImportError as e : if str (e).endswith (name) : irc.error (('No plugin named %s exists.' % utils.str.dqrepr (name))) else : if ("No module named 'config'" in str (e)) : irc.error ('This plugin may be incompatible with your current Python version. Try running 2to3 on it.') else : irc.error (str (e)) return cb = plugin.loadPluginClass (irc, module) name = cb.name () conf.registerPlugin (name, True) irc.replySuccess () Is there a bug in the code above?
No
178
[ "#NEWLINE#", "def save(", "self", ",", "data", ",", "mode", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "not", "self", ".", "name", ")", ":", "#NEWLINE#", "#INDENT#", "self", ".", "name", "=", "uuid4", "(", ")", ".", "hex", "#NEWLINE#", ...
false
0
[ "2", "16", "23", "39", "43", "50", "self", "4", "48", "data", "6", "mode" ]
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": 33, "after_index": 4...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "django-import-export/django-import-export/import_export/tmp_storages.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 save(self, data, mode = None) : if (not self.name) : self.name = uuid4 ().hex cache.set ((self.CACHE_PREFIX + self.name), data, self.CACHE_LIFETIME) Is there a bug in the code above?
No
179
[ "#NEWLINE#", "@", "classmethod", "#NEWLINE#", "def resource_uri(", "cls", ",", "obj", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "object_id", "=", "'id'", "#NEWLINE#", "if", "(", "obj", "is not", "None", ")", ":", "#NEWLINE#", "#INDENT#", "object_id", "="...
false
0
[ "7", "20", "29", "obj", "5", "cls", "14", "27", "39", "object_id" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 6, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 16, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "treeio/treeio/treeio/core/administration/api/handlers.py", "license": "mit", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
@ classmethod def resource_uri(cls, obj = None) : object_id = 'id' if (obj is not None) : object_id = obj.id return ('api_admin_users', [object_id]) Is there a bug in the code above?
No
180
[ "#NEWLINE#", "def testModule_aliasInScope(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "'Tests that goog.module style aliases are supported.'", "#NEWLINE#", "input_lines", "=", "[", "\"goog.module('test.module');\"", ",", "\"var AliasedClass = goog.require('goog.AliasedClass');\"", ",...
false
0
[ "2", "25", "38", "45", "self", "23", "49", "namespaces_info", "36", "53", "namespaceToken", "9", "29", "input_lines" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 7, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 11, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 22, "after_index": 30...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "google/closure-linter/closure_linter/closurizednamespacesinfo_test.py", "license": "apache-2.0", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def testModule_aliasInScope(self) : 'Tests that goog.module style aliases are supported.' input_lines = ["goog.module('test.module');", "var AliasedClass = goog.require('goog.AliasedClass');", 'goog.scope(function() {', 'var x = new AliasedClass();', '});'] namespaces_info = self._GetNamespacesInfoForScript (input_lines, ['goog']) namespaceToken = self._GetRequireTokens ('goog.AliasedClass') self.assertFalse (namespaces_info.IsExtraRequire (namespaceToken), 'AliasedClass should be marked as used') Is there a bug in the code above?
No
181
[ "#NEWLINE#", "def testScope_usedTypeAlias(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "'Tests aliased symbols in type annotations.'", "#NEWLINE#", "input_lines", "=", "[", "'goog.scope(function() {'", ",", "'var Event = goog.events.Event;'", ",", "'/** @type {Event} */;'", ",", ...
false
0
[ "21", "40", "namespaces_info", "37", "77", "illegal_alias_stmts", "9", "27", "input_lines", "35", "57", "missing_requires", "2", "23", "46", "60", "self" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 7, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 11, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 20, "after_index": 28...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "google/closure-linter/closure_linter/closurizednamespacesinfo_test.py", "license": "apache-2.0", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def testScope_usedTypeAlias(self) : 'Tests aliased symbols in type annotations.' input_lines = ['goog.scope(function() {', 'var Event = goog.events.Event;', '/** @type {Event} */;', '});'] namespaces_info = self._GetNamespacesInfoForScript (input_lines, ['goog']) (missing_requires, illegal_alias_stmts) = namespaces_info.GetMissingRequires () self.assertEquals ({ }, missing_requires) self.assertEquals ({ 'goog.events' : 2, }, _ToLineDict (illegal_alias_stmts)) Is there a bug in the code above?
No
182
[ "#NEWLINE#", "def _GetNamespacesInfoForScript(", "self", ",", "script", ",", "closurized_namespaces", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "(", "_", ",", "namespaces_info", ")", "=", "self", ".", "_GetStartTokenAndNamespacesInfoForScript", "(", "script", ",...
false
0
[ "16", "29", "namespaces_info", "4", "23", "script", "6", "25", "closurized_namespaces", "2", "19", "self", "14", "_" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 24, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 28, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "google/closure-linter/closure_linter/closurizednamespacesinfo_test.py", "license": "apache-2.0", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def _GetNamespacesInfoForScript(self, script, closurized_namespaces = None) : (_, namespaces_info) = self._GetStartTokenAndNamespacesInfoForScript (script, closurized_namespaces) return namespaces_info Is there a bug in the code above?
No
183
[ "#NEWLINE#", "@", "staticmethod", "#NEWLINE#", "def from_stream(", "body", ")", ":", "#NEWLINE#", "#INDENT#", "(", "msg_type", ",", "length", ")", "=", "struct", ".", "unpack", "(", "'!BI'", ",", "(", "(", "body", "[", "0", "]", "+", "'\\x00'", ")", "+",...
false
0
[ "11", "43", "56", "100", "141", "msg_type", "13", "70", "76", "147", "length", "92", "111", "type", "108", "125", "size", "5", "24", "32", "61", "63", "80", "115", "122", "body", "106", "143", "obj" ]
0
NONE
[]
[ [ { "before_index": 9, "after_index": 21, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 41, "after_index": 44, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 60, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "google/nogotofail/nogotofail/mitm/util/tls/types/handshake.py", "license": "apache-2.0", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
@ staticmethod def from_stream(body) : (msg_type, length) = struct.unpack ('!BI', ((body [0] + '\x00') + body [1 : 4])) if (msg_type not in name_map) : raise ValueError (('Unknown HanshakeMessage type %d' % msg_type)) body = body [4 : (4 + length)] if (length != len (body)) : raise TlsNotEnoughDataError () type = HandshakeMessage.type_map.get (msg_type, OpaqueMessage) (obj, size) = type.from_stream (body) if (len (body) != size) : raise ValueError ('Read mismatch') return (HandshakeMessage (msg_type, obj), (length + 4)) Is there a bug in the code above?
No
184
[ "#NEWLINE#", "def act(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "workerName", "=", "self", ".", "get", "(", "'name'", ",", "''", ")", "#NEWLINE#", "if", "(", "not", "workerName", ")", ":", "#NEWLINE#", "#INDENT#", "logger", ".", "error", "(", "'empty w...
false
0
[ "7", "21", "51", "57", "72", "workerName", "2", "9", "34", "self", "66", "75", "88", "105", "engine" ]
0
NONE
[]
[ [ { "before_index": 6, "after_index": 14, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 20, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 42, "after_index": ...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "xumiao/pymonk/monk/roles/administrator.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 act(self) : workerName = self.get ('name', '') if (not workerName) : logger.error ('empty worker name {}'.format (self.decodedMessage)) return logger.info ('worker {} unregistering'.format (workerName)) if (workerName in admin.workers) : engine = admin.workers [workerName] engine._setattr (Engine.FSTATUS, cons.STATUS_INACTIVE) engine._setattr (Engine.FENDTIME, datetime.datetime.now ()) engine.save () Is there a bug in the code above?
No
185
[ "#NEWLINE#", "def __init__(", "cls", ",", "name", ",", "bases", ",", "dct", ")", ":", "#NEWLINE#", "#INDENT#", "super", "(", "NULLType", ",", "cls", ")", ".", "__init__", "(", "name", ",", "bases", ",", "dct", ")" ]
false
0
[ "6", "24", "bases", "4", "22", "name", "8", "26", "dct", "2", "17", "cls" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 12, "after_index": 23, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 23, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "kdart/pycopia/aid/pycopia/aid.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__(cls, name, bases, dct) : super (NULLType, cls).__init__ (name, bases, dct) Is there a bug in the code above?
No
186
[ "#NEWLINE#", "def __setattr__(", "self", ",", "name", ",", "value", ")", ":", "#NEWLINE#", "#INDENT#", "return", "setattr", "(", "connections", "[", "DEFAULT_DB_ALIAS", "]", ",", "name", ",", "value", ")" ]
false
0
[ "6", "21", "value", "4", "19", "name", "2", "self" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 18, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "django/django/django/db/__init__.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 __setattr__(self, name, value) : return setattr (connections [DEFAULT_DB_ALIAS], name, value) Is there a bug in the code above?
No
187
[ "#NEWLINE#", "def flatzset(", "iterable", "=", "None", ",", "kwargs", "=", "None", ")", ":", "#NEWLINE#", "#INDENT#", "if", "iterable", ":", "#NEWLINE#", "#INDENT#", "c", "=", "flat2d", "(", "iterable", ")", "#NEWLINE#", "if", "kwargs", ":", "#NEWLINE#", "#I...
false
0
[ "2", "14", "22", "iterable", "6", "26", "38", "49", "57", "kwargs", "18", "30", "34", "53", "65", "c" ]
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": 62, "after_index": 6...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "lsbardel/python-stdnet/stdnet/utils/__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 flatzset(iterable = None, kwargs = None) : if iterable : c = flat2d (iterable) if kwargs : c = chain (c, _flatzsetdict (kwargs)) else : if kwargs : c = _flatzsetdict (kwargs) return tuple (c) Is there a bug in the code above?
No
188
[ "#NEWLINE#", "def _load_json_config(", "self", ",", "context", ")", ":", "#NEWLINE#", "#INDENT#", "user_config_file", "=", "self", ".", "_get_raw_json_config", "(", "context", ".", "resolver", ")", "#NEWLINE#", "config_file", "=", "self", ".", "_generate_workgen_confi...
false
0
[ "2", "11", "22", "57", "64", "80", "self", "39", "49", "fh", "43", "61", "68", "86", "113", "config_data", "9", "26", "user_config_file", "105", "115", "wfh", "4", "15", "28", "context", "20", "36", "100", "124", "config_file" ]
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": 19, "after_index": 27...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "ARM-software/workload-automation/wlauto/workloads/rt_app/__init__.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_json_config(self, context) : user_config_file = self._get_raw_json_config (context.resolver) config_file = self._generate_workgen_config (user_config_file, context.output_directory) with open (config_file) as fh : config_data = json.load (fh, object_pairs_hook = OrderedDict) self._update_rt_app_config (config_data) self.duration = config_data ['global'].get ('duration', 0) self.task_count = len (config_data.get ('tasks', [])) with open (config_file, 'w') as wfh : json.dump (config_data, wfh, indent = 4) return config_file Is there a bug in the code above?
No
189
[ "#NEWLINE#", "@", "has_access", "#NEWLINE#", "@", "expose", "(", "'/runsql/'", ",", "methods", "=", "[", "'POST'", ",", "'GET'", "]", ")", "#NEWLINE#", "@", "log_this", "#NEWLINE#", "def runsql(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "'Runs arbitrary sql a...
false
0
[ "29", "33", "77", "280", "session", "75", "128", "134", "mydb", "66", "90", "database_id", "158", "194", "qry", "132", "198", "232", "eng", "41", "59", "68", "data", "57", "145", "147", "171", "190", "226", "228", "sql", "263", "273", "e", "123", ...
0
NONE
[]
[ [ { "before_index": 26, "after_index": 27, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 28, "after_index": 34, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 36, "after_index":...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "airbnb/caravel/caravel/views.py", "license": "apache-2.0", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
@ has_access @ expose ('/runsql/', methods = ['POST', 'GET']) @ log_this def runsql(self) : 'Runs arbitrary sql and returns and html table' session = db.session () limit = 1000 data = json.loads (request.form.get ('data')) sql = data.get ('sql') database_id = data.get ('database_id') mydb = session.query (models.Database).filter_by (id = database_id).first () if (not self.appbuilder.sm.has_access ('all_datasource_access', 'all_datasource_access')) : raise Exception ('This view requires the `all_datasource_access` permission') content = '' if mydb : eng = mydb.get_sqla_engine () if limit : sql = sql.strip ().strip (';') qry = select ('*').select_from (TextAsFrom (text (sql), ['*']).alias ('inner_qry')).limit (limit) sql = str (qry.compile (eng, compile_kwargs = { 'literal_binds' : True, })) try : df = pd.read_sql_query (sql = sql, con = eng) content = df.to_html (index = False, na_rep = '', classes = 'dataframe table table-striped table-bordered table-condensed sql_results'.split (' ')) except Exception as e : content = '<div class="alert alert-danger">{}</div>'.format (e.message) session.commit () return content Is there a bug in the code above?
No
190
[ "#NEWLINE#", "def _ip_to_int(", "self", ",", "ip", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "'.'", "in", "ip", ")", ":", "#NEWLINE#", "#INDENT#", "return", "sum", "(", "[", "int", "(", "x", ")", "for", "x", "in", "ip", ".", "split", "(", "'.'", ...
false
0
[ "51", "80", "lo", "49", "75", "hi", "4", "13", "29", "43", "68", "90", "ip", "24", "27", "x", "2", "self" ]
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": 39, "after_index": 42...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "disqus/gargoyle/gargoyle/builtins.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 _ip_to_int(self, ip) : if ('.' in ip) : return sum ([int (x) for x in ip.split ('.')]) if (':' in ip) : (hi, lo) = struct.unpack ('!QQ', socket.inet_pton (socket.AF_INET6, ip)) return ((hi << 64) | lo) raise ValueError (('Invalid IP Address %r' % ip)) Is there a bug in the code above?
No
191
[ "#NEWLINE#", "def find_path_in_tree(", "data", ",", "path_tokens", ")", ":", "#NEWLINE#", "#INDENT#", "for", "i", "in", "range", "(", "0", ",", "len", "(", "path_tokens", ")", ")", ":", "#NEWLINE#", "#INDENT#", "if", "(", "isinstance", "(", "data", ",", "d...
false
0
[ "4", "18", "45", "59", "77", "99", "115", "129", "path_tokens", "2", "28", "35", "50", "55", "57", "125", "127", "138", "data", "10", "47", "61", "81", "94", "119", "131", "i" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 15,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/api/metadata/base.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 find_path_in_tree(data, path_tokens) : for i in range (0, len (path_tokens)) : if (isinstance (data, dict) or isinstance (data, list)) : if (path_tokens [i] in data) : data = data [path_tokens [i]] else : raise KeyError ('/'.join (path_tokens [0 : i])) else : if (i != (len (path_tokens) - 1)) : raise KeyError ('/'.join (path_tokens [0 : i])) data = data [path_tokens [i]] return data Is there a bug in the code above?
No
192
[ "#NEWLINE#", "def _fetch_disk_image(", "context", ",", "session", ",", "instance", ",", "name_label", ",", "image_id", ",", "image_type", ")", ":", "#NEWLINE#", "#INDENT#", "'Fetch the image from Glance\\n\\n NOTE:\\n Unlike _fetch_vhd_image, this method does not use the Glan...
false
0
[ "2", "92", "context", "138", "180", "206", "242", "271", "378", "vdi_size", "19", "44", "269", "image_type_str", "12", "25", "57", "171", "192", "317", "327", "437", "472", "548", "image_type", "86", "98", "112", "126", "glance_image", "218", "247", "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": 18, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/virt/xenapi/vm_utils.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 _fetch_disk_image(context, session, instance, name_label, image_id, image_type) : 'Fetch the image from Glance NOTE: Unlike _fetch_vhd_image, this method does not use the Glance plugin; instead, it streams the disks through domU to the VDI directly. Returns: A single filename if image_type is KERNEL_RAMDISK A list of dictionaries that describe VDIs, otherwise ' image_type_str = ImageType.to_string (image_type) LOG.debug ('Fetching image %(image_id)s, type %(image_type_str)s', { 'image_id' : image_id, 'image_type_str' : image_type_str, }, instance = instance) if (image_type == ImageType.DISK_ISO) : sr_ref = _safe_find_iso_sr (session) else : sr_ref = safe_find_sr (session) glance_image = image_utils.GlanceImage (context, image_id) if glance_image.is_raw_tgz () : image = image_utils.RawTGZImage (glance_image) else : image = image_utils.RawImage (glance_image) virtual_size = image.get_size () vdi_size = virtual_size LOG.debug ('Size for image %(image_id)s: %(virtual_size)d', { 'image_id' : image_id, 'virtual_size' : virtual_size, }, instance = instance) if (image_type == ImageType.DISK) : vdi_size += MBR_SIZE_BYTES else : if ((image_type in (ImageType.KERNEL, ImageType.RAMDISK)) and (vdi_size > CONF.xenserver.max_kernel_ramdisk_size)) : max_size = CONF.xenserver.max_kernel_ramdisk_size raise exception.NovaException ((_ ('Kernel/Ramdisk image is too large: %(vdi_size)d bytes, max %(max_size)d bytes') % { 'vdi_size' : vdi_size, 'max_size' : max_size, })) vdi_ref = create_vdi (session, sr_ref, instance, name_label, image_type_str, vdi_size) try : filename = None vdi_uuid = session.call_xenapi ('VDI.get_uuid', vdi_ref) with vdi_attached_here (session, vdi_ref, read_only = False) as dev : _stream_disk (session, image.stream_to, image_type, virtual_size, dev) if (image_type in (ImageType.KERNEL, ImageType.RAMDISK)) : LOG.debug ('Copying VDI %s to /boot/guest on dom0', vdi_ref, instance = instance) args = { } args ['vdi-ref'] = vdi_ref args ['image-size'] = str (vdi_size) if CONF.xenserver.cache_images : args ['cached-image'] = image_id filename = session.call_plugin ('kernel', 'copy_vdi', args) destroy_vdi (session, vdi_ref) LOG.debug ('Kernel/Ramdisk VDI %s destroyed', vdi_ref, instance = instance) vdi_role = ImageType.get_role (image_type) return { vdi_role : dict (uuid = None, file = filename), } else : vdi_role = ImageType.get_role (image_type) return { vdi_role : dict (uuid = vdi_uuid, file = None), } except (session.XenAPI.Failure, IOError, OSError) as e : LOG.exception (_LE ('Failed to fetch glance image'), instance = instance) e.args = (e.args + ([dict (type = ImageType.to_string (image_type), uuid = vdi_uuid, file = filename)],)) raise Is there a bug in the code above?
No
193
[ "#NEWLINE#", "def conv2d(", "x", ",", "W", ")", ":", "#NEWLINE#", "#INDENT#", "'Create a convolution layer, given inputs x and\\n weights W (tf.Variable)'", "#NEWLINE#", "return", "tf", ".", "nn", ".", "conv2d", "(", "x", ",", "W", ",", "strides", "=", "[", "1", ...
false
0
[ "2", "18", "x", "4", "20", "W" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 8, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 19,...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "longubu/datumio/examples/tensorflow/mnist_cnn.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 conv2d(x, W) : 'Create a convolution layer, given inputs x and weights W (tf.Variable)' return tf.nn.conv2d (x, W, strides = [1, 1, 1, 1], padding = 'SAME') Is there a bug in the code above?
No
194
[ "#NEWLINE#", "def PowX_PowY(", "data", "=", "None", ",", "args", "=", "None", ",", "eqInstance", "=", "None", ",", "NameOrValueFlag", "=", "0", ")", ":", "#NEWLINE#", "#INDENT#", "if", "NameOrValueFlag", ":", "#NEWLINE#", "#INDENT#", "return", "(", "(", "(",...
false
0
[ "2", "72", "87", "112", "data", "14", "22", "NameOrValueFlag", "6", "45", "54", "77", "92", "args", "10", "eqInstance" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 21, "after_index": 22, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": 5...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "zunzun/pyeq2/DataCache/DataCacheFunctions.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 PowX_PowY(data = None, args = None, eqInstance = None, NameOrValueFlag = 0) : if NameOrValueFlag : return (((sys._getframe ().f_code.co_name + '_') + str (args [0])) + str (args [1])) try : return (numpy.power (data [0], args [0]) * numpy.power (data [1], args [1])) except : return (1e+300 * numpy.ones_like (data [0])) Is there a bug in the code above?
No
195
[ "#NEWLINE#", "def test_outputs(", "self", ")", ":", "#NEWLINE#", "#INDENT#", "for", "(", "output_value", ",", "expected_output", ")", "in", "get_items", "(", "self", ".", "outputs", ")", ":", "#NEWLINE#", "#INDENT#", "assert", "(", "self", ".", "field", ".", ...
false
0
[ "9", "31", "output_value", "2", "16", "25", "self", "11", "34", "expected_output" ]
0
NONE
[]
[ [ { "before_index": 7, "after_index": 10, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 7, "after_index": 15, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 15, "after_index": 1...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "tomchristie/django-rest-framework/tests/test_fields.py", "license": "bsd-2-clause", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def test_outputs(self) : for (output_value, expected_output) in get_items (self.outputs) : assert (self.field.to_representation (output_value) == expected_output) Is there a bug in the code above?
No
196
[ "#NEWLINE#", "def to_python(", "self", ",", "value", ")", ":", "#NEWLINE#", "#INDENT#", "raise", "serializers", ".", "ValidationError", "(", "self", ".", "error_messages", "[", "'invalid_image'", "]", ")" ]
false
0
[ "4", "value", "2", "14", "self" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 9, "after_index": 13, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 11...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "tomchristie/django-rest-framework/tests/test_fields.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 to_python(self, value) : raise serializers.ValidationError (self.error_messages ['invalid_image']) Is there a bug in the code above?
No
197
[ "#NEWLINE#", "def fire_callback_on_node_update(", "node", ")", ":", "#NEWLINE#", "#INDENT#", "for", "extension", "in", "get_all_extensions", "(", ")", ":", "#NEWLINE#", "#INDENT#", "extension", ".", "on_node_update", "(", "node", ")" ]
false
0
[ "2", "20", "node", "8", "16", "extension" ]
0
NONE
[]
[ [ { "before_index": 7, "after_index": 8, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 7, "after_index": 11, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 11, "after_index": 10...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "openstack/fuel-web/nailgun/nailgun/extensions/manager.py", "license": "apache-2.0", "note": "license: bigquery_api" } } ]
bug detection
{% set indent = ' ' %} {% set ns = namespace(indent_size=0, result=[]) %} {% for token in source_tokens %} {% if token== '#INDENT#' %} {% set ns.indent_size = ns.indent_size + 1 %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% elif token == '#NEWLINE#' %} {% set ns.result = ns.result + ["\n"] %} {% elif token == '#UNINDENT#' %} {% set ns.indent_size = ns.indent_size - 1 %} {% else %} {% if not loop.first and loop.previtem == '#NEWLINE#' %} {% set ns.result = ns.result + [indent * ns.indent_size] %} {% endif %} {% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %} {% endif %} {% endfor %} {{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}} Is there a bug in the code above? ||| {{ {True: "Yes", False: "No"}[has_bug] }}
def fire_callback_on_node_update(node) : for extension in get_all_extensions () : extension.on_node_update (node) Is there a bug in the code above?
No
198
[ "#NEWLINE#", "def __init__(", "self", ",", "iterable", "=", "(", ")", ",", "**kwargs", ")", ":", "#NEWLINE#", "#INDENT#", "super", "(", "LayerCollection", ",", "self", ")", ".", "__init__", "(", ")", "#NEWLINE#", "self", ".", "update", "(", "iterable", ","...
false
0
[ "4", "29", "iterable", "32", "kwargs", "37", "65", "key", "2", "18", "25", "42", "63", "self", "39", "55", "71", "val" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 3, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 13, "after_index": 22, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 24, "after_index": 3...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "bkg/django-spillway/spillway/collections.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, iterable = (), **kwargs) : super (LayerCollection, self).__init__ () self.update (iterable, ** kwargs) for (key, val) in self.iteritems () : if (not isinstance (val, FeatureCollection)) : self [key] = FeatureCollection (** val) Is there a bug in the code above?
No
199
[ "#NEWLINE#", "@", "bound_function", "(", "'list.extend'", ")", "#NEWLINE#", "def resolve_extend(", "self", ",", "list", ",", "args", ",", "kws", ")", ":", "#NEWLINE#", "#INDENT#", "(", "iterable", ",", ")", "=", "args", "#NEWLINE#", "assert", "(", "not", "kw...
false
0
[ "82", "93", "107", "sig", "58", "75", "103", "unified", "20", "37", "52", "90", "iterable", "12", "24", "args", "14", "29", "kws", "50", "68", "70", "101", "dtype", "10", "66", "97", "list", "8", "60", "self" ]
0
NONE
[]
[ [ { "before_index": 1, "after_index": 9, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 18, "after_index": 24, "edge_type": 7, "edge_type_name": "enum_FIELD" } ], [ { "before_index": 26, "after_index": 2...
[ { "datasetProvenance": { "datasetName": "ETHPy150Open", "filepath": "numba/numba/numba/typing/listdecl.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] }}
@ bound_function ('list.extend') def resolve_extend(self, list, args, kws) : (iterable,) = args assert (not kws) if (not isinstance (iterable, types.IterableType)) : return dtype = iterable.iterator_type.yield_type unified = self.context.unify_pairs (list.dtype, dtype) if (unified is not None) : sig = signature (types.none, iterable) sig.recvr = list.copy (dtype = unified) return sig Is there a bug in the code above?
No