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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
600 | [
"#NEWLINE#",
"def run_test_command(",
"test_command",
")",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"result",
":",
"#NEWLINE#",
"#INDENT#",
"result",
"=",
"shell",
".",
"dry_run",
"(",
"test_command",
",",
"context",
".",
"dry_run",
")",
"#NEWLINE#",
"log",
".",
"inf... | true | 8 | [
"8",
"12",
"33",
"2",
"18",
"31"
] | 1 | VARIABLE_MISUSE | [
2,
18,
31
] | [
[
{
"before_index": 7,
"after_index": 8,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 37,
"after_index": 38,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 11,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "michaeljoseph/changes/changes/verification.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 run_test_command(test_command) :
if result :
result = shell.dry_run (test_command, context.dry_run)
log.info ('Test command "%s", returned %s', test_command, result)
return True
Is there a bug in the code above? | Yes |
601 | [
"#NEWLINE#",
"def testBadActivity(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"\"\\n Make sure the user cannot add an entry for an activity that is not in\\n the project's activity group\\n \"",
"#NEWLINE#",
"data",
"=",
"self",
".",
"default_data",
"#NEWLINE#",
... | true | 68 | [
"2",
"11",
"24",
"37",
"43",
"58",
"68",
"35",
"62",
"50",
"54",
"9",
"15",
"47"
] | 1 | VARIABLE_MISUSE | [
50,
54
] | [
[
{
"before_index": 6,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 18... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "caktus/django-timepiece/timepiece/entries/tests/test_timesheet.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 testBadActivity(self) :
"
Make sure the user cannot add an entry for an activity that is not in
the project's activity group
"
data = self.default_data
data.update ({
'activity' : self.sick_activity.id,
})
response = self.client.post (self.create_url, data)
err_msg = 'sick/personal is not allowed for this project. Please '
err_msg += 'choose among development, and Work'
self.assertFormError (response, 'form', None, self)
Is there a bug in the code above? | Yes |
602 | [
"#NEWLINE#",
"def clean_preview_email(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"email",
"=",
"normalise_email",
"(",
"self",
".",
"cleaned_data",
"[",
"'preview_email'",
"]",
")",
"#NEWLINE#",
"if",
"(",
"not",
"self",
".",
"send_preview",
")",
":",
"#NEWLI... | true | 30 | [
"2",
"11",
"22",
"30",
"7",
"36",
"54"
] | 1 | VARIABLE_MISUSE | [
7,
36,
54
] | [
[
{
"before_index": 6,
"after_index": 10,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 19,
"after_index": 21,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 33,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "django-oscar/django-oscar/src/oscar/apps/dashboard/communications/forms.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 clean_preview_email(self) :
email = normalise_email (self.cleaned_data ['preview_email'])
if (not self.send_preview) :
return self
if (not email) :
raise forms.ValidationError (_ ('Please enter an email address'))
return email
Is there a bug in the code above? | Yes |
603 | [
"#NEWLINE#",
"def mask_secret_parameters(",
"parameters",
",",
"secret_parameters",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n Introspect the parameters dict and return a new dict with masked secret\\n parameters.\\n\\n :param parameters: Parameters to process.\\n :type parameters: ``dic... | true | 46 | [
"21",
"29",
"38",
"11",
"31",
"36",
"2",
"17",
"46",
"4",
"23"
] | 1 | VARIABLE_MISUSE | [
11,
31,
36
] | [
[
{
"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": "StackStorm/st2/st2common/st2common/util/secrets.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 mask_secret_parameters(parameters, secret_parameters) :
'
Introspect the parameters dict and return a new dict with masked secret
parameters.
:param parameters: Parameters to process.
:type parameters: ``dict``
:param secret_parameters: List of parameter names which are secret.
:type secret_parameters: ``list``
'
result = copy.deepcopy (parameters)
for parameter in secret_parameters :
if (parameter in result) :
result [parameter] = MASKED_ATTRIBUTE_VALUE
return parameters
Is there a bug in the code above? | Yes |
604 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"node",
",",
"class_names",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"_class_names",
"=",
"node",
"#NEWLINE#",
"self",
".",
"visit",
"(",
"node",
")"
] | true | 15 | [
"4",
"15",
"21",
"6",
"2",
"11",
"17"
] | 1 | VARIABLE_MISUSE | [
6
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 15,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 16,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "PythonJS/PythonJS/pythonjs/pythonjs_to_coffee.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, node, class_names) :
self._class_names = node
self.visit (node)
Is there a bug in the code above? | Yes |
605 | [
"#NEWLINE#",
"def visit_List(",
"self",
",",
"node",
")",
":",
"#NEWLINE#",
"#INDENT#",
"return",
"(",
"'[%s]'",
"%",
"', '",
".",
"join",
"(",
"map",
"(",
"node",
".",
"visit",
",",
"node",
".",
"elts",
")",
")",
")"
] | true | 19 | [
"4",
"19",
"23",
"2"
] | 1 | VARIABLE_MISUSE | [
2
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 9,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 11... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "PythonJS/PythonJS/pythonjs/pythonjs_to_coffee.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 visit_List(self, node) :
return ('[%s]' % ', '.join (map (node.visit, node.elts)))
Is there a bug in the code above? | Yes |
606 | [
"#NEWLINE#",
"def logpdf_link(",
"self",
",",
"inv_link_f",
",",
"y",
",",
"Y_metadata",
"=",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"\"\\n Log Likelihood function given inverse link of f.\\n\\n .. math::\\n \\\\ln p(y_{i}|\\\\lambda(f_{i})) = y_{i}\\\\log\... | true | 98 | [
"6",
"44",
"59",
"73",
"88",
"4",
"79",
"17",
"33",
"57",
"86",
"8",
"19",
"2",
"24",
"70",
"98"
] | 1 | VARIABLE_MISUSE | [
4,
79
] | [
[
{
"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": "SheffieldML/GPy/GPy/likelihoods/binomial.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 logpdf_link(self, inv_link_f, y, Y_metadata = None) :
"
Log Likelihood function given inverse link of f.
.. math::
\\ln p(y_{i}|\\lambda(f_{i})) = y_{i}\\log\\lambda(f_{i}) + (1-y_{i})\\log (1-f_{i})
:param inv_link_f: latent variables inverse link of f.
:type inv_link_f: Nx1 array
:param y: data
:type y: Nx1 array
:param Y_metadata: Y_metadata must contain 'trials'
:returns: log likelihood evaluated at points inverse link of f.
:rtype: float
"
N = Y_metadata ['trials']
nchoosey = ((special.gammaln ((N + 1)) - special.gammaln ((y + 1))) - special.gammaln (((N - y) + 1)))
return ((nchoosey + (y * np.log (inv_link_f))) + ((N - y) * np.log ((1.0 - nchoosey))))
Is there a bug in the code above? | Yes |
607 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"port",
",",
"host",
",",
"num_executors",
"=",
"10",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n :param port: The port number the slave service is running on\\n :type port: int\\n :param host: The hostname at which the slave... | true | 66 | [
"2",
"17",
"23",
"29",
"35",
"41",
"47",
"58",
"69",
"97",
"106",
"116",
"122",
"133",
"139",
"145",
"151",
"157",
"8",
"45",
"85",
"130",
"81",
"94",
"110",
"90",
"103",
"113",
"6",
"25",
"27",
"66",
"4",
"19",
"21"
] | 1 | VARIABLE_MISUSE | [
8,
45,
85,
130
] | [
[
{
"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": "box/ClusterRunner/app/slave/cluster_slave.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, port, host, num_executors = 10) :
'
:param port: The port number the slave service is running on
:type port: int
:param host: The hostname at which the slave is reachable
:type host: str
:param num_executors: The number of executors this slave should operate with -- this determines how many
concurrent subjobs the slave can execute.
:type num_executors: int
'
self.port = port
self.host = host
self.is_alive = True
self._slave_id = None
self._num_executors = num_executors
self._logger = log.get_logger (__name__)
self._idle_executors = Queue (maxsize = host)
self.executors_by_id = {
}
for executor_id in range (num_executors) :
executor = SubjobExecutor (executor_id)
self._idle_executors.put (executor)
self.executors_by_id [executor_id] = executor
self._master_url = None
self._network = Network (min_connection_poolsize = num_executors)
self._master_api = None
self._project_type = None
self._current_build_id = None
self._build_teardown_coin = None
self._base_executor_index = None
Is there a bug in the code above? | Yes |
608 | [
"#NEWLINE#",
"def connectProxy(",
"self",
",",
"proxyClient",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n Connect a proxy client to a L{StringTransportWithDisconnection}.\\n\\n @param proxyClient: A L{ProxyClient}.\\n @return: The L{StringTransportWithDisconnection}.\\n '"... | true | 31 | [
"11",
"17",
"27",
"2",
"31",
"4",
"21",
"23"
] | 1 | VARIABLE_MISUSE | [
11,
17,
27
] | [
[
{
"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": "twisted/twisted/twisted/web/test/test_proxy.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 connectProxy(self, proxyClient) :
'
Connect a proxy client to a L{StringTransportWithDisconnection}.
@param proxyClient: A L{ProxyClient}.
@return: The L{StringTransportWithDisconnection}.
'
clientTransport = StringTransportWithDisconnection ()
clientTransport.protocol = proxyClient
proxyClient.makeConnection (clientTransport)
return self
Is there a bug in the code above? | Yes |
609 | [
"#NEWLINE#",
"def _serialize(",
"self",
",",
"data",
",",
"content_type",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Serialize the given dict to the provided content_type.\\n\\n Uses self._serialization_metadata if it exists, which is a dict mapping\\n MIME types to information needed ... | true | 36 | [
"2",
"19",
"4",
"48",
"6",
"50",
"69",
"32",
"44",
"36",
"61",
"79",
"13"
] | 1 | VARIABLE_MISUSE | [
13
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 11,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "openstack/neutron/neutron/wsgi.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def _serialize(self, data, content_type) :
'Serialize the given dict to the provided content_type.
Uses self._serialization_metadata if it exists, which is a dict mapping
MIME types to information needed to serialize to that type.
'
_metadata = getattr (type (self), '_serialization_metadata', {
})
serializer = Serializer (msg)
try :
return serializer.serialize (data, content_type)
except exception.InvalidContentType :
msg = (_ ('The requested content type %s is invalid.') % content_type)
raise webob.exc.HTTPNotAcceptable (msg)
Is there a bug in the code above? | Yes |
610 | [
"#NEWLINE#",
"def get_controller_by_id(",
"self",
",",
"id",
")",
":",
"#NEWLINE#",
"#INDENT#",
"\"Get the controller object given the id.\\n\\n This method returns the controller object for given id.\\n\\n :param id: id of the controller, for example\\n 'Smart Array P822 ... | true | 14 | [
"2",
"4",
"24",
"26",
"12",
"14",
"22",
"32"
] | 1 | VARIABLE_MISUSE | [
2
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 9,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 11,
"after_index": 12,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "openstack/proliantutils/proliantutils/hpssa/objects.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_controller_by_id(self, id) :
"Get the controller object given the id.
This method returns the controller object for given id.
:param id: id of the controller, for example
'Smart Array P822 in Slot 2'
:returns: Controller object which has the id or None if the
controller is not found.
"
for controller in controller.controllers :
if (controller.id == id) :
return controller
return None
Is there a bug in the code above? | Yes |
611 | [
"#NEWLINE#",
"def authenticate(",
"self",
",",
"remote_user",
")",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"(",
"not",
"remote_user",
")",
":",
"#NEWLINE#",
"#INDENT#",
"return",
"None",
"#NEWLINE#",
"#UNINDENT#",
"email",
"=",
"remote_user_to_email",
"(",
"remote_user"... | true | 36 | [
"2",
"32",
"52",
"63",
"21",
"4",
"12",
"25",
"36"
] | 1 | VARIABLE_MISUSE | [
21
] | [
[
{
"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": "zulip/zulip/zproject/backends.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def authenticate(self, remote_user) :
if (not remote_user) :
return None
email = remote_user_to_email (remote_user)
try :
user_profile = get_user_profile_by_email (remote_user)
except UserProfile.DoesNotExist :
return None
if user_profile.is_mirror_dummy :
return None
return user_profile
Is there a bug in the code above? | Yes |
612 | [
"#NEWLINE#",
"def test_update_l3_policy_unset_routers(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"resource",
"=",
"'l3_policy'",
"#NEWLINE#",
"cmd",
"=",
"gbp",
".",
"UpdateL3Policy",
"(",
"test_cli20",
".",
"MyApp",
"(",
"sys",
".",
"stdout",
")",
",",
"None",... | true | 73 | [
"47",
"37",
"71",
"73",
"29",
"44",
"69",
"2",
"61",
"7",
"65",
"33",
"42",
"11",
"67"
] | 1 | VARIABLE_MISUSE | [
47
] | [
[
{
"before_index": 6,
"after_index": 9,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 25,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 28,
"after_index": 3... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "openstack/python-group-based-policy-client/gbpclient/tests/unit/test_cli20_l3policy.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_update_l3_policy_unset_routers(self) :
resource = 'l3_policy'
cmd = gbp.UpdateL3Policy (test_cli20.MyApp (sys.stdout), None)
my_id = 'someid'
routers = ''
args = ['--routers', routers, my_id]
params = {
'routers' : [],
}
self._test_update_resource (resource, cmd, my_id, args, args)
Is there a bug in the code above? | Yes |
613 | [
"#NEWLINE#",
"def _test_router_update_unset_gw_keeps_global_router(",
"self",
",",
"set_context",
"=",
"False",
")",
":",
"#NEWLINE#",
"#INDENT#",
"tenant_id",
"=",
"_uuid",
"(",
")",
"#NEWLINE#",
"with",
"self",
".",
"network",
"(",
"tenant_id",
"=",
"tenant_id",
"... | true | 114 | [
"114",
"121",
"150",
"222",
"257",
"281",
"4",
"116",
"118",
"139",
"141",
"11",
"22",
"24",
"53",
"55",
"108",
"110",
"131",
"133",
"31",
"68",
"148",
"210",
"252",
"166",
"185",
"144",
"157",
"84",
"137",
"58",
"75",
"91",
"155",
"215",
"264"... | 1 | VARIABLE_MISUSE | [
84,
137
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 14,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "openstack/networking-cisco/networking_cisco/tests/unit/cisco/l3/test_asr1k_routertype_driver.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_router_update_unset_gw_keeps_global_router(self, set_context = False) :
tenant_id = _uuid ()
with self.network (tenant_id = tenant_id) as n_external :
res = self._create_subnet (self.fmt, n_external ['network'] ['id'], cidr = '10.0.1.0/24', tenant_id = tenant_id)
s = self.deserialize (self.fmt, res)
self._set_net_external (s ['subnet'] ['network_id'])
ext_gw = {
'network_id' : s ['subnet'] ['network_id'],
}
with self.router (tenant_id = tenant_id, external_gateway_info = router1, set_context = set_context) as router1, self.router (name = 'router2', tenant_id = tenant_id, external_gateway_info = ext_gw, set_context = set_context) as router2 :
r1 = router1 ['router']
r2 = router2 ['router']
qp = 'template_id=00000000-0000-0000-0000-000000000005'
hds = self._list ('hosting_devices', query_params = qp)
self._delete ('hosting_devices', hds ['hosting_devices'] [1] ['id'])
self.plugin._process_backlogged_routers ()
self._verify_ha_created_routers ([r1 ['id'], r2 ['id']])
r_spec = {
'router' : {
l3.EXTERNAL_GW_INFO : None,
},
}
self._update ('routers', r1 ['id'], r_spec)
self._verify_ha_updated_router (r2 ['id'])
self._update ('routers', r2 ['id'], r_spec)
self._verify_ha_updated_router (r2 ['id'], has_gw = False)
Is there a bug in the code above? | Yes |
614 | [
"#NEWLINE#",
"def test_metrics_casing(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"raise",
"SkipTest",
"(",
"\"Skipped for now as it's hard to configure couchbase on travis\"",
")",
"#NEWLINE#",
"self",
".",
"check",
".",
"check",
"(",
"self",
".",
"config",
"[",
"'in... | true | 62 | [
"40",
"62",
"70",
"84",
"30",
"55",
"60",
"65",
"2",
"13",
"19",
"32",
"74",
"52",
"78"
] | 1 | VARIABLE_MISUSE | [
30
] | [
[
{
"before_index": 7,
"after_index": 9,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 18,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 29,
"after_index": 3... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "serverdensity/sd-agent/tests/checks/mock/test_couchbase.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_metrics_casing(self) :
raise SkipTest ("Skipped for now as it's hard to configure couchbase on travis")
self.check.check (self.config ['instances'] [0])
metrics = self.check.get_metrics ()
camel_cased_metrics = ['couchbase.hdd.used_by_data', 'couchbase.ram.used_by_data', 'couchbase.ram.quota_total', 'couchbase.ram.quota_used']
found_metrics = [k [0] for k in camel_cased_metrics if (k [0] in camel_cased_metrics)]
self.assertEqual (found_metrics.sort (), camel_cased_metrics.sort ())
Is there a bug in the code above? | Yes |
615 | [
"#NEWLINE#",
"def test_master_detail_view(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n Test Master detail view\\n '",
"#NEWLINE#",
"client",
"=",
"self",
".",
"app",
".",
"test_client",
"(",
")",
"#NEWLINE#",
"self",
".",
"login",
"(",
"client",... | true | 83 | [
"2",
"11",
"19",
"30",
"83",
"36",
"47",
"54",
"65",
"72",
"90",
"101",
"9",
"23",
"38",
"56",
"74",
"92"
] | 1 | VARIABLE_MISUSE | [
36,
47,
54,
65,
72,
90,
101
] | [
[
{
"before_index": 6,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 16,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 18,
"after_index": 24... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "dpgaspar/Flask-AppBuilder/flask_appbuilder/tests/test_base.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_master_detail_view(self) :
'
Test Master detail view
'
client = self.app.test_client ()
self.login (client, DEFAULT_ADMIN_USER, DEFAULT_ADMIN_PASSWORD)
self.insert_data2 ()
rv = client.get ('/model1masterview/list/')
eq_ (rv.status_code, 200)
rv = client.get ('/model1masterview/list/1')
eq_ (rv.status_code, 200)
rv = client.get ('/model1masterchartview/list/')
eq_ (self.status_code, 200)
rv = client.get ('/model1masterchartview/list/1')
eq_ (rv.status_code, 200)
Is there a bug in the code above? | Yes |
616 | [
"#NEWLINE#",
"def test_state_with_children_and_attrs(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Test media player with children and master state.'",
"#NEWLINE#",
"config",
"=",
"self",
".",
"config_children_and_attr",
"#NEWLINE#",
"universal",
".",
"validate_config",
"(",
... | true | 28 | [
"2",
"11",
"58",
"69",
"77",
"90",
"101",
"109",
"123",
"134",
"142",
"155",
"9",
"19",
"33",
"46",
"22",
"28",
"36",
"52",
"64",
"84",
"96",
"117",
"129",
"149",
"161"
] | 1 | VARIABLE_MISUSE | [
2,
11,
58,
69,
77,
90,
101,
109,
123,
134,
142,
155
] | [
[
{
"before_index": 6,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 18... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "home-assistant/home-assistant/tests/components/media_player/test_universal.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_state_with_children_and_attrs(self) :
'Test media player with children and master state.'
config = self.config_children_and_attr
universal.validate_config (config)
ump = universal.UniversalMediaPlayer (ump.hass, ** config)
ump.entity_id = media_player.ENTITY_ID_FORMAT.format (config ['name'])
ump.update ()
self.assertEqual (STATE_OFF, ump.state)
self.hass.states.set (self.mock_state_switch_id, STATE_ON)
ump.update ()
self.assertEqual (STATE_ON, ump.state)
self.mock_mp_1._state = STATE_PLAYING
self.mock_mp_1.update_ha_state ()
ump.update ()
self.assertEqual (STATE_PLAYING, ump.state)
self.hass.states.set (self.mock_state_switch_id, STATE_OFF)
ump.update ()
self.assertEqual (STATE_OFF, ump.state)
Is there a bug in the code above? | Yes |
617 | [
"#NEWLINE#",
"def __iadd__(",
"self",
",",
"other",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n Combine the chart with another one\\n '",
"#NEWLINE#",
"if",
"(",
"not",
"isinstance",
"(",
"self",
",",
"ChartBase",
")",
")",
":",
"#NEWLINE#",
"#INDENT#",
"ra... | true | 16 | [
"2",
"16",
"31",
"41",
"4",
"37"
] | 1 | VARIABLE_MISUSE | [
4,
37
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 9,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 11,
"after_index": 13,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "cloudera/hue/desktop/core/ext-py/openpyxl-2.3.0-b2/openpyxl/chart/_chart.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 __iadd__(self, other) :
'
Combine the chart with another one
'
if (not isinstance (self, ChartBase)) :
raise TypeError ('Only other charts can be added')
self._charts.append (other)
return self
Is there a bug in the code above? | Yes |
618 | [
"#NEWLINE#",
"def _ListSeparatorsInXMLFormat(",
"separators",
",",
"indent",
"=",
"''",
")",
":",
"#NEWLINE#",
"#INDENT#",
"\"Generates XML encoding of a list of list separators.\\n\\n Args:\\n separators: A list of list separators. Usually, this should be a\\n string whose character... | true | 47 | [
"31",
"13",
"37",
"54",
"4",
"43",
"2",
"17",
"21",
"24",
"33",
"47"
] | 1 | VARIABLE_MISUSE | [
31
] | [
[
{
"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": "AppScale/appscale/AppServer/lib/python-gflags/tests/gflags_helpxml_test.py",
"license": "apache-2.0",
"note": "license: github_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def _ListSeparatorsInXMLFormat(separators, indent = '') :
"Generates XML encoding of a list of list separators.
Args:
separators: A list of list separators. Usually, this should be a
string whose characters are the valid list separators, e.g., ','
means that both comma (',') and space (' ') are valid list
separators.
indent: A string that is added at the beginning of each generated
XML element.
Returns:
A string.
"
result = ''
separators = list (separators)
separators.sort ()
for sep_char in separators :
result += ('%s<list_separator>%s</list_separator>
' % (indent, repr (separators)))
return result
Is there a bug in the code above? | Yes |
619 | [
"#NEWLINE#",
"def add_fields(",
"self",
",",
"field_names",
",",
"allow_m2m",
"=",
"True",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n Adds the given (model) fields to the select set. The field names are\\n added in the order specified.\\n '",
"#NEWLINE#",
"alias",
... | true | 86 | [
"77",
"86",
"108",
"152",
"196",
"23",
"65",
"162",
"51",
"90",
"36",
"58",
"126",
"140",
"190",
"15",
"67",
"6",
"71",
"45",
"75",
"96",
"2",
"17",
"25",
"54",
"82",
"100",
"168",
"176",
"49",
"79",
"88",
"43",
"47",
"4",
"38",
"94",
"104"... | 1 | VARIABLE_MISUSE | [
45,
75,
96
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 13,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "django/django/django/db/models/sql/query.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 add_fields(self, field_names, allow_m2m = True) :
'
Adds the given (model) fields to the select set. The field names are
added in the order specified.
'
alias = self.get_initial_alias ()
opts = self.get_meta ()
try :
for name in field_names :
(_, targets, _, joins, path) = self.setup_joins (name.split (LOOKUP_SEP), opts, alias, allow_many = allow_m2m)
(targets, final_alias, joins) = self.trim_joins (final_alias, joins, path)
for target in targets :
self.add_select (target.get_col (final_alias))
except MultiJoin :
raise FieldError (("Invalid field name: '%s'" % name))
except FieldError :
if (LOOKUP_SEP in name) :
raise
else :
names = sorted (((list (get_field_names_from_opts (opts)) + list (self.extra)) + list (self.annotation_select)))
raise FieldError (('Cannot resolve keyword %r into field. Choices are: %s' % (name, ', '.join (names))))
Is there a bug in the code above? | Yes |
620 | [
"#NEWLINE#",
"def _update(",
"self",
",",
"what",
",",
"msgcount",
",",
"cur",
",",
"val",
")",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"(",
"what",
"==",
"'max'",
")",
":",
"#NEWLINE#",
"#INDENT#",
"return",
"max",
"(",
"[",
"cur",
",",
"val",
"]",
")",
... | true | 65 | [
"4",
"17",
"41",
"78",
"6",
"65",
"95",
"8",
"28",
"50",
"88",
"105",
"2",
"10",
"30",
"58",
"67",
"90"
] | 1 | VARIABLE_MISUSE | [
8,
28,
50,
88,
105
] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 15,
"after_index": 18,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 18,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "selfsk/nodeset.core/benchmark/common.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 _update(self, what, msgcount, cur, val) :
if (what == 'max') :
return max ([cur, val])
else :
if (what == 'min') :
if (cur == 0.0) :
return val
return min ([msgcount, val])
else :
if (what == 'avg') :
return ((cur + val) / float (msgcount))
else :
return cur
Is there a bug in the code above? | Yes |
621 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"transferable",
",",
"dropTargetDetails",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"_transferable",
"=",
"transferable",
"#NEWLINE#",
"self",
".",
"_dropTargetDetails",
"=",
"dropTargetDetails"
] | false | 0 | [
"6",
"21",
"dropTargetDetails",
"4",
"15",
"transferable",
"2",
"11",
"17",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 15,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 16,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "rwl/muntjac/muntjac/event/dd/drag_and_drop_event.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, transferable, dropTargetDetails) :
self._transferable = transferable
self._dropTargetDetails = dropTargetDetails
Is there a bug in the code above? | No |
622 | [
"#NEWLINE#",
"@",
"staticmethod",
"#NEWLINE#",
"def select_by_user(",
"user",
")",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"user",
".",
"is_admin",
":",
"#NEWLINE#",
"#INDENT#",
"qs",
"=",
"User",
".",
"objects",
".",
"all",
"(",
")",
"#NEWLINE#",
"#UNINDENT#",
"e... | false | 0 | [
"50",
"88",
"126",
"sites",
"17",
"113",
"140",
"qs",
"53",
"57",
"62",
"95",
"101",
"sp",
"91",
"133",
"user_ids",
"37",
"59",
"78",
"103",
"site_privs",
"5",
"11",
"45",
"47",
"97",
"107",
"user"
] | 0 | NONE | [] | [
[
{
"before_index": 10,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 139,
"after_index": 140,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "open-cloud/xos/xos/core/models/user.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 select_by_user(user) :
if user.is_admin :
qs = User.objects.all ()
else :
from core.models.site import SitePrivilege
site_privs = SitePrivilege.objects.filter (user = user)
sites = [sp.site for sp in site_privs if (sp.role.role in ['Admin', 'admin', 'pi'])]
site_privs = SitePrivilege.objects.filter (site__in = sites)
user_ids = ([sp.user.id for sp in site_privs] + [user.id])
qs = User.objects.filter ((Q (site__in = sites) | Q (id__in = user_ids)))
return qs
Is there a bug in the code above? | No |
623 | [
"#NEWLINE#",
"def set_rows(",
"self",
",",
"rows",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"_rows",
"=",
"[",
"]",
"#NEWLINE#",
"self",
".",
"add_rows",
"(",
"rows",
")",
"#NEWLINE#",
"return",
"self"
] | false | 0 | [
"4",
"20",
"rows",
"2",
"9",
"16",
"24",
"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": 15,
"after_index": 19... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "sdispater/cleo/cleo/helpers/table.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def set_rows(self, rows) :
self._rows = []
self.add_rows (rows)
return self
Is there a bug in the code above? | No |
624 | [
"#NEWLINE#",
"@",
"utils",
".",
"synchronized",
"(",
"'resource_allocator'",
",",
"external",
"=",
"True",
",",
"lock_path",
"=",
"'/tmp'",
")",
"#NEWLINE#",
"def allocate(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"allocations",
"=",
"self",
".",
"_get_alloc... | false | 0 | [
"23",
"59",
"64",
"75",
"90",
"109",
"allocations",
"41",
"57",
"68",
"84",
"94",
"resource",
"32",
"i",
"18",
"25",
"45",
"53",
"71",
"86",
"105",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 22,
"after_index": 28,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 31,
"after_index": 32,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 31,
"after_index":... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "openstack/neutron/neutron/tests/common/exclusive_resources/resource_allocator.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | @ utils.synchronized ('resource_allocator', external = True, lock_path = '/tmp')
def allocate(self) :
allocations = self._get_allocations ()
for i in range (MAX_ATTEMPTS) :
resource = str (self._allocator_function ())
if self._validator (resource, allocations) :
allocations.add (resource)
self._write_allocations (allocations)
LOG.debug ('Allocated exclusive resource %s of type %s. The allocations are now: %s', resource, self._resource_name, allocations)
return resource
raise ValueError (('Could not allocate a new resource of type %s from pool %s' % (self._resource_name, allocations)))
Is there a bug in the code above? | No |
625 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"bundle",
",",
"name",
",",
"path",
",",
"config",
"=",
"{",
"#NEWLINE#",
"#INDENT#",
"#NEWLINE#",
"#UNINDENT#",
"}",
",",
"help",
"=",
"{",
"#NEWLINE#",
"#INDENT#",
"#NEWLINE#",
"#UNINDENT#",
"}",
")",
":",
"#NEWLI... | false | 0 | [
"2",
"31",
"37",
"43",
"52",
"58",
"self",
"4",
"33",
"35",
"bundle",
"19",
"60",
"62",
"help",
"10",
"54",
"56",
"config",
"6",
"39",
"41",
"name",
"8",
"45",
"49",
"path"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 30,
"after_index": 35,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 36,
"after_index": 4... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "robmadole/jig/src/jig/plugins/manager.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, bundle, name, path, config = {
}, help = {
}) :
self.bundle = bundle
self.name = name
self.path = realpath (path)
self.config = config
self.help = help
Is there a bug in the code above? | No |
626 | [
"#NEWLINE#",
"def name_to_docid(",
"self",
",",
"name",
")",
":",
"#NEWLINE#",
"#INDENT#",
"return",
"self",
".",
"_name_to_docid_map",
"[",
"name",
"]"
] | false | 0 | [
"4",
"14",
"name",
"2",
"10",
"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": "taherh/pysimsearch/pysimsearch/sim_index/map_sim_index.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 name_to_docid(self, name) :
return self._name_to_docid_map [name]
Is there a bug in the code above? | No |
627 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"source",
",",
"on_error",
")",
":",
"#NEWLINE#",
"#INDENT#",
"super",
"(",
"JoinObserver",
",",
"self",
")",
".",
"__init__",
"(",
"on_next",
"=",
"self",
".",
"_next",
")",
"#NEWLINE#",
"self",
".",
"source",
"=... | false | 0 | [
"6",
"35",
"37",
"on_error",
"4",
"29",
"31",
"source",
"2",
"15",
"22",
"27",
"33",
"39",
"46",
"53",
"61",
"self"
] | 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": 26,
"after_index": 3... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "ReactiveX/RxPY/rx/joins/joinobserver.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, source, on_error) :
super (JoinObserver, self).__init__ (on_next = self._next)
self.source = source
self.on_error = on_error
self.queue = []
self.active_plans = []
self.subscription = SingleAssignmentDisposable ()
self.is_disposed = False
Is there a bug in the code above? | No |
628 | [
"#NEWLINE#",
"def to_dict(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"workload",
"=",
"{",
"#NEWLINE#",
"#INDENT#",
"'runner'",
":",
"self",
".",
"runner",
",",
"#NEWLINE#",
"#UNINDENT#",
"}",
"#NEWLINE#",
"for",
"prop",
"in",
"(",
"'sla'",
",",
"'args'",
... | false | 0 | [
"7",
"49",
"59",
"workload",
"23",
"41",
"51",
"prop",
"35",
"45",
"54",
"value",
"2",
"14",
"39",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 9,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 22,
"after_index": 23,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 22,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "openstack/rally/rally/task/engine.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 to_dict(self) :
workload = {
'runner' : self.runner,
}
for prop in ('sla', 'args', 'context') :
value = getattr (self, prop)
if value :
workload [prop] = value
return workload
Is there a bug in the code above? | No |
629 | [
"#NEWLINE#",
"def test_append_no_reorder(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"_setup",
"(",
"ordering_list",
"(",
"'position'",
",",
"count_from",
"=",
"1",
",",
"reorder_on_append",
"=",
"False",
")",
")",
"#NEWLINE#",
"s1",
"=",
"Slide",... | false | 0 | [
"453",
"471",
"483",
"513",
"srt",
"179",
"186",
"198",
"bul",
"504",
"525",
"found",
"25",
"38",
"51",
"60",
"76",
"88",
"102",
"115",
"134",
"148",
"166",
"192",
"206",
"224",
"242",
"255",
"272",
"290",
"308",
"326",
"339",
"352",
"370",
"388"... | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 10,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 24,
"after_index": 28,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 31,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "zzzeek/sqlalchemy/test/ext/test_orderinglist.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_append_no_reorder(self) :
self._setup (ordering_list ('position', count_from = 1, reorder_on_append = False))
s1 = Slide ('Slide #1')
self.assert_ ((not s1.bullets))
self.assert_ ((len (s1.bullets) == 0))
s1.bullets.append (Bullet ('s1/b1'))
self.assert_ (s1.bullets)
self.assert_ ((len (s1.bullets) == 1))
self.assert_ ((s1.bullets [0].position == 1))
s1.bullets.append (Bullet ('s1/b2'))
self.assert_ ((len (s1.bullets) == 2))
self.assert_ ((s1.bullets [0].position == 1))
self.assert_ ((s1.bullets [1].position == 2))
bul = Bullet ('s1/b100')
bul.position = 100
s1.bullets.append (bul)
self.assert_ ((s1.bullets [0].position == 1))
self.assert_ ((s1.bullets [1].position == 2))
self.assert_ ((s1.bullets [2].position == 100))
s1.bullets.append (Bullet ('s1/b4'))
self.assert_ ((s1.bullets [0].position == 1))
self.assert_ ((s1.bullets [1].position == 2))
self.assert_ ((s1.bullets [2].position == 100))
self.assert_ ((s1.bullets [3].position == 4))
s1.bullets._reorder ()
self.assert_ ((s1.bullets [0].position == 1))
self.assert_ ((s1.bullets [1].position == 2))
self.assert_ ((s1.bullets [2].position == 3))
self.assert_ ((s1.bullets [3].position == 4))
session = create_session ()
session.add (s1)
session.flush ()
id = s1.id
session.expunge_all ()
del s1
srt = session.query (Slide).get (id)
self.assert_ (srt.bullets)
self.assert_ ((len (srt.bullets) == 4))
titles = ['s1/b1', 's1/b2', 's1/b100', 's1/b4']
found = [b.text for b in srt.bullets]
self.assert_ ((titles == found))
Is there a bug in the code above? | No |
630 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"uri",
",",
"timeout",
"=",
"10",
",",
"*",
"args",
",",
"**kwargs",
")",
":",
"#NEWLINE#",
"#INDENT#",
"kwargs",
"[",
"'transport'",
"]",
"=",
"TimeoutTransport",
"(",
"timeout",
"=",
"timeout",
",",
"use_datetime"... | false | 0 | [
"11",
"52",
"args",
"18",
"31",
"55",
"kwargs",
"6",
"25",
"27",
"timeout",
"4",
"49",
"uri",
"2",
"47",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 3,
"after_index": 11,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 17,
"after_index": 28... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "QingdaoU/OnlineJudge/judge_dispatcher/rpc_client.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 __init__(self, uri, timeout = 10, * args, **kwargs) :
kwargs ['transport'] = TimeoutTransport (timeout = timeout, use_datetime = kwargs.get ('use_datetime', 0))
xmlrpclib.ServerProxy.__init__ (self, uri, * args, ** kwargs)
Is there a bug in the code above? | No |
631 | [
"#NEWLINE#",
"def test_get_alias(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"parsed_post_response_body",
"=",
"self",
".",
"add_alias",
"(",
")",
"#NEWLINE#",
"get_response",
"=",
"self",
".",
"get",
"(",
"parsed_post_response_body",
"[",
"'self'",
"]",
")",
"#... | false | 0 | [
"15",
"33",
"44",
"get_response",
"38",
"55",
"parsed_get_response_body",
"7",
"21",
"53",
"parsed_post_response_body",
"2",
"9",
"17",
"27",
"49",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 20,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 26,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "wrr/wwwhisper/wwwhisper_admin/tests/tests_views.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_get_alias(self) :
parsed_post_response_body = self.add_alias ()
get_response = self.get (parsed_post_response_body ['self'])
self.assertEqual (200, get_response.status_code)
parsed_get_response_body = json.loads (get_response.content)
self.assertEqual (parsed_post_response_body, parsed_get_response_body)
Is there a bug in the code above? | No |
632 | [
"#NEWLINE#",
"def test_unsupported_grant_type(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"validator",
".",
"authenticate_client",
".",
"side_effect",
"=",
"self",
".",
"set_client",
"#NEWLINE#",
"(",
"_",
",",
"body",
",",
"_",
")",
"=",
"self",
... | false | 0 | [
"22",
"35",
"50",
"60",
"73",
"88",
"98",
"111",
"126",
"body",
"20",
"24",
"58",
"62",
"96",
"100",
"_",
"2",
"7",
"15",
"27",
"40",
"65",
"78",
"103",
"116",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 16,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 18,
"after_index": 34,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 39,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "idan/oauthlib/tests/oauth2/rfc6749/endpoints/test_error_responses.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_unsupported_grant_type(self) :
self.validator.authenticate_client.side_effect = self.set_client
(_, body, _) = self.web.create_token_response ('https://i.b/token', body = 'grant_type=bar&code=foo')
self.assertEqual ('unsupported_grant_type', json.loads (body) ['error'])
(_, body, _) = self.legacy.create_token_response ('https://i.b/token', body = 'grant_type=bar&username=foo&password=bar')
self.assertEqual ('unsupported_grant_type', json.loads (body) ['error'])
(_, body, _) = self.backend.create_token_response ('https://i.b/token', body = 'grant_type=bar')
self.assertEqual ('unsupported_grant_type', json.loads (body) ['error'])
Is there a bug in the code above? | No |
633 | [
"#NEWLINE#",
"@",
"reconnect",
"#NEWLINE#",
"def volume(",
"self",
",",
"level",
"=",
"None",
",",
"interval",
"=",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"level",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"client",
".",
"setvol",
"(",
"int",
"(... | false | 0 | [
"5",
"23",
"48",
"66",
"self",
"11",
"39",
"62",
"interval",
"7",
"19",
"31",
"43",
"74",
"level"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 6,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 18,
"after_index": 19,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 38,
"after_index": 3... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "jasperproject/jasper-client/client/modules/MPDControl.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] }} | @ reconnect
def volume(self, level = None, interval = None) :
if level :
self.client.setvol (int (level))
return
if interval :
level = (int (self.client.status () ['volume']) + int (interval))
self.client.setvol (int (level))
return
Is there a bug in the code above? | No |
634 | [
"#NEWLINE#",
"def _get(",
"self",
",",
"blockid",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Return a block for a blockid. Internal use only.'",
"#NEWLINE#",
"cursor",
"=",
"self",
".",
"_cursor",
"(",
")",
"#NEWLINE#",
"cursor",
".",
"execute",
"(",
"(",
"self",
".",
"... | false | 0 | [
"2",
"13",
"24",
"53",
"self",
"11",
"19",
"39",
"cursor",
"37",
"46",
"55",
"row",
"4",
"32",
"blockid"
] | 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": "ricmoo/pycoind/pycoind/blockchain/block.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def _get(self, blockid) :
'Return a block for a blockid. Internal use only.'
cursor = self._cursor ()
cursor.execute ((self.sql_select + ' where id = ?'), (blockid,))
row = cursor.fetchone ()
if row :
return Block (self, row)
return None
Is there a bug in the code above? | No |
635 | [
"#NEWLINE#",
"def testForgetOne(",
"self",
",",
"tasks",
",",
"depfile_name",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"_add_task_deps",
"(",
"tasks",
",",
"depfile_name",
")",
"#NEWLINE#",
"output",
"=",
"StringIO",
"(",
")",
"#NEWLINE#",
"cmd_forget",
"... | false | 0 | [
"6",
"17",
"38",
"101",
"depfile_name",
"20",
"34",
"66",
"output",
"2",
"11",
"self",
"26",
"57",
"cmd_forget",
"4",
"15",
"46",
"tasks",
"95",
"108",
"122",
"136",
"dep",
"64",
"92",
"got"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 16,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 19,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "pydoit/doit/tests/test_cmd_forget.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 testForgetOne(self, tasks, depfile_name) :
self._add_task_deps (tasks, depfile_name)
output = StringIO ()
cmd_forget = CmdFactory (Forget, outstream = output, dep_file = depfile_name, backend = 'dbm', task_list = tasks, sel_tasks = ['t2', 't1'])
cmd_forget._execute (False)
got = output.getvalue ().split ('
') [: (- 1)]
assert (['forgetting t2', 'forgetting t1'] == got)
dep = Dependency (DbmDB, depfile_name)
assert (None == dep._get ('t1', 'dep'))
assert (None == dep._get ('t2', 'dep'))
assert ('1' == dep._get ('g1.a', 'dep'))
Is there a bug in the code above? | No |
636 | [
"#NEWLINE#",
"def _ensure_errback(",
"exc",
",",
"interval",
")",
":",
"#NEWLINE#",
"#INDENT#",
"logger",
".",
"error",
"(",
"'Connection error: %r. Retry in %ss\\n'",
",",
"exc",
",",
"interval",
",",
"exc_info",
"=",
"True",
")"
] | false | 0 | [
"2",
"15",
"exc",
"4",
"17",
"interval"
] | 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": 14,
"after_index": 10... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "celery/kombu/kombu/common.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 _ensure_errback(exc, interval) :
logger.error ('Connection error: %r. Retry in %ss
', exc, interval, exc_info = True)
Is there a bug in the code above? | No |
637 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"seconds",
",",
"limit",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"last_time",
"=",
"(",
"time",
".",
"time",
"(",
")",
"-",
"seconds",
")",
"#NEWLINE#",
"self",
".",
"queue",
"=",
"[",
"]",
"#NEWLINE#",
... | false | 0 | [
"6",
"46",
"48",
"limit",
"4",
"22",
"40",
"42",
"seconds",
"2",
"11",
"25",
"32",
"38",
"44",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 21,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 24,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "accerqueira/sublime-test-runner/test_runner/decorators.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, seconds, limit) :
self.last_time = (time.time () - seconds)
self.queue = []
self.processing_queue = False
self.seconds = seconds
self.limit = limit
Is there a bug in the code above? | No |
638 | [
"#NEWLINE#",
"def test_basic_morph_many_relationship(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"user",
"=",
"OratorTestUser",
".",
"create",
"(",
"email",
"=",
"'john@doe.com'",
")",
"#NEWLINE#",
"user",
".",
"photos",
"(",
")",
".",
"create",
"(",
"name",
"... | false | 0 | [
"7",
"18",
"31",
"46",
"89",
"100",
"143",
"169",
"185",
"user",
"20",
"33",
"61",
"74",
"91",
"102",
"116",
"127",
"145",
"159",
"171",
"187",
"203",
"219",
"227",
"244",
"257",
"265",
"279",
"295",
"311",
"photos",
"44",
"59",
"72",
"114",
"1... | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 17,
"after_index": 25,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 30,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "sdispater/orator/tests/integrations/__init__.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_basic_morph_many_relationship(self) :
user = OratorTestUser.create (email = 'john@doe.com')
user.photos ().create (name = 'Avatar 1')
user.photos ().create (name = 'Avatar 2')
post = user.posts ().create (name = 'First Post')
post.photos ().create (name = 'Hero 1')
post.photos ().create (name = 'Hero 2')
self.assertIsInstance (user.photos, Collection)
self.assertIsInstance (user.photos [0], OratorTestPhoto)
self.assertIsInstance (post.photos, Collection)
self.assertIsInstance (post.photos [0], OratorTestPhoto)
self.assertEqual (2, len (user.photos))
self.assertEqual (2, len (post.photos))
self.assertEqual ('Avatar 1', user.photos [0].name)
self.assertEqual ('Avatar 2', user.photos [1].name)
self.assertEqual ('Hero 1', post.photos [0].name)
self.assertEqual ('Hero 2', post.photos [1].name)
photos = OratorTestPhoto.order_by ('name').get ()
self.assertIsInstance (photos, Collection)
self.assertEqual (4, len (photos))
self.assertIsInstance (photos [0].imageable, OratorTestUser)
self.assertIsInstance (photos [2].imageable, OratorTestPost)
self.assertEqual ('john@doe.com', photos [1].imageable.email)
self.assertEqual ('First Post', photos [3].imageable.name)
Is there a bug in the code above? | No |
639 | [
"#NEWLINE#",
"def test_belongs_to_morph_many_eagerload(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"user",
"=",
"OratorTestUser",
".",
"create",
"(",
"id",
"=",
"1",
",",
"email",
"=",
"'john@doe.com'",
")",
"#NEWLINE#",
"user",
".",
"photos",
"(",
")",
".",
... | false | 0 | [
"7",
"22",
"35",
"50",
"113",
"122",
"131",
"user",
"52",
"89",
"108",
"126",
"146",
"160",
"posts",
"48",
"63",
"76",
"post",
"2",
"104",
"118",
"142",
"156",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 16,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 21,
"after_index": 29,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 34,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "sdispater/orator/tests/integrations/__init__.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_belongs_to_morph_many_eagerload(self) :
user = OratorTestUser.create (id = 1, email = 'john@doe.com')
user.photos ().create (name = 'Avatar 1')
user.photos ().create (name = 'Avatar 2')
post = user.posts ().create (name = 'First Post')
post.photos ().create (name = 'Hero 1')
post.photos ().create (name = 'Hero 2')
posts = OratorTestPost.with_ ('user', 'photos').get ()
self.assertIsInstance (posts [0].user, OratorTestUser)
self.assertEqual (user.id, posts [0].user ().first ().id)
self.assertIsInstance (posts [0].photos, Collection)
self.assertEqual (posts [0].photos ().where ('name', 'Hero 2').first ().name, 'Hero 2')
Is there a bug in the code above? | No |
640 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"stream",
",",
"override_appveyor",
"=",
"False",
",",
"disable_windows",
"=",
"False",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"stream",
"=",
"stream",
"#NEWLINE#",
"on_windows",
"=",
"(",
"platform",
".",
"s... | false | 0 | [
"10",
"64",
"disable_windows",
"4",
"19",
"21",
"73",
"79",
"stream",
"2",
"17",
"71",
"77",
"91",
"self",
"35",
"58",
"on_appveyor",
"23",
"54",
"on_windows",
"6",
"50",
"override_appveyor"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 16,
"after_index": 21,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 22,
"after_index": 3... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "CleanCut/green/green/output.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, stream, override_appveyor = False, disable_windows = False) :
self.stream = stream
on_windows = (platform.system () == 'Windows')
on_appveyor = os.environ.get ('APPVEYOR', False)
if (override_appveyor or ((on_windows and (not on_appveyor)) and (not disable_windows))) :
self.stream = wrap_stream (self.stream, None, None, None, True)
self.closed = False
Is there a bug in the code above? | No |
641 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"delta",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"delta",
"=",
"delta",
"#NEWLINE#",
"super",
"(",
"PaymentRequiredError",
",",
"self",
")",
".",
"__init__",
"(",
"(",
"'%d more units required.'",
"%",
"delta",
... | false | 0 | [
"4",
"11",
"13",
"27",
"delta",
"2",
"9",
"19",
"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": 23... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "chrisseto/dinosaurs.sexy/dinosaurs/exceptions.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, delta) :
self.delta = delta
super (PaymentRequiredError, self).__init__ (('%d more units required.' % delta))
Is there a bug in the code above? | No |
642 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"address",
",",
"time_left",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"time_left",
"=",
"time_left",
"#NEWLINE#",
"self",
".",
"email",
"=",
"address",
"#NEWLINE#",
"super",
"(",
"AddressReserved",
",",
"self",
... | false | 0 | [
"6",
"13",
"15",
"38",
"time_left",
"2",
"11",
"17",
"27",
"self",
"4",
"21",
"36",
"address"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 15,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 16,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "chrisseto/dinosaurs.sexy/dinosaurs/exceptions.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, address, time_left) :
self.time_left = time_left
self.email = address
super (AddressReserved, self).__init__ (('Address %s is unavailable for %d more seconds' % (address, time_left)))
Is there a bug in the code above? | No |
643 | [
"#NEWLINE#",
"def ListChildren(",
"self",
",",
"urn",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Lists children of a given urn. Resulting list is cached.'",
"#NEWLINE#",
"result",
"=",
"self",
".",
"MultiListChildren",
"(",
"[",
"urn",
"]",
")",
"#NEWLINE#",
"try",
":",
"#N... | false | 0 | [
"2",
"13",
"self",
"4",
"18",
"29",
"urn",
"11",
"27",
"result"
] | 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/aff4.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 ListChildren(self, urn) :
'Lists children of a given urn. Resulting list is cached.'
result = self.MultiListChildren ([urn])
try :
return result [urn]
except KeyError :
return []
Is there a bug in the code above? | No |
644 | [
"#NEWLINE#",
"def test_3d_rotation_inverse_eye(",
")",
":",
"#NEWLINE#",
"#INDENT#",
"a",
"=",
"(",
"np",
".",
"sqrt",
"(",
"3.0",
")",
"/",
"2.0",
")",
"#NEWLINE#",
"b",
"=",
"0.5",
"#NEWLINE#",
"rotation_matrix",
"=",
"np",
".",
"array",
"(",
"[",
"[",
... | false | 0 | [
"19",
"43",
"51",
"b",
"23",
"63",
"rotation_matrix",
"59",
"68",
"72",
"rotation",
"6",
"41",
"54",
"a",
"66",
"88",
"transformed"
] | 0 | NONE | [] | [
[
{
"before_index": 5,
"after_index": 15,
"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": "menpo/menpo/menpo/transform/test/homogeneous_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_3d_rotation_inverse_eye() :
a = (np.sqrt (3.0) / 2.0)
b = 0.5
rotation_matrix = np.array ([[1, 0, 0], [0, a, b], [0, (- b), a]])
rotation = Rotation (rotation_matrix)
transformed = rotation.compose_before (rotation.pseudoinverse ())
assert_allclose (np.eye (4), transformed.h_matrix, atol = 1e-15)
Is there a bug in the code above? | No |
645 | [
"#NEWLINE#",
"def test_getVersionOther(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n Test that getting the version of a non-core project reads from\\n the [base]/[projname]/_version.py file.\\n '",
"#NEWLINE#",
"os",
".",
"mkdir",
"(",
"os",
".",
"path",
".... | false | 0 | [
"27",
"49",
"56",
"f",
"2",
"19",
"37",
"62",
"74",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 26,
"after_index": 45... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "kuri65536/python-for-android/python-modules/twisted/twisted/python/test/test_dist.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_getVersionOther(self) :
'
Test that getting the version of a non-core project reads from
the [base]/[projname]/_version.py file.
'
os.mkdir (os.path.join (self.dirname, 'blat'))
f = open (os.path.join (self.dirname, 'blat', '_version.py'), 'w')
f.write ('
from twisted.python import versions
version = versions.Version("twisted.blat", 9, 8, 10)
')
f.close ()
self.assertEquals (dist.getVersion ('blat', base = self.dirname), '9.8.10')
Is there a bug in the code above? | No |
646 | [
"#NEWLINE#",
"@",
"ignore_warnings",
"#NEWLINE#",
"def test_nmf_inverse_transform(",
")",
":",
"#NEWLINE#",
"#INDENT#",
"random_state",
"=",
"np",
".",
"random",
".",
"RandomState",
"(",
"0",
")",
"#NEWLINE#",
"A",
"=",
"np",
".",
"abs",
"(",
"random_state",
"."... | false | 0 | [
"77",
"92",
"t",
"68",
"ft",
"9",
"26",
"63",
"random_state",
"20",
"74",
"83",
"97",
"A",
"86",
"99",
"A_new",
"37",
"51",
"53",
"solver",
"47",
"70",
"79",
"88",
"m"
] | 0 | NONE | [] | [
[
{
"before_index": 8,
"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": 36,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "scikit-learn/scikit-learn/sklearn/decomposition/tests/test_nmf.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] }} | @ ignore_warnings
def test_nmf_inverse_transform() :
random_state = np.random.RandomState (0)
A = np.abs (random_state.randn (6, 4))
for solver in ('pg', 'cd') :
m = NMF (solver = solver, n_components = 4, init = 'random', random_state = 0)
ft = m.fit_transform (A)
t = m.transform (A)
A_new = m.inverse_transform (t)
assert_array_almost_equal (A, A_new, decimal = 2)
Is there a bug in the code above? | No |
647 | [
"#NEWLINE#",
"def _invalidate_get_event_cache(",
"self",
",",
"event_id",
")",
":",
"#NEWLINE#",
"#INDENT#",
"for",
"check_redacted",
"in",
"(",
"False",
",",
"True",
")",
":",
"#NEWLINE#",
"#INDENT#",
"for",
"get_prev_content",
"in",
"(",
"False",
",",
"True",
... | false | 0 | [
"21",
"42",
"get_prev_content",
"4",
"38",
"event_id",
"2",
"31",
"self",
"10",
"40",
"check_redacted"
] | 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": 14,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "matrix-org/synapse/synapse/storage/events.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 _invalidate_get_event_cache(self, event_id) :
for check_redacted in (False, True) :
for get_prev_content in (False, True) :
self._get_event_cache.invalidate ((event_id, check_redacted, get_prev_content))
Is there a bug in the code above? | No |
648 | [
"#NEWLINE#",
"def scalar_div(",
"self",
",",
"scalar",
")",
":",
"#NEWLINE#",
"#INDENT#",
"v",
"=",
"self",
".",
"_v",
"#NEWLINE#",
"v",
"[",
"0",
"]",
"/=",
"scalar",
"#NEWLINE#",
"v",
"[",
"1",
"]",
"/=",
"scalar",
"#NEWLINE#",
"v",
"[",
"2",
"]",
... | false | 0 | [
"9",
"15",
"22",
"29",
"v",
"4",
"20",
"27",
"34",
"scalar",
"2",
"11",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 16... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "PythonProgramming/Beginning-Game-Development-with-Python-and-Pygame/Chapter 10/gameobjects/vector3.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 scalar_div(self, scalar) :
v = self._v
v [0] /= scalar
v [1] /= scalar
v [2] /= scalar
Is there a bug in the code above? | No |
649 | [
"#NEWLINE#",
"def test_as_context_mgr_nested(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"_PROJECT",
"=",
"'PROJECT'",
"#NEWLINE#",
"_PROPERTIES",
"=",
"{",
"#NEWLINE#",
"#INDENT#",
"'foo'",
":",
"'bar'",
",",
"#NEWLINE#",
"#UNINDENT#",
"}",
"#NEWLINE#",
"connection... | false | 0 | [
"2",
"75",
"91",
"102",
"126",
"137",
"163",
"180",
"199",
"208",
"225",
"234",
"247",
"self",
"195",
"212",
"mutated_entity1",
"30",
"39",
"122",
"entity1",
"66",
"81",
"95",
"108",
"130",
"143",
"169",
"186",
"client",
"7",
"45",
"63",
"70",
"257... | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 9,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 13,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 23,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "GoogleCloudPlatform/gcloud-python/gcloud/datastore/test_batch.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_as_context_mgr_nested(self) :
_PROJECT = 'PROJECT'
_PROPERTIES = {
'foo' : 'bar',
}
connection = _Connection ()
entity1 = _Entity (_PROPERTIES)
key1 = entity1.key = _Key (_PROJECT)
entity2 = _Entity (_PROPERTIES)
key2 = entity2.key = _Key (_PROJECT)
client = _Client (_PROJECT, connection)
self.assertEqual (list (client._batches), [])
with self._makeOne (client) as batch1 :
self.assertEqual (list (client._batches), [batch1])
batch1.put (entity1)
with self._makeOne (client) as batch2 :
self.assertEqual (list (client._batches), [batch2, batch1])
batch2.put (entity2)
self.assertEqual (list (client._batches), [batch1])
self.assertEqual (list (client._batches), [])
mutated_entity1 = _mutated_pb (self, batch1.mutations, 'upsert')
self.assertEqual (mutated_entity1.key, key1._key)
mutated_entity2 = _mutated_pb (self, batch2.mutations, 'upsert')
self.assertEqual (mutated_entity2.key, key2._key)
self.assertEqual (connection._committed, [(_PROJECT, batch2._commit_request, None), (_PROJECT, batch1._commit_request, None)])
Is there a bug in the code above? | No |
650 | [
"#NEWLINE#",
"@",
"run_with_all_backends",
"#NEWLINE#",
"def test_full_delete(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"test_loc",
"=",
"make_loc",
"(",
"'test_loc'",
",",
"type",
"=",
"'state'",
",",
"parent",
"=",
"self",
".",
"user",
".",
"location",
")"... | false | 0 | [
"5",
"22",
"45",
"56",
"68",
"80",
"96",
"106",
"117",
"self",
"35",
"90",
"original_count",
"54",
"62",
"loc",
"10",
"29",
"test_loc"
] | 0 | NONE | [] | [
[
{
"before_index": 9,
"after_index": 15,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 28,
"after_index": 32,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 34,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "dimagi/commcare-hq/corehq/apps/commtrack/tests/test_locations.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] }} | @ run_with_all_backends
def test_full_delete(self) :
test_loc = make_loc ('test_loc', type = 'state', parent = self.user.location)
test_loc.save ()
original_count = len (list (Location.by_domain (self.domain.name)))
loc = self.user.location
loc.full_delete ()
self.assertEqual (len (list (Location.by_domain (self.domain.name))), (original_count - 2))
self.assertEqual (len (Location.root_locations (self.domain.name)), 0)
self.assertEqual (len (SQLLocation.objects.all ()), 0)
Is there a bug in the code above? | No |
651 | [
"#NEWLINE#",
"def test_resid(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"l",
"=",
"(",
"len",
"(",
"self",
".",
"res1",
".",
"resid_response",
")",
"-",
"1",
")",
"#NEWLINE#",
"l2",
"=",
"(",
"len",
"(",
"self",
".",
"res2",
".",
"resid_response",
"... | false | 0 | [
"22",
"89",
"156",
"223",
"307",
"l2",
"2",
"12",
"27",
"44",
"55",
"72",
"83",
"111",
"122",
"139",
"150",
"178",
"189",
"206",
"217",
"243",
"262",
"273",
"290",
"301",
"self",
"7",
"61",
"128",
"195",
"279",
"l"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 18,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 21,
"after_index": 33,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 36,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "statsmodels/statsmodels/statsmodels/genmod/tests/test_glm.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_resid(self) :
l = (len (self.res1.resid_response) - 1)
l2 = (len (self.res2.resid_response) - 1)
assert_allclose (np.concatenate ((self.res1.resid_response [: 17], [self.res1.resid_response [l]])), np.concatenate ((self.res2.resid_response [: 17], [self.res2.resid_response [l2]])), rtol = 1e-05, atol = 1e-05)
assert_allclose (np.concatenate ((self.res1.resid_pearson [: 17], [self.res1.resid_pearson [l]])), np.concatenate ((self.res2.resid_pearson [: 17], [self.res2.resid_pearson [l2]])), rtol = 1e-05, atol = 1e-05)
assert_allclose (np.concatenate ((self.res1.resid_deviance [: 17], [self.res1.resid_deviance [l]])), np.concatenate ((self.res2.resid_deviance [: 17], [self.res2.resid_deviance [l2]])), rtol = 1e-05, atol = 1e-05)
if (not isinstance (self, (TestTweedieLog1, TestTweedieLog15Fair))) :
assert_allclose (np.concatenate ((self.res1.resid_working [: 17], [self.res1.resid_working [l]])), np.concatenate ((self.res2.resid_working [: 17], [self.res2.resid_working [l2]])), rtol = 1e-05, atol = 1e-05)
Is there a bug in the code above? | No |
652 | [
"#NEWLINE#",
"def _create_rtmp_stream(",
"self",
",",
"rtmp",
",",
"playpath",
",",
"live",
")",
":",
"#NEWLINE#",
"#INDENT#",
"return",
"RTMPStream",
"(",
"self",
".",
"session",
",",
"{",
"#NEWLINE#",
"#INDENT#",
"'rtmp'",
":",
"rtmp",
",",
"#NEWLINE#",
"'pl... | false | 0 | [
"8",
"47",
"live",
"4",
"25",
"rtmp",
"2",
"16",
"35",
"self",
"6",
"30",
"playpath"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 13,
"after_index": 19,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 19,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "chrippa/livestreamer/src/livestreamer/plugins/gaminglive.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 _create_rtmp_stream(self, rtmp, playpath, live) :
return RTMPStream (self.session, {
'rtmp' : rtmp,
'playpath' : playpath,
'pageUrl' : self.url,
'swfVfy' : SWF_URL,
'live' : live,
})
Is there a bug in the code above? | No |
653 | [
"#NEWLINE#",
"def remove(",
"self",
",",
"irc",
",",
"msg",
",",
"args",
",",
"channel",
",",
"numbers",
")",
":",
"#NEWLINE#",
"#INDENT#",
"\"[<channel>] <number1> [<number2> <number3>...]\\n\\n Removes topics <numbers> from the topic for <channel> Topics are\\n num... | false | 0 | [
"2",
"19",
"32",
"86",
"self",
"6",
"25",
"msg",
"56",
"64",
"n",
"4",
"23",
"36",
"90",
"irc",
"12",
"48",
"52",
"58",
"numbers",
"30",
"62",
"70",
"77",
"94",
"topics",
"73",
"75",
"80",
"topic",
"8",
"args",
"10",
"27",
"42",
"45",
"92",
... | 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/Topic/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 remove(self, irc, msg, args, channel, numbers) :
"[<channel>] <number1> [<number2> <number3>...]
Removes topics <numbers> from the topic for <channel> Topics are
numbered starting from 1; you can also use negative indexes to refer
to topics starting the from the end of the topic. <channel> is only
necessary if the message isn't sent in the channel itself.
"
self._checkManageCapabilities (irc, msg, channel)
topics = self._splitTopic (irc.state.getTopic (channel), channel)
numbers = set (numbers)
for n in numbers :
topics [n] = ''
topics = [topic for topic in topics if (topic != '')]
self._sendTopics (irc, channel, topics)
Is there a bug in the code above? | No |
654 | [
"#NEWLINE#",
"def test_split_ret_type(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"(",
"train_idx",
",",
"val_idx",
")",
"=",
"du",
".",
"get_train_val_split_from_names",
"(",
"[",
"'a'",
",",
"'b'",
",",
"'c'",
"]",
",",
"[",
"'b'",
"]",
")",
"#NEWLINE#",... | false | 0 | [
"8",
"32",
"37",
"train_idx",
"10",
"44",
"49",
"val_idx",
"2",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 24,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 29,
"after_index": 31,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 34,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "kashefy/nideep/nideep/datasets/test_dataset_utils.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_split_ret_type(self) :
(train_idx, val_idx) = du.get_train_val_split_from_names (['a', 'b', 'c'], ['b'])
assert_is_not_none (train_idx)
assert_is_instance (train_idx, list)
assert_is_not_none (val_idx)
assert_is_instance (val_idx, list)
Is there a bug in the code above? | No |
655 | [
"#NEWLINE#",
"def do_execute_no_params(",
"self",
",",
"cursor",
",",
"statement",
",",
"context",
"=",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"cursor",
".",
"execute",
"(",
"statement",
")"
] | false | 0 | [
"4",
"15",
"cursor",
"2",
"self",
"6",
"19",
"statement",
"8",
"context"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 18,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 18,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "RoseOu/flasky/venv/lib/python2.7/site-packages/sqlalchemy/engine/default.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 do_execute_no_params(self, cursor, statement, context = None) :
cursor.execute (statement)
Is there a bug in the code above? | No |
656 | [
"#NEWLINE#",
"def set_input_sizes(",
"self",
",",
"translate",
"=",
"None",
",",
"exclude_types",
"=",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"\"Given a cursor and ClauseParameters, call the appropriate\\n style of ``setinputsizes()`` on the cursor, using DB-API types\\n ... | false | 0 | [
"8",
"128",
"134",
"257",
"263",
"exclude_types",
"47",
"50",
"55",
"bindparam",
"97",
"120",
"132",
"145",
"226",
"249",
"261",
"319",
"dbtype",
"80",
"94",
"205",
"223",
"275",
"281",
"283",
"299",
"307",
"316",
"key",
"90",
"99",
"219",
"228",
"... | 0 | NONE | [] | [
[
{
"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": 17,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "RoseOu/flasky/venv/lib/python2.7/site-packages/sqlalchemy/engine/default.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 set_input_sizes(self, translate = None, exclude_types = None) :
"Given a cursor and ClauseParameters, call the appropriate
style of ``setinputsizes()`` on the cursor, using DB-API types
from the bind parameter's ``TypeEngine`` objects.
This method only called by those dialects which require it,
currently cx_oracle.
"
if (not hasattr (self.compiled, 'bind_names')) :
return
types = dict (((self.compiled.bind_names [bindparam], bindparam.type) for bindparam in self.compiled.bind_names))
if self.dialect.positional :
inputsizes = []
for key in self.compiled.positiontup :
typeengine = types [key]
dbtype = typeengine.dialect_impl (self.dialect).get_dbapi_type (self.dialect.dbapi)
if ((dbtype is not None) and ((not exclude_types) or (dbtype not in exclude_types))) :
inputsizes.append (dbtype)
try :
self.cursor.setinputsizes (* inputsizes)
except Exception as e :
self.root_connection._handle_dbapi_exception (e, None, None, None, self)
else :
inputsizes = {
}
for key in self.compiled.bind_names.values () :
typeengine = types [key]
dbtype = typeengine.dialect_impl (self.dialect).get_dbapi_type (self.dialect.dbapi)
if ((dbtype is not None) and ((not exclude_types) or (dbtype not in exclude_types))) :
if translate :
key = translate.get (key, key)
if (not self.dialect.supports_unicode_binds) :
key = self.dialect._encoder (key) [0]
inputsizes [key] = dbtype
try :
self.cursor.setinputsizes (** inputsizes)
except Exception as e :
self.root_connection._handle_dbapi_exception (e, None, None, None, self)
Is there a bug in the code above? | No |
657 | [
"#NEWLINE#",
"def encode(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"pieces",
"=",
"list",
"(",
")",
"#NEWLINE#",
"pieces",
".",
"append",
"(",
"struct",
".",
"pack",
"(",
"'>Q'",
",",
"self",
".",
"delivery_tag",
")",
")",
"#NEWLINE#",
"bit_buffer",
"=... | false | 0 | [
"2",
"23",
"34",
"self",
"7",
"13",
"53",
"68",
"pieces",
"29",
"40",
"43",
"63",
"bit_buffer"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 10,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 16,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 28,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "pika/pika/pika/spec.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def encode(self) :
pieces = list ()
pieces.append (struct.pack ('>Q', self.delivery_tag))
bit_buffer = 0
if self.multiple :
bit_buffer = (bit_buffer | (1 << 0))
pieces.append (struct.pack ('B', bit_buffer))
return pieces
Is there a bug in the code above? | No |
658 | [
"#NEWLINE#",
"def _extend(",
"nnbrs",
",",
"cand",
",",
"done",
",",
"so_far",
",",
"cliques",
")",
":",
"#NEWLINE#",
"#INDENT#",
"maxconn",
"=",
"(",
"-",
"1",
")",
"#NEWLINE#",
"numb_cand",
"=",
"len",
"(",
"cand",
")",
"#NEWLINE#",
"for",
"n",
"in",
... | false | 0 | [
"176",
"193",
"218",
"258",
"new_done",
"15",
"58",
"67",
"114",
"123",
"maxconn",
"63",
"119",
"136",
"pivotnbrs",
"129",
"143",
"smallercand",
"2",
"41",
"97",
"163",
"254",
"nnbrs",
"22",
"75",
"numb_cand",
"168",
"188",
"224",
"242",
"256",
"new_ca... | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 18,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 21,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "gkno/gkno_launcher/src/networkx/algorithms/clique.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 _extend(nnbrs, cand, done, so_far, cliques) :
maxconn = (- 1)
numb_cand = len (cand)
for n in done :
cn = (cand & nnbrs [n])
conn = len (cn)
if (conn > maxconn) :
pivotnbrs = cn
maxconn = conn
if (conn == numb_cand) :
return
for n in cand :
cn = (cand & nnbrs [n])
conn = len (cn)
if (conn > maxconn) :
pivotnbrs = cn
maxconn = conn
smallercand = set ((cand - pivotnbrs))
for n in smallercand :
cand.remove (n)
so_far.append (n)
nn = nnbrs [n]
new_cand = (cand & nn)
new_done = (done & nn)
if ((not new_cand) and (not new_done)) :
cliques.append (so_far [:])
else :
if ((not new_done) and (len (new_cand) is 1)) :
cliques.append ((so_far + list (new_cand)))
else :
_extend (nnbrs, new_cand, new_done, so_far, cliques)
done.add (so_far.pop ())
Is there a bug in the code above? | No |
659 | [
"#NEWLINE#",
"@",
"mock",
".",
"patch",
"(",
"'importlib.import_module'",
")",
"#NEWLINE#",
"def test_command_use_01(",
"self",
",",
"mocked_import_module",
")",
":",
"#NEWLINE#",
"#INDENT#",
"' Testing command_use()\\n\\n * Known Exploit\\n * Known module\\n '... | false | 0 | [
"10",
"23",
"31",
"75",
"91",
"95",
"self",
"43",
"73",
"101",
"exploit_class",
"12",
"54",
"84",
"mocked_import_module",
"58",
"69",
"mocked_module",
"19",
"38",
"81",
"module_path"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 11,
"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": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "reverse-shell/routersploit/routersploit/test/test_interpreter.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] }} | @ mock.patch ('importlib.import_module')
def test_command_use_01(self, mocked_import_module) :
' Testing command_use()
* Known Exploit
* Known module
'
module_path = 'exploits/foo/bar'
self.interpreter.current_module = None
self.interpreter.modules = [module_path, 'doo/pa/foo/bar']
exploit_class = mock.MagicMock (name = 'password_disclosure_module')
mocked_import_module.return_value = mocked_module = mock.MagicMock (name = 'module')
mocked_module.Exploit = exploit_class
self.interpreter.command_use (module_path)
mocked_import_module.assert_called_once_with ('routersploit.modules.exploits.foo.bar')
self.assertEqual (self.interpreter.current_module, exploit_class ())
Is there a bug in the code above? | No |
660 | [
"#NEWLINE#",
"def register_port(",
"self",
",",
"dpid",
",",
"port_no",
",",
"remote_dpid",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"dpids",
".",
"add_remote_dpid",
"(",
"dpid",
",",
"port_no",
",",
"remote_dpid",
")"
] | false | 0 | [
"8",
"23",
"remote_dpid",
"4",
"19",
"dpid",
"6",
"21",
"port_no",
"2",
"13",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 20,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 20,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "osrg/ryu/ryu/controller/tunnels.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_port(self, dpid, port_no, remote_dpid) :
self.dpids.add_remote_dpid (dpid, port_no, remote_dpid)
Is there a bug in the code above? | No |
661 | [
"#NEWLINE#",
"def delete_port(",
"self",
",",
"dpid",
",",
"port_no",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"dpids",
".",
"delete_port",
"(",
"dpid",
",",
"port_no",
")"
] | false | 0 | [
"4",
"17",
"dpid",
"6",
"19",
"port_no",
"2",
"11",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 18,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 18,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "osrg/ryu/ryu/controller/tunnels.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 delete_port(self, dpid, port_no) :
self.dpids.delete_port (dpid, port_no)
Is there a bug in the code above? | No |
662 | [
"#NEWLINE#",
"def SetShadingPropertySet(",
"self",
",",
"value",
")",
":",
"#NEWLINE#",
"#INDENT#",
"assert",
"(",
"(",
"value",
"is",
"None",
")",
"or",
"isinstance",
"(",
"value",
",",
"ShadingPropertySet",
")",
")",
"#NEWLINE#",
"self",
".",
"ShadingPropertyS... | false | 0 | [
"4",
"12",
"19",
"30",
"value",
"2",
"25",
"38",
"self"
] | 0 | NONE | [] | [
[
{
"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": 24,
"after_index": 31... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "uwdata/termite-data-server/web2py/gluon/contrib/pyrtf/Styles.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 SetShadingPropertySet(self, value) :
assert ((value is None) or isinstance (value, ShadingPropertySet))
self.ShadingPropertySet = (value or ShadingPropertySet ())
return self
Is there a bug in the code above? | No |
663 | [
"#NEWLINE#",
"def process(",
"args",
")",
":",
"#NEWLINE#",
"#INDENT#",
"fs",
"=",
"abdt_fs",
".",
"make_default_accessor",
"(",
")",
"#NEWLINE#",
"config",
"=",
"''",
"#NEWLINE#",
"if",
"args",
".",
"repo_url_format",
":",
"#NEWLINE#",
"#INDENT#",
"config",
"="... | false | 0 | [
"2",
"20",
"41",
"50",
"71",
"80",
"101",
"110",
"131",
"140",
"165",
"195",
"args",
"15",
"26",
"33",
"56",
"63",
"86",
"93",
"116",
"123",
"146",
"153",
"174",
"176",
"199",
"config",
"7",
"183",
"191",
"fs"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 17,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 19,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "bloomberg/phabricator-tools/py/abd/abdcmd_addrepohost.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 process(args) :
fs = abdt_fs.make_default_accessor ()
config = ''
if args.repo_url_format :
config = '
'.join ([config, _CONFIG_REPO_URL_FORMAT.format (repo_url_format = args.repo_url_format)])
if args.repo_push_url_format :
config = '
'.join ([config, _CONFIG_REPO_PUSH_URL_FORMAT.format (repo_push_url_format = args.repo_push_url_format)])
if args.repo_snoop_url_format :
config = '
'.join ([config, _CONFIG_REPO_SNOOP_URL_FORMAT.format (repo_snoop_url_format = args.repo_snoop_url_format)])
if args.branch_url_format :
config = '
'.join ([config, _CONFIG_BRANCH_URL_FORMAT.format (branch_url_format = args.branch_url_format)])
if args.admin_emails :
config = '
'.join ([config, _CONFIG_ADMIN_EMAILS_FORMAT.format (admin_emails = '
'.join (args.admin_emails))])
config = config.strip ()
with fs.lockfile_context () :
fs.create_repohost_config (args.name, config)
Is there a bug in the code above? | No |
664 | [
"#NEWLINE#",
"def test_localtime_daylight_false_dst_false(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"test",
".",
"support",
".",
"patch",
"(",
"self",
",",
"time",
",",
"'daylight'",
",",
"False",
")",
"#NEWLINE#",
"t0",
"=",
"datetime",
".",
"datetime",
"("... | false | 0 | [
"55",
"70",
"t2",
"39",
"61",
"68",
"t1",
"2",
"13",
"64",
"self",
"22",
"45",
"t0"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 14,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 21,
"after_index": 29,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 38,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "amrdraz/kodr/app/brython/www/src/Lib/test/test_email/test_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 test_localtime_daylight_false_dst_false(self) :
test.support.patch (self, time, 'daylight', False)
t0 = datetime.datetime (2012, 3, 12, 1, 1)
t1 = utils.localtime (t0, isdst = (- 1))
t2 = utils.localtime (t1)
self.assertEqual (t1, t2)
Is there a bug in the code above? | No |
665 | [
"#NEWLINE#",
"def bundle_link_reorder(",
"self",
",",
"bundle_link",
",",
"link",
",",
"display_order",
")",
":",
"#NEWLINE#",
"#INDENT#",
"' reorder the links in a bundle'",
"#NEWLINE#",
"params",
"=",
"dict",
"(",
"bundle_link",
"=",
"bundle_link",
",",
"link",
"=",... | false | 0 | [
"4",
"19",
"21",
"bundle_link",
"32",
"44",
"data",
"6",
"23",
"25",
"link",
"8",
"27",
"29",
"display_order",
"2",
"34",
"self",
"15",
"40",
"params"
] | 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": "bitly/bitly-api-python/bitly_api/bitly_api.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 bundle_link_reorder(self, bundle_link, link, display_order) :
' reorder the links in a bundle'
params = dict (bundle_link = bundle_link, link = link, display_order = display_order)
data = self._call_oauth2_metrics ('v3/bundle/link_reorder', params)
return data
Is there a bug in the code above? | No |
666 | [
"#NEWLINE#",
"def test_call(",
"self",
",",
"monkeypatch",
")",
":",
"#NEWLINE#",
"#INDENT#",
"request",
"=",
"pretend",
".",
"stub",
"(",
")",
"#NEWLINE#",
"registry",
"=",
"pretend",
".",
"stub",
"(",
")",
"#NEWLINE#",
"result",
"=",
"pretend",
".",
"stub"... | false | 0 | [
"25",
"112",
"158",
"result",
"17",
"40",
"141",
"143",
"172",
"174",
"registry",
"115",
"123",
"131",
"146",
"154",
"task",
"4",
"82",
"monkeypatch",
"9",
"45",
"108",
"208",
"request",
"65",
"90",
"163",
"prepare",
"33",
"78",
"181",
"prepared",
"2... | 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": 16,
"after_index": 22... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "pypa/warehouse/tests/unit/test_celery.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_call(self, monkeypatch) :
request = pretend.stub ()
registry = pretend.stub ()
result = pretend.stub ()
prepared = {
'registry' : registry,
'request' : request,
'closer' : pretend.call_recorder ((lambda : None)),
}
prepare = pretend.call_recorder ((lambda * a, **kw : prepared))
monkeypatch.setattr (scripting, 'prepare', prepare)
@ pretend.call_recorder
def runner(irequest) :
assert (irequest is request)
return result
task = celery.WarehouseTask ()
task.app = Celery ()
task.app.pyramid_config = pretend.stub (registry = registry)
task.run = runner
assert (task () is result)
assert (prepare.calls == [pretend.call (registry = registry)])
assert (prepared ['closer'].calls == [pretend.call ()])
assert (runner.calls == [pretend.call (request)])
Is there a bug in the code above? | No |
667 | [
"#NEWLINE#",
"def _check_is_permutation(",
"indices",
",",
"n_samples",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Check whether indices is a reordering of the array np.arange(n_samples)\\n\\n Parameters\\n ----------\\n indices : ndarray\\n integer array to test\\n n_samples : int\\n... | false | 0 | [
"27",
"38",
"52",
"hit",
"4",
"18",
"33",
"n_samples",
"2",
"15",
"40",
"indices"
] | 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": 17,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "scikit-learn/scikit-learn/sklearn/model_selection/_validation.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 _check_is_permutation(indices, n_samples) :
'Check whether indices is a reordering of the array np.arange(n_samples)
Parameters
----------
indices : ndarray
integer array to test
n_samples : int
number of expected elements
Returns
-------
is_partition : bool
True iff sorted(locs) is range(n)
'
if (len (indices) != n_samples) :
return False
hit = np.zeros (n_samples, bool)
hit [indices] = True
if (not np.all (hit)) :
return False
return True
Is there a bug in the code above? | No |
668 | [
"#NEWLINE#",
"def flask(",
"self",
",",
"in_headers",
"=",
"False",
",",
"url",
"=",
"'http://demos.gsi.dit.upm.es/senpy/senpy.jsonld'",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n Return the values and error to be used in flask\\n '",
"#NEWLINE#",
"js",
"=",
"self",... | false | 0 | [
"25",
"41",
"90",
"92",
"headers",
"34",
"ctx",
"17",
"36",
"59",
"72",
"js",
"8",
"51",
"url",
"4",
"30",
"in_headers",
"2",
"19",
"81",
"self"
] | 0 | NONE | [] | [
[
{
"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": "gsi-upm/senpy/senpy/models.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 flask(self, in_headers = False, url = 'http://demos.gsi.dit.upm.es/senpy/senpy.jsonld') :
'
Return the values and error to be used in flask
'
js = self.jsonld ()
headers = None
if in_headers :
ctx = js ['@context']
headers = {
'Link' : ('<%s>;rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' % url),
}
del js ['@context']
return FlaskResponse (json.dumps (js, indent = 4), status = self.get ('status', 200), headers = headers, mimetype = 'application/json')
Is there a bug in the code above? | No |
669 | [
"#NEWLINE#",
"def get_outfilename(",
"url",
",",
"domain",
"=",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Construct the output filename from partial domain and end of path'",
"#NEWLINE#",
"if",
"(",
"domain",
"is",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"domain",
... | false | 0 | [
"4",
"15",
"22",
"125",
"134",
"276",
"290",
"305",
"domain",
"53",
"73",
"79",
"87",
"99",
"109",
"145",
"157",
"169",
"179",
"192",
"200",
"202",
"240",
"263",
"265",
"282",
"292",
"tail_url",
"120",
"129",
"148",
"195",
"205",
"235",
"268",
"m... | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": 11,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 13,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "huntrar/scrape/scrape/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 get_outfilename(url, domain = None) :
'Construct the output filename from partial domain and end of path'
if (domain is None) :
domain = get_domain (url)
path = '{url.path}'.format (url = urlparse (url))
if ('.' in path) :
tail_url = path.split ('.') [(- 2)]
else :
tail_url = path
if tail_url :
if ('/' in tail_url) :
tail_pieces = [x for x in tail_url.split ('/') if x]
tail_url = tail_pieces [(- 1)]
max_len = 24
if domain :
max_len -= (len (domain) + 1)
if (len (tail_url) > max_len) :
if ('-' in tail_url) :
tail_pieces = [x for x in tail_url.split ('-') if x]
tail_url = tail_pieces.pop (0)
if (len (tail_url) > max_len) :
tail_url = tail_url [: max_len]
else :
tail_len = 0
for piece in tail_pieces :
tail_len += len (piece)
if (tail_len <= max_len) :
tail_url += ('-' + piece)
else :
break
else :
tail_url = tail_url [: max_len]
if (not domain) :
return tail_url
return '{0}-{1}'.format (domain, tail_url).lower ()
else :
return domain.lower ()
Is there a bug in the code above? | No |
670 | [
"#NEWLINE#",
"def test_created_at(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"exp",
"=",
"Experiment",
"(",
"'bench-press'",
",",
"[",
"'joe'",
",",
"'think'",
"]",
",",
"redis",
"=",
"self",
".",
"redis",
")",
"#NEWLINE#",
"date",
"=",
"exp",
".",
"cre... | false | 0 | [
"7",
"28",
"39",
"47",
"exp",
"2",
"21",
"32",
"51",
"self",
"26",
"36",
"45",
"57",
"date"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 25,
"after_index": 29,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 31,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "seatgeek/sixpack/sixpack/test/experiment_model_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_created_at(self) :
exp = Experiment ('bench-press', ['joe', 'think'], redis = self.redis)
date = exp.created_at
self.assertIsNone (date)
exp.save ()
date = exp.created_at
self.assertTrue (isinstance (date, str))
Is there a bug in the code above? | No |
671 | [
"#NEWLINE#",
"def build_ds_transform(",
"ds_factor",
"=",
"1.0",
",",
"orig_size",
"=",
"(",
"424",
",",
"424",
")",
",",
"target_size",
"=",
"(",
"53",
",",
"53",
")",
",",
"do_shift",
"=",
"True",
",",
"subpixel_shift",
"=",
"False",
")",
":",
"#NEWLIN... | false | 0 | [
"88",
"105",
"131",
"173",
"dst_corners",
"46",
"237",
"tcols",
"14",
"49",
"target_size",
"2",
"55",
"194",
"200",
"212",
"218",
"232",
"252",
"ds_factor",
"53",
"140",
"row_scale",
"223",
"274",
"shift_x",
"51",
"114",
"col_scale",
"263",
"282",
"tform... | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 32,
"after_index": 33,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 34,
"after_index": 4... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "benanne/kaggle-galaxies/realtime_augmentation.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 build_ds_transform(ds_factor = 1.0, orig_size = (424, 424), target_size = (53, 53), do_shift = True, subpixel_shift = False) :
"
This version is a bit more 'correct', it mimics the skimage.transform.resize function.
"
(rows, cols) = orig_size
(trows, tcols) = target_size
col_scale = row_scale = ds_factor
src_corners = (np.array ([[1, 1], [1, rows], [cols, rows]]) - 1)
dst_corners = np.zeros (src_corners.shape, dtype = np.double)
dst_corners [:, 0] = ((col_scale * (src_corners [:, 0] + 0.5)) - 0.5)
dst_corners [:, 1] = ((row_scale * (src_corners [:, 1] + 0.5)) - 0.5)
tform_ds = skimage.transform.AffineTransform ()
tform_ds.estimate (src_corners, dst_corners)
if do_shift :
if subpixel_shift :
cols = ((cols // int (ds_factor)) * int (ds_factor))
rows = ((rows // int (ds_factor)) * int (ds_factor))
shift_x = ((cols / (2 * ds_factor)) - (tcols / 2.0))
shift_y = ((rows / (2 * ds_factor)) - (trows / 2.0))
tform_shift_ds = skimage.transform.SimilarityTransform (translation = (shift_x, shift_y))
return (tform_shift_ds + tform_ds)
else :
return tform_ds
Is there a bug in the code above? | No |
672 | [
"#NEWLINE#",
"def load_and_process_image_fixed_pysex_centering_rescaling(",
"img_index",
",",
"subset",
",",
"ds_transforms",
",",
"augmentation_transforms",
",",
"target_sizes",
"=",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"(",
"subset",
"==",
"'train'",
")",
... | false | 0 | [
"2",
"32",
"55",
"64",
"img_index",
"69",
"90",
"img",
"86",
"104",
"img_a",
"4",
"19",
"42",
"66",
"81",
"83",
"subset",
"8",
"94",
"augmentation_transforms",
"60",
"100",
"tf_center_rescale",
"26",
"49",
"75",
"img_id",
"6",
"92",
"ds_transforms",
"10"... | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 17,
"after_index": 20,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 59,
"after_index": 6... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "benanne/kaggle-galaxies/realtime_augmentation.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 load_and_process_image_fixed_pysex_centering_rescaling(img_index, subset, ds_transforms, augmentation_transforms, target_sizes = None) :
if (subset == 'train') :
img_id = load_data.train_ids [img_index]
else :
if (subset == 'test') :
img_id = load_data.test_ids [img_index]
tf_center_rescale = build_pysex_center_rescale_transform (img_index, subset)
img = load_data.load_image (img_id, from_ram = True, subset = subset)
img_a = augment_fixed_and_dscrop_with_prepro (img, ds_transforms, augmentation_transforms, target_sizes, prepro_transform = tf_center_rescale)
return img_a
Is there a bug in the code above? | No |
673 | [
"#NEWLINE#",
"@",
"request_method_decorator",
"#NEWLINE#",
"def _update(",
"resource",
",",
"data",
"=",
"None",
",",
"query_args",
"=",
"{",
"#NEWLINE#",
"#INDENT#",
"#NEWLINE#",
"#UNINDENT#",
"}",
",",
"*",
"args",
",",
"**kwargs",
")",
":",
"#NEWLINE#",
"#IND... | false | 0 | [
"21",
"args",
"7",
"55",
"62",
"76",
"data",
"83",
"99",
"value",
"30",
"93",
"104",
"request",
"11",
"48",
"50",
"query_args",
"72",
"88",
"kwargs",
"81",
"97",
"name",
"5",
"34",
"resource"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 6,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 6,
"after_index": 21,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 27,
"after_index": 28... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "reviewboard/rbtools/rbtools/api/resource.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] }} | @ request_method_decorator
def _update(resource, data = None, query_args = {
}, * args, **kwargs) :
"Generate a PUT request on a resource.
Unlike other methods, any additional query args must be passed in
using the 'query_args' parameter, since kwargs is used for the
fields which will be sent.
Review Board expects ``extra_data`` fields to be sent as
``extra_data.field_name``, which cannot be passed as a raw literal in
Python. Fields like this would have to be added to a dict and splatted.
However, this function also accepts keyword arguments of the form
``extra_data__field_name``, which will be rewritten to fields of the form
``extra_data.field_name``.
"
request = HttpRequest (resource._links ['update'] ['href'], method = 'PUT', query_args = query_args)
if (data is None) :
data = {
}
kwargs.update (data)
for (name, value) in _preprocess_fields (kwargs) :
request.add_field (name, value)
return request
Is there a bug in the code above? | No |
674 | [
"#NEWLINE#",
"@",
"property",
"#NEWLINE#",
"def all_items(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Yield all item resources in all pages of this resource.'",
"#NEWLINE#",
"for",
"page",
"in",
"self",
".",
"all_pages",
":",
"#NEWLINE#",
"#INDENT#",
"for",
"item",
... | false | 0 | [
"5",
"15",
"self",
"22",
"30",
"item",
"13",
"24",
"page"
] | 0 | NONE | [] | [
[
{
"before_index": 9,
"after_index": 10,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 13,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "reviewboard/rbtools/rbtools/api/resource.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] }} | @ property
def all_items(self) :
'Yield all item resources in all pages of this resource.'
for page in self.all_pages :
for item in page :
(yield item)
Is there a bug in the code above? | No |
675 | [
"#NEWLINE#",
"def __call__(",
"self",
",",
"fn",
")",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"hasattr",
"(",
"fn",
",",
"'_sa_exclusion_extend'",
")",
":",
"#NEWLINE#",
"#INDENT#",
"fn",
".",
"_sa_exclusion_extend",
"(",
"self",
")",
"#NEWLINE#",
"return",
"fn",
... | false | 0 | [
"103",
"extend",
"2",
"23",
"36",
"47",
"74",
"self",
"4",
"12",
"19",
"27",
"63",
"82",
"96",
"fn",
"92",
"99",
"106",
"decorated",
"94",
"decorate"
] | 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": 59,
"after_index": 64... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "RoseOu/flasky/venv/lib/python2.7/site-packages/sqlalchemy/testing/exclusions.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 __call__(self, fn) :
if hasattr (fn, '_sa_exclusion_extend') :
fn._sa_exclusion_extend (self)
return fn
def extend(other) :
self.skips.update (other.skips)
self.fails.update (other.fails)
@ decorator
def decorate(fn, * args, **kw) :
return self._do (config._current, fn, * args, ** kw)
decorated = decorate (fn)
decorated._sa_exclusion_extend = extend
return decorated
Is there a bug in the code above? | No |
676 | [
"#NEWLINE#",
"def test_namedtemporaryfile_closes(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n The symbol django.core.files.NamedTemporaryFile is assigned as\\n a different class on different operating systems. In\\n any case, the result should minimally mock some of the API... | false | 0 | [
"2",
"15",
"27",
"42",
"self",
"9",
"21",
"31",
"36",
"46",
"tempfile"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 18... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "cloudera/hue/desktop/core/ext-py/Django-1.6.10/tests/files/tests.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_namedtemporaryfile_closes(self) :
'
The symbol django.core.files.NamedTemporaryFile is assigned as
a different class on different operating systems. In
any case, the result should minimally mock some of the API of
tempfile.NamedTemporaryFile from the Python standard library.
'
tempfile = NamedTemporaryFile ()
self.assertTrue (hasattr (tempfile, 'closed'))
self.assertFalse (tempfile.closed)
tempfile.close ()
self.assertTrue (tempfile.closed)
Is there a bug in the code above? | No |
677 | [
"#NEWLINE#",
"def test_file_move_overwrite(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"(",
"handle_a",
",",
"self",
".",
"file_a",
")",
"=",
"tempfile",
".",
"mkstemp",
"(",
"dir",
"=",
"os",
".",
"environ",
"[",
"'DJANGO_TEST_TEMP_DIR'",
"]",
")",
"#NEWLIN... | false | 0 | [
"30",
"108",
"handle_b",
"2",
"10",
"32",
"51",
"62",
"66",
"77",
"83",
"87",
"self",
"8",
"101",
"handle_a"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 18,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 28,
"after_index": 40,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 50,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "cloudera/hue/desktop/core/ext-py/Django-1.6.10/tests/files/tests.py",
"license": "apache-2.0",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_file_move_overwrite(self) :
(handle_a, self.file_a) = tempfile.mkstemp (dir = os.environ ['DJANGO_TEST_TEMP_DIR'])
(handle_b, self.file_b) = tempfile.mkstemp (dir = os.environ ['DJANGO_TEST_TEMP_DIR'])
self.assertRaises (IOError, (lambda : file_move_safe (self.file_a, self.file_b, allow_overwrite = False)))
self.assertIsNone (file_move_safe (self.file_a, self.file_b, allow_overwrite = True))
os.close (handle_a)
os.close (handle_b)
Is there a bug in the code above? | No |
678 | [
"#NEWLINE#",
"def v4greatersm(",
"a",
",",
"b",
")",
":",
"#NEWLINE#",
"#INDENT#",
"(",
"a0",
",",
"a1",
",",
"a2",
",",
"a3",
")",
"=",
"a",
"#NEWLINE#",
"return",
"(",
"(",
"a0",
">",
"b",
")",
",",
"(",
"a1",
">",
"b",
")",
",",
"(",
"a2",
... | false | 0 | [
"16",
"42",
"a3",
"4",
"26",
"32",
"38",
"44",
"b",
"14",
"36",
"a2",
"12",
"30",
"a1",
"10",
"24",
"a0",
"2",
"19",
"a"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 19,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 21,
"after_index": 28... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "turbulenz/turbulenz_tools/turbulenz_tools/tools/vmath.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 v4greatersm(a, b) :
(a0, a1, a2, a3) = a
return ((a0 > b), (a1 > b), (a2 > b), (a3 > b))
Is there a bug in the code above? | No |
679 | [
"#NEWLINE#",
"def version(",
"user",
"=",
"None",
",",
"host",
"=",
"None",
",",
"port",
"=",
"None",
",",
"maintenance_db",
"=",
"None",
",",
"password",
"=",
"None",
",",
"runas",
"=",
"None",
")",
":",
"#NEWLINE#",
"#INDENT#",
"\"\\n Return the version... | false | 0 | [
"10",
"53",
"55",
"84",
"86",
"port",
"14",
"57",
"59",
"maintenance_db",
"94",
"115",
"line",
"2",
"49",
"51",
"88",
"90",
"user",
"35",
"70",
"cmd",
"31",
"41",
"query",
"6",
"45",
"47",
"80",
"82",
"host",
"22",
"72",
"74",
"runas",
"66",
"1... | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 28,
"after_index": 29,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 30,
"after_index": 3... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "saltstack/salt/salt/modules/postgres.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 version(user = None, host = None, port = None, maintenance_db = None, password = None, runas = None) :
"
Return the version of a Postgres server.
CLI Example:
.. code-block:: bash
salt '*' postgres.version
"
query = "SELECT setting FROM pg_catalog.pg_settings WHERE name = 'server_version'"
cmd = _psql_cmd ('-c', query, '-t', host = host, user = user, port = port, maintenance_db = maintenance_db, password = password)
ret = _run_psql (cmd, runas = runas, password = password, host = host, port = port, user = user)
for line in salt.utils.itertools.split (ret ['stdout'], '
') :
return line
Is there a bug in the code above? | No |
680 | [
"#NEWLINE#",
"@",
"recorder",
".",
"use_cassette",
"(",
"'nc4_strings'",
")",
"#NEWLINE#",
"def test_strings(",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Test reading an array of strings'",
"#NEWLINE#",
"ds",
"=",
"Dataset",
"(",
"'http://localhost:8080/thredds/cdmremote/nc4/tst/t... | false | 0 | [
"16",
"25",
"ds",
"23",
"34",
"46",
"56",
"66",
"var"
] | 0 | NONE | [] | [
[
{
"before_index": 13,
"after_index": 14,
"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": "Unidata/siphon/siphon/cdmr/tests/test_dataset.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] }} | @ recorder.use_cassette ('nc4_strings')
def test_strings() :
'Test reading an array of strings'
ds = Dataset ('http://localhost:8080/thredds/cdmremote/nc4/tst/tst_strings.nc')
var = ds.variables ['measure_for_measure_var']
assert (var.shape == (43,))
assert (var [0] == 'Washington')
assert (var [10] == 'Polk')
assert (var [(- 1)] == '')
Is there a bug in the code above? | No |
681 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"*",
"args",
",",
"**kwargs",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"_documents",
"=",
"{",
"#NEWLINE#",
"#INDENT#",
"#NEWLINE#",
"#UNINDENT#",
"}",
"#NEWLINE#",
"self",
".",
"_collections",
"=",
"{",
"#NEWL... | false | 0 | [
"5",
"44",
"args",
"2",
"12",
"23",
"38",
"50",
"54",
"self",
"47",
"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": 16,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "namlook/mongokit/mongokit/collection.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def __init__(self, * args, **kwargs) :
self._documents = {
}
self._collections = {
}
super (Collection, self).__init__ (* args, ** kwargs)
self._registered_documents = self.database.connection._registered_documents
Is there a bug in the code above? | No |
682 | [
"#NEWLINE#",
"def get_npc_by_kw(",
"self",
",",
"keyword",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Get an NPC from this room if its name is equal to the keyword given.'",
"#NEWLINE#",
"keyword",
"=",
"keyword",
".",
"strip",
"(",
")",
".",
"lower",
"(",
")",
"#NEWLINE#",
"... | false | 0 | [
"2",
"26",
"self",
"24",
"36",
"44",
"npc",
"4",
"11",
"13",
"34",
"keyword"
] | 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": 20,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "shinymud/ShinyMUD/src/shinymud/models/room.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_npc_by_kw(self, keyword) :
'Get an NPC from this room if its name is equal to the keyword given.'
keyword = keyword.strip ().lower ()
for npc in self.npcs :
if (keyword in npc.keywords) :
return npc
return None
Is there a bug in the code above? | No |
683 | [
"#NEWLINE#",
"def test_child_static_site_paths(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"paths",
"=",
"list",
"(",
"self",
".",
"home_page",
".",
"get_static_site_paths",
"(",
")",
")",
"#NEWLINE#",
"self",
".",
"assertEqual",
"(",
"paths",
",",
"[",
"'/'",... | false | 0 | [
"2",
"11",
"20",
"self",
"7",
"24",
"paths"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 10,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 19,
"after_index": 25,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 10,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "torchbox/wagtail/wagtail/wagtailcore/tests/test_page_model.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_child_static_site_paths(self) :
paths = list (self.home_page.get_static_site_paths ())
self.assertEqual (paths, ['/', '/about/', '/contact/'])
Is there a bug in the code above? | No |
684 | [
"#NEWLINE#",
"def test_post_create_domain(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"resp",
"=",
"self",
".",
"client",
".",
"post",
"(",
"(",
"MOZDNS_BASE_URL",
"+",
"(",
"'/%s/create/'",
"%",
"self",
".",
"url_slug",
")",
")",
",",
"self",
".",
"post_d... | false | 0 | [
"7",
"43",
"resp",
"2",
"9",
"21",
"27",
"38",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 26,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 37,
"after_index": 41,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 26,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "mozilla/inventory/mozdns/domain/view_tests.py",
"license": "bsd-3-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def test_post_create_domain(self) :
resp = self.client.post ((MOZDNS_BASE_URL + ('/%s/create/' % self.url_slug)), self.post_data (), follow = True)
self.assertTrue ((resp.status_code in (302, 200)))
Is there a bug in the code above? | No |
685 | [
"#NEWLINE#",
"def test_model_choice_preference(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"global_preferences",
"=",
"global_preferences_registry",
".",
"manager",
"(",
")",
"#NEWLINE#",
"global_preferences",
"[",
"'blog__featured_entry'",
"]",
"=",
"self",
".",
"blog_... | false | 0 | [
"7",
"15",
"global_preferences",
"24",
"45",
"58",
"in_db",
"2",
"20",
"41",
"49",
"54",
"64",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 21,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 23,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "EliotBerriot/django-dynamic-preferences/tests/test_types.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_model_choice_preference(self) :
global_preferences = global_preferences_registry.manager ()
global_preferences ['blog__featured_entry'] = self.blog_entry
in_db = GlobalPreferenceModel.objects.get (section = 'blog', name = 'featured_entry')
self.assertEqual (in_db.value, self.blog_entry)
self.assertEqual (in_db.raw_value, str (self.blog_entry.pk))
Is there a bug in the code above? | No |
686 | [
"#NEWLINE#",
"def fit(",
"self",
",",
"X",
",",
"y",
"=",
"None",
",",
"**params",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Learn a NMF model for the data X.\\n\\n Parameters\\n ----------\\n\\n X: {array-like, sparse matrix}, shape = [n_samples, n_features]\\n ... | false | 0 | [
"24",
"params",
"4",
"21",
"X",
"2",
"17",
"28",
"self",
"6",
"y"
] | 0 | NONE | [] | [
[
{
"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": "omangin/multimodal/multimodal/lib/nmf.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 fit(self, X, y = None, **params) :
'Learn a NMF model for the data X.
Parameters
----------
X: {array-like, sparse matrix}, shape = [n_samples, n_features]
Data matrix to be decomposed
Returns
-------
self
'
self.fit_transform (X, ** params)
return self
Is there a bug in the code above? | No |
687 | [
"#NEWLINE#",
"@",
"classmethod",
"#NEWLINE#",
"def _Q(",
"cls",
",",
"X",
",",
"W",
",",
"H",
",",
"eps",
"=",
"1e-08",
")",
":",
"#NEWLINE#",
"#INDENT#",
"\"Computes X / (WH)\\n where '/' is element-wise and WH is a matrix product.\\n \"",
"#NEWLINE#",
"... | false | 0 | [
"7",
"27",
"40",
"49",
"79",
"X",
"13",
"53",
"61",
"81",
"94",
"eps",
"32",
"43",
"57",
"66",
"WH",
"9",
"36",
"89",
"W",
"5",
"cls",
"11",
"38",
"91",
"H"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 6,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 19,
"after_index": 20,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 22,
"after_index": 2... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "omangin/multimodal/multimodal/lib/nmf.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] }} | @ classmethod
def _Q(cls, X, W, H, eps = 1e-08) :
"Computes X / (WH)
where '/' is element-wise and WH is a matrix product.
"
if sp.issparse (X) :
WH = _special_sparse_dot (W, H, X)
WH.data = ((X.data + eps) / (WH.data + eps))
return WH
else :
return np.divide ((X + eps), (np.dot (W, H) + eps))
Is there a bug in the code above? | No |
688 | [
"#NEWLINE#",
"def _get_ironic_client(",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'return an Ironic client.'",
"#NEWLINE#",
"kwargs",
"=",
"{",
"#NEWLINE#",
"#INDENT#",
"'os_username'",
":",
"CONF",
".",
"ironic",
".",
"admin_username",
",",
"#NEWLINE#",
"'os_password'",
":",... | false | 0 | [
"76",
"93",
"icli",
"8",
"89",
"kwargs"
] | 0 | NONE | [] | [
[
{
"before_index": 5,
"after_index": 6,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 7,
"after_index": 10,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 75,
"after_index": 87... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/api/openstack/compute/baremetal_nodes.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_ironic_client() :
'return an Ironic client.'
kwargs = {
'os_username' : CONF.ironic.admin_username,
'os_password' : CONF.ironic.admin_password,
'os_auth_url' : CONF.ironic.admin_url,
'os_tenant_name' : CONF.ironic.admin_tenant_name,
'os_service_type' : 'baremetal',
'os_endpoint_type' : 'public',
'insecure' : 'true',
'ironic_url' : CONF.ironic.api_endpoint,
}
icli = ironic_client.get_client (CONF.ironic.api_version, ** kwargs)
return icli
Is there a bug in the code above? | No |
689 | [
"#NEWLINE#",
"def __init__(",
"self",
",",
"name",
",",
"email",
",",
"openid",
")",
":",
"#NEWLINE#",
"#INDENT#",
"self",
".",
"name",
"=",
"name",
"#NEWLINE#",
"self",
".",
"email",
"=",
"email",
"#NEWLINE#",
"self",
".",
"openid",
"=",
"openid"
] | false | 0 | [
"6",
"21",
"23",
"email",
"8",
"27",
"29",
"openid",
"4",
"15",
"17",
"name",
"2",
"13",
"19",
"25",
"self"
] | 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": "ib-lundgren/flask-oauthprovider/examples/demoprovider/models.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, name, email, openid) :
self.name = name
self.email = email
self.openid = openid
Is there a bug in the code above? | No |
690 | [
"#NEWLINE#",
"@",
"property",
"#NEWLINE#",
"@",
"serialized",
"#NEWLINE#",
"def query(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"\"The search query.\\n\\n Will always return :class:`None` if the search isn't loaded.\\n \"",
"#NEWLINE#",
"spotify",
".",
"Error",
... | false | 0 | [
"8",
"21",
"36",
"self",
"26",
"44",
"46",
"query"
] | 0 | NONE | [] | [
[
{
"before_index": 12,
"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": 25,
"after_index":... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "mopidy/pyspotify/spotify/search.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] }} | @ property
@ serialized
def query(self) :
"The search query.
Will always return :class:`None` if the search isn't loaded.
"
spotify.Error.maybe_raise (self.error)
query = utils.to_unicode (lib.sp_search_query (self._sp_search))
return (query if query else None)
Is there a bug in the code above? | No |
691 | [
"#NEWLINE#",
"def make_string(",
"xml",
")",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"isinstance",
"(",
"xml",
",",
"six",
".",
"string_types",
")",
":",
"#NEWLINE#",
"#INDENT#",
"xml",
"=",
"make_xml",
"(",
"xml",
")",
"#NEWLINE#",
"#UNINDENT#",
"s",
"=",
"ET",... | false | 0 | [
"27",
"38",
"51",
"58",
"68",
"72",
"s",
"2",
"10",
"19",
"23",
"33",
"xml"
] | 0 | NONE | [] | [
[
{
"before_index": 7,
"after_index": 11,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 26,
"after_index": 32,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 36,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "formencode/formencode/formencode/doctest_xml_compare.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_string(xml) :
if isinstance (xml, six.string_types) :
xml = make_xml (xml)
s = ET.tostring (xml)
if (s == '<xml />') :
return ''
assert (s.startswith ('<xml>') and s.endswith ('</xml>')), repr (s)
return s [5 : (- 6)]
Is there a bug in the code above? | No |
692 | [
"#NEWLINE#",
"@",
"cacheit",
"#NEWLINE#",
"def _nT(",
"n",
",",
"k",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'Return the partitions of ``n`` items into ``k`` parts. This\\n is used by ``nT`` for the case when ``n`` is an integer.'",
"#NEWLINE#",
"if",
"(",
"k",
"==",
"0",
")",
... | false | 0 | [
"5",
"30",
"44",
"62",
"n",
"49",
"52",
"j",
"7",
"16",
"28",
"46",
"59",
"64",
"k"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 6,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 11,
"after_index": 12,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 1... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "sympy/sympy/sympy/functions/combinatorial/numbers.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] }} | @ cacheit
def _nT(n, k) :
'Return the partitions of ``n`` items into ``k`` parts. This
is used by ``nT`` for the case when ``n`` is an integer.'
if (k == 0) :
return (1 if (k == n) else 0)
return sum ((_nT ((n - k), j) for j in range ((min (k, (n - k)) + 1))))
Is there a bug in the code above? | No |
693 | [
"#NEWLINE#",
"def start(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"\"\\n Start the actual proxy minion.\\n\\n If sub-classed, don't **ever** forget to run:\\n\\n super(YourSubClass, self).start()\\n\\n NOTE: Run any required code before calling `super()`.\\n ... | false | 0 | [
"2",
"13",
"27",
"44",
"50",
"57",
"78",
"102",
"123",
"self",
"74",
"88",
"119",
"127",
"exc"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 8,
"after_index": 17,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 17,
"after_index": 15... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "saltstack/salt/salt/cli/daemons.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 start(self) :
"
Start the actual proxy minion.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).start()
NOTE: Run any required code before calling `super()`.
"
super (ProxyMinion, self).start ()
try :
if check_user (self.config ['user']) :
log.info ('The proxy minion is starting up')
self.verify_hash_type ()
self.action_log_info ('Starting up')
self.minion.tune_in ()
except (KeyboardInterrupt, SaltSystemExit) as exc :
self.action_log_info ('Stopping')
if isinstance (exc, KeyboardInterrupt) :
log.warning ('Exiting on Ctrl-c')
self.shutdown ()
else :
log.error (str (exc))
self.shutdown (exc.code)
Is there a bug in the code above? | No |
694 | [
"#NEWLINE#",
"@",
"mock",
".",
"patch",
"(",
"'mkdocs.commands.build.build'",
",",
"autospec",
"=",
"True",
")",
"#NEWLINE#",
"def test_json(",
"self",
",",
"mock_build",
")",
":",
"#NEWLINE#",
"#INDENT#",
"result",
"=",
"self",
".",
"runner",
".",
"invoke",
"... | false | 0 | [
"14",
"23",
"42",
"53",
"self",
"21",
"46",
"result",
"16",
"57",
"mock_build"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 15,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 20,
"after_index": 32,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 41,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "mkdocs/mkdocs/mkdocs/tests/cli_tests.py",
"license": "bsd-2-clause",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | @ mock.patch ('mkdocs.commands.build.build', autospec = True)
def test_json(self, mock_build) :
result = self.runner.invoke (cli.cli, ['json'], catch_exceptions = False)
self.assertEqual (result.exit_code, 0)
self.assertEqual (mock_build.call_count, 1)
Is there a bug in the code above? | No |
695 | [
"#NEWLINE#",
"def create(",
"kernel",
")",
":",
"#NEWLINE#",
"#INDENT#",
"result",
"=",
"Weapon",
"(",
")",
"#NEWLINE#",
"result",
".",
"template",
"=",
"'object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s13_gen1.iff'",
"#NEWLINE#",
"result",
".",... | false | 0 | [
"2",
"kernel",
"7",
"13",
"19",
"25",
"35",
"result"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 10,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 12,
"after_index": 17,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 18,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "anhstudios/swganh/data/scripts/templates/object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s13_gen1.py",
"license": "mit",
"note": "license: bigquery_api"
}
}
] | bug detection | {% set indent = ' ' %}
{% set ns = namespace(indent_size=0, result=[]) %}
{% for token in source_tokens %}
{% if token== '#INDENT#' %}
{% set ns.indent_size = ns.indent_size + 1 %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% elif token == '#NEWLINE#' %}
{% set ns.result = ns.result + ["\n"] %}
{% elif token == '#UNINDENT#' %}
{% set ns.indent_size = ns.indent_size - 1 %}
{% else %}
{% if not loop.first and loop.previtem == '#NEWLINE#' %}
{% set ns.result = ns.result + [indent * ns.indent_size] %}
{% endif %}
{% set ns.result = ns.result + [token | replace('\\n', '\n'), " "] %}
{% endif %}
{% endfor %}
{{ns.result | join("") | replace(" . ", ".") | replace(" , ", ", ") | replace("( ", "(") | replace(" )", ")") | replace("[ ", "[") | replace(" ]", "]")}}
Is there a bug in the code above?
|||
{{ {True: "Yes", False: "No"}[has_bug] }} | def create(kernel) :
result = Weapon ()
result.template = 'object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s13_gen1.iff'
result.attribute_template_id = 10
result.stfName ('weapon_name', 'sword_lightsaber_2h_type13')
return result
Is there a bug in the code above? | No |
696 | [
"#NEWLINE#",
"def testIsIRI(",
")",
":",
"#NEWLINE#",
"#INDENT#",
"a",
"=",
"set",
"(",
"g",
".",
"query",
"(",
"'SELECT (isIRI(?target) AS ?r) WHERE { }'",
",",
"initBindings",
"=",
"{",
"#NEWLINE#",
"#INDENT#",
"'target'",
":",
"URIRef",
"(",
"'example:a'",
")",... | false | 0 | [
"34",
"50",
"59",
"b",
"6",
"48",
"57",
"a"
] | 0 | NONE | [] | [
[
{
"before_index": 5,
"after_index": 9,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 33,
"after_index": 37,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 46,
"after_index": 4... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "RDFLib/rdflib/test/test_initbindings.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 testIsIRI() :
a = set (g.query ('SELECT (isIRI(?target) AS ?r) WHERE { }', initBindings = {
'target' : URIRef ('example:a'),
}))
b = set (g.query ('SELECT (isIRI(?target) AS ?r) WHERE { } VALUES (?target) {(<example:a>)}'))
assert (a == b), ('isIRI: %r != %r' % (a, b))
Is there a bug in the code above? | No |
697 | [
"#NEWLINE#",
"def get(",
"self",
",",
"request",
",",
"*",
"args",
",",
"**kwargs",
")",
":",
"#NEWLINE#",
"#INDENT#",
"if",
"request",
".",
"user",
".",
"is_authenticated",
"(",
")",
":",
"#NEWLINE#",
"#INDENT#",
"signals",
".",
"start_checkout",
".",
"send... | false | 0 | [
"4",
"15",
"35",
"37",
"58",
"request",
"7",
"61",
"args",
"64",
"kwargs",
"2",
"33",
"41",
"53",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 1,
"after_index": 3,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 3,
"after_index": 7,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 14,
"after_index": 20,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "django-oscar/django-oscar/src/oscar/apps/checkout/views.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(self, request, * args, **kwargs) :
if request.user.is_authenticated () :
signals.start_checkout.send_robust (sender = self, request = request)
return self.get_success_response ()
return super (IndexView, self).get (request, * args, ** kwargs)
Is there a bug in the code above? | No |
698 | [
"#NEWLINE#",
"def _cov_eigen(",
"self",
",",
"X",
")",
":",
"#NEWLINE#",
"#INDENT#",
"'\\n Compute covariance matrix eigen{values,vectors} via Singular Value\\n Decomposition (SVD).\\n\\n Parameters\\n ----------\\n X : WRITEME\\n\\n Returns\\n ----... | false | 0 | [
"14",
"33",
"s",
"12",
"U",
"16",
"38",
"Vh",
"4",
"23",
"X",
"2",
"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": 24,... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "lisa-lab/pylearn2/pylearn2/models/pca.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 _cov_eigen(self, X) :
'
Compute covariance matrix eigen{values,vectors} via Singular Value
Decomposition (SVD).
Parameters
----------
X : WRITEME
Returns
-------
WRITEME
'
(U, s, Vh) = linalg.svd (X, full_matrices = False)
return ((s ** 2), Vh.T)
Is there a bug in the code above? | No |
699 | [
"#NEWLINE#",
"def test01_create_and_add(",
"self",
")",
":",
"#NEWLINE#",
"#INDENT#",
"rc",
"=",
"ResourceContainer",
"(",
"resources",
"=",
"[",
"]",
")",
"#NEWLINE#",
"self",
".",
"assertEqual",
"(",
"len",
"(",
"rc",
".",
"resources",
")",
",",
"0",
",",
... | false | 0 | [
"7",
"23",
"33",
"49",
"71",
"rc",
"2",
"17",
"65",
"self"
] | 0 | NONE | [] | [
[
{
"before_index": 6,
"after_index": 10,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 16,
"after_index": 27,
"edge_type": 7,
"edge_type_name": "enum_FIELD"
}
],
[
{
"before_index": 32,
"after_index": ... | [
{
"datasetProvenance": {
"datasetName": "ETHPy150Open",
"filepath": "resync/resync/tests/test_resource_container.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 test01_create_and_add(self) :
rc = ResourceContainer (resources = [])
self.assertEqual (len (rc.resources), 0, 'empty')
rc.resources.append (Resource ('a', timestamp = 1))
rc.resources.append (Resource ('b', timestamp = 2))
self.assertEqual (len (rc.resources), 2, 'two resources')
Is there a bug in the code above? | No |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.