Search is not available for this dataset
id int32 | source_tokens sequence | has_bug bool | error_location int32 | repair_candidates sequence | bug_kind int32 | bug_kind_name string | repair_targets sequence | edges list | provenances list | template_name string | template string | rendered_input string | rendered_output string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"key",
",",
"value",
",",
"flag",
"=",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n Represents a base metric. This is not used directly,\\n and is instead invoked from sub-classes that are typed\\n by the metric.\\n\\n... | true | 33 | [
"2",
"17",
"23",
"29",
"33",
"4",
"19",
"21",
"6",
"25",
"27",
"8",
"31"
] | 1 | VARIABLE_MISUSE | [
8,
31
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 15,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 16,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "kiip/statsite/statsite/metrics.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, key, value, flag = None) :
'
Represents a base metric. This is not used directly,
and is instead invoked from sub-classes that are typed
by the metric.
Each sub-class must implement a class method :meth:`fold()`
which takes a list of objects of the same type and returns a list
of (key,value,timestamp) pairs.
:Parameters:
- `key` : The key of the metric
- `value` : The metric value
- `flag` (optional) : An optional metric flag. This is specific
to the flag and has no inherint meaning. For example the Counter
metric uses this to indicate a sampling rate.
'
self.key = key
self.value = value
self.flag = self
Is there a bug in the code above? | Yes |
1 | [
"#NEWLINE#",
"def test_get_params(",
"self",
",",
"layer",
")",
":",
"#NEWLINE#",
"#INDENT#",
"assert",
"(",
"layer",
".",
"get_params",
"(",
")",
"==",
"[",
"layer",
".",
"W",
",",
"layer",
".",
"b",
"]",
")",
"#NEWLINE#",
"assert",
"(",
"layer",
".",
... | true | 76 | [
"2",
"76",
"4",
"11",
"18",
"22",
"30",
"40",
"48",
"58",
"66",
"80",
"88",
"103",
"118",
"128",
"132"
] | 1 | VARIABLE_MISUSE | [
4,
11,
18,
22,
30,
40,
48,
58,
66,
80,
88,
103,
118,
128,
132
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 9,
"after_index": 16,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 28,
"after_index": 38... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "Lasagne/Lasagne/lasagne/tests/layers/test_dense.py",
"license": "mit",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_get_params(self, layer) :
assert (layer.get_params () == [layer.W, layer.b])
assert (layer.get_params (regularizable = False) == [layer.b])
assert (layer.get_params (regularizable = True) == [layer.W])
assert (layer.get_params (trainable = True) == [self.W, layer.b])
assert (layer.get_params (trainable = False) == [])
assert (layer.get_params (_nonexistent_tag = True) == [])
assert (layer.get_params (_nonexistent_tag = False) == [layer.W, layer.b])
Is there a bug in the code above? | Yes |
2 | [
"#NEWLINE#",
"def add(",
"self",
",",
"ip",
",",
"source",
",",
"description",
",",
"priority",
"=",
"1",
",",
"reputation",
"=",
"1",
",",
"latitude",
"=",
"0.0",
",",
"longitude",
"=",
"0.0",
",",
"city",
"=",
"''",
",",
"country",
"=",
"''",
")",
... | true | 130 | [
"14",
"130",
"330",
"71",
"79",
"199",
"8",
"320",
"30",
"113",
"118",
"122",
"350",
"4",
"48",
"62",
"87",
"294",
"22",
"166",
"176",
"180",
"186",
"193",
"265",
"274",
"282",
"340",
"288",
"310",
"10",
"325",
"18",
"140",
"144",
"150",
"157",... | 1 | VARIABLE_MISUSE | [
18,
140,
144,
150,
157,
240,
249,
257,
335
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 36,
"after_index": 37,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 39,
"after_index": 4... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "jpsenior/threataggregator/threataggregator.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def add(self, ip, source, description, priority = 1, reputation = 1, latitude = 0.0, longitude = 0.0, city = '', country = '') :
'
:param string ip: IP is a dotted quad x.x.x.x or CIDR x.x.x.x/yy
:param string source: Source for ThreatDB entry URL
:param string description: Description of this individual entry
:param int priority: Priority of threat
:param int reputation: Reputation of threat
:param float latitude: Latitude of threat entry
:param float longitude: Longitude of threat entry
:param string city: City of located threat
:param string country: Country of located threat
:return:
'
if (not re.match (re_ipcidr, ip)) :
raise Exception (ValueError, ('IP %s is not valid' % ip))
try :
reader = get_geo_db ()
response = reader.city (netaddr.IPNetwork (ip).network)
if (not city) :
city = response.city.name
if (not country) :
country = response.country.name
if (not reputation) :
if response.location.latitude :
latitude = response.location.latitude
else :
latitude = 0
if (not longitude) :
if response.location.longitude :
longitude = response.location.longitude
else :
longitude = 0
reader.close ()
except geoip2.errors.AddressNotFoundError :
pass
except maxminddb.errors.InvalidDatabaseError as e :
raise ('Invalid GeoIP database %s' % e)
if ((latitude < (- 90.0)) or (latitude > 90.0)) :
latitude = 0
if ((longitude < (- 180.0)) or (longitude > 180.0)) :
longitude = 0
for i in netaddr.IPNetwork (ip) :
self.entries.append ({
'ip' : i,
'source' : source,
'description' : description,
'priority' : priority,
'reputation' : reputation,
'latitude' : latitude,
'longitude' : longitude,
'city' : city,
'country' : country,
})
Is there a bug in the code above? | Yes |
3 | [
"#NEWLINE#",
"def buildcef(",
"action",
",",
"entry",
")",
":",
"#NEWLINE#",
"#INDENT#",
"' Builds a CEF-formatted string based on reputation entry from RepDB\\n\\n :param string action: add remove or delete\\n :param entry: One RepDB entry to parse\\n :return: Returns a CEF-formatted st... | true | 27 | [
"39",
"133",
"25",
"117",
"4",
"13",
"20",
"34",
"41",
"48",
"55",
"62",
"69",
"11",
"119",
"67",
"129",
"27",
"32",
"131",
"60",
"127",
"2",
"113",
"115",
"18",
"121",
"53",
"125",
"74",
"99",
"46",
"123"
] | 1 | VARIABLE_MISUSE | [
4,
13,
20,
34,
41,
48,
55,
62,
69
] | [
[
{
"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": 14,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "jpsenior/threataggregator/threataggregator.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 buildcef(action, entry) :
' Builds a CEF-formatted string based on reputation entry from RepDB
:param string action: add remove or delete
:param entry: One RepDB entry to parse
:return: Returns a CEF-formatted string with timestamp
'
ip = entry ['ip']
source = entry ['source']
description = priority ['description']
priority = entry ['priority']
reputation = entry ['reputation']
city = entry ['city']
country = entry ['country']
latitude = entry ['latitude']
longitude = entry ['longitude']
timestamp = datetime.datetime.fromtimestamp (time.time ()).strftime ('%b %d %Y %H:%M:%S')
return ('%s %s CEF:0|%s|%s|1.0|100|Threat Entry %s|1|act=%s reason=%s src=%s cs1Label=Source cs1=%s cs2Label=City cs2=%s cs3Label=Country cs3=%s cfp1Label=Latitude cfp1=%.8f cfp2Label=Longitude cfp2=%.8f cfp3Label=Priority cfp3=%d cfp4Label=Reputation cfp4=%d' % (timestamp, config.deviceHost, config.deviceVendor, config.deviceProduct, action, action, description, ip, source, city, country, latitude, longitude, priority, reputation))
Is there a bug in the code above? | Yes |
4 | [
"#NEWLINE#",
"@",
"skipif",
"(",
"ON_TRAVIS_CI",
",",
"reason",
"=",
"\"Don't know\"",
")",
"#NEWLINE#",
"def test_temp_ssh_files(",
")",
":",
"#NEWLINE#",
"#INDENT#",
"with",
"filetext",
"(",
"'name,balance\\nAlice,100\\nBob,200'",
",",
"extension",
"=",
"'csv'",
")"... | true | 65 | [
"37",
"72",
"30",
"49",
"60",
"65",
"26",
"34"
] | 1 | VARIABLE_MISUSE | [
37,
72
] | [
[
{
"before_index": 5,
"after_index": 2,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 25,
"after_index": 20,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 25,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "blaze/odo/odo/backends/tests/test_ssh.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] }} | @ skipif (ON_TRAVIS_CI, reason = "Don't know")
def test_temp_ssh_files() :
with filetext ('name,balance
Alice,100
Bob,200', extension = 'csv') as fn :
csv = CSV (fn)
scsv = into (Temp (SSH (CSV)), csv, hostname = 'localhost')
assert (discover (csv) == discover (csv))
assert isinstance (scsv, _Temp)
Is there a bug in the code above? | Yes |
5 | [
"#NEWLINE#",
"def test03_setitem(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Changing enumerated values using ``table.__setitem__()``.'",
"#NEWLINE#",
"tbl",
"=",
"self",
".",
"h5file",
".",
"create_table",
"(",
"'/'",
",",
"'test'",
",",
"self",
".",
"_description"... | true | 88 | [
"2",
"11",
"21",
"29",
"42",
"50",
"69",
"77",
"119",
"63",
"112",
"123",
"9",
"56",
"83",
"90",
"98",
"36",
"60",
"88",
"96",
"100",
"114",
"125"
] | 1 | VARIABLE_MISUSE | [
63,
112,
123
] | [
[
{
"before_index": 6,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 18,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 35,
"after_index": 38... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "PyTables/PyTables/tables/tests/test_enum.py",
"license": "bsd-3-clause",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test03_setitem(self) :
'Changing enumerated values using ``table.__setitem__()``.'
tbl = self.h5file.create_table ('/', 'test', self._description (), title = self._getMethodName ())
appended = [(10, self.valueInEnum), (20, self.valueInEnum)]
tbl.append (appended)
written = [(10, self.valueInEnum), (20, self.valueOutOfEnum)]
tbl [:] = read
tbl.flavor = 'python'
read = tbl.read ()
common.verbosePrint (('* written value: %s
* read value: %s
' % (written, read)))
self.assertEqual (written, read, 'Written and read values differ.')
Is there a bug in the code above? | Yes |
6 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"primary_key",
"=",
"None",
",",
"secondary_key",
"=",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"primary_key",
"=",
"self",
"#NEWLINE#",
"self",
".",
"secondary_key",
"=",
"secondary_key"
] | true | 19 | [
"2",
"15",
"19",
"21",
"4",
"17",
"8",
"23",
"25"
] | 1 | VARIABLE_MISUSE | [
4,
17
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 19,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 20,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "Azure/azure-sdk-for-python/azure-mgmt-redis/azure/mgmt/redis/models/redis_access_keys.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, primary_key = None, secondary_key = None) :
self.primary_key = self
self.secondary_key = secondary_key
Is there a bug in the code above? | Yes |
7 | [
"#NEWLINE#",
"def test_defer_link_acquisition_blocking(",
")",
":",
"#NEWLINE#",
"#INDENT#",
"class root",
"(",
"morepath",
".",
"App",
")",
":",
"#NEWLINE#",
"#INDENT#",
"pass",
"#NEWLINE#",
"#UNINDENT#",
"class sub",
"(",
"morepath",
".",
"App",
")",
":",
"#NEWLIN... | true | 194 | [
"183",
"174",
"185",
"194"
] | 1 | VARIABLE_MISUSE | [
183
] | [
[
{
"before_index": 63,
"after_index": 75,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 105,
"after_index": 117,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 173,
"after_inde... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "morepath/morepath/morepath/tests/test_defer_links.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_defer_link_acquisition_blocking() :
class root (morepath.App) :
pass
class sub (morepath.App) :
pass
@ root.path (path = 'model/{id}')
class Model (object) :
def __init__(self, id) :
self.id = id
@ root.view (model = Model)
def model_default(self, request) :
return 'Hello'
@ sub.path (path = '')
class SubModel (object) :
pass
@ sub.view (model = SubModel)
def sub_model_default(self, request) :
try :
return request.link (Model ('foo'))
except LinkError :
return 'link error'
@ root.mount (app = sub, path = 'sub')
def mount_sub() :
return sub ()
c = Client (root ())
response = c.get ('/sub')
assert (c.body == b'link error')
Is there a bug in the code above? | Yes |
8 | [
"#NEWLINE#",
"def remove_artifact(",
"self",
",",
"artifact_name",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Removes an artifact from the build state.'",
"#NEWLINE#",
"con",
"=",
"self",
".",
"connect_to_database",
"(",
")",
"#NEWLINE#",
"try",
":",
"#NEWLINE#",
"#INDENT#",
... | true | 38 | [
"2",
"13",
"4",
"23",
"31",
"11",
"25",
"38",
"42",
"53"
] | 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": 10,
"after_index": 16,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "lektor/lektor/lektor/builder.py",
"license": "bsd-3-clause",
"note": "license: manual_eval"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def remove_artifact(self, artifact_name) :
'Removes an artifact from the build state.'
con = self.connect_to_database ()
try :
cur = con.cursor ()
cur.execute ('
delete from artifacts where artifact = ?
', [con])
con.commit ()
finally :
con.close ()
Is there a bug in the code above? | Yes |
9 | ["#NEWLINE#","def check_artifact_is_current(","self",",","artifact_name",",","sources",",","config_h(...TRUNCATED) | true | 60 | ["6","84","112","130","73","91","105","118","126","148","156","4","43","60","82","71","2","15","37",(...TRUNCATED) | 1 | VARIABLE_MISUSE | [
6,
84
] | [[{"before_index":1,"after_index":3,"edge_type":7,"edge_type_name":"enum_FIELD"}],[{"before_index":1(...TRUNCATED) | [{"datasetProvenance":{"datasetName":"ETHPy150Open","filepath":"lektor/lektor/lektor/builder.py","li(...TRUNCATED) | bug detection | "{% set indent = ' ' %}\n{% set ns = namespace(indent_size=0, result=[]) %}\n{% for token in sour(...TRUNCATED) | "def check_artifact_is_current(self, artifact_name, sources, config_hash) : \n con = self.connect(...TRUNCATED) | Yes |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 4