query_name
stringlengths 13
55
| code_file_path
stringlengths 14
194
| context_blocks
list | answer_spans
list | supporting_fact_spans
list | example_type
int8 0
1
| single_hop
bool 2
classes | subtokenized_input_sequence
sequence | label_sequence
sequence |
---|---|---|---|---|---|---|---|---|
Unused local variable | serverdensity/sd-agent/tests/checks/integration/test_mcache.py | [
{
"content": " def testConnectionLeaks(self):\n for i in range(3):\n # Count open connections to localhost:11211, should be 0\n self.assertEquals(self._countConnections(11211), 0)\n new_conf = {'init_config': {}, 'instances': [\n {'url': \"localhost\"}]\n }\n self.run_check(new_conf)\n # Verify that the count is still 0\n self.assertEquals(self._countConnections(11211), 0)",
"metadata": "root.TestMemCache.testConnectionLeaks",
"header": "['class', 'TestMemCache', '(', 'AgentCheckTest', ')', ':', '___EOS___']",
"index": 133
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Test",
"Mem",
"Cache_",
"(_",
"Agent",
"Check",
"Test_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Connect",
"ion",
"Leak",
"s_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"i_",
"in_",
"range_",
"(_",
"3_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Count",
" ",
"open",
" ",
"connections",
" ",
"to",
" ",
"local",
"host",
":",
"1121",
"1",
",",
" ",
"shou",
"ld",
" ",
"be",
" ",
"0_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"assert",
"Equals_",
"(_",
"self_",
"._",
"\\u",
"count",
"Connections_",
"(_",
"1121",
"1_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"new",
"\\u",
"conf_",
"=_",
"{_",
"'",
"init",
"\\u",
"config",
"'_",
":_",
"{_",
"}_",
",_",
"'",
"instance",
"s",
"'_",
":_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"{_",
"'",
"url",
"'_",
":_",
"\"",
"local",
"host",
"\"_",
"}_",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"run",
"\\u",
"check_",
"(_",
"new",
"\\u",
"conf_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Verify",
" ",
"tha",
"t",
" ",
"the",
" ",
"count",
" ",
"is",
" ",
"still",
" ",
"0_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"self_",
"._",
"\\u",
"count",
"Connections_",
"(_",
"1121",
"1_",
")_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Imprecise assert | openstack/neutron/neutron/tests/unit/objects/qos/test_rule.py | [
{
"content": " def _test_should_apply_to_port(self, rule_policy_id, port_policy_id,\n device_owner, expected_result):\n test_rule = rule.QosRule(qos_policy_id=rule_policy_id)\n port = {qos_consts.QOS_POLICY_ID: port_policy_id,\n 'device_owner': device_owner}\n self.assertEqual(expected_result, test_rule.should_apply_to_port(port))",
"metadata": "root.QosRuleObjectTestCase._test_should_apply_to_port",
"header": "['class', 'QosRuleObjectTestCase', '(', 'neutron_test_base', '.', 'BaseTestCase', ')', ':', '___EOS___']",
"index": 28
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Imp",
"reci",
"se_",
"assert_",
"[SEP]_",
"class_",
"Qo",
"s",
"Rule",
"Object",
"Test",
"Case_",
"(_",
"neut",
"ron",
"\\u",
"test\\u",
"base_",
"._",
"Base",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"\\u",
"test\\u",
"shou",
"ld",
"\\u",
"appl",
"y",
"\\u",
"to",
"\\u",
"port_",
"(_",
"self_",
",_",
"rule",
"\\u",
"policy",
"\\u",
"id_",
",_",
"port",
"\\u",
"policy",
"\\u",
"id_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"device",
"\\u",
"owner_",
",_",
"expected",
"\\u",
"result_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"test\\u",
"rule_",
"=_",
"rule_",
"._",
"Qo",
"s",
"Rule_",
"(_",
"qo",
"s",
"\\u",
"policy",
"\\u",
"id_",
"=_",
"rule",
"\\u",
"policy",
"\\u",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"port_",
"=_",
"{_",
"qo",
"s",
"\\u",
"consts_",
"._",
"QO",
"S",
"\\u",
"POLICY",
"\\u",
"ID_",
":_",
"port",
"\\u",
"policy",
"\\u",
"id_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"device",
"\\u",
"owner",
"'_",
":_",
"device",
"\\u",
"owner_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"expected",
"\\u",
"result_",
",_",
"test\\u",
"rule_",
"._",
"shou",
"ld",
"\\u",
"appl",
"y",
"\\u",
"to",
"\\u",
"port_",
"(_",
"port_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | Lasagne/Lasagne/lasagne/layers/input.py | [
{
"content": "from collections import OrderedDict\n\nimport theano\nimport theano.tensor as T\n\nfrom .. import utils\n\nfrom .base import Layer\n\n\n__all__ = [\n \"InputLayer\",\n]\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class InputLayer(Layer):\n \"\"\"\n This layer holds a symbolic variable that represents a network input. A\n variable can be specified when the layer is instantiated, else it is\n created.\n\n Parameters\n ----------\n shape : tuple of `int` or `None` elements\n The shape of the input. Any element can be `None` to indicate that the\n size of that dimension is not fixed at compile time.\n\n input_var : Theano symbolic variable or `None` (default: `None`)\n A variable representing a network input. If it is not provided, a\n variable will be created.\n\n Raises\n ------\n ValueError\n If the dimension of `input_var` is not equal to `len(shape)`\n\n Notes\n -----\n The first dimension usually indicates the batch size. If you specify it,\n Theano may apply more optimizations while compiling the training or\n prediction function, but the compiled function will not accept data of a\n different batch size at runtime. To compile for a variable batch size, set\n the first shape element to `None` instead.\n\n Examples\n --------\n >>> from lasagne.layers import InputLayer\n >>> l_in = InputLayer((100, 20))\n \"\"\"\n",
"metadata": "root.InputLayer",
"header": "['module', '___EOS___']",
"index": 15
},
{
"content": " def __init__(self, shape, input_var=None, name=None, **kwargs):\n self.shape = shape\n if any(d is not None and d <= 0 for d in self.shape):\n raise ValueError((\n \"Cannot create InputLayer with a non-positive shape \"\n \"dimension. shape=%r, self.name=%r\") % (\n self.shape, name))\n\n ndim = len(shape)\n if input_var is None:\n # create the right TensorType for the given number of dimensions\n input_var_type = T.TensorType(theano.config.floatX, [False] * ndim)\n var_name = (\"%s.input\" % name) if name is not None else \"input\"\n input_var = input_var_type(var_name)\n else:\n # ensure the given variable has the correct dimensionality\n if input_var.ndim != ndim:\n raise ValueError(\"shape has %d dimensions, but variable has \"\n \"%d\" % (ndim, input_var.ndim))\n self.input_var = input_var\n self.name = name\n self.params = OrderedDict()",
"metadata": "root.InputLayer.__init__",
"header": "['class', 'InputLayer', '(', 'Layer', ')', ':', '___EOS___']",
"index": 49
},
{
"content": " @Layer.output_shape.getter\n def output_shape(self):\n return self.shape",
"metadata": "root.InputLayer.output_shape",
"header": "['class', 'InputLayer', '(', 'Layer', ')', ':', '___EOS___']",
"index": 72
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"from_",
"collections_",
"import_",
"Order",
"ed",
"Dict_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"theano_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"theano_",
"._",
"tensor_",
"as_",
"T_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"._",
"._",
"import_",
"utils_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"._",
"base_",
"import_",
"Layer_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u",
"all\\u\\u_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Inp",
"ut",
"Layer",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Inp",
"ut",
"Layer_",
"(_",
"Layer_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"layer",
" ",
"hold",
"s",
" ",
"a",
" ",
"symbolic",
" ",
"variab",
"le",
" ",
"tha",
"t",
" ",
"represent",
"s",
" ",
"a",
" ",
"network",
" ",
"input",
".",
" ",
"A",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"variab",
"le",
" ",
"can",
" ",
"be",
" ",
"specified",
" ",
"whe",
"n",
" ",
"the",
" ",
"layer",
" ",
"is",
" ",
"instantiate",
"d",
",",
" ",
"else",
" ",
"it",
" ",
"is",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"created",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"shape",
" ",
":",
" ",
"tuple",
" ",
"of",
" ",
"`",
"int",
"`",
" ",
"or",
" ",
"`",
"Non",
"e",
"`",
" ",
"element",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"shape",
" ",
"of",
" ",
"the",
" ",
"input",
".",
" ",
"Any",
" ",
"element",
" ",
"can",
" ",
"be",
" ",
"`",
"Non",
"e",
"`",
" ",
"to",
" ",
"indicat",
"e",
" ",
"tha",
"t",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"size",
" ",
"of",
" ",
"tha",
"t",
" ",
"dimension",
" ",
"is",
" ",
"not",
" ",
"fixed",
" ",
"at",
" ",
"compile",
" ",
"time",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"input",
"\\u",
"var",
" ",
":",
" ",
"The",
"ano",
" ",
"symbolic",
" ",
"variab",
"le",
" ",
"or",
" ",
"`",
"Non",
"e",
"`",
" ",
"(",
"default",
":",
" ",
"`",
"Non",
"e",
"`)",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"A",
" ",
"variab",
"le",
" ",
"represent",
"ing",
" ",
"a",
" ",
"network",
" ",
"input",
".",
" ",
"If",
" ",
"it",
" ",
"is",
" ",
"not",
" ",
"provided",
",",
" ",
"a",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"variab",
"le",
" ",
"will",
" ",
"be",
" ",
"created",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Rai",
"ses",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Value",
"Error",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"If",
" ",
"the",
" ",
"dimension",
" ",
"of",
" ",
"`",
"input",
"\\u",
"var",
"`",
" ",
"is",
" ",
"not",
" ",
"equal",
" ",
"to",
" ",
"`",
"len",
"(",
"shape",
")`",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Not",
"es",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-----",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"first",
" ",
"dimension",
" ",
"usual",
"ly",
" ",
"indicat",
"es",
" ",
"the",
" ",
"batch",
" ",
"size",
".",
" ",
"If",
" ",
"you",
" ",
"speci",
"fy",
" ",
"it",
",",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
"ano",
" ",
"may",
" ",
"appl",
"y",
" ",
"more",
" ",
"optimization",
"s",
" ",
"whi",
"le",
" ",
"compil",
"ing",
" ",
"the",
" ",
"train",
"ing",
" ",
"or",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"predicti",
"on",
" ",
"function",
",",
" ",
"but",
" ",
"the",
" ",
"compile",
"d",
" ",
"function",
" ",
"will",
" ",
"not",
" ",
"accept",
" ",
"data",
" ",
"of",
" ",
"a",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"different",
" ",
"batch",
" ",
"size",
" ",
"at",
" ",
"runt",
"ime",
".",
" ",
"To",
" ",
"compile",
" ",
"for",
" ",
"a",
" ",
"variab",
"le",
" ",
"batch",
" ",
"size",
",",
" ",
"set",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"the",
" ",
"first",
" ",
"shape",
" ",
"element",
" ",
"to",
" ",
"`",
"Non",
"e",
"`",
" ",
"inst",
"ead",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Exam",
"ples",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"--------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
">>>",
" ",
"from",
" ",
"las",
"agn",
"e",
".",
"layer",
"s",
" ",
"import",
" ",
"Inp",
"ut",
"Layer",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
">>>",
" ",
"l\\u",
"in",
" ",
"=",
" ",
"Inp",
"ut",
"Layer",
"((",
"100",
",",
" ",
"20",
"))\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Inp",
"ut",
"Layer_",
"(_",
"Layer_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"shape_",
",_",
"input",
"\\u",
"var_",
"=_",
"None_",
",_",
"name_",
"=_",
"None_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"shape_",
"=_",
"shape_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"any_",
"(_",
"d_",
"is_",
"not_",
"None_",
"and_",
"d_",
"<=_",
"0_",
"for_",
"d_",
"in_",
"self_",
"._",
"shape_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Value",
"Error_",
"(_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Cann",
"ot",
" ",
"create",
" ",
"Inp",
"ut",
"Layer",
" ",
"with",
" ",
"a",
" ",
"non",
"-",
"posit",
"ive",
" ",
"shape",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"dimension",
".",
" ",
"shape",
"=",
"%",
"r",
",",
" ",
"self",
".",
"name",
"=",
"%",
"r",
"\"_",
")_",
"%_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"shape_",
",_",
"name_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"ndim_",
"=_",
"len_",
"(_",
"shape_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"input",
"\\u",
"var_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"create",
" ",
"the",
" ",
"right",
" ",
"Tensor",
"Type",
" ",
"for",
" ",
"the",
" ",
"give",
"n",
" ",
"number",
" ",
"of",
" ",
"dimensions_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"input",
"\\u",
"var",
"\\u",
"type_",
"=_",
"T_",
"._",
"Tensor",
"Type_",
"(_",
"theano_",
"._",
"config_",
"._",
"float",
"X_",
",_",
"[_",
"False_",
"]_",
"*_",
"ndim_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"var",
"\\u",
"name_",
"=_",
"(_",
"\"%",
"s",
".",
"input",
"\"_",
"%_",
"name_",
")_",
"if_",
"name_",
"is_",
"not_",
"None_",
"else_",
"\"",
"input",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"input",
"\\u",
"var_",
"=_",
"input",
"\\u",
"var",
"\\u",
"type_",
"(_",
"var",
"\\u",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"ensure",
" ",
"the",
" ",
"give",
"n",
" ",
"variab",
"le",
" ",
"has",
" ",
"the",
" ",
"correct",
" ",
"dimensionality",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"input",
"\\u",
"var_",
"._",
"ndim_",
"!=_",
"ndim_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Value",
"Error_",
"(_",
"\"",
"shape",
" ",
"has",
" ",
"%",
"d",
" ",
"dimension",
"s",
",",
" ",
"but",
" ",
"variab",
"le",
" ",
"has",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"%",
"d",
"\"_",
"%_",
"(_",
"ndim_",
",_",
"input",
"\\u",
"var_",
"._",
"ndim_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"input",
"\\u",
"var_",
"=_",
"input",
"\\u",
"var_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"name_",
"=_",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"params_",
"=_",
"Order",
"ed",
"Dict_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Inp",
"ut",
"Layer_",
"(_",
"Layer_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"Layer_",
"._",
"output",
"\\u",
"shape_",
"._",
"getter_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"output",
"\\u",
"shape_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"shape_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | khamidou/kite/src/back/kite/kite-adduser.py | [
{
"content": "#!/usr/bin/env python\n# add an user to Kite and Postfix\nimport sys\nimport os\nimport getopt\nimport config\nfrom cabinet import DatetimeCabinet\n\n\n \n\ntry:\n opts, args = getopt.getopt(sys.argv[1:], 'u:p:', ['username=', 'password='])\nexcept getopt.GetoptError:\n usage()\n\nusername = None\npassword = None\n\nfor opt, arg in opts:\n if opt in ('-u', '--username'):\n username = arg\n elif opt in ('-p', '--password'):\n password = arg\n\nif username == None or password == None:\n usage()\n\nadd_postfix_user(username)\nadd_kite_user(username, password)\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "def usage():\n print \"%s: Add an user to kite and postfix. required arguments: --username user --password pass\" % sys.argv[0]\n sys.exit(-1)",
"metadata": "root.usage",
"header": "['module', '___EOS___']",
"index": 8
},
{
"content": "def add_kite_user(username, password):\n usersdb = DatetimeCabinet(\"/home/kite/users.db\")\n usersdb[username] = {\"password\": password} # FIXME: hash password\n usersdb.sync()",
"metadata": "root.add_kite_user",
"header": "['module', '___EOS___']",
"index": 12
},
{
"content": "def add_postfix_user(username):\n # FIXME: do something a little more serious than a superficial grep\n # for instance, slurp the file, get the first column and check the \n # username isn't in it.\n with open('/etc/postfix/vmaps', 'r') as fd: \n if username in fd.read():\n print \"User already exists\"\n return\n\n with open('/etc/postfix/vmaps', 'a') as fd:\n fd.write(\"%s@%s %s/\\n\" % (username, config.SERVER_NAME, username))\n\n os.system(\"postmap /etc/postfix/vmaps\") \n os.system(\"service postfix reload\")",
"metadata": "root.add_postfix_user",
"header": "['module', '___EOS___']",
"index": 17
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#!",
"/",
"usr",
"/",
"bin",
"/",
"env",
" ",
"python_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"add",
" ",
"an",
" ",
"user",
" ",
"to",
" ",
"Kit",
"e",
" ",
"and",
" ",
"Post",
"fix_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"sys_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"os_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"getopt_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"config_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"cab",
"inet",
"_",
"import_",
"Date",
"time",
"Cab",
"inet",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"opts_",
",_",
"args_",
"=_",
"getopt_",
"._",
"getopt_",
"(_",
"sys_",
"._",
"argv_",
"[_",
"1_",
":_",
"]_",
",_",
"'",
"u",
":",
"p",
":'_",
",_",
"[_",
"'",
"user",
"name",
"='_",
",_",
"'",
"password",
"='_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"getopt_",
"._",
"Get",
"opt",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"usage_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"username_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"password_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"opt_",
",_",
"arg_",
"in_",
"opts_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"opt_",
"in_",
"(_",
"'-",
"u",
"'_",
",_",
"'--",
"user",
"name",
"'_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"username_",
"=_",
"arg_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"opt_",
"in_",
"(_",
"'-",
"p",
"'_",
",_",
"'--",
"password",
"'_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"password_",
"=_",
"arg_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"username_",
"==_",
"None_",
"or_",
"password_",
"==_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"usage_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"add",
"\\u",
"postfix",
"\\u",
"user_",
"(_",
"username_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"add",
"\\u",
"kite",
"\\u",
"user_",
"(_",
"username_",
",_",
"password_",
")_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"usage_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"\"%",
"s",
":",
" ",
"Add",
" ",
"an",
" ",
"user",
" ",
"to",
" ",
"kite",
" ",
"and",
" ",
"postfix",
".",
" ",
"require",
"d",
" ",
"argu",
"ment",
"s",
":",
" ",
"--",
"user",
"name",
" ",
"user",
" ",
"--",
"password",
" ",
"pass",
"\"_",
"%_",
"sys_",
"._",
"argv_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"sys_",
"._",
"exit_",
"(_",
"-_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"add",
"\\u",
"kite",
"\\u",
"user_",
"(_",
"username_",
",_",
"password_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"users",
"db_",
"=_",
"Date",
"time",
"Cab",
"inet",
"_",
"(_",
"\"/",
"home",
"/",
"kite",
"/",
"users",
".",
"db",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"users",
"db_",
"[_",
"username_",
"]_",
"=_",
"{_",
"\"",
"password",
"\"_",
":_",
"password_",
"}_",
"#",
" ",
"FIX",
"ME",
":",
" ",
"hash",
" ",
"password_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"users",
"db_",
"._",
"sync_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"add",
"\\u",
"postfix",
"\\u",
"user_",
"(_",
"username_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"FIX",
"ME",
":",
" ",
"do",
" ",
"somet",
"hing",
" ",
"a",
" ",
"litt",
"le",
" ",
"more",
" ",
"seri",
"ous",
" ",
"than",
" ",
"a",
" ",
"super",
"ficia",
"l",
" ",
"grep",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"for",
" ",
"instance",
",",
" ",
"slur",
"p",
" ",
"the",
" ",
"file",
",",
" ",
"get",
" ",
"the",
" ",
"first",
" ",
"column",
" ",
"and",
" ",
"check",
" ",
"the",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"user",
"name",
" ",
"isn",
"'",
"t",
" ",
"in",
" ",
"it",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"with_",
"open_",
"(_",
"'/",
"etc",
"/",
"postfix",
"/",
"vma",
"ps",
"'_",
",_",
"'",
"r",
"'_",
")_",
"as_",
"fd_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"username_",
"in_",
"fd_",
"._",
"read_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"\"",
"User",
" ",
"alr",
"ead",
"y",
" ",
"exist",
"s",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"open_",
"(_",
"'/",
"etc",
"/",
"postfix",
"/",
"vma",
"ps",
"'_",
",_",
"'",
"a",
"'_",
")_",
"as_",
"fd_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"fd_",
"._",
"write_",
"(_",
"\"%",
"s",
"@",
"%",
"s",
" ",
"%",
"s",
"/\\\\",
"n",
"\"_",
"%_",
"(_",
"username_",
",_",
"config_",
"._",
"SERVER",
"\\u",
"NAME_",
",_",
"username_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\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
"content": "import sys\ntry:\n import StringIO\n import cStringIO\nexcept ImportError:\n from io import BytesIO\n\nrunning_python_3 = sys.version_info[0] == 3\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Except",
"_",
"block_",
"handles_",
"'",
"Base",
"Except",
"ion",
"'_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"import_",
"sys_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"String",
"IO_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"c",
"String",
"IO_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Import",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"io_",
"import_",
"Byte",
"s",
"IO_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"runn",
"ing",
"\\u",
"python",
"\\u",
"3_",
"=_",
"sys_",
"._",
"version",
"\\u",
"info_",
"[_",
"0_",
"]_",
"==_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | scanny/python-pptx/pptx/enum/base.py | [
{
"content": " @property\n def _member_defs(self):\n \"\"\"\n A single string containing the aggregated member definitions section\n of the documentation page\n \"\"\"\n members = self._clsdict['__members__']\n member_defs = [\n self._member_def(member) for member in members\n if member.name is not None\n ]\n return '\\n'.join(member_defs)",
"metadata": "root._DocsPageFormatter._member_defs",
"header": "['class', '_DocsPageFormatter', '(', 'object', ')', ':', '___EOS___']",
"index": 74
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"\\u",
"Docs",
"Page",
"Formatter_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"\\u",
"member",
"\\u",
"defs_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"A",
" ",
"single",
" ",
"string",
" ",
"contain",
"ing",
" ",
"the",
" ",
"aggregated",
" ",
"member",
" ",
"definit",
"ion",
"s",
" ",
"section",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"of",
" ",
"the",
" ",
"documentation",
" ",
"page",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"members_",
"=_",
"self_",
"._",
"\\u",
"cls",
"dict_",
"[_",
"'\\u",
"\\u",
"member",
"s",
"\\u\\u'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"member",
"\\u",
"defs_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"member",
"\\u",
"def_",
"(_",
"member_",
")_",
"for_",
"member_",
"in_",
"members_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"member_",
"._",
"name_",
"is_",
"not_",
"None_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"'\\\\",
"n",
"'_",
"._",
"join_",
"(_",
"member",
"\\u",
"defs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | brunobraga/termsaver/termsaverlib/screen/rssfeed.py | [
{
"content": "###############################################################################\n#\n# file: rssfeed.py\n#\n# Purpose: refer to module documentation for details\n#\n# Note: This file is part of Termsaver application, and should not be used\n# or executed separately.\n#\n###############################################################################\n#\n# Copyright 2012 Termsaver\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n# License for the specific language governing permissions and limitations\n# under the License.\n#\n###############################################################################\n\"\"\"\nSimple screensaver that displays data from a RSS feed.\n\nSee additional information in the class itself.\n\nThe screen class available here is:\n\n * `RSSFeedScreen`\n\"\"\"\n\n#\n# Internal modules\n#\nfrom termsaverlib.screen.base.rssfeed import RSSFeedScreenBase\nfrom termsaverlib import constants\nfrom termsaverlib.i18n import _\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class RSSFeedScreen(RSSFeedScreenBase):\n \"\"\"\n Simple screensaver that displays data from a RSS feed.\n\n RSS Feed Screen configuration:\n\n * sleep between items: 3 seconds\n\n * clean up each cycle: True\n this will force the screen to be cleaned (cleared) before each joke\n is displayed\n\n * character display delay: 0.015\n a bit faster than traditional speeds, because users are not\n interested in the char print animation as much.\n\n * clean up each item: False\n\n * display format:\n\n '%(title)s (%(pubDate)s)\\n%(description)s\\n%(link)s\\n.\\n'\n \"\"\"\n\n",
"metadata": "root.RSSFeedScreen",
"header": "['module', '___EOS___']",
"index": 44
},
{
"content": " def __init__(self):\n \"\"\"\n Creates a new instance of this class.\n \"\"\"\n RSSFeedScreenBase.__init__(self,\n \"rssfeed\",\n _(\"displays rss feed information\"),\n None,\n [\"pubDate\", \"title\", \"link\", \"description\"],\n '%(title)s (%(pubDate)s)\\n%(description)s\\n%(link)s\\n.\\n',\n )\n\n # set defaults for this screen\n self.cleanup_per_cycle = True\n self.cleanup_per_item = False\n self.sleep_between_items = 3\n self.delay = 0.015",
"metadata": "root.RSSFeedScreen.__init__",
"header": "['class', 'RSSFeedScreen', '(', 'RSSFeedScreenBase', ')', ':', '___EOS___']",
"index": 67
},
{
"content": " def _message_no_url(self):\n \"\"\"\n Defines a method to be overriden by inheriting classes, with the\n purpose to display extra help information for specific errors.\n \"\"\"\n return _(\"\"\"\nYou just need to provide the URL of the RSS feed from where %(app_title)s will\nread and display on screen.\n\nIf you do not have any idea which RSS to use, check out some examples here:\n\n CNN\n Top Stories - http://rss.cnn.com/rss/edition.rss\n World - http://rss.cnn.com/rss/edition_world.rss\n Technology - http://rss.cnn.com/rss/edition_technology.rss\n\n See CNN's complete list of RSS syndication here:\n http://edition.cnn.com/services/rss/\n\n Lifehacker - http://www.lifehacker.com/index.xml\n Note: Lifehacker uses HTML to deliver \"description\" contents in the RSS,\n so you might need to change the format to something like:\n --format \"%%(title)s (%%(pubDate)s)\\\\n\"\n\"\"\") % {\n 'app_title': constants.App.TITLE,\n }",
"metadata": "root.RSSFeedScreen._message_no_url",
"header": "['class', 'RSSFeedScreen', '(', 'RSSFeedScreenBase', ')', ':', '___EOS___']",
"index": 85
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"##",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"file",
":",
" ",
"rs",
"sf",
"eed",
".",
"py_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Pur",
"pose",
":",
" ",
" ",
"refer",
" ",
"to",
" ",
"module",
" ",
"documentation",
" ",
"for",
" ",
"details_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Not",
"e",
":",
" ",
"Thi",
"s",
" ",
"file",
" ",
"is",
" ",
"part",
" ",
"of",
" ",
"Term",
"saver",
" ",
"applica",
"tion",
",",
" ",
"and",
" ",
"shou",
"ld",
" ",
"not",
" ",
"be",
" ",
"used_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"or",
" ",
"executed",
" ",
"separately",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"##",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Copy",
"right",
" ",
"2012",
" ",
"Term",
"saver_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"License",
"d",
" ",
"under",
" ",
"the",
" ",
"Ap",
"ache",
" ",
"License",
",",
" ",
"Version",
" ",
"2.0",
" ",
"(",
"the",
" ",
"\"",
"License",
"\");",
" ",
"you",
" ",
"may",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"not",
" ",
"use",
" ",
"this",
" ",
"file",
" ",
"except",
" ",
"in",
" ",
"compli",
"anc",
"e",
" ",
"with",
" ",
"the",
" ",
"License",
".",
" ",
"You",
" ",
"may",
" ",
"obtain",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"a",
" ",
"copy",
" ",
"of",
" ",
"the",
" ",
"License",
" ",
"at_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"http",
"://",
"www",
".",
"apa",
"che",
".",
"org",
"/",
"license",
"s",
"/",
"LICENSE",
"-",
"2.0_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Un",
"less",
" ",
"require",
"d",
" ",
"by",
" ",
"applica",
"ble",
" ",
"law",
" ",
"or",
" ",
"agree",
"d",
" ",
"to",
" ",
"in",
" ",
"writ",
"ing",
",",
" ",
"software",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"distributed",
" ",
"under",
" ",
"the",
" ",
"License",
" ",
"is",
" ",
"distributed",
" ",
"on",
" ",
"an",
" ",
"\"",
"AS",
" ",
"IS",
"\"",
" ",
"BAS",
"IS",
",",
" ",
"WITH",
"OUT_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"WAR",
"RAN",
"TIES",
" ",
"OR",
" ",
"CONDITION",
"S",
" ",
"OF",
" ",
"ANY",
" ",
"KIND",
",",
" ",
"eit",
"her",
" ",
"express",
" ",
"or",
" ",
"impli",
"ed",
".",
" ",
"See",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"License",
" ",
"for",
" ",
"the",
" ",
"specific",
" ",
"language",
" ",
"govern",
"ing",
" ",
"permissi",
"ons",
" ",
"and",
" ",
"limit",
"ations_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"under",
" ",
"the",
" ",
"License",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"##",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"\"\"",
"\\",
"10",
";",
"Simple",
" ",
"screens",
"aver",
" ",
"tha",
"t",
" ",
"display",
"s",
" ",
"data",
" ",
"from",
" ",
"a",
" ",
"RSS",
" ",
"feed",
".",
"\\",
"10",
";",
"\\",
"10",
";",
"See",
" ",
"addition",
"al",
" ",
"informati",
"on",
" ",
"in",
" ",
"the",
" ",
"class",
" ",
"its",
"elf",
".",
"\\",
"10",
";",
"\\",
"10",
";",
"The",
" ",
"screen",
" ",
"class",
" ",
"avail",
"able",
" ",
"here",
" ",
"is",
":",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"*",
" ",
"`",
"RSS",
"Feed",
"Scr",
"een",
"`",
"\\",
"10",
";\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Intern",
"al",
" ",
"modules_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"term",
"saver",
"lib_",
"._",
"screen_",
"._",
"base_",
"._",
"rs",
"sf",
"eed_",
"import_",
"RSS",
"Feed",
"Scr",
"een",
"Base_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"term",
"saver",
"lib_",
"import_",
"constants_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"term",
"saver",
"lib_",
"._",
"i18n_",
"import_",
"\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"RSS",
"Feed",
"Screen_",
"(_",
"RSS",
"Feed",
"Scr",
"een",
"Base_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Simple",
" ",
"screens",
"aver",
" ",
"tha",
"t",
" ",
"display",
"s",
" ",
"data",
" ",
"from",
" ",
"a",
" ",
"RSS",
" ",
"feed",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"RSS",
" ",
"Feed",
" ",
"Scr",
"een",
" ",
"configura",
"tion",
":",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
"*",
" ",
"sleep",
" ",
"bet",
"ween",
" ",
"items",
":",
" ",
"3",
" ",
"second",
"s",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
"*",
" ",
"clean",
" ",
"up",
" ",
"each",
" ",
"cycle",
":",
" ",
"Tru",
"e",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"this",
" ",
"will",
" ",
"force",
" ",
"the",
" ",
"screen",
" ",
"to",
" ",
"be",
" ",
"clean",
"ed",
" ",
"(",
"clear",
"ed",
")",
" ",
"bef",
"ore",
" ",
"each",
" ",
"joke",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"is",
" ",
"displaye",
"d",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
"*",
" ",
"character",
" ",
"display",
" ",
"dela",
"y",
":",
" ",
"0.015",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"a",
" ",
"bit",
" ",
"faste",
"r",
" ",
"than",
" ",
"trad",
"itional",
" ",
"speeds",
",",
" ",
"bec",
"aus",
"e",
" ",
"users",
" ",
"are",
" ",
"not",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"interest",
"ed",
" ",
"in",
" ",
"the",
" ",
"char",
" ",
"print",
" ",
"animati",
"on",
" ",
"as",
" ",
"muc",
"h",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
"*",
" ",
"clean",
" ",
"up",
" ",
"each",
" ",
"item",
":",
" ",
"Fal",
"se",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
"*",
" ",
"display",
" ",
"format",
":",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
"'%",
"(",
"title",
")",
"s",
" ",
"(%",
"(",
"pub",
"Date",
")",
"s",
")\\\\",
"n",
"%",
"(",
"description",
")",
"s",
"\\\\",
"n",
"%",
"(",
"link",
")",
"s",
"\\\\",
"n",
".\\\\",
"n",
"'",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"RSS",
"Feed",
"Screen_",
"(_",
"RSS",
"Feed",
"Scr",
"een",
"Base_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Creat",
"es",
" ",
"a",
" ",
"new",
" ",
"instance",
" ",
"of",
" ",
"this",
" ",
"class",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"RSS",
"Feed",
"Scr",
"een",
"Base_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"rs",
"sf",
"eed",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u_",
"(_",
"\"",
"display",
"s",
" ",
"rs",
"s",
" ",
"feed",
" ",
"informati",
"on",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"[_",
"\"",
"pub",
"Date",
"\"_",
",_",
"\"",
"title",
"\"_",
",_",
"\"",
"link",
"\"_",
",_",
"\"",
"description",
"\"_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'%",
"(",
"title",
")",
"s",
" ",
"(%",
"(",
"pub",
"Date",
")",
"s",
")\\\\",
"n",
"%",
"(",
"description",
")",
"s",
"\\\\",
"n",
"%",
"(",
"link",
")",
"s",
"\\\\",
"n",
".\\\\",
"n",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"set",
" ",
"default",
"s",
" ",
"for",
" ",
"this",
" ",
"screen_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"clean",
"up",
"\\u",
"per",
"\\u",
"cycle_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"clean",
"up",
"\\u",
"per",
"\\u",
"item_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"sleep",
"\\u",
"bet",
"ween",
"\\u",
"items_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"delay_",
"=_",
"0.015",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"RSS",
"Feed",
"Screen_",
"(_",
"RSS",
"Feed",
"Scr",
"een",
"Base_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"message",
"\\u",
"no",
"\\u",
"url_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Define",
"s",
" ",
"a",
" ",
"method",
" ",
"to",
" ",
"be",
" ",
"override",
"n",
" ",
"by",
" ",
"inherit",
"ing",
" ",
"classe",
"s",
",",
" ",
"with",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"purpose",
" ",
"to",
" ",
"display",
" ",
"extra",
" ",
"help",
" ",
"informati",
"on",
" ",
"for",
" ",
"specific",
" ",
"error",
"s",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"\\u_",
"(_",
"\"\"\"",
"\\",
"10",
";",
"You",
" ",
"just",
" ",
"need",
" ",
"to",
" ",
"provide",
" ",
"the",
" ",
"URL",
" ",
"of",
" ",
"the",
" ",
"RSS",
" ",
"feed",
" ",
"from",
" ",
"where",
" ",
"%",
"(",
"app",
"\\u",
"title",
")",
"s",
" ",
"will",
"\\",
"10",
";",
"read",
" ",
"and",
" ",
"display",
" ",
"on",
" ",
"screen",
".",
"\\",
"10",
";",
"\\",
"10",
";",
"If",
" ",
"you",
" ",
"do",
" ",
"not",
" ",
"have",
" ",
"any",
" ",
"idea",
" ",
"whi",
"ch",
" ",
"RSS",
" ",
"to",
" ",
"use",
",",
" ",
"check",
" ",
"out",
" ",
"some",
" ",
"example",
"s",
" ",
"here",
":",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"CNN",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Top",
" ",
"Stor",
"ies",
" ",
"-",
" ",
"http",
"://",
"rs",
"s",
".",
"cnn",
".",
"com",
"/",
"rs",
"s",
"/",
"edition",
".",
"rs",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Wor",
"ld",
" ",
" ",
" ",
"-",
" ",
"http",
"://",
"rs",
"s",
".",
"cnn",
".",
"com",
"/",
"rs",
"s",
"/",
"edition",
"\\u",
"world",
".",
"rs",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Techno",
"log",
"y",
" ",
" ",
"-",
" ",
"http",
"://",
"rs",
"s",
".",
"cnn",
".",
"com",
"/",
"rs",
"s",
"/",
"edition",
"\\u",
"technology",
".",
"rs",
"s",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"See",
" ",
"CNN",
"'",
"s",
" ",
"complete",
" ",
"list",
" ",
"of",
" ",
"RSS",
" ",
"syn",
"dicat",
"ion",
" ",
"here",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"http",
"://",
"edition",
".",
"cnn",
".",
"com",
"/",
"service",
"s",
"/",
"rs",
"s",
"/",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Life",
"hacke",
"r",
" ",
"-",
" ",
"http",
"://",
"www",
".",
"life",
"hacke",
"r",
".",
"com",
"/",
"index",
".",
"xml",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Not",
"e",
":",
" ",
"Life",
"hacke",
"r",
" ",
"use",
"s",
" ",
"HTM",
"L",
" ",
"to",
" ",
"deliver",
" ",
"\"",
"description",
"\"",
" ",
"content",
"s",
" ",
"in",
" ",
"the",
" ",
"RSS",
",",
"\\",
"10",
";",
" ",
" ",
"so",
" ",
"you",
" ",
"mig",
"ht",
" ",
"need",
" ",
"to",
" ",
"change",
" ",
"the",
" ",
"format",
" ",
"to",
" ",
"somet",
"hing",
" ",
"like",
":",
"\\",
"10",
";",
" ",
" ",
" ",
"--",
"format",
" ",
"\"%%",
"(",
"title",
")",
"s",
" ",
"(%",
"%",
"(",
"pub",
"Date",
")",
"s",
")\\\\\\\\",
"n",
"\"",
"\\",
"10",
";\"\"\"_",
")_",
"%_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"app",
"\\u",
"title",
"'_",
":_",
"constants_",
"._",
"App_",
"._",
"TITLE_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n# License for the specific language governing permissions and limitations\n# under the License.\n\nimport uuid\n\nimport mock\nfrom oslo_config import cfg\nfrom oslo_serialization import jsonutils\nfrom oslo_utils import timeutils\nimport six\nimport webob\n\nfrom nova.api.openstack.compute.legacy_v2 import server_metadata \\\n as server_metadata_v2\nfrom nova.api.openstack.compute import server_metadata \\\n as server_metadata_v21\nfrom nova.compute import rpcapi as compute_rpcapi\nfrom nova.compute import vm_states\nimport nova.db\nfrom nova import exception\nfrom nova import objects\nfrom nova import test\nfrom nova.tests.unit.api.openstack import fakes\nfrom nova.tests.unit import fake_instance\n\n\nCONF = cfg.CONF\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "def return_create_instance_metadata_max(context, server_id, metadata, delete):\n return stub_max_server_metadata()",
"metadata": "root.return_create_instance_metadata_max",
"header": "['module', '___EOS___']",
"index": 41
},
{
"content": "def return_create_instance_metadata(context, server_id, metadata, delete):\n return stub_server_metadata()",
"metadata": "root.return_create_instance_metadata",
"header": "['module', '___EOS___']",
"index": 45
},
{
"content": "def fake_instance_save(inst, **kwargs):\n inst.metadata = stub_server_metadata()\n inst.obj_reset_changes()",
"metadata": "root.fake_instance_save",
"header": "['module', '___EOS___']",
"index": 49
},
{
"content": "def return_server_metadata(context, server_id):\n if not isinstance(server_id, six.string_types) or not len(server_id) == 36:\n msg = 'id %s must be a uuid in return server metadata' % server_id\n raise Exception(msg)\n return stub_server_metadata()",
"metadata": "root.return_server_metadata",
"header": "['module', '___EOS___']",
"index": 54
},
{
"content": "def return_empty_server_metadata(context, server_id):\n return {}",
"metadata": "root.return_empty_server_metadata",
"header": "['module', '___EOS___']",
"index": 61
},
{
"content": "def delete_server_metadata(context, server_id, key):\n pass",
"metadata": "root.delete_server_metadata",
"header": "['module', '___EOS___']",
"index": 65
},
{
"content": "def stub_server_metadata():\n metadata = {\n \"key1\": \"value1\",\n \"key2\": \"value2\",\n \"key3\": \"value3\",\n }\n return metadata",
"metadata": "root.stub_server_metadata",
"header": "['module', '___EOS___']",
"index": 69
},
{
"content": "def stub_max_server_metadata():\n metadata = {\"metadata\": {}}\n for num in range(CONF.quota_metadata_items):\n metadata['metadata']['key%i' % num] = \"blah\"\n return metadata",
"metadata": "root.stub_max_server_metadata",
"header": "['module', '___EOS___']",
"index": 78
},
{
"content": "def return_server(context, server_id, columns_to_join=None):\n return fake_instance.fake_db_instance(\n **{'id': server_id,\n 'uuid': '0cc3346e-9fef-4445-abe6-5d2b2690ec64',\n 'name': 'fake',\n 'locked': False,\n 'launched_at': timeutils.utcnow(),\n 'vm_state': vm_states.ACTIVE})",
"metadata": "root.return_server",
"header": "['module', '___EOS___']",
"index": 85
},
{
"content": "def return_server_by_uuid(context, server_uuid,\n columns_to_join=None, use_slave=False):\n return fake_instance.fake_db_instance(\n **{'id': 1,\n 'uuid': '0cc3346e-9fef-4445-abe6-5d2b2690ec64',\n 'name': 'fake',\n 'locked': False,\n 'launched_at': timeutils.utcnow(),\n 'metadata': stub_server_metadata(),\n 'vm_state': vm_states.ACTIVE})",
"metadata": "root.return_server_by_uuid",
"header": "['module', '___EOS___']",
"index": 95
},
{
"content": "def return_server_nonexistent(context, server_id,\n columns_to_join=None, use_slave=False):\n raise exception.InstanceNotFound(instance_id=server_id)",
"metadata": "root.return_server_nonexistent",
"header": "['module', '___EOS___']",
"index": 107
},
{
"content": "def fake_change_instance_metadata(self, context, instance, diff):\n pass",
"metadata": "root.fake_change_instance_metadata",
"header": "['module', '___EOS___']",
"index": 112
},
{
"content": "class ServerMetaDataTestV21(test.TestCase):\n validation_ex = exception.ValidationError\n validation_ex_large = validation_ex\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root.ServerMetaDataTestV21",
"header": "['module', '___EOS___']",
"index": 116
},
{
"content": " def setUp(self):\n super(ServerMetaDataTestV21, self).setUp()\n fakes.stub_out_key_pair_funcs(self.stubs)\n self.stub_out('nova.db.instance_get', return_server)\n self.stub_out('nova.db.instance_get_by_uuid',\n return_server_by_uuid)\n\n self.stub_out('nova.db.instance_metadata_get',\n return_server_metadata)\n\n self.stubs.Set(compute_rpcapi.ComputeAPI, 'change_instance_metadata',\n fake_change_instance_metadata)\n self._set_up_resources()",
"metadata": "root.ServerMetaDataTestV21.setUp",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 120
},
{
"content": " def _set_up_resources(self):\n self.controller = server_metadata_v21.ServerMetadataController()\n self.uuid = str(uuid.uuid4())\n self.url = '/fake/servers/%s/metadata' % self.uuid",
"metadata": "root.ServerMetaDataTestV21._set_up_resources",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 134
},
{
"content": " def _get_request(self, param_url=''):\n return fakes.HTTPRequestV21.blank(self.url + param_url)",
"metadata": "root.ServerMetaDataTestV21._get_request",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 139
},
{
"content": " def test_index(self):\n req = self._get_request()\n res_dict = self.controller.index(req, self.uuid)\n\n expected = {\n 'metadata': {\n 'key1': 'value1',\n 'key2': 'value2',\n 'key3': 'value3',\n },\n }\n self.assertEqual(expected, res_dict)",
"metadata": "root.ServerMetaDataTestV21.test_index",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 142
},
{
"content": " def test_index_nonexistent_server(self):\n self.stub_out('nova.db.instance_metadata_get',\n return_server_nonexistent)\n req = self._get_request()\n self.assertRaises(webob.exc.HTTPNotFound,\n self.controller.index, req, self.url)",
"metadata": "root.ServerMetaDataTestV21.test_index_nonexistent_server",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 155
},
{
"content": " def test_index_no_data(self):\n self.stub_out('nova.db.instance_metadata_get',\n return_empty_server_metadata)\n req = self._get_request()\n res_dict = self.controller.index(req, self.uuid)\n expected = {'metadata': {}}\n self.assertEqual(expected, res_dict)",
"metadata": "root.ServerMetaDataTestV21.test_index_no_data",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 162
},
{
"content": " def test_show(self):\n req = self._get_request('/key2')\n res_dict = self.controller.show(req, self.uuid, 'key2')\n expected = {\"meta\": {'key2': 'value2'}}\n self.assertEqual(expected, res_dict)",
"metadata": "root.ServerMetaDataTestV21.test_show",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 170
},
{
"content": " def test_show_nonexistent_server(self):\n self.stub_out('nova.db.instance_metadata_get',\n return_server_nonexistent)\n req = self._get_request('/key2')\n self.assertRaises(webob.exc.HTTPNotFound,\n self.controller.show, req, self.uuid, 'key2')",
"metadata": "root.ServerMetaDataTestV21.test_show_nonexistent_server",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 176
},
{
"content": " def test_show_meta_not_found(self):\n self.stub_out('nova.db.instance_metadata_get',\n return_empty_server_metadata)\n req = self._get_request('/key6')\n self.assertRaises(webob.exc.HTTPNotFound,\n self.controller.show, req, self.uuid, 'key6')",
"metadata": "root.ServerMetaDataTestV21.test_show_meta_not_found",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 183
},
{
"content": " def test_delete(self):\n self.stub_out('nova.db.instance_metadata_get',\n return_server_metadata)\n self.stub_out('nova.db.instance_metadata_delete',\n delete_server_metadata)\n req = self._get_request('/key2')\n req.method = 'DELETE'\n res = self.controller.delete(req, self.uuid, 'key2')\n\n self.assertIsNone(res)",
"metadata": "root.ServerMetaDataTestV21.test_delete",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 190
},
{
"content": " def test_delete_nonexistent_server(self):\n self.stub_out('nova.db.instance_get_by_uuid',\n return_server_nonexistent)\n req = self._get_request('/key1')\n req.method = 'DELETE'\n self.assertRaises(webob.exc.HTTPNotFound,\n self.controller.delete, req, self.uuid, 'key1')",
"metadata": "root.ServerMetaDataTestV21.test_delete_nonexistent_server",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 201
},
{
"content": " def test_delete_meta_not_found(self):\n self.stub_out('nova.db.instance_metadata_get',\n return_empty_server_metadata)\n req = self._get_request('/key6')\n req.method = 'DELETE'\n self.assertRaises(webob.exc.HTTPNotFound,\n self.controller.delete, req, self.uuid, 'key6')",
"metadata": "root.ServerMetaDataTestV21.test_delete_meta_not_found",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 209
},
{
"content": " def test_create(self):\n self.stubs.Set(objects.Instance, 'save', fake_instance_save)\n req = self._get_request()\n req.method = 'POST'\n req.content_type = \"application/json\"\n body = {\"metadata\": {\"key9\": \"value9\"}}\n req.body = jsonutils.dump_as_bytes(body)\n res_dict = self.controller.create(req, self.uuid, body=body)\n\n body['metadata'].update({\n \"key1\": \"value1\",\n \"key2\": \"value2\",\n \"key3\": \"value3\",\n })\n self.assertEqual(body, res_dict)",
"metadata": "root.ServerMetaDataTestV21.test_create",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 217
},
{
"content": " def test_create_empty_body(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = self._get_request()\n req.method = 'POST'\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex,\n self.controller.create, req, self.uuid, body=None)",
"metadata": "root.ServerMetaDataTestV21.test_create_empty_body",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 233
},
{
"content": " def test_create_item_empty_key(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = self._get_request('/key1')\n req.method = 'PUT'\n body = {\"metadata\": {\"\": \"value1\"}}\n req.body = jsonutils.dump_as_bytes(body)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex,\n self.controller.create, req, self.uuid, body=body)",
"metadata": "root.ServerMetaDataTestV21.test_create_item_empty_key",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 243
},
{
"content": " def test_create_item_non_dict(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = self._get_request('/key1')\n req.method = 'PUT'\n body = {\"metadata\": None}\n req.body = jsonutils.dump_as_bytes(body)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex,\n self.controller.create, req, self.uuid, body=body)",
"metadata": "root.ServerMetaDataTestV21.test_create_item_non_dict",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 255
},
{
"content": " def test_create_item_key_too_long(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = self._get_request('/key1')\n req.method = 'PUT'\n body = {\"metadata\": {(\"a\" * 260): \"value1\"}}\n req.body = jsonutils.dump_as_bytes(body)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex_large,\n self.controller.create,\n req, self.uuid, body=body)",
"metadata": "root.ServerMetaDataTestV21.test_create_item_key_too_long",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 267
},
{
"content": " def test_create_malformed_container(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = fakes.HTTPRequest.blank(self.url + '/key1')\n req.method = 'PUT'\n body = {\"meta\": {}}\n req.body = jsonutils.dump_as_bytes(body)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex,\n self.controller.create, req, self.uuid, body=body)",
"metadata": "root.ServerMetaDataTestV21.test_create_malformed_container",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 280
},
{
"content": " def test_create_malformed_data(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = fakes.HTTPRequest.blank(self.url + '/key1')\n req.method = 'PUT'\n body = {\"metadata\": ['asdf']}\n req.body = jsonutils.dump_as_bytes(body)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex,\n self.controller.create, req, self.uuid, body=body)",
"metadata": "root.ServerMetaDataTestV21.test_create_malformed_data",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 292
},
{
"content": " def test_create_nonexistent_server(self):\n self.stub_out('nova.db.instance_get_by_uuid',\n return_server_nonexistent)\n req = self._get_request()\n req.method = 'POST'\n body = {\"metadata\": {\"key1\": \"value1\"}}\n req.body = jsonutils.dump_as_bytes(body)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(webob.exc.HTTPNotFound,\n self.controller.create, req, self.uuid, body=body)",
"metadata": "root.ServerMetaDataTestV21.test_create_nonexistent_server",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 304
},
{
"content": " def test_update_metadata(self):\n self.stubs.Set(objects.Instance, 'save', fake_instance_save)\n req = self._get_request()\n req.method = 'POST'\n req.content_type = 'application/json'\n expected = {\n 'metadata': {\n 'key1': 'updatedvalue',\n 'key29': 'newkey',\n }\n }\n req.body = jsonutils.dump_as_bytes(expected)\n response = self.controller.update_all(req, self.uuid, body=expected)\n self.assertEqual(expected, response)",
"metadata": "root.ServerMetaDataTestV21.test_update_metadata",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 316
},
{
"content": " def test_update_all(self):\n self.stubs.Set(objects.Instance, 'save', fake_instance_save)\n req = self._get_request()\n req.method = 'PUT'\n req.content_type = \"application/json\"\n expected = {\n 'metadata': {\n 'key10': 'value10',\n 'key99': 'value99',\n },\n }\n req.body = jsonutils.dump_as_bytes(expected)\n res_dict = self.controller.update_all(req, self.uuid, body=expected)\n\n self.assertEqual(expected, res_dict)",
"metadata": "root.ServerMetaDataTestV21.test_update_all",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 331
},
{
"content": " def test_update_all_empty_container(self):\n self.stubs.Set(objects.Instance, 'save', fake_instance_save)\n req = self._get_request()\n req.method = 'PUT'\n req.content_type = \"application/json\"\n expected = {'metadata': {}}\n req.body = jsonutils.dump_as_bytes(expected)\n res_dict = self.controller.update_all(req, self.uuid, body=expected)\n\n self.assertEqual(expected, res_dict)",
"metadata": "root.ServerMetaDataTestV21.test_update_all_empty_container",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 347
},
{
"content": " def test_update_all_empty_body_item(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = fakes.HTTPRequest.blank(self.url + '/key1')\n req.method = 'PUT'\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex,\n self.controller.update_all, req, self.uuid,\n body=None)",
"metadata": "root.ServerMetaDataTestV21.test_update_all_empty_body_item",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 358
},
{
"content": " def test_update_all_with_non_dict_item(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = fakes.HTTPRequest.blank(self.url + '/bad')\n req.method = 'PUT'\n body = {\"metadata\": None}\n req.body = jsonutils.dump_as_bytes(body)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex,\n self.controller.update_all, req, self.uuid,\n body=body)",
"metadata": "root.ServerMetaDataTestV21.test_update_all_with_non_dict_item",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 369
},
{
"content": " def test_update_all_malformed_container(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = self._get_request()\n req.method = 'PUT'\n req.content_type = \"application/json\"\n expected = {'meta': {}}\n req.body = jsonutils.dump_as_bytes(expected)\n\n self.assertRaises(self.validation_ex,\n self.controller.update_all, req, self.uuid,\n body=expected)",
"metadata": "root.ServerMetaDataTestV21.test_update_all_malformed_container",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 382
},
{
"content": " def test_update_all_malformed_data(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = self._get_request()\n req.method = 'PUT'\n req.content_type = \"application/json\"\n expected = {'metadata': ['asdf']}\n req.body = jsonutils.dump_as_bytes(expected)\n\n self.assertRaises(self.validation_ex,\n self.controller.update_all, req, self.uuid,\n body=expected)",
"metadata": "root.ServerMetaDataTestV21.test_update_all_malformed_data",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 395
},
{
"content": " def test_update_all_nonexistent_server(self):\n self.stub_out('nova.db.instance_get', return_server_nonexistent)\n req = self._get_request()\n req.method = 'PUT'\n req.content_type = \"application/json\"\n body = {'metadata': {'key10': 'value10'}}\n req.body = jsonutils.dump_as_bytes(body)\n\n self.assertRaises(webob.exc.HTTPNotFound,\n self.controller.update_all, req, '100', body=body)",
"metadata": "root.ServerMetaDataTestV21.test_update_all_nonexistent_server",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 408
},
{
"content": " def test_update_all_non_dict(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = self._get_request()\n req.method = 'PUT'\n body = {\"metadata\": None}\n req.body = jsonutils.dump_as_bytes(body)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex, self.controller.update_all,\n req, self.uuid, body=body)",
"metadata": "root.ServerMetaDataTestV21.test_update_all_non_dict",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 419
},
{
"content": " def test_update_item(self):\n self.stubs.Set(objects.Instance, 'save', fake_instance_save)\n req = self._get_request('/key1')\n req.method = 'PUT'\n body = {\"meta\": {\"key1\": \"value1\"}}\n req.body = jsonutils.dump_as_bytes(body)\n req.headers[\"content-type\"] = \"application/json\"\n res_dict = self.controller.update(req, self.uuid, 'key1', body=body)\n expected = {\"meta\": {'key1': 'value1'}}\n self.assertEqual(expected, res_dict)",
"metadata": "root.ServerMetaDataTestV21.test_update_item",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 431
},
{
"content": " def test_update_item_nonexistent_server(self):\n self.stub_out('nova.db.instance_get_by_uuid',\n return_server_nonexistent)\n req = self._get_request('/key1')\n req.method = 'PUT'\n body = {\"meta\": {\"key1\": \"value1\"}}\n req.body = jsonutils.dump_as_bytes(body)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(webob.exc.HTTPNotFound,\n self.controller.update, req, self.uuid, 'key1',\n body=body)",
"metadata": "root.ServerMetaDataTestV21.test_update_item_nonexistent_server",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 442
},
{
"content": " def test_update_item_empty_body(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = self._get_request('/key1')\n req.method = 'PUT'\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex,\n self.controller.update, req, self.uuid, 'key1',\n body=None)",
"metadata": "root.ServerMetaDataTestV21.test_update_item_empty_body",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 455
},
{
"content": " def test_update_malformed_container(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = fakes.HTTPRequest.blank(self.url)\n req.method = 'PUT'\n expected = {'meta': {}}\n req.body = jsonutils.dump_as_bytes(expected)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex,\n self.controller.update, req, self.uuid, 'key1',\n body=expected)",
"metadata": "root.ServerMetaDataTestV21.test_update_malformed_container",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 466
},
{
"content": " def test_update_malformed_data(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = fakes.HTTPRequest.blank(self.url)\n req.method = 'PUT'\n expected = {'metadata': ['asdf']}\n req.body = jsonutils.dump_as_bytes(expected)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex,\n self.controller.update, req, self.uuid, 'key1',\n body=expected)",
"metadata": "root.ServerMetaDataTestV21.test_update_malformed_data",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 479
},
{
"content": " def test_update_item_empty_key(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = self._get_request('/key1')\n req.method = 'PUT'\n body = {\"meta\": {\"\": \"value1\"}}\n req.body = jsonutils.dump_as_bytes(body)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex,\n self.controller.update, req, self.uuid, '',\n body=body)",
"metadata": "root.ServerMetaDataTestV21.test_update_item_empty_key",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 492
},
{
"content": " def test_update_item_key_too_long(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = self._get_request('/key1')\n req.method = 'PUT'\n body = {\"meta\": {(\"a\" * 260): \"value1\"}}\n req.body = jsonutils.dump_as_bytes(body)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex_large,\n self.controller.update,\n req, self.uuid, (\"a\" * 260), body=body)",
"metadata": "root.ServerMetaDataTestV21.test_update_item_key_too_long",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 505
},
{
"content": " def test_update_item_value_too_long(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = self._get_request('/key1')\n req.method = 'PUT'\n body = {\"meta\": {\"key1\": (\"a\" * 260)}}\n req.body = jsonutils.dump_as_bytes(body)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex_large,\n self.controller.update,\n req, self.uuid, \"key1\", body=body)",
"metadata": "root.ServerMetaDataTestV21.test_update_item_value_too_long",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 518
},
{
"content": " def test_update_item_too_many_keys(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = self._get_request('/key1')\n req.method = 'PUT'\n body = {\"meta\": {\"key1\": \"value1\", \"key2\": \"value2\"}}\n req.body = jsonutils.dump_as_bytes(body)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex,\n self.controller.update, req, self.uuid, 'key1',\n body=body)",
"metadata": "root.ServerMetaDataTestV21.test_update_item_too_many_keys",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 531
},
{
"content": " def test_update_item_body_uri_mismatch(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = self._get_request('/bad')\n req.method = 'PUT'\n body = {\"meta\": {\"key1\": \"value1\"}}\n req.body = jsonutils.dump_as_bytes(body)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(webob.exc.HTTPBadRequest,\n self.controller.update, req, self.uuid, 'bad',\n body=body)",
"metadata": "root.ServerMetaDataTestV21.test_update_item_body_uri_mismatch",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 544
},
{
"content": " def test_update_item_non_dict(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = self._get_request('/bad')\n req.method = 'PUT'\n body = {\"meta\": None}\n req.body = jsonutils.dump_as_bytes(body)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex,\n self.controller.update, req, self.uuid, 'bad',\n body=body)",
"metadata": "root.ServerMetaDataTestV21.test_update_item_non_dict",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 557
},
{
"content": " def test_update_empty_container(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = fakes.HTTPRequest.blank(self.url)\n req.method = 'PUT'\n expected = {'metadata': {}}\n req.body = jsonutils.dump_as_bytes(expected)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(self.validation_ex,\n self.controller.update, req, self.uuid, 'bad',\n body=expected)",
"metadata": "root.ServerMetaDataTestV21.test_update_empty_container",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 570
},
{
"content": " def test_too_many_metadata_items_on_create(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n data = {\"metadata\": {}}\n for num in range(CONF.quota_metadata_items + 1):\n data['metadata']['key%i' % num] = \"blah\"\n req = self._get_request()\n req.method = 'POST'\n req.body = jsonutils.dump_as_bytes(data)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(webob.exc.HTTPForbidden,\n self.controller.create, req, self.uuid, body=data)",
"metadata": "root.ServerMetaDataTestV21.test_too_many_metadata_items_on_create",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 583
},
{
"content": " def test_invalid_metadata_items_on_create(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = self._get_request()\n req.method = 'POST'\n req.headers[\"content-type\"] = \"application/json\"\n\n # test for long key\n data = {\"metadata\": {\"a\" * 260: \"value1\"}}\n req.body = jsonutils.dump_as_bytes(data)\n self.assertRaises(self.validation_ex_large,\n self.controller.create, req, self.uuid, body=data)\n\n # test for long value\n data = {\"metadata\": {\"key\": \"v\" * 260}}\n req.body = jsonutils.dump_as_bytes(data)\n self.assertRaises(self.validation_ex_large,\n self.controller.create, req, self.uuid, body=data)\n\n # test for empty key.\n data = {\"metadata\": {\"\": \"value1\"}}\n req.body = jsonutils.dump_as_bytes(data)\n self.assertRaises(self.validation_ex,\n self.controller.create, req, self.uuid, body=data)",
"metadata": "root.ServerMetaDataTestV21.test_invalid_metadata_items_on_create",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 597
},
{
"content": " def test_too_many_metadata_items_on_update_item(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n data = {\"metadata\": {}}\n for num in range(CONF.quota_metadata_items + 1):\n data['metadata']['key%i' % num] = \"blah\"\n req = self._get_request()\n req.method = 'PUT'\n req.body = jsonutils.dump_as_bytes(data)\n req.headers[\"content-type\"] = \"application/json\"\n\n self.assertRaises(webob.exc.HTTPForbidden, self.controller.update_all,\n req, self.uuid, body=data)",
"metadata": "root.ServerMetaDataTestV21.test_too_many_metadata_items_on_update_item",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 622
},
{
"content": " def test_invalid_metadata_items_on_update_item(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n data = {\"metadata\": {}}\n for num in range(CONF.quota_metadata_items + 1):\n data['metadata']['key%i' % num] = \"blah\"\n req = self._get_request()\n req.method = 'PUT'\n req.body = jsonutils.dump_as_bytes(data)\n req.headers[\"content-type\"] = \"application/json\"\n\n # test for long key\n data = {\"metadata\": {\"a\" * 260: \"value1\"}}\n req.body = jsonutils.dump_as_bytes(data)\n self.assertRaises(self.validation_ex_large,\n self.controller.update_all, req, self.uuid,\n body=data)\n\n # test for long value\n data = {\"metadata\": {\"key\": \"v\" * 260}}\n req.body = jsonutils.dump_as_bytes(data)\n self.assertRaises(self.validation_ex_large,\n self.controller.update_all, req, self.uuid,\n body=data)\n\n # test for empty key.\n data = {\"metadata\": {\"\": \"value1\"}}\n req.body = jsonutils.dump_as_bytes(data)\n self.assertRaises(self.validation_ex,\n self.controller.update_all, req, self.uuid,\n body=data)",
"metadata": "root.ServerMetaDataTestV21.test_invalid_metadata_items_on_update_item",
"header": "['class', 'ServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 636
},
{
"content": "class ServerMetaDataTestV2(ServerMetaDataTestV21):\n validation_ex = webob.exc.HTTPBadRequest\n validation_ex_large = webob.exc.HTTPRequestEntityTooLarge\n\n",
"metadata": "root.ServerMetaDataTestV2",
"header": "['module', '___EOS___']",
"index": 671
},
{
"content": " def _set_up_resources(self):\n self.controller = server_metadata_v2.Controller()\n self.uuid = str(uuid.uuid4())\n self.url = '/v1.1/fake/servers/%s/metadata' % self.uuid",
"metadata": "root.ServerMetaDataTestV2._set_up_resources",
"header": "['class', 'ServerMetaDataTestV2', '(', 'ServerMetaDataTestV21', ')', ':', '___EOS___']",
"index": 675
},
{
"content": " def _get_request(self, param_url=''):\n return fakes.HTTPRequest.blank(self.url + param_url)",
"metadata": "root.ServerMetaDataTestV2._get_request",
"header": "['class', 'ServerMetaDataTestV2', '(', 'ServerMetaDataTestV21', ')', ':', '___EOS___']",
"index": 680
},
{
"content": "class BadStateServerMetaDataTestV21(test.TestCase):\n\n\n\n\n\n\n\n",
"metadata": "root.BadStateServerMetaDataTestV21",
"header": "['module', '___EOS___']",
"index": 684
},
{
"content": " def setUp(self):\n super(BadStateServerMetaDataTestV21, self).setUp()\n fakes.stub_out_key_pair_funcs(self.stubs)\n self.stub_out('nova.db.instance_metadata_get',\n return_server_metadata)\n self.stubs.Set(compute_rpcapi.ComputeAPI, 'change_instance_metadata',\n fake_change_instance_metadata)\n self.stub_out('nova.db.instance_get', self._return_server_in_build)\n self.stub_out('nova.db.instance_get_by_uuid',\n self._return_server_in_build_by_uuid)\n self.stub_out('nova.db.instance_metadata_delete',\n delete_server_metadata)\n self._set_up_resources()",
"metadata": "root.BadStateServerMetaDataTestV21.setUp",
"header": "['class', 'BadStateServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 686
},
{
"content": " def _set_up_resources(self):\n self.controller = server_metadata_v21.ServerMetadataController()\n self.uuid = str(uuid.uuid4())\n self.url = '/fake/servers/%s/metadata' % self.uuid",
"metadata": "root.BadStateServerMetaDataTestV21._set_up_resources",
"header": "['class', 'BadStateServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 700
},
{
"content": " def _get_request(self, param_url=''):\n return fakes.HTTPRequestV21.blank(self.url + param_url)",
"metadata": "root.BadStateServerMetaDataTestV21._get_request",
"header": "['class', 'BadStateServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 705
},
{
"content": " def test_invalid_state_on_delete(self):\n req = self._get_request('/key2')\n req.method = 'DELETE'\n self.assertRaises(webob.exc.HTTPConflict, self.controller.delete,\n req, self.uuid, 'key2')",
"metadata": "root.BadStateServerMetaDataTestV21.test_invalid_state_on_delete",
"header": "['class', 'BadStateServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 708
},
{
"content": " def test_invalid_state_on_update_metadata(self):\n self.stub_out('nova.db.instance_metadata_update',\n return_create_instance_metadata)\n req = self._get_request()\n req.method = 'POST'\n req.content_type = 'application/json'\n expected = {\n 'metadata': {\n 'key1': 'updatedvalue',\n 'key29': 'newkey',\n }\n }\n req.body = jsonutils.dump_as_bytes(expected)\n self.assertRaises(webob.exc.HTTPConflict, self.controller.update_all,\n req, self.uuid, body=expected)",
"metadata": "root.BadStateServerMetaDataTestV21.test_invalid_state_on_update_metadata",
"header": "['class', 'BadStateServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 714
},
{
"content": " def _return_server_in_build(self, context, server_id,\n columns_to_join=None):\n return fake_instance.fake_db_instance(\n **{'id': server_id,\n 'uuid': '0cc3346e-9fef-4445-abe6-5d2b2690ec64',\n 'name': 'fake',\n 'locked': False,\n 'vm_state': vm_states.BUILDING})",
"metadata": "root.BadStateServerMetaDataTestV21._return_server_in_build",
"header": "['class', 'BadStateServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 730
},
{
"content": " def _return_server_in_build_by_uuid(self, context, server_uuid,\n columns_to_join=None, use_slave=False):\n return fake_instance.fake_db_instance(\n **{'id': 1,\n 'uuid': '0cc3346e-9fef-4445-abe6-5d2b2690ec64',\n 'name': 'fake',\n 'locked': False,\n 'vm_state': vm_states.BUILDING})",
"metadata": "root.BadStateServerMetaDataTestV21._return_server_in_build_by_uuid",
"header": "['class', 'BadStateServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 739
},
{
"content": " @mock.patch.object(nova.compute.api.API, 'update_instance_metadata',\n side_effect=exception.InstanceIsLocked(instance_uuid=0))\n def test_instance_lock_update_metadata(self, mock_update):\n req = self._get_request()\n req.method = 'POST'\n req.content_type = 'application/json'\n expected = {\n 'metadata': {\n 'keydummy': 'newkey',\n }\n }\n req.body = jsonutils.dump_as_bytes(expected)\n self.assertRaises(webob.exc.HTTPConflict, self.controller.update_all,\n req, self.uuid, body=expected)",
"metadata": "root.BadStateServerMetaDataTestV21.test_instance_lock_update_metadata",
"header": "['class', 'BadStateServerMetaDataTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 748
},
{
"content": "class BadStateServerMetaDataTestV2(BadStateServerMetaDataTestV21):\n",
"metadata": "root.BadStateServerMetaDataTestV2",
"header": "['module', '___EOS___']",
"index": 764
},
{
"content": " def _set_up_resources(self):\n self.controller = server_metadata_v2.Controller()\n self.uuid = str(uuid.uuid4())\n self.url = '/v1.1/fake/servers/%s/metadata' % self.uuid",
"metadata": "root.BadStateServerMetaDataTestV2._set_up_resources",
"header": "['class', 'BadStateServerMetaDataTestV2', '(', 'BadStateServerMetaDataTestV21', ')', ':', '___EOS___']",
"index": 765
},
{
"content": " def _get_request(self, param_url=''):\n return fakes.HTTPRequest.blank(self.url + param_url)",
"metadata": "root.BadStateServerMetaDataTestV2._get_request",
"header": "['class', 'BadStateServerMetaDataTestV2', '(', 'BadStateServerMetaDataTestV21', ')', ':', '___EOS___']",
"index": 770
},
{
"content": "class ServerMetaPolicyEnforcementV21(test.NoDBTestCase):\n\n\n\n\n\n\n",
"metadata": "root.ServerMetaPolicyEnforcementV21",
"header": "['module', '___EOS___']",
"index": 774
},
{
"content": " def setUp(self):\n super(ServerMetaPolicyEnforcementV21, self).setUp()\n self.controller = server_metadata_v21.ServerMetadataController()\n self.req = fakes.HTTPRequest.blank('')",
"metadata": "root.ServerMetaPolicyEnforcementV21.setUp",
"header": "['class', 'ServerMetaPolicyEnforcementV21', '(', 'test', '.', 'NoDBTestCase', ')', ':', '___EOS___']",
"index": 776
},
{
"content": " def test_create_policy_failed(self):\n rule_name = \"os_compute_api:server-metadata:create\"\n self.policy.set_rules({rule_name: \"project:non_fake\"})\n exc = self.assertRaises(\n exception.PolicyNotAuthorized,\n self.controller.create, self.req, fakes.FAKE_UUID,\n body={'metadata': {}})\n self.assertEqual(\n \"Policy doesn't allow %s to be performed.\" % rule_name,\n exc.format_message())",
"metadata": "root.ServerMetaPolicyEnforcementV21.test_create_policy_failed",
"header": "['class', 'ServerMetaPolicyEnforcementV21', '(', 'test', '.', 'NoDBTestCase', ')', ':', '___EOS___']",
"index": 781
},
{
"content": " def test_index_policy_failed(self):\n rule_name = \"os_compute_api:server-metadata:index\"\n self.policy.set_rules({rule_name: \"project:non_fake\"})\n exc = self.assertRaises(\n exception.PolicyNotAuthorized,\n self.controller.index, self.req, fakes.FAKE_UUID)\n self.assertEqual(\n \"Policy doesn't allow %s to be performed.\" % rule_name,\n exc.format_message())",
"metadata": "root.ServerMetaPolicyEnforcementV21.test_index_policy_failed",
"header": "['class', 'ServerMetaPolicyEnforcementV21', '(', 'test', '.', 'NoDBTestCase', ')', ':', '___EOS___']",
"index": 792
},
{
"content": " def test_update_policy_failed(self):\n rule_name = \"os_compute_api:server-metadata:update\"\n self.policy.set_rules({rule_name: \"project:non_fake\"})\n exc = self.assertRaises(\n exception.PolicyNotAuthorized,\n self.controller.update, self.req, fakes.FAKE_UUID, fakes.FAKE_UUID,\n body={'meta': {'fake_meta': 'fake_meta'}})\n self.assertEqual(\n \"Policy doesn't allow %s to be performed.\" % rule_name,\n exc.format_message())",
"metadata": "root.ServerMetaPolicyEnforcementV21.test_update_policy_failed",
"header": "['class', 'ServerMetaPolicyEnforcementV21', '(', 'test', '.', 'NoDBTestCase', ')', ':', '___EOS___']",
"index": 802
},
{
"content": " def test_update_all_policy_failed(self):\n rule_name = \"os_compute_api:server-metadata:update_all\"\n self.policy.set_rules({rule_name: \"project:non_fake\"})\n exc = self.assertRaises(\n exception.PolicyNotAuthorized,\n self.controller.update_all, self.req, fakes.FAKE_UUID,\n body={'metadata': {}})\n self.assertEqual(\n \"Policy doesn't allow %s to be performed.\" % rule_name,\n exc.format_message())",
"metadata": "root.ServerMetaPolicyEnforcementV21.test_update_all_policy_failed",
"header": "['class', 'ServerMetaPolicyEnforcementV21', '(', 'test', '.', 'NoDBTestCase', ')', ':', '___EOS___']",
"index": 813
},
{
"content": " def test_delete_policy_failed(self):\n rule_name = \"os_compute_api:server-metadata:delete\"\n self.policy.set_rules({rule_name: \"project:non_fake\"})\n exc = self.assertRaises(\n exception.PolicyNotAuthorized,\n self.controller.delete, self.req, fakes.FAKE_UUID, fakes.FAKE_UUID)\n self.assertEqual(\n \"Policy doesn't allow %s to be performed.\" % rule_name,\n exc.format_message())",
"metadata": "root.ServerMetaPolicyEnforcementV21.test_delete_policy_failed",
"header": "['class', 'ServerMetaPolicyEnforcementV21', '(', 'test', '.', 'NoDBTestCase', ')', ':', '___EOS___']",
"index": 824
},
{
"content": " def test_show_policy_failed(self):\n rule_name = \"os_compute_api:server-metadata:show\"\n self.policy.set_rules({rule_name: \"project:non_fake\"})\n exc = self.assertRaises(\n exception.PolicyNotAuthorized,\n self.controller.show, self.req, fakes.FAKE_UUID, fakes.FAKE_UUID)\n self.assertEqual(\n \"Policy doesn't allow %s to be performed.\" % rule_name,\n exc.format_message())",
"metadata": "root.ServerMetaPolicyEnforcementV21.test_show_policy_failed",
"header": "['class', 'ServerMetaPolicyEnforcementV21', '(', 'test', '.', 'NoDBTestCase', ')', ':', '___EOS___']",
"index": 834
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#",
" ",
"Copy",
"right",
" ",
"2011",
" ",
"Open",
"Stack",
" ",
"Foun",
"dati",
"on_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"All",
" ",
"Rig",
"hts",
" ",
"Reserve",
"d",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"License",
"d",
" ",
"under",
" ",
"the",
" ",
"Ap",
"ache",
" ",
"License",
",",
" ",
"Version",
" ",
"2.0",
" ",
"(",
"the",
" ",
"\"",
"License",
"\");",
" ",
"you",
" ",
"may",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"not",
" ",
"use",
" ",
"this",
" ",
"file",
" ",
"except",
" ",
"in",
" ",
"compli",
"anc",
"e",
" ",
"with",
" ",
"the",
" ",
"License",
".",
" ",
"You",
" ",
"may",
" ",
"obtain",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"a",
" ",
"copy",
" ",
"of",
" ",
"the",
" ",
"License",
" ",
"at_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
" ",
"http",
"://",
"www",
".",
"apa",
"che",
".",
"org",
"/",
"license",
"s",
"/",
"LICENSE",
"-",
"2.0_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"Un",
"less",
" ",
"require",
"d",
" ",
"by",
" ",
"applica",
"ble",
" ",
"law",
" ",
"or",
" ",
"agree",
"d",
" ",
"to",
" ",
"in",
" ",
"writ",
"ing",
",",
" ",
"software",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"distributed",
" ",
"under",
" ",
"the",
" ",
"License",
" ",
"is",
" ",
"distributed",
" ",
"on",
" ",
"an",
" ",
"\"",
"AS",
" ",
"IS",
"\"",
" ",
"BAS",
"IS",
",",
" ",
"WITH",
"OUT_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"WAR",
"RAN",
"TIES",
" ",
"OR",
" ",
"CONDITION",
"S",
" ",
"OF",
" ",
"ANY",
" ",
"KIND",
",",
" ",
"eit",
"her",
" ",
"express",
" ",
"or",
" ",
"impli",
"ed",
".",
" ",
"See",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"License",
" ",
"for",
" ",
"the",
" ",
"specific",
" ",
"language",
" ",
"govern",
"ing",
" ",
"permissi",
"ons",
" ",
"and",
" ",
"limit",
"ations_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"under",
" ",
"the",
" ",
"License",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"uuid_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"mock_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"oslo",
"\\u",
"config_",
"import_",
"cfg_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"oslo",
"\\u",
"serialization_",
"import_",
"jsonutils_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"oslo",
"\\u",
"utils_",
"import_",
"timeutils_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"six_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"webob_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"nova_",
"._",
"api_",
"._",
"openstack_",
"._",
"compute_",
"._",
"lega",
"cy",
"\\u",
"v2_",
"import_",
"server",
"\\u",
"metadata_",
"as_",
"server",
"\\u",
"metadata",
"\\u",
"v2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"nova_",
"._",
"api_",
"._",
"openstack_",
"._",
"compute_",
"import_",
"server",
"\\u",
"metadata_",
"as_",
"server",
"\\u",
"metadata",
"\\u",
"v2",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"nova_",
"._",
"compute_",
"import_",
"rpcapi_",
"as_",
"compute",
"\\u",
"rpcapi_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"nova_",
"._",
"compute_",
"import_",
"vm",
"\\u",
"states_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"nova_",
"._",
"db_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"nova_",
"import_",
"exception_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"nova_",
"import_",
"objects_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"nova_",
"import_",
"test_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"nova_",
"._",
"tests_",
"._",
"unit_",
"._",
"api_",
"._",
"openstack_",
"import_",
"fakes_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"nova_",
"._",
"tests_",
"._",
"unit_",
"import_",
"fake",
"\\u",
"instance_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"CONF_",
"=_",
"cfg_",
"._",
"CONF_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\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
"\\u",
"metadata",
"\\u",
"max_",
"(_",
"context_",
",_",
"server",
"\\u",
"id_",
",_",
"metadata_",
",_",
"delete_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"stub",
"\\u",
"max",
"\\u",
"server",
"\\u",
"metadata_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
"(_",
"context_",
",_",
"server",
"\\u",
"id_",
",_",
"metadata_",
",_",
"delete_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"stub",
"\\u",
"server",
"\\u",
"metadata_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"fake",
"\\u",
"instance",
"\\u",
"save_",
"(_",
"inst_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"inst_",
"._",
"metadata_",
"=_",
"stub",
"\\u",
"server",
"\\u",
"metadata_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"inst_",
"._",
"obj",
"\\u",
"reset",
"\\u",
"changes_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"return",
"\\u",
"server",
"\\u",
"metadata_",
"(_",
"context_",
",_",
"server",
"\\u",
"id_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"isinstance_",
"(_",
"server",
"\\u",
"id_",
",_",
"six_",
"._",
"string",
"\\u",
"types_",
")_",
"or_",
"not_",
"len_",
"(_",
"server",
"\\u",
"id_",
")_",
"==_",
"36_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"msg_",
"=_",
"'",
"id",
" ",
"%",
"s",
" ",
"must",
" ",
"be",
" ",
"a",
" ",
"uuid",
" ",
"in",
" ",
"return",
" ",
"server",
" ",
"metadata",
"'_",
"%_",
"server",
"\\u",
"id_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Exception_",
"(_",
"msg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"stub",
"\\u",
"server",
"\\u",
"metadata_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"return",
"\\u",
"empty",
"\\u",
"server",
"\\u",
"metadata_",
"(_",
"context_",
",_",
"server",
"\\u",
"id_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"delete",
"\\u",
"server",
"\\u",
"metadata_",
"(_",
"context_",
",_",
"server",
"\\u",
"id_",
",_",
"key_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"stub",
"\\u",
"server",
"\\u",
"metadata_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"metadata_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"key",
"1",
"\"_",
":_",
"\"",
"value",
"1",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"key",
"2",
"\"_",
":_",
"\"",
"value",
"2",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"key",
"3",
"\"_",
":_",
"\"",
"value",
"3",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"metadata_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"stub",
"\\u",
"max",
"\\u",
"server",
"\\u",
"metadata_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"metadata_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"{_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"num_",
"in_",
"range_",
"(_",
"CONF_",
"._",
"quot",
"a",
"\\u",
"metadata",
"\\u",
"items_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"metadata_",
"[_",
"'",
"metadata",
"'_",
"]_",
"[_",
"'",
"key",
"%",
"i",
"'_",
"%_",
"num_",
"]_",
"=_",
"\"",
"bla",
"h",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"metadata_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"return",
"\\u",
"server_",
"(_",
"context_",
",_",
"server",
"\\u",
"id_",
",_",
"column",
"s",
"\\u",
"to",
"\\u",
"join_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"fake",
"\\u",
"instance_",
"._",
"fake",
"\\u",
"db",
"\\u",
"instance_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"**_",
"{_",
"'",
"id",
"'_",
":_",
"server",
"\\u",
"id_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"uuid",
"'_",
":_",
"'",
"0c",
"c3",
"346",
"e-",
"9",
"fe",
"f",
"-",
"444",
"5",
"-",
"abe",
"6",
"-",
"5d",
"2b",
"269",
"0e",
"c6",
"4",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"name",
"'_",
":_",
"'",
"fake",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"lock",
"ed",
"'_",
":_",
"False_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"launched",
"\\u",
"at",
"'_",
":_",
"timeutils_",
"._",
"utcnow_",
"(_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"vm",
"\\u",
"state",
"'_",
":_",
"vm",
"\\u",
"states_",
"._",
"ACTIVE_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"return",
"\\u",
"server",
"\\u",
"by",
"\\u",
"uuid_",
"(_",
"context_",
",_",
"server",
"\\u",
"uuid_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"column",
"s",
"\\u",
"to",
"\\u",
"join_",
"=_",
"None_",
",_",
"use",
"\\u",
"slave_",
"=_",
"False_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"fake",
"\\u",
"instance_",
"._",
"fake",
"\\u",
"db",
"\\u",
"instance_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"**_",
"{_",
"'",
"id",
"'_",
":_",
"1_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"uuid",
"'_",
":_",
"'",
"0c",
"c3",
"346",
"e-",
"9",
"fe",
"f",
"-",
"444",
"5",
"-",
"abe",
"6",
"-",
"5d",
"2b",
"269",
"0e",
"c6",
"4",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"name",
"'_",
":_",
"'",
"fake",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"lock",
"ed",
"'_",
":_",
"False_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"launched",
"\\u",
"at",
"'_",
":_",
"timeutils_",
"._",
"utcnow_",
"(_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"metadata",
"'_",
":_",
"stub",
"\\u",
"server",
"\\u",
"metadata_",
"(_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"vm",
"\\u",
"state",
"'_",
":_",
"vm",
"\\u",
"states_",
"._",
"ACTIVE_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"return",
"\\u",
"server",
"\\u",
"nonexist",
"ent_",
"(_",
"context_",
",_",
"server",
"\\u",
"id_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"column",
"s",
"\\u",
"to",
"\\u",
"join_",
"=_",
"None_",
",_",
"use",
"\\u",
"slave_",
"=_",
"False_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"exception_",
"._",
"Insta",
"nce",
"Not",
"Found_",
"(_",
"instance",
"\\u",
"id_",
"=_",
"server",
"\\u",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"fake",
"\\u",
"change",
"\\u",
"instance",
"\\u",
"metadata_",
"(_",
"self_",
",_",
"context_",
",_",
"instance_",
",_",
"diff_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"validation",
"\\u",
"ex_",
"=_",
"exception_",
"._",
"Validat",
"ion",
"Error_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"validation",
"\\u",
"ex",
"\\u",
"large_",
"=_",
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u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"set",
"Up_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"super_",
"(_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
",_",
"self_",
")_",
"._",
"set",
"Up_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"fakes_",
"._",
"stub",
"\\u",
"out",
"\\u",
"key",
"\\u",
"pair",
"\\u",
"funcs_",
"(_",
"self_",
"._",
"stubs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"get",
"'_",
",_",
"return",
"\\u",
"server_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"get",
"\\u",
"by",
"\\u",
"uuid",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"server",
"\\u",
"by",
"\\u",
"uuid_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"get",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"server",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"stubs_",
"._",
"Set_",
"(_",
"compute",
"\\u",
"rpcapi_",
"._",
"Compute",
"API_",
",_",
"'",
"change",
"\\u",
"instance",
"\\u",
"metadata",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"fake",
"\\u",
"change",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"set\\u",
"up",
"\\u",
"resources_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"set\\u",
"up",
"\\u",
"resources_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"controller_",
"=_",
"server",
"\\u",
"metadata",
"\\u",
"v2",
"1_",
"._",
"Server",
"Meta",
"data",
"Controller_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"uuid_",
"=_",
"str_",
"(_",
"uuid_",
"._",
"uuid4_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"url_",
"=_",
"'/",
"fake",
"/",
"server",
"s",
"/",
"%",
"s",
"/",
"metadata",
"'_",
"%_",
"self_",
"._",
"uuid_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get",
"\\u",
"request_",
"(_",
"self_",
",_",
"param",
"\\u",
"url_",
"=_",
"''_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"fakes_",
"._",
"HTTP",
"Request",
"V2",
"1_",
"._",
"blank_",
"(_",
"self_",
"._",
"url_",
"+_",
"param",
"\\u",
"url_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"index_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res",
"\\u",
"dict_",
"=_",
"self_",
"._",
"controller_",
"._",
"index_",
"(_",
"req_",
",_",
"self_",
"._",
"uuid_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"expected_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"metadata",
"'_",
":_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"key",
"1",
"'_",
":_",
"'",
"value",
"1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"key",
"2",
"'_",
":_",
"'",
"value",
"2",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"key",
"3",
"'_",
":_",
"'",
"value",
"3",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"expected_",
",_",
"res",
"\\u",
"dict_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"index",
"\\u",
"nonexist",
"ent",
"\\u",
"server_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"get",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"server",
"\\u",
"nonexist",
"ent_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"webob_",
"._",
"exc_",
"._",
"HTTP",
"Not",
"Found_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"index_",
",_",
"req_",
",_",
"self_",
"._",
"url_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"index",
"\\u",
"no",
"\\u",
"data_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"get",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"empty",
"\\u",
"server",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res",
"\\u",
"dict_",
"=_",
"self_",
"._",
"controller_",
"._",
"index_",
"(_",
"req_",
",_",
"self_",
"._",
"uuid_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"{_",
"'",
"metadata",
"'_",
":_",
"{_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"expected_",
",_",
"res",
"\\u",
"dict_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"show_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"key",
"2",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res",
"\\u",
"dict_",
"=_",
"self_",
"._",
"controller_",
"._",
"show_",
"(_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"'",
"key",
"2",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"{_",
"\"",
"meta",
"\"_",
":_",
"{_",
"'",
"key",
"2",
"'_",
":_",
"'",
"value",
"2",
"'_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"expected_",
",_",
"res",
"\\u",
"dict_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"show",
"\\u",
"nonexist",
"ent",
"\\u",
"server_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"get",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"server",
"\\u",
"nonexist",
"ent_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"key",
"2",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"webob_",
"._",
"exc_",
"._",
"HTTP",
"Not",
"Found_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"show_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"'",
"key",
"2",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"show",
"\\u",
"meta",
"\\u",
"not",
"\\u",
"found_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"get",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"empty",
"\\u",
"server",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"key",
"6",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"webob_",
"._",
"exc_",
"._",
"HTTP",
"Not",
"Found_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"show_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"'",
"key",
"6",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"delete_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"get",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"server",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"delete",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"delete",
"\\u",
"server",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"key",
"2",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"DELET",
"E",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"self_",
"._",
"controller_",
"._",
"delete_",
"(_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"'",
"key",
"2",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Is",
"None_",
"(_",
"res_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"delete",
"\\u",
"nonexist",
"ent",
"\\u",
"server_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"get",
"\\u",
"by",
"\\u",
"uuid",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"server",
"\\u",
"nonexist",
"ent_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"key",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"DELET",
"E",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"webob_",
"._",
"exc_",
"._",
"HTTP",
"Not",
"Found_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"delete_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"'",
"key",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"delete",
"\\u",
"meta",
"\\u",
"not",
"\\u",
"found_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"get",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"empty",
"\\u",
"server",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"key",
"6",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"DELET",
"E",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"webob_",
"._",
"exc_",
"._",
"HTTP",
"Not",
"Found_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"delete_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"'",
"key",
"6",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"create_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stubs_",
"._",
"Set_",
"(_",
"objects_",
"._",
"Instance_",
",_",
"'",
"save",
"'_",
",_",
"fake",
"\\u",
"instance",
"\\u",
"save_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"POST",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"content",
"\\u",
"type_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"{_",
"\"",
"key",
"9",
"\"_",
":_",
"\"",
"value",
"9",
"\"_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res",
"\\u",
"dict_",
"=_",
"self_",
"._",
"controller_",
"._",
"create_",
"(_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"[_",
"'",
"metadata",
"'_",
"]_",
"._",
"update_",
"(_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"key",
"1",
"\"_",
":_",
"\"",
"value",
"1",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"key",
"2",
"\"_",
":_",
"\"",
"value",
"2",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"key",
"3",
"\"_",
":_",
"\"",
"value",
"3",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"body_",
",_",
"res",
"\\u",
"dict_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"create",
"\\u",
"empty",
"\\u",
"body_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"POST",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"create_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"create",
"\\u",
"item",
"\\u",
"empty",
"\\u",
"key_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"key",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"{_",
"\"\"_",
":_",
"\"",
"value",
"1",
"\"_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"create_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"create",
"\\u",
"item",
"\\u",
"non",
"\\u",
"dict_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"key",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"None_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"create_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"create",
"\\u",
"item",
"\\u",
"key",
"\\u",
"too",
"\\u",
"long_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"key",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"{_",
"(_",
"\"",
"a",
"\"_",
"*_",
"260_",
")_",
":_",
"\"",
"value",
"1",
"\"_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex",
"\\u",
"large_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"create_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"create",
"\\u",
"mal",
"formed",
"\\u",
"container_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"fakes_",
"._",
"HTTP",
"Request_",
"._",
"blank_",
"(_",
"self_",
"._",
"url_",
"+_",
"'/",
"key",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"\"",
"meta",
"\"_",
":_",
"{_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"create_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"create",
"\\u",
"mal",
"formed",
"\\u",
"data_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"fakes_",
"._",
"HTTP",
"Request_",
"._",
"blank_",
"(_",
"self_",
"._",
"url_",
"+_",
"'/",
"key",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"[_",
"'",
"asd",
"f",
"'_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"create_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"create",
"\\u",
"nonexist",
"ent",
"\\u",
"server_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"get",
"\\u",
"by",
"\\u",
"uuid",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"server",
"\\u",
"nonexist",
"ent_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"POST",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"{_",
"\"",
"key",
"1",
"\"_",
":_",
"\"",
"value",
"1",
"\"_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"webob_",
"._",
"exc_",
"._",
"HTTP",
"Not",
"Found_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"create_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"metadata_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stubs_",
"._",
"Set_",
"(_",
"objects_",
"._",
"Instance_",
",_",
"'",
"save",
"'_",
",_",
"fake",
"\\u",
"instance",
"\\u",
"save_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"POST",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"content",
"\\u",
"type_",
"=_",
"'",
"applica",
"tion",
"/",
"json",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"metadata",
"'_",
":_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"key",
"1",
"'_",
":_",
"'",
"update",
"dva",
"lue",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"key",
"2",
"9",
"'_",
":_",
"'",
"new",
"key",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"response_",
"=_",
"self_",
"._",
"controller_",
"._",
"update",
"\\u",
"all_",
"(_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"expected_",
",_",
"response_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"all_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stubs_",
"._",
"Set_",
"(_",
"objects_",
"._",
"Instance_",
",_",
"'",
"save",
"'_",
",_",
"fake",
"\\u",
"instance",
"\\u",
"save_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"content",
"\\u",
"type_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"metadata",
"'_",
":_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"key",
"10",
"'_",
":_",
"'",
"value",
"10",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"key",
"9",
"9",
"'_",
":_",
"'",
"value",
"9",
"9",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res",
"\\u",
"dict_",
"=_",
"self_",
"._",
"controller_",
"._",
"update",
"\\u",
"all_",
"(_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"expected_",
",_",
"res",
"\\u",
"dict_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"all",
"\\u",
"empty",
"\\u",
"container_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stubs_",
"._",
"Set_",
"(_",
"objects_",
"._",
"Instance_",
",_",
"'",
"save",
"'_",
",_",
"fake",
"\\u",
"instance",
"\\u",
"save_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"content",
"\\u",
"type_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"{_",
"'",
"metadata",
"'_",
":_",
"{_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res",
"\\u",
"dict_",
"=_",
"self_",
"._",
"controller_",
"._",
"update",
"\\u",
"all_",
"(_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"expected_",
",_",
"res",
"\\u",
"dict_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"all",
"\\u",
"empty",
"\\u",
"body",
"\\u",
"item_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"fakes_",
"._",
"HTTP",
"Request_",
"._",
"blank_",
"(_",
"self_",
"._",
"url_",
"+_",
"'/",
"key",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update",
"\\u",
"all_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"all",
"\\u",
"with",
"\\u",
"non",
"\\u",
"dict",
"\\u",
"item_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"fakes_",
"._",
"HTTP",
"Request_",
"._",
"blank_",
"(_",
"self_",
"._",
"url_",
"+_",
"'/",
"bad",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"None_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update",
"\\u",
"all_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"all",
"\\u",
"mal",
"formed",
"\\u",
"container_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"content",
"\\u",
"type_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"{_",
"'",
"meta",
"'_",
":_",
"{_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update",
"\\u",
"all_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"all",
"\\u",
"mal",
"formed",
"\\u",
"data_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"content",
"\\u",
"type_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"{_",
"'",
"metadata",
"'_",
":_",
"[_",
"'",
"asd",
"f",
"'_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update",
"\\u",
"all_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"all",
"\\u",
"nonexist",
"ent",
"\\u",
"server_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"get",
"'_",
",_",
"return",
"\\u",
"server",
"\\u",
"nonexist",
"ent_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"content",
"\\u",
"type_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"'",
"metadata",
"'_",
":_",
"{_",
"'",
"key",
"10",
"'_",
":_",
"'",
"value",
"10",
"'_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"webob_",
"._",
"exc_",
"._",
"HTTP",
"Not",
"Found_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update",
"\\u",
"all_",
",_",
"req_",
",_",
"'",
"100",
"'_",
",_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"all",
"\\u",
"non",
"\\u",
"dict_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"None_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"self_",
"._",
"controller_",
"._",
"update",
"\\u",
"all_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"item_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stubs_",
"._",
"Set_",
"(_",
"objects_",
"._",
"Instance_",
",_",
"'",
"save",
"'_",
",_",
"fake",
"\\u",
"instance",
"\\u",
"save_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"key",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"\"",
"meta",
"\"_",
":_",
"{_",
"\"",
"key",
"1",
"\"_",
":_",
"\"",
"value",
"1",
"\"_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res",
"\\u",
"dict_",
"=_",
"self_",
"._",
"controller_",
"._",
"update_",
"(_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"'",
"key",
"1",
"'_",
",_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"{_",
"\"",
"meta",
"\"_",
":_",
"{_",
"'",
"key",
"1",
"'_",
":_",
"'",
"value",
"1",
"'_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"expected_",
",_",
"res",
"\\u",
"dict_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"item",
"\\u",
"nonexist",
"ent",
"\\u",
"server_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"get",
"\\u",
"by",
"\\u",
"uuid",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"server",
"\\u",
"nonexist",
"ent_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"key",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"\"",
"meta",
"\"_",
":_",
"{_",
"\"",
"key",
"1",
"\"_",
":_",
"\"",
"value",
"1",
"\"_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"webob_",
"._",
"exc_",
"._",
"HTTP",
"Not",
"Found_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"'",
"key",
"1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"item",
"\\u",
"empty",
"\\u",
"body_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"key",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"'",
"key",
"1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"mal",
"formed",
"\\u",
"container_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"fakes_",
"._",
"HTTP",
"Request_",
"._",
"blank_",
"(_",
"self_",
"._",
"url_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"{_",
"'",
"meta",
"'_",
":_",
"{_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"'",
"key",
"1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"mal",
"formed",
"\\u",
"data_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"fakes_",
"._",
"HTTP",
"Request_",
"._",
"blank_",
"(_",
"self_",
"._",
"url_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"{_",
"'",
"metadata",
"'_",
":_",
"[_",
"'",
"asd",
"f",
"'_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"'",
"key",
"1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"item",
"\\u",
"empty",
"\\u",
"key_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"key",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"\"",
"meta",
"\"_",
":_",
"{_",
"\"\"_",
":_",
"\"",
"value",
"1",
"\"_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"''_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"item",
"\\u",
"key",
"\\u",
"too",
"\\u",
"long_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"key",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"\"",
"meta",
"\"_",
":_",
"{_",
"(_",
"\"",
"a",
"\"_",
"*_",
"260_",
")_",
":_",
"\"",
"value",
"1",
"\"_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex",
"\\u",
"large_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"(_",
"\"",
"a",
"\"_",
"*_",
"260_",
")_",
",_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"item",
"\\u",
"value",
"\\u",
"too",
"\\u",
"long_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"key",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"\"",
"meta",
"\"_",
":_",
"{_",
"\"",
"key",
"1",
"\"_",
":_",
"(_",
"\"",
"a",
"\"_",
"*_",
"260_",
")_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex",
"\\u",
"large_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"\"",
"key",
"1",
"\"_",
",_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"item",
"\\u",
"too",
"\\u",
"many",
"\\u",
"keys_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"key",
"1",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"\"",
"meta",
"\"_",
":_",
"{_",
"\"",
"key",
"1",
"\"_",
":_",
"\"",
"value",
"1",
"\"_",
",_",
"\"",
"key",
"2",
"\"_",
":_",
"\"",
"value",
"2",
"\"_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"'",
"key",
"1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"item",
"\\u",
"body",
"\\u",
"uri",
"\\u",
"mismatch_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"bad",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"\"",
"meta",
"\"_",
":_",
"{_",
"\"",
"key",
"1",
"\"_",
":_",
"\"",
"value",
"1",
"\"_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"webob_",
"._",
"exc_",
"._",
"HTTP",
"Ba",
"d",
"Request_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"'",
"bad",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"item",
"\\u",
"non",
"\\u",
"dict_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"bad",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"body_",
"=_",
"{_",
"\"",
"meta",
"\"_",
":_",
"None_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"'",
"bad",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"empty",
"\\u",
"container_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"fakes_",
"._",
"HTTP",
"Request_",
"._",
"blank_",
"(_",
"self_",
"._",
"url_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"{_",
"'",
"metadata",
"'_",
":_",
"{_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"'",
"bad",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"too",
"\\u",
"many",
"\\u",
"metadata",
"\\u",
"items",
"\\u",
"on",
"\\u",
"create_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"data_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"{_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"num_",
"in_",
"range_",
"(_",
"CONF_",
"._",
"quot",
"a",
"\\u",
"metadata",
"\\u",
"items_",
"+_",
"1_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"[_",
"'",
"metadata",
"'_",
"]_",
"[_",
"'",
"key",
"%",
"i",
"'_",
"%_",
"num_",
"]_",
"=_",
"\"",
"bla",
"h",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"POST",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"webob_",
"._",
"exc_",
"._",
"HTTP",
"Forbidden_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"create_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"invalid",
"\\u",
"metadata",
"\\u",
"items",
"\\u",
"on",
"\\u",
"create_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"POST",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"test",
" ",
"for",
" ",
"long",
" ",
"key_",
"\\u\\u\\uNL\\u\\u\\u_",
"data_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"{_",
"\"",
"a",
"\"_",
"*_",
"260_",
":_",
"\"",
"value",
"1",
"\"_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex",
"\\u",
"large_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"create_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"test",
" ",
"for",
" ",
"long",
" ",
"value_",
"\\u\\u\\uNL\\u\\u\\u_",
"data_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"{_",
"\"",
"key",
"\"_",
":_",
"\"",
"v",
"\"_",
"*_",
"260_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex",
"\\u",
"large_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"create_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"test",
" ",
"for",
" ",
"empty",
" ",
"key",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"data_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"{_",
"\"\"_",
":_",
"\"",
"value",
"1",
"\"_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"create_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"too",
"\\u",
"many",
"\\u",
"metadata",
"\\u",
"items",
"\\u",
"on",
"\\u",
"update",
"\\u",
"item_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"data_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"{_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"num_",
"in_",
"range_",
"(_",
"CONF_",
"._",
"quot",
"a",
"\\u",
"metadata",
"\\u",
"items_",
"+_",
"1_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"[_",
"'",
"metadata",
"'_",
"]_",
"[_",
"'",
"key",
"%",
"i",
"'_",
"%_",
"num_",
"]_",
"=_",
"\"",
"bla",
"h",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"webob_",
"._",
"exc_",
"._",
"HTTP",
"Forbidden_",
",_",
"self_",
"._",
"controller_",
"._",
"update",
"\\u",
"all_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"invalid",
"\\u",
"metadata",
"\\u",
"items",
"\\u",
"on",
"\\u",
"update",
"\\u",
"item_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"data_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"{_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"num_",
"in_",
"range_",
"(_",
"CONF_",
"._",
"quot",
"a",
"\\u",
"metadata",
"\\u",
"items_",
"+_",
"1_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"[_",
"'",
"metadata",
"'_",
"]_",
"[_",
"'",
"key",
"%",
"i",
"'_",
"%_",
"num_",
"]_",
"=_",
"\"",
"bla",
"h",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"PU",
"T",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"headers_",
"[_",
"\"",
"content",
"-",
"type",
"\"_",
"]_",
"=_",
"\"",
"applica",
"tion",
"/",
"json",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"test",
" ",
"for",
" ",
"long",
" ",
"key_",
"\\u\\u\\uNL\\u\\u\\u_",
"data_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"{_",
"\"",
"a",
"\"_",
"*_",
"260_",
":_",
"\"",
"value",
"1",
"\"_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex",
"\\u",
"large_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update",
"\\u",
"all_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"test",
" ",
"for",
" ",
"long",
" ",
"value_",
"\\u\\u\\uNL\\u\\u\\u_",
"data_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"{_",
"\"",
"key",
"\"_",
":_",
"\"",
"v",
"\"_",
"*_",
"260_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex",
"\\u",
"large_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update",
"\\u",
"all_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"test",
" ",
"for",
" ",
"empty",
" ",
"key",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"data_",
"=_",
"{_",
"\"",
"metadata",
"\"_",
":_",
"{_",
"\"\"_",
":_",
"\"",
"value",
"1",
"\"_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"self_",
"._",
"validation",
"\\u",
"ex_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update",
"\\u",
"all_",
",_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2_",
"(_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"validation",
"\\u",
"ex_",
"=_",
"webob_",
"._",
"exc_",
"._",
"HTTP",
"Ba",
"d",
"Request_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"validation",
"\\u",
"ex",
"\\u",
"large_",
"=_",
"webob_",
"._",
"exc_",
"._",
"HTTP",
"Request",
"Entit",
"y",
"Too",
"Large",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2_",
"(_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u",
"set\\u",
"up",
"\\u",
"resources_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"controller_",
"=_",
"server",
"\\u",
"metadata",
"\\u",
"v2_",
"._",
"Controller_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"uuid_",
"=_",
"str_",
"(_",
"uuid_",
"._",
"uuid4_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"url_",
"=_",
"'/",
"v1",
".1",
"/",
"fake",
"/",
"server",
"s",
"/",
"%",
"s",
"/",
"metadata",
"'_",
"%_",
"self_",
"._",
"uuid_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Data",
"Test",
"V2_",
"(_",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get",
"\\u",
"request_",
"(_",
"self_",
",_",
"param",
"\\u",
"url_",
"=_",
"''_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"fakes_",
"._",
"HTTP",
"Request_",
"._",
"blank_",
"(_",
"self_",
"._",
"url_",
"+_",
"param",
"\\u",
"url_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Ba",
"d",
"State",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Ba",
"d",
"State",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"set",
"Up_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"super_",
"(_",
"Ba",
"d",
"State",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
",_",
"self_",
")_",
"._",
"set",
"Up_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"fakes_",
"._",
"stub",
"\\u",
"out",
"\\u",
"key",
"\\u",
"pair",
"\\u",
"funcs_",
"(_",
"self_",
"._",
"stubs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"get",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"server",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"stubs_",
"._",
"Set_",
"(_",
"compute",
"\\u",
"rpcapi_",
"._",
"Compute",
"API_",
",_",
"'",
"change",
"\\u",
"instance",
"\\u",
"metadata",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"fake",
"\\u",
"change",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"get",
"'_",
",_",
"self_",
"._",
"\\u",
"return",
"\\u",
"server",
"\\u",
"in",
"\\u",
"build_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"get",
"\\u",
"by",
"\\u",
"uuid",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"return",
"\\u",
"server",
"\\u",
"in",
"\\u",
"build",
"\\u",
"by",
"\\u",
"uuid_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"delete",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"delete",
"\\u",
"server",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"set\\u",
"up",
"\\u",
"resources_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Ba",
"d",
"State",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"set\\u",
"up",
"\\u",
"resources_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"controller_",
"=_",
"server",
"\\u",
"metadata",
"\\u",
"v2",
"1_",
"._",
"Server",
"Meta",
"data",
"Controller_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"uuid_",
"=_",
"str_",
"(_",
"uuid_",
"._",
"uuid4_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"url_",
"=_",
"'/",
"fake",
"/",
"server",
"s",
"/",
"%",
"s",
"/",
"metadata",
"'_",
"%_",
"self_",
"._",
"uuid_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Ba",
"d",
"State",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get",
"\\u",
"request_",
"(_",
"self_",
",_",
"param",
"\\u",
"url_",
"=_",
"''_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"fakes_",
"._",
"HTTP",
"Request",
"V2",
"1_",
"._",
"blank_",
"(_",
"self_",
"._",
"url_",
"+_",
"param",
"\\u",
"url_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Ba",
"d",
"State",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"invalid",
"\\u",
"state",
"\\u",
"on",
"\\u",
"delete_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
"'/",
"key",
"2",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"DELET",
"E",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"webob_",
"._",
"exc_",
"._",
"HTTP",
"Conflict_",
",_",
"self_",
"._",
"controller_",
"._",
"delete_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"'",
"key",
"2",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Ba",
"d",
"State",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"invalid",
"\\u",
"state",
"\\u",
"on",
"\\u",
"update",
"\\u",
"metadata_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"stub",
"\\u",
"out_",
"(_",
"'",
"nova",
".",
"db",
".",
"instance",
"\\u",
"metadata",
"\\u",
"update",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"return",
"\\u",
"create",
"\\u",
"instance",
"\\u",
"metadata_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"POST",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"content",
"\\u",
"type_",
"=_",
"'",
"applica",
"tion",
"/",
"json",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"metadata",
"'_",
":_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"key",
"1",
"'_",
":_",
"'",
"update",
"dva",
"lue",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"key",
"2",
"9",
"'_",
":_",
"'",
"new",
"key",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"webob_",
"._",
"exc_",
"._",
"HTTP",
"Conflict_",
",_",
"self_",
"._",
"controller_",
"._",
"update",
"\\u",
"all_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Ba",
"d",
"State",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"return",
"\\u",
"server",
"\\u",
"in",
"\\u",
"build_",
"(_",
"self_",
",_",
"context_",
",_",
"server",
"\\u",
"id_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"column",
"s",
"\\u",
"to",
"\\u",
"join_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"fake",
"\\u",
"instance_",
"._",
"fake",
"\\u",
"db",
"\\u",
"instance_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"**_",
"{_",
"'",
"id",
"'_",
":_",
"server",
"\\u",
"id_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"uuid",
"'_",
":_",
"'",
"0c",
"c3",
"346",
"e-",
"9",
"fe",
"f",
"-",
"444",
"5",
"-",
"abe",
"6",
"-",
"5d",
"2b",
"269",
"0e",
"c6",
"4",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"name",
"'_",
":_",
"'",
"fake",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"lock",
"ed",
"'_",
":_",
"False_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"vm",
"\\u",
"state",
"'_",
":_",
"vm",
"\\u",
"states_",
"._",
"BUILD",
"ING_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Ba",
"d",
"State",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"return",
"\\u",
"server",
"\\u",
"in",
"\\u",
"build",
"\\u",
"by",
"\\u",
"uuid_",
"(_",
"self_",
",_",
"context_",
",_",
"server",
"\\u",
"uuid_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"column",
"s",
"\\u",
"to",
"\\u",
"join_",
"=_",
"None_",
",_",
"use",
"\\u",
"slave_",
"=_",
"False_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"fake",
"\\u",
"instance_",
"._",
"fake",
"\\u",
"db",
"\\u",
"instance_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"**_",
"{_",
"'",
"id",
"'_",
":_",
"1_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"uuid",
"'_",
":_",
"'",
"0c",
"c3",
"346",
"e-",
"9",
"fe",
"f",
"-",
"444",
"5",
"-",
"abe",
"6",
"-",
"5d",
"2b",
"269",
"0e",
"c6",
"4",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"name",
"'_",
":_",
"'",
"fake",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"lock",
"ed",
"'_",
":_",
"False_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"vm",
"\\u",
"state",
"'_",
":_",
"vm",
"\\u",
"states_",
"._",
"BUILD",
"ING_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Ba",
"d",
"State",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"._",
"object_",
"(_",
"nova_",
"._",
"compute_",
"._",
"api_",
"._",
"API_",
",_",
"'",
"update",
"\\u",
"instance",
"\\u",
"metadata",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"side",
"\\u",
"effect_",
"=_",
"exception_",
"._",
"Insta",
"nce",
"Is",
"Locke",
"d_",
"(_",
"instance",
"\\u",
"uuid_",
"=_",
"0_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"test\\u",
"instance",
"\\u",
"lock",
"\\u",
"update",
"\\u",
"metadata_",
"(_",
"self_",
",_",
"mock",
"\\u",
"update_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"req_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"method_",
"=_",
"'",
"POST",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"content",
"\\u",
"type_",
"=_",
"'",
"applica",
"tion",
"/",
"json",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"metadata",
"'_",
":_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"keyd",
"umm",
"y",
"'_",
":_",
"'",
"new",
"key",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"req_",
"._",
"body_",
"=_",
"jsonutils_",
"._",
"dump",
"\\u",
"as",
"\\u",
"bytes_",
"(_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"webob_",
"._",
"exc_",
"._",
"HTTP",
"Conflict_",
",_",
"self_",
"._",
"controller_",
"._",
"update",
"\\u",
"all_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"req_",
",_",
"self_",
"._",
"uuid_",
",_",
"body_",
"=_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Ba",
"d",
"State",
"Server",
"Meta",
"Data",
"Test",
"V2_",
"(_",
"Ba",
"d",
"State",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Ba",
"d",
"State",
"Server",
"Meta",
"Data",
"Test",
"V2_",
"(_",
"Ba",
"d",
"State",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"\\u",
"set\\u",
"up",
"\\u",
"resources_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"controller_",
"=_",
"server",
"\\u",
"metadata",
"\\u",
"v2_",
"._",
"Controller_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"uuid_",
"=_",
"str_",
"(_",
"uuid_",
"._",
"uuid4_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"url_",
"=_",
"'/",
"v1",
".1",
"/",
"fake",
"/",
"server",
"s",
"/",
"%",
"s",
"/",
"metadata",
"'_",
"%_",
"self_",
"._",
"uuid_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Ba",
"d",
"State",
"Server",
"Meta",
"Data",
"Test",
"V2_",
"(_",
"Ba",
"d",
"State",
"Server",
"Meta",
"Data",
"Test",
"V2",
"1_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get",
"\\u",
"request_",
"(_",
"self_",
",_",
"param",
"\\u",
"url_",
"=_",
"''_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"fakes_",
"._",
"HTTP",
"Request_",
"._",
"blank_",
"(_",
"self_",
"._",
"url_",
"+_",
"param",
"\\u",
"url_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Server",
"Meta",
"Polic",
"y",
"Enf",
"orce",
"ment",
"V2",
"1_",
"(_",
"test_",
"._",
"No",
"DB",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Polic",
"y",
"Enf",
"orce",
"ment",
"V2",
"1_",
"(_",
"test_",
"._",
"No",
"DB",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"set",
"Up_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"super_",
"(_",
"Server",
"Meta",
"Polic",
"y",
"Enf",
"orce",
"ment",
"V2",
"1_",
",_",
"self_",
")_",
"._",
"set",
"Up_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"controller_",
"=_",
"server",
"\\u",
"metadata",
"\\u",
"v2",
"1_",
"._",
"Server",
"Meta",
"data",
"Controller_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"req_",
"=_",
"fakes_",
"._",
"HTTP",
"Request_",
"._",
"blank_",
"(_",
"''_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Polic",
"y",
"Enf",
"orce",
"ment",
"V2",
"1_",
"(_",
"test_",
"._",
"No",
"DB",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"create",
"\\u",
"policy",
"\\u",
"failed_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"rule",
"\\u",
"name_",
"=_",
"\"",
"os",
"\\u",
"compute",
"\\u",
"api",
":",
"server",
"-",
"metadata",
":",
"create",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"policy_",
"._",
"set\\u",
"rules_",
"(_",
"{_",
"rule",
"\\u",
"name_",
":_",
"\"",
"project",
":",
"non",
"\\u",
"fake",
"\"_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"exc_",
"=_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"exception_",
"._",
"Polic",
"y",
"Not",
"Authorized",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"create_",
",_",
"self_",
"._",
"req_",
",_",
"fakes_",
"._",
"FAKE",
"\\u",
"UUID_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"{_",
"'",
"metadata",
"'_",
":_",
"{_",
"}_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Polic",
"y",
" ",
"doe",
"sn",
"'",
"t",
" ",
"allow",
" ",
"%",
"s",
" ",
"to",
" ",
"be",
" ",
"perform",
"ed",
".\"_",
"%_",
"rule",
"\\u",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"exc_",
"._",
"format\\u",
"message_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Polic",
"y",
"Enf",
"orce",
"ment",
"V2",
"1_",
"(_",
"test_",
"._",
"No",
"DB",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"index",
"\\u",
"policy",
"\\u",
"failed_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"rule",
"\\u",
"name_",
"=_",
"\"",
"os",
"\\u",
"compute",
"\\u",
"api",
":",
"server",
"-",
"metadata",
":",
"index",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"policy_",
"._",
"set\\u",
"rules_",
"(_",
"{_",
"rule",
"\\u",
"name_",
":_",
"\"",
"project",
":",
"non",
"\\u",
"fake",
"\"_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"exc_",
"=_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"exception_",
"._",
"Polic",
"y",
"Not",
"Authorized",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"index_",
",_",
"self_",
"._",
"req_",
",_",
"fakes_",
"._",
"FAKE",
"\\u",
"UUID_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Polic",
"y",
" ",
"doe",
"sn",
"'",
"t",
" ",
"allow",
" ",
"%",
"s",
" ",
"to",
" ",
"be",
" ",
"perform",
"ed",
".\"_",
"%_",
"rule",
"\\u",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"exc_",
"._",
"format\\u",
"message_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Polic",
"y",
"Enf",
"orce",
"ment",
"V2",
"1_",
"(_",
"test_",
"._",
"No",
"DB",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"policy",
"\\u",
"failed_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"rule",
"\\u",
"name_",
"=_",
"\"",
"os",
"\\u",
"compute",
"\\u",
"api",
":",
"server",
"-",
"metadata",
":",
"update",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"policy_",
"._",
"set\\u",
"rules_",
"(_",
"{_",
"rule",
"\\u",
"name_",
":_",
"\"",
"project",
":",
"non",
"\\u",
"fake",
"\"_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"exc_",
"=_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"exception_",
"._",
"Polic",
"y",
"Not",
"Authorized",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update_",
",_",
"self_",
"._",
"req_",
",_",
"fakes_",
"._",
"FAKE",
"\\u",
"UUID_",
",_",
"fakes_",
"._",
"FAKE",
"\\u",
"UUID_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"{_",
"'",
"meta",
"'_",
":_",
"{_",
"'",
"fake",
"\\u",
"meta",
"'_",
":_",
"'",
"fake",
"\\u",
"meta",
"'_",
"}_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Polic",
"y",
" ",
"doe",
"sn",
"'",
"t",
" ",
"allow",
" ",
"%",
"s",
" ",
"to",
" ",
"be",
" ",
"perform",
"ed",
".\"_",
"%_",
"rule",
"\\u",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"exc_",
"._",
"format\\u",
"message_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Polic",
"y",
"Enf",
"orce",
"ment",
"V2",
"1_",
"(_",
"test_",
"._",
"No",
"DB",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"update",
"\\u",
"all",
"\\u",
"policy",
"\\u",
"failed_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"rule",
"\\u",
"name_",
"=_",
"\"",
"os",
"\\u",
"compute",
"\\u",
"api",
":",
"server",
"-",
"metadata",
":",
"update",
"\\u",
"all",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"policy_",
"._",
"set\\u",
"rules_",
"(_",
"{_",
"rule",
"\\u",
"name_",
":_",
"\"",
"project",
":",
"non",
"\\u",
"fake",
"\"_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"exc_",
"=_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"exception_",
"._",
"Polic",
"y",
"Not",
"Authorized",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"update",
"\\u",
"all_",
",_",
"self_",
"._",
"req_",
",_",
"fakes_",
"._",
"FAKE",
"\\u",
"UUID_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"body_",
"=_",
"{_",
"'",
"metadata",
"'_",
":_",
"{_",
"}_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Polic",
"y",
" ",
"doe",
"sn",
"'",
"t",
" ",
"allow",
" ",
"%",
"s",
" ",
"to",
" ",
"be",
" ",
"perform",
"ed",
".\"_",
"%_",
"rule",
"\\u",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"exc_",
"._",
"format\\u",
"message_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Polic",
"y",
"Enf",
"orce",
"ment",
"V2",
"1_",
"(_",
"test_",
"._",
"No",
"DB",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"delete",
"\\u",
"policy",
"\\u",
"failed_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"rule",
"\\u",
"name_",
"=_",
"\"",
"os",
"\\u",
"compute",
"\\u",
"api",
":",
"server",
"-",
"metadata",
":",
"delete",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"policy_",
"._",
"set\\u",
"rules_",
"(_",
"{_",
"rule",
"\\u",
"name_",
":_",
"\"",
"project",
":",
"non",
"\\u",
"fake",
"\"_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"exc_",
"=_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"exception_",
"._",
"Polic",
"y",
"Not",
"Authorized",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"delete_",
",_",
"self_",
"._",
"req_",
",_",
"fakes_",
"._",
"FAKE",
"\\u",
"UUID_",
",_",
"fakes_",
"._",
"FAKE",
"\\u",
"UUID_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Polic",
"y",
" ",
"doe",
"sn",
"'",
"t",
" ",
"allow",
" ",
"%",
"s",
" ",
"to",
" ",
"be",
" ",
"perform",
"ed",
".\"_",
"%_",
"rule",
"\\u",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"exc_",
"._",
"format\\u",
"message_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Server",
"Meta",
"Polic",
"y",
"Enf",
"orce",
"ment",
"V2",
"1_",
"(_",
"test_",
"._",
"No",
"DB",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"show",
"\\u",
"policy",
"\\u",
"failed_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"rule",
"\\u",
"name_",
"=_",
"\"",
"os",
"\\u",
"compute",
"\\u",
"api",
":",
"server",
"-",
"metadata",
":",
"show",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"policy_",
"._",
"set\\u",
"rules_",
"(_",
"{_",
"rule",
"\\u",
"name_",
":_",
"\"",
"project",
":",
"non",
"\\u",
"fake",
"\"_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"exc_",
"=_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"exception_",
"._",
"Polic",
"y",
"Not",
"Authorized",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"controller_",
"._",
"show_",
",_",
"self_",
"._",
"req_",
",_",
"fakes_",
"._",
"FAKE",
"\\u",
"UUID_",
",_",
"fakes_",
"._",
"FAKE",
"\\u",
"UUID_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Polic",
"y",
" ",
"doe",
"sn",
"'",
"t",
" ",
"allow",
" ",
"%",
"s",
" ",
"to",
" ",
"be",
" ",
"perform",
"ed",
".\"_",
"%_",
"rule",
"\\u",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"exc_",
"._",
"format\\u",
"message_",
"(_",
")_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Implicit string concatenation in a list | Xion/pyqcy/docs/conf.py | [
{
"content": "# -*- coding: utf-8 -*-\n#\n# pyqcy documentation build configuration file, created by\n# sphinx-quickstart on Sat May 5 00:30:04 2012.\n#\n# This file is execfile()d with the current directory set to its containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport sys, os\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#sys.path.insert(0, os.path.abspath('.'))\n\n# -- General configuration -----------------------------------------------------\n\nimport pyqcy\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be extensions\n# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.\nextensions = ['sphinx.ext.autodoc', 'sphinx.ext.coverage']\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix of source filenames.\nsource_suffix = '.rst'\n\n# The encoding of source files.\n#source_encoding = 'utf-8-sig'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = u'pyqcy'\ncopyright = u'2012, Karol Kuczmarski'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nimport re\nversion = re.search(r\"\\d+\\.\\d+\", pyqcy.__version__).group()\n# The full version, including alpha/beta/rc tags.\nrelease = pyqcy.__version__\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#language = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = ['_build']\n\n# The reST default role (used for this markup: `text`) to use for all documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n#add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\n#add_module_names = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n\n# -- Options for HTML output ---------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages. See the documentation for\n# a list of builtin themes.\nhtml_theme = 'default'\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further. For a list of options available for each theme, see the\n# documentation.\n#html_theme_options = {}\n\n# Add any paths that contain custom themes here, relative to this directory.\n#html_theme_path = []\n\n# The name for this set of Sphinx documents. If None, it defaults to\n# \"<project> v<release> documentation\".\n#html_title = None\n\n# A shorter title for the navigation bar. Default is the same as html_title.\n#html_short_title = None\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\n#html_logo = None\n\n# The name of an image file (within the static path) to use as favicon of the\n# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\n#html_favicon = None\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\n#html_last_updated_fmt = '%b %d, %Y'\n\n# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\n#html_use_smartypants = True\n\n# Custom sidebar templates, maps document names to template names.\n#html_sidebars = {}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n#html_additional_pages = {}\n\n# If false, no module index is generated.\n#html_domain_indices = True\n\n# If false, no index is generated.\n#html_use_index = True\n\n# If true, the index is split into individual pages for each letter.\n#html_split_index = False\n\n# If true, links to the reST sources are added to the pages.\n#html_show_sourcelink = True\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\n#html_show_sphinx = True\n\n# If true, \"(C) Copyright ...\" is shown in the HTML footer. Default is True.\n#html_show_copyright = True\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a <link> tag referring to it. The value of this option must be the\n# base URL from which the finished HTML is served.\n#html_use_opensearch = ''\n\n# This is the file name suffix for HTML files (e.g. \".xhtml\").\n#html_file_suffix = None\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'pyqcydoc'\n\n\n# -- Options for LaTeX output --------------------------------------------------\n\nlatex_elements = {\n# The paper size ('letterpaper' or 'a4paper').\n#'papersize': 'letterpaper',\n\n# The font size ('10pt', '11pt' or '12pt').\n#'pointsize': '10pt',\n\n# Additional stuff for the LaTeX preamble.\n#'preamble': '',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title, author, documentclass [howto/manual]).\nlatex_documents = [\n ('index', 'pyqcy.tex', u'pyqcy Documentation',\n u'Karol Kuczmarski', 'manual'),\n]\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#latex_use_parts = False\n\n# If true, show page references after internal links.\n#latex_show_pagerefs = False\n\n# If true, show URL addresses after external links.\n#latex_show_urls = False\n\n# Documents to append as an appendix to all manuals.\n#latex_appendices = []\n\n# If false, no module index is generated.\n#latex_domain_indices = True\n\n\n# -- Options for manual page output --------------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n ('index', 'pyqcy', u'pyqcy Documentation',\n [u'Karol Kuczmarski'], 1)\n]\n\n# If true, show URL addresses after external links.\n#man_show_urls = False\n\n\n# -- Options for Texinfo output ------------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n# dir menu entry, description, category)\ntexinfo_documents = [\n ('index', 'pyqcy', u'pyqcy Documentation',\n u'Karol Kuczmarski', 'pyqcy', 'One line description of project.',\n 'Miscellaneous'),\n]\n\n# Documents to append as an appendix to all manuals.\n#texinfo_appendices = []\n\n# If false, no module index is generated.\n#texinfo_domain_indices = True\n\n# How to display URL addresses: 'footnote', 'no', or 'inline'.\n#texinfo_show_urls = 'footnote'\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Implicit",
"_",
"string_",
"concate",
"nation_",
"in_",
"a_",
"list_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#",
" ",
"-*-",
" ",
"codi",
"ng",
":",
" ",
"utf",
"-",
"8",
" ",
"-*-",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"pyq",
"cy",
" ",
"documentation",
" ",
"build",
" ",
"configura",
"tion",
" ",
"file",
",",
" ",
"created",
" ",
"by_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"sphinx",
"-",
"quicks",
"tart",
" ",
"on",
" ",
"Sat",
" ",
"Ma",
"y",
" ",
" ",
"5",
" ",
"00",
":",
"30",
":",
"04",
" ",
"2012",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Thi",
"s",
" ",
"file",
" ",
"is",
" ",
"execfile",
"()",
"d",
" ",
"with",
" ",
"the",
" ",
"current",
" ",
"director",
"y",
" ",
"set",
" ",
"to",
" ",
"its",
" ",
"contain",
"ing",
" ",
"dir",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Not",
"e",
" ",
"tha",
"t",
" ",
"not",
" ",
"all",
" ",
"possib",
"le",
" ",
"configura",
"tion",
" ",
"values",
" ",
"are",
" ",
"presen",
"t",
" ",
"in",
" ",
"this_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"autogen",
"erate",
"d",
" ",
"file",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"All",
" ",
"configura",
"tion",
" ",
"values",
" ",
"have",
" ",
"a",
" ",
"default",
";",
" ",
"values",
" ",
"tha",
"t",
" ",
"are",
" ",
"commente",
"d",
" ",
"out_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"serve",
" ",
"to",
" ",
"show",
" ",
"the",
" ",
"default",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"sys_",
",_",
"os_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"extensi",
"ons",
" ",
"(",
"or",
" ",
"module",
"s",
" ",
"to",
" ",
"document",
" ",
"with",
" ",
"autod",
"oc",
")",
" ",
"are",
" ",
"in",
" ",
"anot",
"her",
" ",
"director",
"y",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"add",
" ",
"these",
" ",
"director",
"ies",
" ",
"to",
" ",
"sys",
".",
"path",
" ",
"here",
".",
" ",
"If",
" ",
"the",
" ",
"director",
"y",
" ",
"is",
" ",
"relative",
" ",
"to",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"documentation",
" ",
"root",
",",
" ",
"use",
" ",
"os",
".",
"path",
".",
"abs",
"path",
" ",
"to",
" ",
"make",
" ",
"it",
" ",
"abs",
"olute",
",",
" ",
"like",
" ",
"shown",
" ",
"here",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"sys",
".",
"path",
".",
"insert",
"(",
"0",
",",
" ",
"os",
".",
"path",
".",
"abs",
"path",
"('.",
"'))",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--",
" ",
"General",
" ",
"configura",
"tion",
" ",
"--------------",
"--------------",
"--------------",
"-----------",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"pyq",
"cy_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"your",
" ",
"documentation",
" ",
"need",
"s",
" ",
"a",
" ",
"minima",
"l",
" ",
"Sph",
"inx",
" ",
"version",
",",
" ",
"state",
" ",
"it",
" ",
"here",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"need",
"s",
"\\u",
"sphinx",
" ",
"=",
" ",
"'",
"1.0",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Add",
" ",
"any",
" ",
"Sph",
"inx",
" ",
"extensi",
"on",
" ",
"module",
" ",
"names",
" ",
"here",
",",
" ",
"as",
" ",
"string",
"s",
".",
" ",
"The",
"y",
" ",
"can",
" ",
"be",
" ",
"extensions_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"comi",
"ng",
" ",
"with",
" ",
"Sph",
"inx",
" ",
"(",
"named",
" ",
"'",
"sphinx",
".",
"ext",
".*",
"')",
" ",
"or",
" ",
"your",
" ",
"custom",
" ",
"ones",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"extensions_",
"=_",
"[_",
"'",
"sphinx",
".",
"ext",
".",
"autod",
"oc",
"'_",
",_",
"'",
"sphinx",
".",
"ext",
".",
"covera",
"ge",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Add",
" ",
"any",
" ",
"path",
"s",
" ",
"tha",
"t",
" ",
"contain",
" ",
"template",
"s",
" ",
"here",
",",
" ",
"relative",
" ",
"to",
" ",
"this",
" ",
"director",
"y",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"template",
"s",
"\\u",
"path_",
"=_",
"[_",
"'\\u",
"template",
"s",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"suff",
"ix",
" ",
"of",
" ",
"source",
" ",
"filename",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"source",
"\\u",
"suffix_",
"=_",
"'.",
"rst",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"encoding",
" ",
"of",
" ",
"source",
" ",
"files",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"source",
"\\u",
"encoding",
" ",
"=",
" ",
"'",
"utf",
"-",
"8",
"-",
"sig",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"master",
" ",
"toc",
"tree",
" ",
"document",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"master",
"\\u",
"doc_",
"=_",
"'",
"index",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"General",
" ",
"informati",
"on",
" ",
"abo",
"ut",
" ",
"the",
" ",
"project",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"project_",
"=_",
"u",
"'",
"pyq",
"cy",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"copyright_",
"=_",
"u",
"'",
"2012",
",",
" ",
"Kar",
"ol",
" ",
"Ku",
"cz",
"mars",
"ki",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"version",
" ",
"info",
" ",
"for",
" ",
"the",
" ",
"project",
" ",
"you",
"'",
"re",
" ",
"document",
"ing",
",",
" ",
"acts",
" ",
"as",
" ",
"replace",
"ment",
" ",
"for_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"|",
"version",
"|",
" ",
"and",
" ",
"|",
"release",
"|",
",",
" ",
"als",
"o",
" ",
"used",
" ",
"in",
" ",
"vari",
"ous",
" ",
"other",
" ",
"place",
"s",
" ",
"through",
"out",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"bui",
"lt",
" ",
"document",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"short",
" ",
"X",
".",
"Y",
" ",
"version",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"re_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"version_",
"=_",
"re_",
"._",
"search_",
"(_",
"r",
"\"\\\\",
"d",
"+\\\\.",
"\\\\",
"d",
"+\"_",
",_",
"pyq",
"cy_",
"._",
"\\u\\u",
"version\\u\\u_",
")_",
"._",
"group_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"The",
" ",
"full",
" ",
"version",
",",
" ",
"inclu",
"ding",
" ",
"alpha",
"/",
"beta",
"/",
"rc",
" ",
"tags",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"release_",
"=_",
"pyq",
"cy_",
"._",
"\\u\\u",
"version\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"language",
" ",
"for",
" ",
"content",
" ",
"autogen",
"erate",
"d",
" ",
"by",
" ",
"Sph",
"inx",
".",
" ",
"Refer",
" ",
"to",
" ",
"documentation",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"for",
" ",
"a",
" ",
"list",
" ",
"of",
" ",
"support",
"ed",
" ",
"language",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"language",
" ",
"=",
" ",
"None_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"There",
" ",
"are",
" ",
"two",
" ",
"options",
" ",
"for",
" ",
"repla",
"cing",
" ",
"|",
"toda",
"y",
"|",
":",
" ",
"eit",
"her",
",",
" ",
"you",
" ",
"set",
" ",
"toda",
"y",
" ",
"to",
" ",
"some",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"non",
"-",
"fal",
"se",
" ",
"value",
",",
" ",
"then",
" ",
"it",
" ",
"is",
" ",
"used",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"toda",
"y",
" ",
"=",
" ",
"''_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Else",
",",
" ",
"toda",
"y",
"\\u",
"fmt",
" ",
"is",
" ",
"used",
" ",
"as",
" ",
"the",
" ",
"format",
" ",
"for",
" ",
"a",
" ",
"strf",
"time",
" ",
"call",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"toda",
"y",
"\\u",
"fmt",
" ",
"=",
" ",
"'%",
"B",
" ",
"%",
"d",
",",
" ",
"%",
"Y",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"List",
" ",
"of",
" ",
"pattern",
"s",
",",
" ",
"relative",
" ",
"to",
" ",
"source",
" ",
"director",
"y",
",",
" ",
"tha",
"t",
" ",
"match",
" ",
"files",
" ",
"and_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"director",
"ies",
" ",
"to",
" ",
"ignore",
" ",
"whe",
"n",
" ",
"look",
"ing",
" ",
"for",
" ",
"source",
" ",
"files",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"exclu",
"de",
"\\u",
"patterns_",
"=_",
"[_",
"'\\u",
"build",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"re",
"ST",
" ",
"default",
" ",
"role",
" ",
"(",
"used",
" ",
"for",
" ",
"this",
" ",
"markup",
":",
" ",
"`",
"text",
"`)",
" ",
"to",
" ",
"use",
" ",
"for",
" ",
"all",
" ",
"document",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"default",
"\\u",
"role",
" ",
"=",
" ",
"None_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"true",
",",
" ",
"'(",
")'",
" ",
"will",
" ",
"be",
" ",
"append",
"ed",
" ",
"to",
" ",
":",
"func",
":",
" ",
"etc",
".",
" ",
"cross",
"-",
"reference",
" ",
"text",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"add",
"\\u",
"function",
"\\u",
"parenthes",
"es",
" ",
"=",
" ",
"True_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"true",
",",
" ",
"the",
" ",
"current",
" ",
"module",
" ",
"name",
" ",
"will",
" ",
"be",
" ",
"prepend",
"ed",
" ",
"to",
" ",
"all",
" ",
"description_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"unit",
" ",
"titles",
" ",
"(",
"suc",
"h",
" ",
"as",
" ",
"..",
" ",
"function",
"::",
").",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"add",
"\\u",
"module",
"\\u",
"names",
" ",
"=",
" ",
"True_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"true",
",",
" ",
"section",
"author",
" ",
"and",
" ",
"module",
"author",
" ",
"directive",
"s",
" ",
"will",
" ",
"be",
" ",
"shown",
" ",
"in",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"output",
".",
" ",
"The",
"y",
" ",
"are",
" ",
"ignore",
"d",
" ",
"by",
" ",
"default",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"show",
"\\u",
"author",
"s",
" ",
"=",
" ",
"False_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"name",
" ",
"of",
" ",
"the",
" ",
"Pyg",
"ment",
"s",
" ",
"(",
"synta",
"x",
" ",
"highlight",
"ing",
")",
" ",
"style",
" ",
"to",
" ",
"use",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"pyg",
"ment",
"s",
"\\u",
"style_",
"=_",
"'",
"sphinx",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"A",
" ",
"list",
" ",
"of",
" ",
"ignore",
"d",
" ",
"prefix",
"es",
" ",
"for",
" ",
"module",
" ",
"index",
" ",
"sorting",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"modi",
"nde",
"x",
"\\u",
"common",
"\\u",
"prefix",
" ",
"=",
" ",
"[]",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--",
" ",
"Optio",
"ns",
" ",
"for",
" ",
"HTM",
"L",
" ",
"output",
" ",
"--------------",
"--------------",
"--------------",
"---------",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"them",
"e",
" ",
"to",
" ",
"use",
" ",
"for",
" ",
"HTM",
"L",
" ",
"and",
" ",
"HTM",
"L",
" ",
"Help",
" ",
"page",
"s",
".",
" ",
" ",
"See",
" ",
"the",
" ",
"documentation",
" ",
"for_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"a",
" ",
"list",
" ",
"of",
" ",
"bui",
"lti",
"n",
" ",
"themes",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"html",
"\\u",
"theme_",
"=_",
"'",
"default",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Them",
"e",
" ",
"options",
" ",
"are",
" ",
"them",
"e-",
"specific",
" ",
"and",
" ",
"customize",
" ",
"the",
" ",
"look",
" ",
"and",
" ",
"feel",
" ",
"of",
" ",
"a",
" ",
"theme_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"fur",
"ther",
".",
" ",
" ",
"For",
" ",
"a",
" ",
"list",
" ",
"of",
" ",
"options",
" ",
"avail",
"able",
" ",
"for",
" ",
"each",
" ",
"them",
"e",
",",
" ",
"see",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"documentation",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"them",
"e\\u",
"options",
" ",
"=",
" ",
"{}",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Add",
" ",
"any",
" ",
"path",
"s",
" ",
"tha",
"t",
" ",
"contain",
" ",
"custom",
" ",
"themes",
" ",
"here",
",",
" ",
"relative",
" ",
"to",
" ",
"this",
" ",
"director",
"y",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"them",
"e\\u",
"path",
" ",
"=",
" ",
"[]",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"name",
" ",
"for",
" ",
"this",
" ",
"set",
" ",
"of",
" ",
"Sph",
"inx",
" ",
"document",
"s",
".",
" ",
" ",
"If",
" ",
"Non",
"e",
",",
" ",
"it",
" ",
"default",
"s",
" ",
"to_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"\"<",
"project",
">",
" ",
"v",
"<",
"release",
">",
" ",
"documentation",
"\".",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"title",
" ",
"=",
" ",
"None_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"A",
" ",
"shorter",
" ",
"title",
" ",
"for",
" ",
"the",
" ",
"navigation",
" ",
"bar",
".",
" ",
" ",
"Default",
" ",
"is",
" ",
"the",
" ",
"same",
" ",
"as",
" ",
"html",
"\\u",
"title",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"short",
"\\u",
"title",
" ",
"=",
" ",
"None_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"name",
" ",
"of",
" ",
"an",
" ",
"image",
" ",
"file",
" ",
"(",
"relative",
" ",
"to",
" ",
"this",
" ",
"director",
"y",
")",
" ",
"to",
" ",
"place",
" ",
"at",
" ",
"the",
" ",
"top_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"of",
" ",
"the",
" ",
"sidebar",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"logo",
" ",
"=",
" ",
"None_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"name",
" ",
"of",
" ",
"an",
" ",
"image",
" ",
"file",
" ",
"(",
"within",
" ",
"the",
" ",
"static",
" ",
"path",
")",
" ",
"to",
" ",
"use",
" ",
"as",
" ",
"fav",
"icon",
" ",
"of",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"docs",
".",
" ",
" ",
"Thi",
"s",
" ",
"file",
" ",
"shou",
"ld",
" ",
"be",
" ",
"a",
" ",
"Window",
"s",
" ",
"icon",
" ",
"file",
" ",
"(.",
"ico",
")",
" ",
"bei",
"ng",
" ",
"16",
"x1",
"6",
" ",
"or",
" ",
"32",
"x3",
"2_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"pixel",
"s",
" ",
"large",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"fav",
"icon",
" ",
"=",
" ",
"None_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Add",
" ",
"any",
" ",
"path",
"s",
" ",
"tha",
"t",
" ",
"contain",
" ",
"custom",
" ",
"static",
" ",
"files",
" ",
"(",
"suc",
"h",
" ",
"as",
" ",
"style",
" ",
"sheet",
"s",
")",
" ",
"here",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"relative",
" ",
"to",
" ",
"this",
" ",
"director",
"y",
".",
" ",
"The",
"y",
" ",
"are",
" ",
"copie",
"d",
" ",
"after",
" ",
"the",
" ",
"bui",
"lti",
"n",
" ",
"static",
" ",
"files",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"so",
" ",
"a",
" ",
"file",
" ",
"named",
" ",
"\"",
"default",
".",
"css",
"\"",
" ",
"will",
" ",
"overwrit",
"e",
" ",
"the",
" ",
"bui",
"lti",
"n",
" ",
"\"",
"default",
".",
"css",
"\".",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"html",
"\\u",
"static",
"\\u",
"path_",
"=_",
"[_",
"'\\u",
"static",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"not",
" ",
"''",
",",
" ",
"a",
" ",
"'",
"Las",
"t",
" ",
"update",
"d",
" ",
"on",
":'",
" ",
"timestamp",
" ",
"is",
" ",
"inserted",
" ",
"at",
" ",
"every",
" ",
"page",
" ",
"bottom",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"usi",
"ng",
" ",
"the",
" ",
"give",
"n",
" ",
"strf",
"time",
" ",
"format",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"last",
"\\u",
"update",
"d\\u",
"fmt",
" ",
"=",
" ",
"'%",
"b",
" ",
"%",
"d",
",",
" ",
"%",
"Y",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"true",
",",
" ",
"Sma",
"rty",
"Pant",
"s",
" ",
"will",
" ",
"be",
" ",
"used",
" ",
"to",
" ",
"convert",
" ",
"quote",
"s",
" ",
"and",
" ",
"dashes",
" ",
"to_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"typo",
"graphical",
"ly",
" ",
"correct",
" ",
"entit",
"ies",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"use",
"\\u",
"smart",
"ypa",
"nts",
" ",
"=",
" ",
"True_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Custom",
" ",
"sidebar",
" ",
"template",
"s",
",",
" ",
"maps",
" ",
"document",
" ",
"names",
" ",
"to",
" ",
"template",
" ",
"names",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"sidebar",
"s",
" ",
"=",
" ",
"{}",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Addition",
"al",
" ",
"template",
"s",
" ",
"tha",
"t",
" ",
"shou",
"ld",
" ",
"be",
" ",
"render",
"ed",
" ",
"to",
" ",
"page",
"s",
",",
" ",
"maps",
" ",
"page",
" ",
"names",
" ",
"to_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"template",
" ",
"names",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"addition",
"al",
"\\u",
"page",
"s",
" ",
"=",
" ",
"{}",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"fal",
"se",
",",
" ",
"no",
" ",
"module",
" ",
"index",
" ",
"is",
" ",
"generat",
"ed",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"domain",
"\\u",
"indice",
"s",
" ",
"=",
" ",
"True_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"fal",
"se",
",",
" ",
"no",
" ",
"index",
" ",
"is",
" ",
"generat",
"ed",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"use",
"\\u",
"index",
" ",
"=",
" ",
"True_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"true",
",",
" ",
"the",
" ",
"index",
" ",
"is",
" ",
"split",
" ",
"int",
"o",
" ",
"individual",
" ",
"page",
"s",
" ",
"for",
" ",
"each",
" ",
"letter",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"split",
"\\u",
"index",
" ",
"=",
" ",
"False_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"true",
",",
" ",
"link",
"s",
" ",
"to",
" ",
"the",
" ",
"re",
"ST",
" ",
"source",
"s",
" ",
"are",
" ",
"adde",
"d",
" ",
"to",
" ",
"the",
" ",
"page",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"show",
"\\u",
"source",
"link",
" ",
"=",
" ",
"True_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"true",
",",
" ",
"\"",
"Creat",
"ed",
" ",
"usi",
"ng",
" ",
"Sph",
"inx",
"\"",
" ",
"is",
" ",
"shown",
" ",
"in",
" ",
"the",
" ",
"HTM",
"L",
" ",
"footer",
".",
" ",
"Default",
" ",
"is",
" ",
"Tru",
"e",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"show",
"\\u",
"sphinx",
" ",
"=",
" ",
"True_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"true",
",",
" ",
"\"(",
"C",
")",
" ",
"Copy",
"right",
" ",
"...\"",
" ",
"is",
" ",
"shown",
" ",
"in",
" ",
"the",
" ",
"HTM",
"L",
" ",
"footer",
".",
" ",
"Default",
" ",
"is",
" ",
"Tru",
"e",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"show",
"\\u",
"copyr",
"ight",
" ",
"=",
" ",
"True_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"true",
",",
" ",
"an",
" ",
"Open",
"Sear",
"ch",
" ",
"description",
" ",
"file",
" ",
"will",
" ",
"be",
" ",
"output",
",",
" ",
"and",
" ",
"all",
" ",
"page",
"s",
" ",
"will",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"contain",
" ",
"a",
" ",
"<",
"link",
">",
" ",
"tag",
" ",
"refer",
"ring",
" ",
"to",
" ",
"it",
".",
" ",
" ",
"The",
" ",
"value",
" ",
"of",
" ",
"this",
" ",
"option",
" ",
"must",
" ",
"be",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"base",
" ",
"URL",
" ",
"from",
" ",
"whi",
"ch",
" ",
"the",
" ",
"finish",
"ed",
" ",
"HTM",
"L",
" ",
"is",
" ",
"serve",
"d",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"use",
"\\u",
"opens",
"ear",
"ch",
" ",
"=",
" ",
"''_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Thi",
"s",
" ",
"is",
" ",
"the",
" ",
"file",
" ",
"name",
" ",
"suff",
"ix",
" ",
"for",
" ",
"HTM",
"L",
" ",
"files",
" ",
"(",
"e",
".",
"g",
".",
" ",
"\".",
"xh",
"tml",
"\")",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"html",
"\\u",
"file",
"\\u",
"suff",
"ix",
" ",
"=",
" ",
"None_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Output",
" ",
"file",
" ",
"base",
" ",
"name",
" ",
"for",
" ",
"HTM",
"L",
" ",
"help",
" ",
"builde",
"r",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"html",
"help",
"\\u",
"basename_",
"=_",
"'",
"pyq",
"cy",
"doc",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--",
" ",
"Optio",
"ns",
" ",
"for",
" ",
"La",
"Te",
"X",
" ",
"output",
" ",
"--------------",
"--------------",
"--------------",
"--------",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"late",
"x",
"\\u",
"elements_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"pape",
"r",
" ",
"size",
" ",
"('",
"letter",
"pape",
"r",
"'",
" ",
"or",
" ",
"'",
"a4",
"pape",
"r",
"')",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#'",
"papers",
"ize",
"':",
" ",
"'",
"letter",
"pape",
"r",
"',",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"font",
" ",
"size",
" ",
"('",
"10",
"pt",
"',",
" ",
"'",
"11",
"pt",
"'",
" ",
"or",
" ",
"'",
"1",
"2p",
"t",
"')",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#'",
"points",
"ize",
"':",
" ",
"'",
"10",
"pt",
"',",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Addition",
"al",
" ",
"stu",
"ff",
" ",
"for",
" ",
"the",
" ",
"La",
"Te",
"X",
" ",
"preamble",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#'",
"preamble",
"':",
" ",
"''",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Group",
"ing",
" ",
"the",
" ",
"document",
" ",
"tree",
" ",
"int",
"o",
" ",
"La",
"Te",
"X",
" ",
"files",
".",
" ",
"List",
" ",
"of",
" ",
"tuples_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"(",
"source",
" ",
"start",
" ",
"file",
",",
" ",
"target",
" ",
"name",
",",
" ",
"title",
",",
" ",
"author",
",",
" ",
"document",
"class",
" ",
"[",
"how",
"to",
"/",
"manu",
"al",
"])",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"late",
"x",
"\\u",
"documents_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"index",
"'_",
",_",
"'",
"pyq",
"cy",
".",
"tex",
"'_",
",_",
"u",
"'",
"pyq",
"cy",
" ",
"Document",
"ation",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"u",
"'",
"Kar",
"ol",
" ",
"Ku",
"cz",
"mars",
"ki",
"'_",
",_",
"'",
"manu",
"al",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"name",
" ",
"of",
" ",
"an",
" ",
"image",
" ",
"file",
" ",
"(",
"relative",
" ",
"to",
" ",
"this",
" ",
"director",
"y",
")",
" ",
"to",
" ",
"place",
" ",
"at",
" ",
"the",
" ",
"top",
" ",
"of_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"the",
" ",
"title",
" ",
"page",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"late",
"x",
"\\u",
"logo",
" ",
"=",
" ",
"None_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"For",
" ",
"\"",
"manu",
"al",
"\"",
" ",
"document",
"s",
",",
" ",
"if",
" ",
"this",
" ",
"is",
" ",
"true",
",",
" ",
"then",
" ",
"toplevel",
" ",
"heading",
"s",
" ",
"are",
" ",
"part",
"s",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"not",
" ",
"chapters",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"late",
"x",
"\\u",
"use",
"\\u",
"part",
"s",
" ",
"=",
" ",
"False_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"true",
",",
" ",
"show",
" ",
"page",
" ",
"reference",
"s",
" ",
"after",
" ",
"internal",
" ",
"link",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"late",
"x",
"\\u",
"show",
"\\u",
"pager",
"ef",
"s",
" ",
"=",
" ",
"False_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"true",
",",
" ",
"show",
" ",
"URL",
" ",
"addresse",
"s",
" ",
"after",
" ",
"external",
" ",
"link",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"late",
"x",
"\\u",
"show",
"\\u",
"urls",
" ",
"=",
" ",
"False_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Document",
"s",
" ",
"to",
" ",
"append",
" ",
"as",
" ",
"an",
" ",
"appendi",
"x",
" ",
"to",
" ",
"all",
" ",
"manu",
"als",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"late",
"x",
"\\u",
"appendi",
"ces",
" ",
"=",
" ",
"[]",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"fal",
"se",
",",
" ",
"no",
" ",
"module",
" ",
"index",
" ",
"is",
" ",
"generat",
"ed",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"late",
"x",
"\\u",
"domain",
"\\u",
"indice",
"s",
" ",
"=",
" ",
"True_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--",
" ",
"Optio",
"ns",
" ",
"for",
" ",
"manu",
"al",
" ",
"page",
" ",
"output",
" ",
"--------------",
"--------------",
"--------------",
"--",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"One",
" ",
"entry",
" ",
"per",
" ",
"manu",
"al",
" ",
"page",
".",
" ",
"List",
" ",
"of",
" ",
"tuples_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"(",
"source",
" ",
"start",
" ",
"file",
",",
" ",
"name",
",",
" ",
"description",
",",
" ",
"author",
"s",
",",
" ",
"manu",
"al",
" ",
"section",
").",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"man",
"\\u",
"pages_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"index",
"'_",
",_",
"'",
"pyq",
"cy",
"'_",
",_",
"u",
"'",
"pyq",
"cy",
" ",
"Document",
"ation",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"[_",
"u",
"'",
"Kar",
"ol",
" ",
"Ku",
"cz",
"mars",
"ki",
"'_",
"]_",
",_",
"1_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"true",
",",
" ",
"show",
" ",
"URL",
" ",
"addresse",
"s",
" ",
"after",
" ",
"external",
" ",
"link",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"man",
"\\u",
"show",
"\\u",
"urls",
" ",
"=",
" ",
"False_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--",
" ",
"Optio",
"ns",
" ",
"for",
" ",
"Tex",
"info",
" ",
"output",
" ",
"--------------",
"--------------",
"--------------",
"------",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Group",
"ing",
" ",
"the",
" ",
"document",
" ",
"tree",
" ",
"int",
"o",
" ",
"Tex",
"info",
" ",
"files",
".",
" ",
"List",
" ",
"of",
" ",
"tuples_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"(",
"source",
" ",
"start",
" ",
"file",
",",
" ",
"target",
" ",
"name",
",",
" ",
"title",
",",
" ",
"author",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"dir",
" ",
"menu",
" ",
"entry",
",",
" ",
"description",
",",
" ",
"category",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"tex",
"info",
"\\u",
"documents_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"index",
"'_",
",_",
"'",
"pyq",
"cy",
"'_",
",_",
"u",
"'",
"pyq",
"cy",
" ",
"Document",
"ation",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"u",
"'",
"Kar",
"ol",
" ",
"Ku",
"cz",
"mars",
"ki",
"'_",
",_",
"'",
"pyq",
"cy",
"'_",
",_",
"'",
"One",
" ",
"line",
" ",
"description",
" ",
"of",
" ",
"project",
".'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Mis",
"cell",
"ane",
"ous",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Document",
"s",
" ",
"to",
" ",
"append",
" ",
"as",
" ",
"an",
" ",
"appendi",
"x",
" ",
"to",
" ",
"all",
" ",
"manu",
"als",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"tex",
"info",
"\\u",
"appendi",
"ces",
" ",
"=",
" ",
"[]",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"fal",
"se",
",",
" ",
"no",
" ",
"module",
" ",
"index",
" ",
"is",
" ",
"generat",
"ed",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"tex",
"info",
"\\u",
"domain",
"\\u",
"indice",
"s",
" ",
"=",
" ",
"True_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Variable defined multiple times | saltstack/salt/salt/spm/__init__.py | [
{
"content": " def _check_all_deps(self, pkg_name=None, pkg_file=None, formula_def=None):\n '''\n Starting with one package, check all packages for dependencies\n '''\n if pkg_file and not os.path.exists(pkg_file):\n raise SPMInvocationError('Package file {0} not found'.format(pkg_file))\n\n self.repo_metadata = self._get_repo_metadata()\n if not formula_def:\n for repo in self.repo_metadata:\n if not isinstance(self.repo_metadata[repo]['packages'], dict):\n continue\n if pkg_name in self.repo_metadata[repo]['packages']:\n formula_def = self.repo_metadata[repo]['packages'][pkg_name]['info']\n\n if not formula_def:\n raise SPMInvocationError('Unable to read formula for {0}'.format(pkg_name))\n\n # Check to see if the package is already installed\n pkg_info = self._pkgdb_fun('info', pkg_name, self.db_conn)\n pkgs_to_install = []\n if pkg_info is None or self.opts['force']:\n pkgs_to_install.append(pkg_name)\n elif pkg_info is not None and not self.opts['force']:\n raise SPMPackageError(\n 'Package {0} already installed, not installing again'.format(formula_def['name'])\n )\n\n optional_install = []\n recommended_install = []\n if 'dependencies' in formula_def or 'optional' in formula_def or 'recommended' in formula_def:\n self.avail_pkgs = {}\n for repo in self.repo_metadata:\n if not isinstance(self.repo_metadata[repo]['packages'], dict):\n continue\n for pkg in self.repo_metadata[repo]['packages']:\n self.avail_pkgs[pkg] = repo\n\n needs, unavail, optional, recommended = self._resolve_deps(formula_def)\n\n if len(unavail) > 0:\n raise SPMPackageError(\n 'Cannot install {0}, the following dependencies are needed:\\n\\n{1}'.format(\n formula_def['name'], '\\n'.join(unavail))\n )\n\n if optional:\n optional_install.extend(optional)\n for dep_pkg in optional:\n pkg_info = self._pkgdb_fun('info', formula_def['name'])\n msg = dep_pkg\n if isinstance(pkg_info, dict):\n msg = '{0} [Installed]'.format(dep_pkg)\n optional_install.append(msg)\n\n if recommended:\n recommended_install.extend(recommended)\n for dep_pkg in recommended:\n pkg_info = self._pkgdb_fun('info', formula_def['name'])\n msg = dep_pkg\n if isinstance(pkg_info, dict):\n msg = '{0} [Installed]'.format(dep_pkg)\n recommended_install.append(msg)\n\n if needs:\n pkgs_to_install.extend(needs)\n for dep_pkg in needs:\n pkg_info = self._pkgdb_fun('info', formula_def['name'])\n msg = dep_pkg\n if isinstance(pkg_info, dict):\n msg = '{0} [Installed]'.format(dep_pkg)\n\n return pkgs_to_install, optional_install, recommended_install",
"metadata": "root.SPMClient._check_all_deps",
"header": "['class', 'SPMClient', '(', 'object', ')', ':', '___EOS___']",
"index": 246
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Variable_",
"defined_",
"multiple_",
"times_",
"[SEP]_",
"class_",
"SP",
"MC",
"lient_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"check",
"\\u",
"all",
"\\u",
"deps_",
"(_",
"self_",
",_",
"pkg",
"\\u",
"name_",
"=_",
"None_",
",_",
"pkg",
"\\u",
"file_",
"=_",
"None_",
",_",
"formula",
"\\u",
"def_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Start",
"ing",
" ",
"with",
" ",
"one",
" ",
"package",
",",
" ",
"check",
" ",
"all",
" ",
"package",
"s",
" ",
"for",
" ",
"dependen",
"cies",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"pkg",
"\\u",
"file_",
"and_",
"not_",
"os_",
"._",
"path_",
"._",
"exists_",
"(_",
"pkg",
"\\u",
"file_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"SP",
"MI",
"nv",
"ocation",
"Error_",
"(_",
"'",
"Packa",
"ge",
" ",
"file",
" ",
"{",
"0",
"}",
" ",
"not",
" ",
"found",
"'_",
"._",
"format_",
"(_",
"pkg",
"\\u",
"file_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"repo",
"\\u",
"metadata_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"repo",
"\\u",
"metadata_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"formula",
"\\u",
"def_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"repo_",
"in_",
"self_",
"._",
"repo",
"\\u",
"metadata_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"isinstance_",
"(_",
"self_",
"._",
"repo",
"\\u",
"metadata_",
"[_",
"repo_",
"]_",
"[_",
"'",
"package",
"s",
"'_",
"]_",
",_",
"dict_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"continue_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"pkg",
"\\u",
"name_",
"in_",
"self_",
"._",
"repo",
"\\u",
"metadata_",
"[_",
"repo_",
"]_",
"[_",
"'",
"package",
"s",
"'_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"formula",
"\\u",
"def_",
"=_",
"self_",
"._",
"repo",
"\\u",
"metadata_",
"[_",
"repo_",
"]_",
"[_",
"'",
"package",
"s",
"'_",
"]_",
"[_",
"pkg",
"\\u",
"name_",
"]_",
"[_",
"'",
"info",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"formula",
"\\u",
"def_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"SP",
"MI",
"nv",
"ocation",
"Error_",
"(_",
"'",
"Una",
"ble",
" ",
"to",
" ",
"read",
" ",
"formula",
" ",
"for",
" ",
"{",
"0",
"}'_",
"._",
"format_",
"(_",
"pkg",
"\\u",
"name_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Check",
" ",
"to",
" ",
"see",
" ",
"if",
" ",
"the",
" ",
"package",
" ",
"is",
" ",
"alr",
"ead",
"y",
" ",
"installed_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"pkg",
"\\u",
"info_",
"=_",
"self_",
"._",
"\\u",
"pkgd",
"b",
"\\u",
"fun_",
"(_",
"'",
"info",
"'_",
",_",
"pkg",
"\\u",
"name_",
",_",
"self_",
"._",
"db",
"\\u",
"conn_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pkgs",
"\\u",
"to",
"\\u",
"install_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"pkg",
"\\u",
"info_",
"is_",
"None_",
"or_",
"self_",
"._",
"opts_",
"[_",
"'",
"force",
"'_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pkgs",
"\\u",
"to",
"\\u",
"install_",
"._",
"append_",
"(_",
"pkg",
"\\u",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"pkg",
"\\u",
"info_",
"is_",
"not_",
"None_",
"and_",
"not_",
"self_",
"._",
"opts_",
"[_",
"'",
"force",
"'_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"SP",
"MP",
"ack",
"age",
"Error_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Packa",
"ge",
" ",
"{",
"0",
"}",
" ",
"alr",
"ead",
"y",
" ",
"install",
"ed",
",",
" ",
"not",
" ",
"install",
"ing",
" ",
"again",
"'_",
"._",
"format_",
"(_",
"formula",
"\\u",
"def_",
"[_",
"'",
"name",
"'_",
"]_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"option",
"al",
"\\u",
"install_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"recommende",
"d\\u",
"install_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"'",
"dependen",
"cies",
"'_",
"in_",
"formula",
"\\u",
"def_",
"or_",
"'",
"option",
"al",
"'_",
"in_",
"formula",
"\\u",
"def_",
"or_",
"'",
"recommende",
"d",
"'_",
"in_",
"formula",
"\\u",
"def_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"avail",
"\\u",
"pkgs_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"repo_",
"in_",
"self_",
"._",
"repo",
"\\u",
"metadata_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"isinstance_",
"(_",
"self_",
"._",
"repo",
"\\u",
"metadata_",
"[_",
"repo_",
"]_",
"[_",
"'",
"package",
"s",
"'_",
"]_",
",_",
"dict_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"continue_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"pkg_",
"in_",
"self_",
"._",
"repo",
"\\u",
"metadata_",
"[_",
"repo_",
"]_",
"[_",
"'",
"package",
"s",
"'_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"avail",
"\\u",
"pkgs_",
"[_",
"pkg_",
"]_",
"=_",
"repo_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"need",
"s_",
",_",
"unava",
"il_",
",_",
"optional_",
",_",
"recommende",
"d_",
"=_",
"self_",
"._",
"\\u",
"resolve",
"\\u",
"deps_",
"(_",
"formula",
"\\u",
"def_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"len_",
"(_",
"unava",
"il_",
")_",
">_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"SP",
"MP",
"ack",
"age",
"Error_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Cann",
"ot",
" ",
"install",
" ",
"{",
"0",
"},",
" ",
"the",
" ",
"follow",
"ing",
" ",
"dependen",
"cies",
" ",
"are",
" ",
"need",
"ed",
":\\\\",
"n",
"\\\\",
"n",
"{",
"1",
"}'_",
"._",
"format_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"formula",
"\\u",
"def_",
"[_",
"'",
"name",
"'_",
"]_",
",_",
"'\\\\",
"n",
"'_",
"._",
"join_",
"(_",
"unava",
"il_",
")_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"optional_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"option",
"al",
"\\u",
"install_",
"._",
"extend_",
"(_",
"optional_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"dep",
"\\u",
"pkg_",
"in_",
"optional_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"pkg",
"\\u",
"info_",
"=_",
"self_",
"._",
"\\u",
"pkgd",
"b",
"\\u",
"fun_",
"(_",
"'",
"info",
"'_",
",_",
"formula",
"\\u",
"def_",
"[_",
"'",
"name",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"msg_",
"=_",
"dep",
"\\u",
"pkg_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"isinstance_",
"(_",
"pkg",
"\\u",
"info_",
",_",
"dict_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"msg_",
"=_",
"'{",
"0",
"}",
" ",
"[",
"Install",
"ed",
"]'_",
"._",
"format_",
"(_",
"dep",
"\\u",
"pkg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"option",
"al",
"\\u",
"install_",
"._",
"append_",
"(_",
"msg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"recommende",
"d_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"recommende",
"d\\u",
"install_",
"._",
"extend_",
"(_",
"recommende",
"d_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"dep",
"\\u",
"pkg_",
"in_",
"recommende",
"d_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"pkg",
"\\u",
"info_",
"=_",
"self_",
"._",
"\\u",
"pkgd",
"b",
"\\u",
"fun_",
"(_",
"'",
"info",
"'_",
",_",
"formula",
"\\u",
"def_",
"[_",
"'",
"name",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"msg_",
"=_",
"dep",
"\\u",
"pkg_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"isinstance_",
"(_",
"pkg",
"\\u",
"info_",
",_",
"dict_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"msg_",
"=_",
"'{",
"0",
"}",
" ",
"[",
"Install",
"ed",
"]'_",
"._",
"format_",
"(_",
"dep",
"\\u",
"pkg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"recommende",
"d\\u",
"install_",
"._",
"append_",
"(_",
"msg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"need",
"s_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pkgs",
"\\u",
"to",
"\\u",
"install_",
"._",
"extend_",
"(_",
"need",
"s_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"dep",
"\\u",
"pkg_",
"in_",
"need",
"s_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"pkg",
"\\u",
"info_",
"=_",
"self_",
"._",
"\\u",
"pkgd",
"b",
"\\u",
"fun_",
"(_",
"'",
"info",
"'_",
",_",
"formula",
"\\u",
"def_",
"[_",
"'",
"name",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"msg_",
"=_",
"dep",
"\\u",
"pkg_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"isinstance_",
"(_",
"pkg",
"\\u",
"info_",
",_",
"dict_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"msg_",
"=_",
"'{",
"0",
"}",
" ",
"[",
"Install",
"ed",
"]'_",
"._",
"format_",
"(_",
"dep",
"\\u",
"pkg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"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
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | nicolewhite/cycli/cycli/style.py | [
{
"content": "import re\n\nfrom pygments.lexer import RegexLexer\nfrom pygments.token import Comment, Operator, Keyword, Name, String, Number, Token\nfrom pygments.style import Style\n\n__all__ = [\"CypherLexer\"]\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class CypherLexer(RegexLexer):\n name = 'Cypher'\n aliases = ['cypher']\n filenames = ['*.cyp', '*.cypher']\n\n flags = re.IGNORECASE\n\n tokens = {\n 'root': [\n (r'//.*?\\n', Comment.Single),\n (r'\\b(ABS|ACOS|ALL|ALLSHORTESTPATHS|AND|ANY|AS|ASC|ASCENDING|ASIN|ASSERT|ATAN|ATAN2|AVG'\n r'|BY'\n r'|CASE|CEIL|COALESCE|COLLECT|COMMIT|CONSTRAINT|CONTAINS|COS|COT|COUNT|CREATE|CYPHER'\n r'|DEGREES|DELETE|DESC|DESCENDING|DETACH|DISTINCT|DROP'\n r'|E|ELSE|END|ENDNODE|ENDS|EXISTS|EXP|EXPLAIN|EXTRACT'\n r'|FALSE|FIELDTERMINATOR|FILTER|FLOOR|FOREACH|FROM'\n r'|HAS|HAVERSIN|HEAD|HEADERS'\n r'|ID|ILIKE|IN|INDEX|IS'\n r'|KEYS'\n r'|LABELS|LAST|LEFT|LENGTH|LIKE|LIMIT|LOAD CSV|LOG|LOG10|LOWER|LTRIM'\n r'|MATCH|MAX|MERGE|MIN'\n r'|NODE|NODES|NONE|NOT|NULL'\n r'|ON|OPTIONAL|OR|ORDER'\n r'|PERCENTILECONT|PERCENTILEDISC|PERIODIC|PI|PROFILE'\n r'|RADIANS|RAND|RANGE|REDUCE|REL|RELATIONSHIP|RELATIONSHIPS|REMOVE|REPLACE|RETURN|REVERSE|RIGHT|ROUND|RTRIM'\n r'|SCAN|SET|SHORTESTPATH|SIGN|SIN|SINGLE|SIZE|SKIP|SPLIT|SQRT|START|STARTNODE|STARTS|STDEV|STDEVP|STR|SUBSTRING|SUM'\n r'|TAIL|TAN|THEN|TIMESTAMP|TOFLOAT|TOINT|TRIM|TRUE|TYPE'\n r'|UNION|UNIQUE|UNWIND|USING|UPPER'\n r'|WHEN|WHERE|WITH'\n r'|XOR)\\b', Keyword),\n (r'[+*/<>=~!@#%^&|`?-]', Operator),\n (r'quit|exit|help|refresh|run-[0-9]+|save-csv|schema|schema-constraints|schema-indexes|schema-labels|schema-rels|env|export', Number),\n (r'[0-9]+', Name),\n (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),\n (r\"'(''|[^'])*'\", String.Single),\n (r'\"(\"\"|[^\"])*\"', String.Symbol),\n (r'[\\]\\)]-[\\(\\[]|[\\]\\)]->\\(|\\)<-[\\[\\(]|[\\)\\]]-->\\(|\\)<--[\\(\\[]|[\\)\\]]--[\\(\\[]', Token.Pattern),\n (r'\\.', Token.Pattern),\n (r'\\(|\\)|\\]|\\[|{|}', Token.Pattern),\n ]\n }",
"metadata": "root.CypherLexer",
"header": "['module', '___EOS___']",
"index": 9
},
{
"content": "class CypherStyle(Style):\n styles = {\n Token.Keyword: '#3498DB',\n Token.String: '#E67E22',\n Token.Name: '#1ABC9C',\n Token.Pattern: '#E74C3C',\n Token.Number: '#BF5FFF',\n\n Token.Line: 'bg:#000000 #ffffff',\n\n Token.LineNumber: 'bg:#ffffaa #000000',\n Token.Menu.Completions.Completion.Current: 'bg:#00aaaa #000000',\n Token.Menu.Completions.Completion: 'bg:#008888 #ffffff',\n Token.Menu.Completions.ProgressButton: 'bg:#003333',\n Token.Menu.Completions.ProgressBar: 'bg:#00aaaa',\n\n Token.Toolbar.Completions: 'bg:#888800 #000000',\n Token.Toolbar.Completions.Arrow: 'bg:#888800 #000000',\n Token.Toolbar.Completions.Completion: 'bg:#aaaa00 #000000',\n Token.Toolbar.Completions.Completion.Current: 'bg:#ffffaa #000000 bold',\n\n Token.AfterInput: 'bg:#ff44ff #000000',\n }",
"metadata": "root.CypherStyle",
"header": "['module', '___EOS___']",
"index": 52
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"import_",
"re_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"pygments_",
"._",
"lexer_",
"import_",
"Rege",
"x",
"Lexer_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"pygments_",
"._",
"token_",
"import_",
"Comment_",
",_",
"Operator_",
",_",
"Keyword_",
",_",
"Name_",
",_",
"String_",
",_",
"Number_",
",_",
"Token_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"pygments_",
"._",
"style_",
"import_",
"Style_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u",
"all\\u\\u_",
"=_",
"[_",
"\"",
"Cy",
"pher",
"Lex",
"er",
"\"_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Cy",
"pher",
"Lexer_",
"(_",
"Rege",
"x",
"Lexer_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"name_",
"=_",
"'",
"Cy",
"pher",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"aliases_",
"=_",
"[_",
"'",
"cyph",
"er",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"filenames_",
"=_",
"[_",
"'*",
".",
"cy",
"p",
"'_",
",_",
"'*",
".",
"cyph",
"er",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"flags_",
"=_",
"re_",
"._",
"IGNORECASE_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"tokens_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"root",
"'_",
":_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"r",
"'//",
".*?\\\\",
"n",
"'_",
",_",
"Comment_",
"._",
"Single_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"r",
"'\\\\",
"b",
"(",
"ABS",
"|",
"AC",
"OS",
"|",
"ALL",
"|",
"ALLS",
"HOR",
"TEST",
"PATH",
"S",
"|",
"AND",
"|",
"ANY",
"|",
"AS",
"|",
"ASC",
"|",
"ASC",
"ENDI",
"NG",
"|",
"ASI",
"N",
"|",
"ASSERT",
"|",
"ATA",
"N",
"|",
"ATA",
"N",
"2",
"|",
"AVG",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"BY",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"CASE",
"|",
"CE",
"IL",
"|",
"COA",
"LES",
"CE",
"|",
"COLL",
"ECT",
"|",
"COMMIT",
"|",
"CONSTR",
"AIN",
"T",
"|",
"CONT",
"AINS",
"|",
"COS",
"|",
"CO",
"T",
"|",
"COUNT",
"|",
"CREATE",
"|",
"CY",
"PH",
"ER",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"DEG",
"REE",
"S",
"|",
"DELET",
"E",
"|",
"DESC",
"|",
"DESC",
"ENDI",
"NG",
"|",
"DET",
"ACH",
"|",
"DIST",
"INC",
"T",
"|",
"DROP",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"E",
"|",
"ELS",
"E",
"|",
"END",
"|",
"END",
"NODE",
"|",
"ENDS",
"|",
"EXIST",
"S",
"|",
"EXP",
"|",
"EXPL",
"AIN",
"|",
"EXTRACT",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"FAL",
"SE",
"|",
"FIE",
"LD",
"TERMINAT",
"OR",
"|",
"FILTER",
"|",
"FLO",
"OR",
"|",
"FORE",
"ACH",
"|",
"FROM",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"HAS",
"|",
"HA",
"VERSI",
"N",
"|",
"HEAD",
"|",
"HEAD",
"ERS",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"ID",
"|",
"ILI",
"KE",
"|",
"IN",
"|",
"INDE",
"X",
"|",
"IS",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"KEYS",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"LAB",
"ELS",
"|",
"LAS",
"T",
"|",
"LEF",
"T",
"|",
"LENGTH",
"|",
"LI",
"KE",
"|",
"LIMIT",
"|",
"LOAD",
" ",
"CSV",
"|",
"LOG",
"|",
"LOG",
"10",
"|",
"LOWER",
"|",
"LT",
"RI",
"M",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"MATCH",
"|",
"MAX",
"|",
"MERGE",
"|",
"MIN",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"NODE",
"|",
"NODES",
"|",
"NON",
"E",
"|",
"NOT",
"|",
"NULL",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"ON",
"|",
"OPTIONAL",
"|",
"OR",
"|",
"ORDE",
"R",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"PERCENT",
"ILE",
"CONT",
"|",
"PERCENT",
"ILE",
"DISC",
"|",
"PERIOD",
"IC",
"|",
"PI",
"|",
"PROFILE",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"RADI",
"AN",
"S",
"|",
"RAN",
"D",
"|",
"RANGE",
"|",
"RED",
"UCE",
"|",
"REL",
"|",
"RELATION",
"SHIP",
"|",
"RELATION",
"SHIP",
"S",
"|",
"REMOVE",
"|",
"REPLACE",
"|",
"RETURN",
"|",
"REVERSE",
"|",
"RIG",
"HT",
"|",
"ROUND",
"|",
"RT",
"RI",
"M",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"SCAN",
"|",
"SET",
"|",
"SHORT",
"EST",
"PATH",
"|",
"SIGN",
"|",
"SIN",
"|",
"SINGLE",
"|",
"SIZE",
"|",
"SKIP",
"|",
"SPLIT",
"|",
"SQ",
"RT",
"|",
"START",
"|",
"START",
"NODE",
"|",
"START",
"S",
"|",
"STD",
"EV",
"|",
"STD",
"EV",
"P",
"|",
"STR",
"|",
"SUBST",
"RING",
"|",
"SUM",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"TAI",
"L",
"|",
"TAN",
"|",
"THE",
"N",
"|",
"TIMES",
"TAM",
"P",
"|",
"TO",
"FLOAT",
"|",
"TO",
"INT",
"|",
"TRI",
"M",
"|",
"TRU",
"E",
"|",
"TYPE",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"UNION",
"|",
"UNI",
"QUE",
"|",
"UN",
"WIND",
"|",
"US",
"ING",
"|",
"UPPER",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"WHE",
"N",
"|",
"WHE",
"RE",
"|",
"WITH",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"r",
"'|",
"XO",
"R",
")\\\\",
"b",
"'_",
",_",
"Keyword_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"r",
"'[",
"+",
"*/",
"<>",
"=",
"~",
"!@",
"#",
"%",
"^",
"&",
"|",
"`",
"?",
"-]",
"'_",
",_",
"Operator_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"r",
"'",
"quit",
"|",
"exit",
"|",
"help",
"|",
"refre",
"sh",
"|",
"run",
"-[",
"0",
"-",
"9",
"]+",
"|",
"save",
"-",
"csv",
"|",
"schema",
"|",
"schema",
"-",
"constraint",
"s",
"|",
"schema",
"-",
"indexe",
"s",
"|",
"schema",
"-",
"labels",
"|",
"schema",
"-",
"rel",
"s",
"|",
"env",
"|",
"export",
"'_",
",_",
"Number_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"r",
"'[",
"0",
"-",
"9",
"]+'_",
",_",
"Name_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"r",
"'[",
"a",
"-",
"z",
"A",
"-",
"Z",
"\\u]",
"[",
"a",
"-",
"z",
"A",
"-",
"Z",
"0",
"-",
"9",
"\\u]*",
"'_",
",_",
"Name_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"r",
"\"'",
"(''",
"|[",
"^",
"'])",
"*'",
"\"_",
",_",
"String_",
"._",
"Single_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"r",
"'\"",
"(\"",
"\"|",
"[",
"^",
"\"]",
")*",
"\"'_",
",_",
"String_",
"._",
"Symbol_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"r",
"'[",
"\\\\]",
"\\\\)",
"]-",
"[\\\\",
"(\\\\",
"[]",
"|[",
"\\\\]",
"\\\\)",
"]-",
">\\\\",
"(",
"|\\\\",
")<",
"-[",
"\\\\[",
"\\\\(",
"]|",
"[\\\\",
")\\\\",
"]]",
"-->",
"\\\\(",
"|\\\\",
")<",
"--",
"[\\\\",
"(\\\\",
"[]",
"|[",
"\\\\)",
"\\\\]",
"]-",
"-[",
"\\\\(\\\\",
"[]'_",
",_",
"Token_",
"._",
"Pattern_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"r",
"'\\\\.",
"'_",
",_",
"Token_",
"._",
"Pattern_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"r",
"'\\\\(",
"|\\\\",
")|",
"\\\\]",
"|\\\\",
"[",
"|",
"{",
"|",
"}'_",
",_",
"Token_",
"._",
"Pattern_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Cy",
"pher",
"Style_",
"(_",
"Style_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"styles_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"Token_",
"._",
"Keyword_",
":_",
"'#",
"349",
"8",
"DB",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Token_",
"._",
"String_",
":_",
"'#",
"E6",
"7E",
"2",
"2",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Token_",
"._",
"Name_",
":_",
"'#",
"1",
"ABC",
"9",
"C",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Token_",
"._",
"Pattern_",
":_",
"'#",
"E",
"7",
"4",
"C3",
"C",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Token_",
"._",
"Number_",
":_",
"'#",
"BF",
"5",
"FFF",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Token_",
"._",
"Line_",
":_",
"'",
"bg",
":",
"#",
"000000",
" ",
"#",
"ffffff",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Token_",
"._",
"Line",
"Number_",
":_",
"'",
"bg",
":",
"#",
"fff",
"fa",
"a",
" ",
"#",
"000000",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Token_",
"._",
"Menu_",
"._",
"Completi",
"ons_",
"._",
"Completi",
"on_",
"._",
"Current_",
":_",
"'",
"bg",
":",
"#",
"00",
"aaa",
"a",
" ",
"#",
"000000",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Token_",
"._",
"Menu_",
"._",
"Completi",
"ons_",
"._",
"Completi",
"on_",
":_",
"'",
"bg",
":",
"#",
"008",
"888",
" ",
"#",
"ffffff",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Token_",
"._",
"Menu_",
"._",
"Completi",
"ons_",
"._",
"Progres",
"s",
"Button_",
":_",
"'",
"bg",
":",
"#",
"0033",
"3",
"3",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Token_",
"._",
"Menu_",
"._",
"Completi",
"ons_",
"._",
"Progres",
"s",
"Bar_",
":_",
"'",
"bg",
":",
"#",
"00",
"aaa",
"a",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Token_",
"._",
"Toolbar_",
"._",
"Completi",
"ons_",
":_",
"'",
"bg",
":",
"#",
"8888",
"00",
" ",
"#",
"000000",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Token_",
"._",
"Toolbar_",
"._",
"Completi",
"ons_",
"._",
"Arrow",
"_",
":_",
"'",
"bg",
":",
"#",
"8888",
"00",
" ",
"#",
"000000",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Token_",
"._",
"Toolbar_",
"._",
"Completi",
"ons_",
"._",
"Completi",
"on_",
":_",
"'",
"bg",
":",
"#",
"aaa",
"a0",
"0",
" ",
"#",
"000000",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Token_",
"._",
"Toolbar_",
"._",
"Completi",
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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Imprecise assert | quixey/python-aliyun/tests/unit/aliyun/ecs/model_test.py | [
{
"content": " def testNotEqual(self):\n is1 = ecs.InstanceStatus('i1', 'running')\n is2 = ecs.InstanceStatus('i1', 'stopped')\n self.assertNotEqual(is1, is2)",
"metadata": "root.InstanceStatusTest.testNotEqual",
"header": "['class', 'InstanceStatusTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 112
},
{
"content": " def testNotEqual(self):\n d1 = ecs.Disk('d1', 'system', 'cloud', 5)\n d2 = ecs.Disk('d1', 'system', 'cloud', 6)\n self.assertNotEqual(d1, d2)",
"metadata": "root.DiskTest.testNotEqual",
"header": "['class', 'DiskTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 224
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Imp",
"reci",
"se_",
"assert_",
"[SEP]_",
"class_",
"Insta",
"nce",
"Status",
"Test_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Not",
"Equal_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"is",
"1_",
"=_",
"ecs_",
"._",
"Insta",
"nce",
"Status_",
"(_",
"'",
"i1",
"'_",
",_",
"'",
"runn",
"ing",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"is",
"2_",
"=_",
"ecs_",
"._",
"Insta",
"nce",
"Status_",
"(_",
"'",
"i1",
"'_",
",_",
"'",
"stopp",
"ed",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Not",
"Equal_",
"(_",
"is",
"1_",
",_",
"is",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Disk",
"Test_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Not",
"Equal_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"d1_",
"=_",
"ecs_",
"._",
"Disk_",
"(_",
"'",
"d1",
"'_",
",_",
"'",
"system",
"'_",
",_",
"'",
"cloud",
"'_",
",_",
"5_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"d2_",
"=_",
"ecs_",
"._",
"Disk_",
"(_",
"'",
"d1",
"'_",
",_",
"'",
"system",
"'_",
",_",
"'",
"cloud",
"'_",
",_",
"6_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Not",
"Equal_",
"(_",
"d1_",
",_",
"d2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Redundant comparison | gepd/Deviot/libs/pyserial/serialposix.py | [
{
"content": "#!/usr/bin/env python\n#\n# Python Serial Port Extension for Win32, Linux, BSD, Jython\n# module for serial IO for POSIX compatible systems, like Linux\n# see __init__.py\n#\n# (C) 2001-2010 Chris Liechti <[email protected]>\n# this is distributed under a free software license, see license.txt\n#\n# parts based on code from Grant B. Edwards <[email protected]>:\n# ftp://ftp.visi.com/users/grante/python/PosixSerial.py\n#\n# references: http://www.easysw.com/~mike/serial/serial.html\nimport sys\nimport os\nimport fcntl\nimport termios\nimport struct\nimport select\nimport errno\nimport time\nfrom .serialutil import *\n# Do check the Python version as some constants have moved.\nif (sys.hexversion < 0x020100f0):\n import TERMIOS\nelse:\n TERMIOS = termios\nif (sys.hexversion < 0x020200f0):\n import FCNTL\nelse:\n FCNTL = fcntl\n# try to detect the OS so that a device can be selected...\n# this code block should supply a device() and set_special_baudrate() function\n# for the platform\nplat = sys.platform.lower()\nif plat[:5] == 'linux': # Linux (confirmed)\n ASYNC_SPD_MASK = 0x1030\n ASYNC_SPD_CUST = 0x0030\n\n baudrate_constants = {\n 0: 0, # hang up\n 50: 1,\n 75: 2,\n 110: 3,\n 134: 4,\n 150: 5,\n 200: 6,\n 300: 7,\n 600: 10,\n 1200: 11,\n 1800: 12,\n 2400: 13,\n 4800: 14,\n 9600: 15,\n 19200: 16,\n 38400: 17,\n 57600: 10001,\n 115200: 10002,\n 230400: 10003,\n 460800: 10004,\n 500000: 10005,\n 576000: 10006,\n 921600: 10007,\n 1000000: 10010,\n 1152000: 10011,\n 1500000: 10012,\n 2000000: 10013,\n 2500000: 10014,\n 3000000: 10015,\n 3500000: 10016,\n 4000000: 10017\n }\nelif plat == 'cygwin': # cygwin/win32 (confirmed)\n\n baudrate_constants = {}\nelif plat == 'openbsd3': # BSD (confirmed)\n\n baudrate_constants = {}\nelif plat[:3] == 'bsd' or \\\n plat[:7] == 'freebsd' or \\\n plat[:7] == 'openbsd': # BSD (confirmed for freebsd4: cuaa%d)\n\n baudrate_constants = {}\nelif plat[:6] == 'darwin': # OS X\n version = os.uname()[2].split('.')\n # Tiger or above can support arbitrary serial speeds\n if int(version[0]) >= 8:\n else: # version < 8\n\n baudrate_constants = {}\nelif plat[:6] == 'netbsd': # NetBSD 1.6 testing by Erk\n\n baudrate_constants = {}\nelif plat[:4] == 'irix': # IRIX (partially tested)\n\n baudrate_constants = {}\nelif plat[:2] == 'hp': # HP-UX (not tested)\n\n baudrate_constants = {}\nelif plat[:5] == 'sunos': # Solaris/SunOS (confirmed)\n\n baudrate_constants = {}\nelif plat[:3] == 'aix': # AIX\n\n baudrate_constants = {}\nelse:\n # platform detection has failed...\n sys.stderr.write(\"\"\"\\\ndon't know how to number ttys on this system.\n! Use an explicit path (eg /dev/ttyS1) or send this information to\n! the author of this module:\nsys.platform = %r\nos.name = %r\nserialposix.py version = %s\nalso add the device name of the serial port and where the\ncounting starts for the first serial port.\ne.g. 'first serial port: /dev/ttyS0'\nand with a bit luck you can get this module running...\n\"\"\" % (sys.platform, os.name, VERSION))\n # no exception, just continue with a brave attempt to build a device name\n # even if the device name is not correct for the platform it has chances\n # to work using a string with the real device name as port parameter.\n\n\n baudrate_constants = {}\n #~ raise Exception, \"this module does not run on this platform, sorry.\"\n# whats up with \"aix\", \"beos\", ....\n# they should work, just need to know the device names.\n# load some constants for later use.\n# try to use values from TERMIOS, use defaults from linux otherwise\nTIOCMGET = hasattr(TERMIOS, 'TIOCMGET') and TERMIOS.TIOCMGET or 0x5415\nTIOCMBIS = hasattr(TERMIOS, 'TIOCMBIS') and TERMIOS.TIOCMBIS or 0x5416\nTIOCMBIC = hasattr(TERMIOS, 'TIOCMBIC') and TERMIOS.TIOCMBIC or 0x5417\nTIOCMSET = hasattr(TERMIOS, 'TIOCMSET') and TERMIOS.TIOCMSET or 0x5418\n#TIOCM_LE = hasattr(TERMIOS, 'TIOCM_LE') and TERMIOS.TIOCM_LE or 0x001\nTIOCM_DTR = hasattr(TERMIOS, 'TIOCM_DTR') and TERMIOS.TIOCM_DTR or 0x002\nTIOCM_RTS = hasattr(TERMIOS, 'TIOCM_RTS') and TERMIOS.TIOCM_RTS or 0x004\n#TIOCM_ST = hasattr(TERMIOS, 'TIOCM_ST') and TERMIOS.TIOCM_ST or 0x008\n#TIOCM_SR = hasattr(TERMIOS, 'TIOCM_SR') and TERMIOS.TIOCM_SR or 0x010\nTIOCM_CTS = hasattr(TERMIOS, 'TIOCM_CTS') and TERMIOS.TIOCM_CTS or 0x020\nTIOCM_CAR = hasattr(TERMIOS, 'TIOCM_CAR') and TERMIOS.TIOCM_CAR or 0x040\nTIOCM_RNG = hasattr(TERMIOS, 'TIOCM_RNG') and TERMIOS.TIOCM_RNG or 0x080\nTIOCM_DSR = hasattr(TERMIOS, 'TIOCM_DSR') and TERMIOS.TIOCM_DSR or 0x100\nTIOCM_CD = hasattr(TERMIOS, 'TIOCM_CD') and TERMIOS.TIOCM_CD or TIOCM_CAR\nTIOCM_RI = hasattr(TERMIOS, 'TIOCM_RI') and TERMIOS.TIOCM_RI or TIOCM_RNG\n#TIOCM_OUT1 = hasattr(TERMIOS, 'TIOCM_OUT1') and TERMIOS.TIOCM_OUT1 or 0x2000\n#TIOCM_OUT2 = hasattr(TERMIOS, 'TIOCM_OUT2') and TERMIOS.TIOCM_OUT2 or 0x4000\nTIOCINQ = hasattr(TERMIOS, 'FIONREAD') and TERMIOS.FIONREAD or 0x541B\nTIOCM_zero_str = struct.pack('I', 0)\nTIOCM_RTS_str = struct.pack('I', TIOCM_RTS)\nTIOCM_DTR_str = struct.pack('I', TIOCM_DTR)\nTIOCSBRK = hasattr(TERMIOS, 'TIOCSBRK') and TERMIOS.TIOCSBRK or 0x5427\nTIOCCBRK = hasattr(TERMIOS, 'TIOCCBRK') and TERMIOS.TIOCCBRK or 0x5428\n\n\n# assemble Serial class with the platform specifc implementation and the base\n# for file-like behavior. for Python 2.6 and newer, that provide the new I/O\n# library, derrive from io.RawIOBase\ntry:\n import io\nexcept ImportError:\n # classic version with our own file-like emulation\nelse:\n # io library present\n\n\nif __name__ == '__main__':\n s = Serial(0,\n baudrate=19200, # baud rate\n bytesize=EIGHTBITS, # number of data bits\n parity=PARITY_EVEN, # enable parity checking\n stopbits=STOPBITS_ONE, # number of stop bits\n timeout=3, # set a timeout value, None for waiting forever\n xonxoff=0, # enable software flow control\n rtscts=0, # enable RTS/CTS flow control\n )\n s.setRTS(1)\n s.setDTR(1)\n s.flushInput()\n s.flushOutput()\n s.write('hello')\n sys.stdout.write('%r\\n' % s.read(5))\n sys.stdout.write('%s\\n' % s.inWaiting())\n del s\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Redu",
"ndan",
"t_",
"comparison_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#!",
"/",
"usr",
"/",
"bin",
"/",
"env",
" ",
"python_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Pyth",
"on",
" ",
"Ser",
"ial",
" ",
"Port",
" ",
"Ext",
"ensi",
"on",
" ",
"for",
" ",
"Win",
"32",
",",
" ",
"Lin",
"ux",
",",
" ",
"BS",
"D",
",",
" ",
"Jy",
"tho",
"n_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"module",
" ",
"for",
" ",
"serial",
" ",
"IO",
" ",
"for",
" ",
"POSI",
"X",
" ",
"compatible",
" ",
"system",
"s",
",",
" ",
"like",
" ",
"Lin",
"ux_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"see",
" ",
"\\u\\u",
"init",
"\\u\\u",
".",
"py_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"(",
"C",
")",
" ",
"200",
"1",
"-",
"2010",
" ",
"Chr",
"is",
" ",
"Lie",
"cht",
"i",
" ",
"<",
"cli",
"ech",
"ti",
"@",
"gm",
"x",
".",
"net",
">_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"this",
" ",
"is",
" ",
"distributed",
" ",
"under",
" ",
"a",
" ",
"free",
" ",
"software",
" ",
"license",
",",
" ",
"see",
" ",
"license",
".",
"txt_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"part",
"s",
" ",
"based",
" ",
"on",
" ",
"code",
" ",
"from",
" ",
"Grant",
" ",
"B",
".",
" ",
"Ed",
"ward",
"s",
" ",
" ",
"<",
"grant",
"e",
"@",
"visi",
".",
"com",
">:",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"ftp",
"://",
"ftp",
".",
"visi",
".",
"com",
"/",
"users",
"/",
"grant",
"e",
"/",
"python",
"/",
"Posi",
"x",
"Ser",
"ial",
".",
"py_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"reference",
"s",
":",
" ",
"http",
"://",
"www",
".",
"easy",
"sw",
".",
"com",
"/",
"~",
"mike",
"/",
"serial",
"/",
"serial",
".",
"html_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"sys_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"os_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"fcntl_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"termios_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"struct_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"select_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"errno_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"time_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"serial",
"util_",
"import_",
"*_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Do",
" ",
"check",
" ",
"the",
" ",
"Pyth",
"on",
" ",
"version",
" ",
"as",
" ",
"some",
" ",
"constant",
"s",
" ",
"have",
" ",
"moved",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"(_",
"sys_",
"._",
"hex",
"version_",
"<_",
"0x02",
"0100",
"f0_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"TERM",
"IO",
"S_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"TERM",
"IO",
"S_",
"=_",
"termios_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"(_",
"sys_",
"._",
"hex",
"version_",
"<_",
"0x02",
"0200",
"f0_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"FC",
"NT",
"L_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"FC",
"NT",
"L_",
"=_",
"fcntl_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"try",
" ",
"to",
" ",
"detect",
" ",
"the",
" ",
"OS",
" ",
"so",
" ",
"tha",
"t",
" ",
"a",
" ",
"device",
" ",
"can",
" ",
"be",
" ",
"selecte",
"d",
"..._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"this",
" ",
"code",
" ",
"block",
" ",
"shou",
"ld",
" ",
"supply",
" ",
"a",
" ",
"device",
"()",
" ",
"and",
" ",
"set\\u",
"special",
"\\u",
"baud",
"rate",
"()",
" ",
"function_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"for",
" ",
"the",
" ",
"platform_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"plat",
"_",
"=_",
"sys_",
"._",
"platform_",
"._",
"lower_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"plat",
"_",
"[_",
":_",
"5_",
"]_",
"==_",
"'",
"linux",
"'_",
":_",
"#",
" ",
"Lin",
"ux",
" ",
"(",
"confirm",
"ed",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"ASYN",
"C",
"\\u",
"SP",
"D",
"\\u",
"MASK_",
"=_",
"0x10",
"30_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ASYN",
"C",
"\\u",
"SP",
"D",
"\\u",
"CU",
"ST_",
"=_",
"0x003",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"baud",
"rate",
"\\u",
"constants_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"0_",
":_",
"0_",
",_",
"#",
" ",
"hang",
" ",
"up_",
"\\u\\u\\uNL\\u\\u\\u_",
"50_",
":_",
"1_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"75_",
":_",
"2_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"110_",
":_",
"3_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"134_",
":_",
"4_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"150_",
":_",
"5_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"200_",
":_",
"6_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"300_",
":_",
"7_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"600_",
":_",
"10_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"1200_",
":_",
"11_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"1800_",
":_",
"12_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"2400",
"_",
":_",
"13_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"4800",
"_",
":_",
"14_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"9600",
"_",
":_",
"15_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"1920",
"0_",
":_",
"16_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"384",
"00_",
":_",
"17_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"576",
"00_",
":_",
"10001",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"1152",
"00_",
":_",
"1000",
"2_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"230",
"400_",
":_",
"1000",
"3_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"460",
"800_",
":_",
"1000",
"4_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"500000",
"_",
":_",
"1000",
"5_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"576",
"000_",
":_",
"1000",
"6_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"921",
"600_",
":_",
"1000",
"7_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"1000000_",
":_",
"10010",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"1152",
"000_",
":_",
"10011",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"15000",
"00_",
":_",
"100",
"12_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"200000",
"0_",
":_",
"100",
"13_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"25000",
"00_",
":_",
"100",
"14_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"3000000",
"_",
":_",
"100",
"15_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"3500",
"000_",
":_",
"100",
"16_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"4000000",
"_",
":_",
"100",
"17_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"plat",
"_",
"==_",
"'",
"cyg",
"win",
"'_",
":_",
"#",
" ",
"cyg",
"win",
"/",
"win32",
" ",
"(",
"confirm",
"ed",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"baud",
"rate",
"\\u",
"constants_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"plat",
"_",
"==_",
"'",
"openb",
"sd",
"3",
"'_",
":_",
"#",
" ",
"BS",
"D",
" ",
"(",
"confirm",
"ed",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"baud",
"rate",
"\\u",
"constants_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"plat",
"_",
"[_",
":_",
"3_",
"]_",
"==_",
"'",
"bsd",
"'_",
"or_",
"plat",
"_",
"[_",
":_",
"7_",
"]_",
"==_",
"'",
"freeb",
"sd",
"'_",
"or_",
"plat",
"_",
"[_",
":_",
"7_",
"]_",
"==_",
"'",
"openb",
"sd",
"'_",
":_",
"#",
" ",
"BS",
"D",
" ",
"(",
"confirm",
"ed",
" ",
"for",
" ",
"freeb",
"sd",
"4",
":",
" ",
"cua",
"a",
"%",
"d",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"baud",
"rate",
"\\u",
"constants_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"plat",
"_",
"[_",
":_",
"6_",
"]_",
"==_",
"'",
"dar",
"win",
"'_",
":_",
"#",
" ",
"OS",
" ",
"X_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"version_",
"=_",
"os_",
"._",
"uname_",
"(_",
")_",
"[_",
"2_",
"]_",
"._",
"split_",
"(_",
"'.'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Ti",
"ger",
" ",
"or",
" ",
"above",
" ",
"can",
" ",
"support",
" ",
"arbitra",
"ry",
" ",
"serial",
" ",
"speeds",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"int_",
"(_",
"version_",
"[_",
"0_",
"]_",
")_",
">=_",
"8_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"#",
" ",
"version",
" ",
"<",
" ",
"8_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"baud",
"rate",
"\\u",
"constants_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"plat",
"_",
"[_",
":_",
"6_",
"]_",
"==_",
"'",
"netb",
"sd",
"'_",
":_",
"#",
" ",
"Net",
"BS",
"D",
" ",
"1.6",
" ",
"testi",
"ng",
" ",
"by",
" ",
"Er",
"k_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"baud",
"rate",
"\\u",
"constants_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"plat",
"_",
"[_",
":_",
"4_",
"]_",
"==_",
"'",
"iri",
"x",
"'_",
":_",
"#",
" ",
"IRI",
"X",
" ",
"(",
"partial",
"ly",
" ",
"tested",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"baud",
"rate",
"\\u",
"constants_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"plat",
"_",
"[_",
":_",
"2_",
"]_",
"==_",
"'",
"hp",
"'_",
":_",
"#",
" ",
"HP",
"-",
"UX",
" ",
"(",
"not",
" ",
"tested",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"baud",
"rate",
"\\u",
"constants_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"plat",
"_",
"[_",
":_",
"5_",
"]_",
"==_",
"'",
"sun",
"os",
"'_",
":_",
"#",
" ",
"Sol",
"aris",
"/",
"Sun",
"OS",
" ",
"(",
"confirm",
"ed",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"baud",
"rate",
"\\u",
"constants_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"plat",
"_",
"[_",
":_",
"3_",
"]_",
"==_",
"'",
"ai",
"x",
"'_",
":_",
"#",
" ",
"AI",
"X_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"baud",
"rate",
"\\u",
"constants_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"platform",
" ",
"detect",
"ion",
" ",
"has",
" ",
"fail",
"ed",
"..._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"sys_",
"._",
"stderr_",
"._",
"write_",
"(_",
"\"\"\"",
"\\\\",
"\\",
"10",
";",
"don",
"'",
"t",
" ",
"know",
" ",
"how",
" ",
"to",
" ",
"number",
" ",
"tt",
"ys",
" ",
"on",
" ",
"this",
" ",
"system",
".",
"\\",
"10",
";",
"!",
" ",
"Us",
"e",
" ",
"an",
" ",
"explicit",
" ",
"path",
" ",
"(",
"eg",
" ",
"/",
"dev",
"/",
"tt",
"y",
"S1",
")",
" ",
"or",
" ",
"send",
" ",
"this",
" ",
"informati",
"on",
" ",
"to",
"\\",
"10",
";",
"!",
" ",
"the",
" ",
"author",
" ",
"of",
" ",
"this",
" ",
"module",
":",
"\\",
"10",
";",
"sys",
".",
"platform",
" ",
"=",
" ",
"%",
"r",
"\\",
"10",
";",
"os",
".",
"name",
" ",
"=",
" ",
"%",
"r",
"\\",
"10",
";",
"serial",
"posix",
".",
"py",
" ",
"version",
" ",
"=",
" ",
"%",
"s",
"\\",
"10",
";",
"als",
"o",
" ",
"add",
" ",
"the",
" ",
"device",
" ",
"name",
" ",
"of",
" ",
"the",
" ",
"serial",
" ",
"port",
" ",
"and",
" ",
"where",
" ",
"the",
"\\",
"10",
";",
"counti",
"ng",
" ",
"starts",
" ",
"for",
" ",
"the",
" ",
"first",
" ",
"serial",
" ",
"port",
".",
"\\",
"10",
";",
"e",
".",
"g",
".",
" ",
"'",
"first",
" ",
"serial",
" ",
"port",
":",
" ",
"/",
"dev",
"/",
"tt",
"y",
"S0",
"'",
"\\",
"10",
";",
"and",
" ",
"with",
" ",
"a",
" ",
"bit",
" ",
"luck",
" ",
"you",
" ",
"can",
" ",
"get",
" ",
"this",
" ",
"module",
" ",
"runn",
"ing",
"...",
"\\",
"10",
";\"\"\"_",
"%_",
"(_",
"sys_",
"._",
"platform_",
",_",
"os_",
"._",
"name_",
",_",
"VERSION_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"no",
" ",
"exception",
",",
" ",
"just",
" ",
"continue",
" ",
"with",
" ",
"a",
" ",
"bra",
"ve",
" ",
"atte",
"mpt",
" ",
"to",
" ",
"build",
" ",
"a",
" ",
"device",
" ",
"name_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"even",
" ",
"if",
" ",
"the",
" ",
"device",
" ",
"name",
" ",
"is",
" ",
"not",
" ",
"correct",
" ",
"for",
" ",
"the",
" ",
"platform",
" ",
"it",
" ",
"has",
" ",
"chan",
"ces_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"to",
" ",
"work",
" ",
"usi",
"ng",
" ",
"a",
" ",
"string",
" ",
"with",
" ",
"the",
" ",
"real",
" ",
"device",
" ",
"name",
" ",
"as",
" ",
"port",
" ",
"parameter",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"baud",
"rate",
"\\u",
"constants_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
"~",
" ",
"raise",
" ",
"Except",
"ion",
",",
" ",
"\"",
"this",
" ",
"module",
" ",
"doe",
"s",
" ",
"not",
" ",
"run",
" ",
"on",
" ",
"this",
" ",
"platform",
",",
" ",
"sorr",
"y",
".\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"whats",
" ",
"up",
" ",
"with",
" ",
"\"",
"ai",
"x",
"\",",
" ",
"\"",
"be",
"os",
"\",",
" ",
"....",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"the",
"y",
" ",
"shou",
"ld",
" ",
"work",
",",
" ",
"just",
" ",
"need",
" ",
"to",
" ",
"know",
" ",
"the",
" ",
"device",
" ",
"names",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"load",
" ",
"some",
" ",
"constant",
"s",
" ",
"for",
" ",
"late",
"r",
" ",
"use",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"try",
" ",
"to",
" ",
"use",
" ",
"values",
" ",
"from",
" ",
"TERM",
"IO",
"S",
",",
" ",
"use",
" ",
"default",
"s",
" ",
"from",
" ",
"linux",
" ",
"other",
"wise_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"TIO",
"CM",
"GET_",
"=_",
"hasattr_",
"(_",
"TERM",
"IO",
"S_",
",_",
"'",
"TIO",
"CM",
"GET",
"'_",
")_",
"and_",
"TERM",
"IO",
"S_",
"._",
"TIO",
"CM",
"GET_",
"or_",
"0x54",
"15_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIO",
"CM",
"BI",
"S_",
"=_",
"hasattr_",
"(_",
"TERM",
"IO",
"S_",
",_",
"'",
"TIO",
"CM",
"BI",
"S",
"'_",
")_",
"and_",
"TERM",
"IO",
"S_",
"._",
"TIO",
"CM",
"BI",
"S_",
"or_",
"0x54",
"16_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIO",
"CM",
"BIC",
"_",
"=_",
"hasattr_",
"(_",
"TERM",
"IO",
"S_",
",_",
"'",
"TIO",
"CM",
"BIC",
"'_",
")_",
"and_",
"TERM",
"IO",
"S_",
"._",
"TIO",
"CM",
"BIC",
"_",
"or_",
"0x54",
"17_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIO",
"CMS",
"ET_",
"=_",
"hasattr_",
"(_",
"TERM",
"IO",
"S_",
",_",
"'",
"TIO",
"CMS",
"ET",
"'_",
")_",
"and_",
"TERM",
"IO",
"S_",
"._",
"TIO",
"CMS",
"ET_",
"or_",
"0x54",
"18_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
"TIO",
"CM",
"\\u",
"LE",
" ",
"=",
" ",
"has",
"attr",
"(",
"TERM",
"IO",
"S",
",",
" ",
"'",
"TIO",
"CM",
"\\u",
"LE",
"')",
" ",
"and",
" ",
"TERM",
"IO",
"S",
".",
"TIO",
"CM",
"\\u",
"LE",
" ",
"or",
" ",
"0x001",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"TIO",
"CM",
"\\u",
"DT",
"R_",
"=_",
"hasattr_",
"(_",
"TERM",
"IO",
"S_",
",_",
"'",
"TIO",
"CM",
"\\u",
"DT",
"R",
"'_",
")_",
"and_",
"TERM",
"IO",
"S_",
"._",
"TIO",
"CM",
"\\u",
"DT",
"R_",
"or_",
"0x002",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIO",
"CM",
"\\u",
"RTS",
"_",
"=_",
"hasattr_",
"(_",
"TERM",
"IO",
"S_",
",_",
"'",
"TIO",
"CM",
"\\u",
"RTS",
"'_",
")_",
"and_",
"TERM",
"IO",
"S_",
"._",
"TIO",
"CM",
"\\u",
"RTS",
"_",
"or_",
"0x004",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
"TIO",
"CM",
"\\u",
"ST",
" ",
"=",
" ",
"has",
"attr",
"(",
"TERM",
"IO",
"S",
",",
" ",
"'",
"TIO",
"CM",
"\\u",
"ST",
"')",
" ",
"and",
" ",
"TERM",
"IO",
"S",
".",
"TIO",
"CM",
"\\u",
"ST",
" ",
"or",
" ",
"0x008",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"TIO",
"CM",
"\\u",
"SR",
" ",
"=",
" ",
"has",
"attr",
"(",
"TERM",
"IO",
"S",
",",
" ",
"'",
"TIO",
"CM",
"\\u",
"SR",
"')",
" ",
"and",
" ",
"TERM",
"IO",
"S",
".",
"TIO",
"CM",
"\\u",
"SR",
" ",
"or",
" ",
"0x010",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"TIO",
"CM",
"\\u",
"CT",
"S_",
"=_",
"hasattr_",
"(_",
"TERM",
"IO",
"S_",
",_",
"'",
"TIO",
"CM",
"\\u",
"CT",
"S",
"'_",
")_",
"and_",
"TERM",
"IO",
"S_",
"._",
"TIO",
"CM",
"\\u",
"CT",
"S_",
"or_",
"0x02",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIO",
"CM",
"\\u",
"CAR",
"_",
"=_",
"hasattr_",
"(_",
"TERM",
"IO",
"S_",
",_",
"'",
"TIO",
"CM",
"\\u",
"CAR",
"'_",
")_",
"and_",
"TERM",
"IO",
"S_",
"._",
"TIO",
"CM",
"\\u",
"CAR",
"_",
"or_",
"0x04",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIO",
"CM",
"\\u",
"RN",
"G_",
"=_",
"hasattr_",
"(_",
"TERM",
"IO",
"S_",
",_",
"'",
"TIO",
"CM",
"\\u",
"RN",
"G",
"'_",
")_",
"and_",
"TERM",
"IO",
"S_",
"._",
"TIO",
"CM",
"\\u",
"RN",
"G_",
"or_",
"0x08",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIO",
"CM",
"\\u",
"DS",
"R_",
"=_",
"hasattr_",
"(_",
"TERM",
"IO",
"S_",
",_",
"'",
"TIO",
"CM",
"\\u",
"DS",
"R",
"'_",
")_",
"and_",
"TERM",
"IO",
"S_",
"._",
"TIO",
"CM",
"\\u",
"DS",
"R_",
"or_",
"0x100",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIO",
"CM",
"\\u",
"CD_",
"=_",
"hasattr_",
"(_",
"TERM",
"IO",
"S_",
",_",
"'",
"TIO",
"CM",
"\\u",
"CD",
"'_",
")_",
"and_",
"TERM",
"IO",
"S_",
"._",
"TIO",
"CM",
"\\u",
"CD_",
"or_",
"TIO",
"CM",
"\\u",
"CAR",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIO",
"CM",
"\\u",
"RI",
"_",
"=_",
"hasattr_",
"(_",
"TERM",
"IO",
"S_",
",_",
"'",
"TIO",
"CM",
"\\u",
"RI",
"'_",
")_",
"and_",
"TERM",
"IO",
"S_",
"._",
"TIO",
"CM",
"\\u",
"RI",
"_",
"or_",
"TIO",
"CM",
"\\u",
"RN",
"G_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
"TIO",
"CM",
"\\u",
"OUT",
"1",
" ",
"=",
" ",
"has",
"attr",
"(",
"TERM",
"IO",
"S",
",",
" ",
"'",
"TIO",
"CM",
"\\u",
"OUT",
"1",
"')",
" ",
"and",
" ",
"TERM",
"IO",
"S",
".",
"TIO",
"CM",
"\\u",
"OUT",
"1",
" ",
"or",
" ",
"0x2000",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"TIO",
"CM",
"\\u",
"OUT",
"2",
" ",
"=",
" ",
"has",
"attr",
"(",
"TERM",
"IO",
"S",
",",
" ",
"'",
"TIO",
"CM",
"\\u",
"OUT",
"2",
"')",
" ",
"and",
" ",
"TERM",
"IO",
"S",
".",
"TIO",
"CM",
"\\u",
"OUT",
"2",
" ",
"or",
" ",
"0x400",
"0_",
"\\u\\u\\uNL\\u\\u\\u_",
"TIO",
"CIN",
"Q_",
"=_",
"hasattr_",
"(_",
"TERM",
"IO",
"S_",
",_",
"'",
"FI",
"ON",
"READ",
"'_",
")_",
"and_",
"TERM",
"IO",
"S_",
"._",
"FI",
"ON",
"READ_",
"or_",
"0x54",
"1",
"B_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIO",
"CM",
"\\u",
"zero",
"\\u",
"str_",
"=_",
"struct_",
"._",
"pack_",
"(_",
"'",
"I",
"'_",
",_",
"0_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIO",
"CM",
"\\u",
"RTS",
"\\u",
"str_",
"=_",
"struct_",
"._",
"pack_",
"(_",
"'",
"I",
"'_",
",_",
"TIO",
"CM",
"\\u",
"RTS",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIO",
"CM",
"\\u",
"DT",
"R",
"\\u",
"str_",
"=_",
"struct_",
"._",
"pack_",
"(_",
"'",
"I",
"'_",
",_",
"TIO",
"CM",
"\\u",
"DT",
"R_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIO",
"CS",
"BR",
"K_",
"=_",
"hasattr_",
"(_",
"TERM",
"IO",
"S_",
",_",
"'",
"TIO",
"CS",
"BR",
"K",
"'_",
")_",
"and_",
"TERM",
"IO",
"S_",
"._",
"TIO",
"CS",
"BR",
"K_",
"or_",
"0x54",
"27_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"TIO",
"CC",
"BR",
"K_",
"=_",
"hasattr_",
"(_",
"TERM",
"IO",
"S_",
",_",
"'",
"TIO",
"CC",
"BR",
"K",
"'_",
")_",
"and_",
"TERM",
"IO",
"S_",
"._",
"TIO",
"CC",
"BR",
"K_",
"or_",
"0x54",
"28_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"assemble",
" ",
"Ser",
"ial",
" ",
"class",
" ",
"with",
" ",
"the",
" ",
"platform",
" ",
"speci",
"fc",
" ",
"implementation",
" ",
"and",
" ",
"the",
" ",
"base_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"for",
" ",
"file",
"-",
"like",
" ",
"behavior",
".",
" ",
"for",
" ",
"Pyth",
"on",
" ",
"2.6",
" ",
"and",
" ",
"newe",
"r",
",",
" ",
"tha",
"t",
" ",
"provide",
" ",
"the",
" ",
"new",
" ",
"I",
"/",
"O_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"librar",
"y",
",",
" ",
"der",
"rive",
" ",
"from",
" ",
"io",
".",
"Ra",
"w",
"IO",
"Base_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"io_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Import",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"classic",
" ",
"version",
" ",
"with",
" ",
"our",
" ",
"own",
" ",
"file",
"-",
"like",
" ",
"emulation",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"io",
" ",
"librar",
"y",
" ",
"present_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"\\u\\u",
"name\\u\\u_",
"==_",
"'\\u",
"\\u",
"main",
"\\u\\u'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"s_",
"=_",
"Serial_",
"(_",
"0_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"baudrate_",
"=_",
"1920",
"0_",
",_",
"#",
" ",
"baud",
" ",
"rate_",
"\\u\\u\\uNL\\u\\u\\u_",
"bytes",
"ize_",
"=_",
"EI",
"GHT",
"BITS_",
",_",
"#",
" ",
"number",
" ",
"of",
" ",
"data",
" ",
"bits_",
"\\u\\u\\uNL\\u\\u\\u_",
"parity",
"_",
"=_",
"PAR",
"IT",
"Y",
"\\u",
"EVE",
"N_",
",_",
"#",
" ",
"enable",
" ",
"parity",
" ",
"checking",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"stop",
"bits_",
"=_",
"STOP",
"BITS",
"\\u",
"ONE_",
",_",
"#",
" ",
"number",
" ",
"of",
" ",
"stop",
" ",
"bits_",
"\\u\\u\\uNL\\u\\u\\u_",
"timeout_",
"=_",
"3_",
",_",
"#",
" ",
"set",
" ",
"a",
" ",
"timeo",
"ut",
" ",
"value",
",",
" ",
"Non",
"e",
" ",
"for",
" ",
"wait",
"ing",
" ",
"forever_",
"\\u\\u\\uNL\\u\\u\\u_",
"xon",
"xoff",
"_",
"=_",
"0_",
",_",
"#",
" ",
"enable",
" ",
"software",
" ",
"flow",
" ",
"control_",
"\\u\\u\\uNL\\u\\u\\u_",
"rts",
"cts_",
"=_",
"0_",
",_",
"#",
" ",
"enable",
" ",
"RTS",
"/",
"CT",
"S",
" ",
"flow",
" ",
"control_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"s_",
"._",
"set",
"RTS",
"_",
"(_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"s_",
"._",
"set",
"DT",
"R_",
"(_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"s_",
"._",
"flush",
"Input_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"s_",
"._",
"flush",
"Output_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"s_",
"._",
"write_",
"(_",
"'",
"hell",
"o",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"sys_",
"._",
"stdout_",
"._",
"write_",
"(_",
"'%",
"r",
"\\\\",
"n",
"'_",
"%_",
"s_",
"._",
"read_",
"(_",
"5_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"sys_",
"._",
"stdout_",
"._",
"write_",
"(_",
"'%",
"s",
"\\\\",
"n",
"'_",
"%_",
"s_",
"._",
"in",
"Wait",
"ing_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"del_",
"s_",
"\\u\\u\\uDEDENT\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2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
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Testing equality to None | thasso/pyjip/test/test_db.py | [
{
"content": "def test_delete_job_with_parent_job(db, tmpdir):\n if not db.startswith('mysql'):\n db = os.path.join(str(tmpdir), db)\n jip.db.init(db)\n parent = jip.db.Job()\n child = jip.db.Job()\n child.dependencies.append(parent)\n jip.db.save([parent, child])\n assert len(jip.db.get_all()) == 2\n jip.db.delete(child)\n assert len(jip.db.get_all()) == 1\n child = jip.db.get(child.id)\n assert child is None\n parent = jip.db.get(parent.id)\n assert parent is not None\n assert len(parent.children) == 0\n\n # check the raw table\n s = jip.db.job_dependencies.select()\n c = jip.db.engine.connect()\n res = c.execute(s)\n count = sum(map(lambda x: 1, res))\n c.close()\n assert count == 0",
"metadata": "root.test_delete_job_with_parent_job",
"header": "['module', '___EOS___']",
"index": 142
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Test",
"ing_",
"equality",
"_",
"to_",
"None_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"delete",
"\\u",
"job",
"\\u",
"with",
"\\u",
"parent",
"\\u",
"job_",
"(_",
"db_",
",_",
"tmpdir_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"db_",
"._",
"startswith_",
"(_",
"'",
"mysql",
"'_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"db_",
"=_",
"os_",
"._",
"path_",
"._",
"join_",
"(_",
"str_",
"(_",
"tmpdir_",
")_",
",_",
"db_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"ji",
"p_",
"._",
"db_",
"._",
"init_",
"(_",
"db_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"parent_",
"=_",
"ji",
"p_",
"._",
"db_",
"._",
"Job_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"child_",
"=_",
"ji",
"p_",
"._",
"db_",
"._",
"Job_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"child_",
"._",
"dependencies_",
"._",
"append_",
"(_",
"parent_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ji",
"p_",
"._",
"db_",
"._",
"save_",
"(_",
"[_",
"parent_",
",_",
"child_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"len_",
"(_",
"ji",
"p_",
"._",
"db_",
"._",
"get",
"\\u",
"all_",
"(_",
")_",
")_",
"==_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ji",
"p_",
"._",
"db_",
"._",
"delete_",
"(_",
"child_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"len_",
"(_",
"ji",
"p_",
"._",
"db_",
"._",
"get",
"\\u",
"all_",
"(_",
")_",
")_",
"==_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"child_",
"=_",
"ji",
"p_",
"._",
"db_",
"._",
"get_",
"(_",
"child_",
"._",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"child_",
"is_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"parent_",
"=_",
"ji",
"p_",
"._",
"db_",
"._",
"get_",
"(_",
"parent_",
"._",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"parent_",
"is_",
"not_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"len_",
"(_",
"parent_",
"._",
"children_",
")_",
"==_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"check",
" ",
"the",
" ",
"raw",
" ",
"table_",
"\\u\\u\\uNL\\u\\u\\u_",
"s_",
"=_",
"ji",
"p_",
"._",
"db_",
"._",
"job",
"\\u",
"dependencies_",
"._",
"select_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"c_",
"=_",
"ji",
"p_",
"._",
"db_",
"._",
"engine_",
"._",
"connect_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"c_",
"._",
"execute_",
"(_",
"s_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"count_",
"=_",
"sum_",
"(_",
"map_",
"(_",
"lambda_",
"x_",
":_",
"1_",
",_",
"res_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"c_",
"._",
"close_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"count_",
"==_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Testing equality to None | GoogleCloudPlatform/datastore-ndb-python/ndb/key.py | [
{
"content": " @staticmethod\n def _parse_from_ref(cls, pairs=None, flat=None,\n reference=None, serialized=None, urlsafe=None,\n app=None, namespace=None, parent=None):\n \"\"\"Construct a Reference; the signature is the same as for Key.\"\"\"\n if cls is not Key:\n raise TypeError('Cannot construct Key reference on non-Key class; '\n 'received %r' % cls)\n if (bool(pairs) + bool(flat) + bool(reference) + bool(serialized) +\n bool(urlsafe) + bool(parent)) != 1:\n raise TypeError('Cannot construct Key reference from incompatible '\n 'keyword arguments.')\n if urlsafe:\n serialized = _DecodeUrlSafe(urlsafe)\n if serialized:\n reference = _ReferenceFromSerialized(serialized)\n if reference:\n reference = _ReferenceFromReference(reference)\n pairs = []\n elem = None\n path = reference.path()\n for elem in path.element_list():\n kind = elem.type()\n if elem.has_id():\n id_or_name = elem.id()\n else:\n id_or_name = elem.name()\n if not id_or_name:\n id_or_name = None\n tup = (kind, id_or_name)\n pairs.append(tup)\n if elem is None:\n raise RuntimeError('Key reference has no path or elements (%r, %r, %r).'\n % (urlsafe, serialized, str(reference)))\n # TODO: ensure that each element has a type and either an id or a name\n # You needn't specify app= or namespace= together with reference=,\n # serialized= or urlsafe=, but if you do, their values must match\n # what is already in the reference.\n ref_app = reference.app()\n if app is not None:\n if app != ref_app:\n raise RuntimeError('Key reference constructed uses a different app %r '\n 'than the one specified %r' %\n (ref_app, app))\n ref_namespace = reference.name_space()\n if namespace is not None:\n if namespace != ref_namespace:\n raise RuntimeError('Key reference constructed uses a different '\n 'namespace %r than the one specified %r' %\n (ref_namespace, namespace))\n return (reference, tuple(pairs), ref_app, ref_namespace)",
"metadata": "root.Key._parse_from_ref",
"header": "['class', 'Key', '(', 'object', ')', ':', '___EOS___']",
"index": 302
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Test",
"ing_",
"equality",
"_",
"to_",
"None_",
"[SEP]_",
"class_",
"Key_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"staticmethod_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"\\u",
"parse",
"\\u",
"from",
"\\u",
"ref_",
"(_",
"cls_",
",_",
"pairs_",
"=_",
"None_",
",_",
"flat_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"reference_",
"=_",
"None_",
",_",
"serialized_",
"=_",
"None_",
",_",
"urlsafe",
"_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"app_",
"=_",
"None_",
",_",
"namespace_",
"=_",
"None_",
",_",
"parent_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Construct",
" ",
"a",
" ",
"Reference",
";",
" ",
"the",
" ",
"signa",
"ture",
" ",
"is",
" ",
"the",
" ",
"same",
" ",
"as",
" ",
"for",
" ",
"Key",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"cls_",
"is_",
"not_",
"Key_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Type",
"Error_",
"(_",
"'",
"Cann",
"ot",
" ",
"construct",
" ",
"Key",
" ",
"reference",
" ",
"on",
" ",
"non",
"-",
"Key",
" ",
"class",
";",
" ",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"receive",
"d",
" ",
"%",
"r",
"'_",
"%_",
"cls_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"(_",
"bool_",
"(_",
"pairs_",
")_",
"+_",
"bool_",
"(_",
"flat_",
")_",
"+_",
"bool_",
"(_",
"reference_",
")_",
"+_",
"bool_",
"(_",
"serialized_",
")_",
"+_",
"\\u\\u\\uNL\\u\\u\\u_",
"bool_",
"(_",
"urlsafe",
"_",
")_",
"+_",
"bool_",
"(_",
"parent_",
")_",
")_",
"!=_",
"1_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Type",
"Error_",
"(_",
"'",
"Cann",
"ot",
" ",
"construct",
" ",
"Key",
" ",
"reference",
" ",
"from",
" ",
"incomp",
"atible",
" ",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"keyw",
"ord",
" ",
"argu",
"ment",
"s",
".'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"urlsafe",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"serialized_",
"=_",
"\\u",
"Decode",
"Ur",
"l",
"Safe",
"_",
"(_",
"urlsafe",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"serialized_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"reference_",
"=_",
"\\u",
"Reference",
"Fro",
"m",
"Seriali",
"zed_",
"(_",
"serialized_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"reference_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"reference_",
"=_",
"\\u",
"Reference",
"Fro",
"m",
"Reference_",
"(_",
"reference_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"pairs_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"elem_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"path_",
"=_",
"reference_",
"._",
"path_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"elem_",
"in_",
"path_",
"._",
"element",
"\\u",
"list_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"kind_",
"=_",
"elem_",
"._",
"type_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"elem_",
"._",
"has",
"\\u",
"id_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"id",
"\\u",
"or",
"\\u",
"name_",
"=_",
"elem_",
"._",
"id_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"id",
"\\u",
"or",
"\\u",
"name_",
"=_",
"elem_",
"._",
"name_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"id",
"\\u",
"or",
"\\u",
"name_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"id",
"\\u",
"or",
"\\u",
"name_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"tup_",
"=_",
"(_",
"kind_",
",_",
"id",
"\\u",
"or",
"\\u",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pairs_",
"._",
"append_",
"(_",
"tup_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"elem_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Run",
"time",
"Error_",
"(_",
"'",
"Key",
" ",
"reference",
" ",
"has",
" ",
"no",
" ",
"path",
" ",
"or",
" ",
"element",
"s",
" ",
"(%",
"r",
",",
" ",
"%",
"r",
",",
" ",
"%",
"r",
").'_",
"\\u\\u\\uNL\\u\\u\\u_",
"%_",
"(_",
"urlsafe",
"_",
",_",
"serialized_",
",_",
"str_",
"(_",
"reference_",
")_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"TOD",
"O",
":",
" ",
"ensure",
" ",
"tha",
"t",
" ",
"each",
" ",
"element",
" ",
"has",
" ",
"a",
" ",
"type",
" ",
"and",
" ",
"eit",
"her",
" ",
"an",
" ",
"id",
" ",
"or",
" ",
"a",
" ",
"name_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"You",
" ",
"need",
"n",
"'",
"t",
" ",
"speci",
"fy",
" ",
"app",
"=",
" ",
"or",
" ",
"namespace",
"=",
" ",
"tog",
"ether",
" ",
"with",
" ",
"reference",
"=",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"serialize",
"d",
"=",
" ",
"or",
" ",
"urlsafe",
"=",
",",
" ",
"but",
" ",
"if",
" ",
"you",
" ",
"do",
",",
" ",
"thei",
"r",
" ",
"values",
" ",
"must",
" ",
"match_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"what",
" ",
"is",
" ",
"alr",
"ead",
"y",
" ",
"in",
" ",
"the",
" ",
"reference",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"ref",
"\\u",
"app_",
"=_",
"reference_",
"._",
"app_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"app_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"app_",
"!=_",
"ref",
"\\u",
"app_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Run",
"time",
"Error_",
"(_",
"'",
"Key",
" ",
"reference",
" ",
"construct",
"ed",
" ",
"use",
"s",
" ",
"a",
" ",
"different",
" ",
"app",
" ",
"%",
"r",
" ",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"than",
" ",
"the",
" ",
"one",
" ",
"specified",
" ",
"%",
"r",
"'_",
"%_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"ref",
"\\u",
"app_",
",_",
"app_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"ref",
"\\u",
"namespace_",
"=_",
"reference_",
"._",
"name",
"\\u",
"space_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"namespace_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"namespace_",
"!=_",
"ref",
"\\u",
"namespace_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Run",
"time",
"Error_",
"(_",
"'",
"Key",
" ",
"reference",
" ",
"construct",
"ed",
" ",
"use",
"s",
" ",
"a",
" ",
"different",
" ",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"namespace",
" ",
"%",
"r",
" ",
"than",
" ",
"the",
" ",
"one",
" ",
"specified",
" ",
"%",
"r",
"'_",
"%_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"ref",
"\\u",
"namespace_",
",_",
"namespace_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"(_",
"reference_",
",_",
"tuple_",
"(_",
"pairs_",
")_",
",_",
"ref",
"\\u",
"app_",
",_",
"ref",
"\\u",
"namespace_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,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__ import absolute_import, division, print_function\n\ntry:\n import h5py # h5py has precedence over pytables\nexcept:\n pass\nfrom multipledispatch import halt_ordering, restart_ordering\n\nhalt_ordering() # Turn off multipledispatch ordering\n\nfrom .utils import ignoring\nfrom .convert import convert\nfrom .append import append\nfrom .resource import resource\nfrom .directory import Directory\nfrom .into import into\nfrom .odo import odo\nfrom .create import create\nfrom .drop import drop\nfrom .temp import Temp\nfrom .backends.text import TextFile\nfrom .chunks import chunks, Chunks\nfrom datashape import discover, dshape\nimport numpy as np\n\nwith ignoring(ImportError):\n from .backends.sas import sas7bdat\nwith ignoring(ImportError):\n from .backends.pandas import pd\nwith ignoring(ImportError):\n from .backends.bcolz import bcolz\nwith ignoring(ImportError):\n from .backends.h5py import h5py\nwith ignoring(ImportError):\n from .backends.hdfstore import HDFStore\nwith ignoring(ImportError):\n from .backends.pytables import PyTables\nwith ignoring(ImportError):\n from .backends import sql\nwith ignoring(ImportError):\n from .backends import mongo\nwith ignoring(ImportError):\n from .backends.csv import CSV\nwith ignoring(ImportError):\n from .backends.json import JSON, JSONLines\nwith ignoring(ImportError):\n from .backends.hdfs import HDFS\nwith ignoring(ImportError):\n from .backends.ssh import SSH\nwith ignoring(ImportError):\n from .backends import sql_csv\nwith ignoring(ImportError):\n from .backends.aws import S3\nwith ignoring(ImportError):\n from .backends import sql_csv\nwith ignoring(ImportError):\n from .backends.bokeh import ColumnDataSource\nwith ignoring(ImportError):\n from .backends.spark import RDD\nwith ignoring(ImportError):\n from .backends.sparksql import SparkDataFrame\nwith ignoring(ImportError):\n from .backends.url import URL\nwith ignoring(ImportError):\n from .backends.dask import dask\n\n\nrestart_ordering() # Restart multipledispatch ordering and do ordering\n\n\nfrom ._version import get_versions\n__version__ = get_versions()['version']\ndel get_versions\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Module_",
"is_",
"imported_",
"with_",
"'",
"import",
"'_",
"and_",
"'",
"import",
" ",
"from",
"'_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"from_",
"\\u\\u",
"future\\u\\u_",
"import_",
"abs",
"olute",
"\\u",
"import_",
",_",
"division_",
",_",
"print",
"\\u",
"function_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"h5py_",
"#",
" ",
" ",
"h5",
"py",
" ",
"has",
" ",
"preceden",
"ce",
" ",
"over",
" ",
"pyt",
"ables_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"from_",
"multiple",
"dispatch_",
"import_",
"halt",
"\\u",
"ordering_",
",_",
"restart",
"\\u",
"ordering_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"halt",
"\\u",
"ordering_",
"(_",
")_",
"#",
" ",
"Turn",
" ",
"off",
" ",
"multiple",
"dispatch",
" ",
"ordering_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"._",
"utils_",
"import_",
"ign",
"orin",
"g_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"convert_",
"import_",
"convert_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"append_",
"import_",
"append_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"resource_",
"import_",
"resource_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"directory_",
"import_",
"Directory_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"into_",
"import_",
"into_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"odo",
"_",
"import_",
"odo",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"create_",
"import_",
"create_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"drop_",
"import_",
"drop_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"temp_",
"import_",
"Temp_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"backends_",
"._",
"text_",
"import_",
"Text",
"File_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"chunks_",
"import_",
"chunks_",
",_",
"Chunk",
"s_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"datas",
"hape_",
"import_",
"discover_",
",_",
"dsh",
"ape_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"numpy_",
"as_",
"np_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"._",
"sas",
"_",
"import_",
"sas",
"7b",
"dat_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"._",
"pandas_",
"import_",
"pd_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"._",
"bco",
"lz",
"_",
"import_",
"bco",
"lz",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"._",
"h5py_",
"import_",
"h5py_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"._",
"hdfs",
"tore_",
"import_",
"HDF",
"Store_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"._",
"pyt",
"ables_",
"import_",
"Py",
"Tables_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"import_",
"sql_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"import_",
"mongo_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"._",
"csv_",
"import_",
"CSV_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"._",
"json_",
"import_",
"JSON_",
",_",
"JSO",
"NL",
"ines_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"._",
"hdfs",
"_",
"import_",
"HDF",
"S_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"._",
"ssh_",
"import_",
"SSH",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"import_",
"sql",
"\\u",
"csv_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"._",
"aws_",
"import_",
"S3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"import_",
"sql",
"\\u",
"csv_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"._",
"bokeh",
"_",
"import_",
"Colum",
"n",
"Data",
"Source_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"._",
"spark_",
"import_",
"RDD",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"._",
"spark",
"sql_",
"import_",
"Spar",
"k",
"Data",
"Frame_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"._",
"url_",
"import_",
"URL_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"ign",
"orin",
"g_",
"(_",
"Import",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"._",
"backends_",
"._",
"dask",
"_",
"import_",
"dask",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"restart",
"\\u",
"ordering_",
"(_",
")_",
"#",
" ",
"Restart",
" ",
"multiple",
"dispatch",
" ",
"orderi",
"ng",
" ",
"and",
" ",
"do",
" ",
"ordering_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"._",
"\\u",
"version_",
"import_",
"get",
"\\u",
"versions_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u",
"version\\u\\u_",
"=_",
"get",
"\\u",
"versions_",
"(_",
")_",
"[_",
"'",
"version",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"del_",
"get",
"\\u",
"versions_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2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
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | saltstack/salt/salt/modules/postfix.py | [
{
"content": "def show_queue():\n '''\n Show contents of the mail queue\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' postfix.show_queue\n\n '''\n cmd = 'mailq'\n out = __salt__['cmd.run'](cmd).splitlines()\n queue = []\n\n queue_pattern = re.compile(r\"(?P<queue_id>^[A-Z0-9]+)\\s+(?P<size>\\d+)\\s(?P<timestamp>\\w{3}\\s\\w{3}\\s\\d{1,2}\\s\\d{2}\\:\\d{2}\\:\\d{2})\\s+(?P<sender>.+)\")\n recipient_pattern = re.compile(r\"^\\s+(?P<recipient>.+)\")\n for line in out:\n if re.match('^[-|postqueue:|Mail]', line):\n # discard in-queue wrapper\n continue\n if re.match(queue_pattern, line):\n m = re.match(queue_pattern, line)\n queue_id = m.group('queue_id')\n size = m.group('size')\n timestamp = m.group('timestamp')\n sender = m.group('sender')\n elif re.match(recipient_pattern, line): # recipient/s\n m = re.match(recipient_pattern, line)\n recipient = m.group('recipient')\n elif not line: # end of record\n queue.append({'queue_id': queue_id, 'size': size, 'timestamp': timestamp, 'sender': sender, 'recipient': recipient})\n return queue",
"metadata": "root.show_queue",
"header": "['module', '___EOS___']",
"index": 317
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"show",
"\\u",
"queue_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Show",
" ",
"content",
"s",
" ",
"of",
" ",
"the",
" ",
"mail",
" ",
"queue",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"CLI",
" ",
"Exam",
"ple",
":",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"..",
" ",
"code",
"-",
"block",
"::",
" ",
"bash",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"salt",
" ",
"'*",
"'",
" ",
"postfix",
".",
"show",
"\\u",
"queue",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"cmd_",
"=_",
"'",
"mail",
"q",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"out_",
"=_",
"\\u\\u",
"salt\\u\\u_",
"[_",
"'",
"cmd",
".",
"run",
"'_",
"]_",
"(_",
"cmd_",
")_",
"._",
"splitlines_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"queue_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"queue",
"\\u",
"pattern_",
"=_",
"re_",
"._",
"compile_",
"(_",
"r",
"\"(?",
"P",
"<",
"queue",
"\\u",
"id",
">",
"^",
"[",
"A",
"-",
"Z",
"0",
"-",
"9",
"]+)\\\\",
"s",
"+(?",
"P",
"<",
"size",
">\\\\",
"d",
"+)\\\\",
"s",
"(?",
"P",
"<",
"timestamp",
">\\\\",
"w",
"{",
"3",
"}\\\\",
"s",
"\\\\",
"w",
"{",
"3",
"}\\\\",
"s",
"\\\\",
"d",
"{",
"1",
",",
"2",
"}\\\\",
"s",
"\\\\",
"d",
"{",
"2",
"}\\\\",
":\\\\",
"d",
"{",
"2",
"}\\\\",
":\\\\",
"d",
"{",
"2",
"})\\\\",
"s",
"+(?",
"P",
"<",
"sender",
">.+)",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"recip",
"ient",
"\\u",
"pattern_",
"=_",
"re_",
"._",
"compile_",
"(_",
"r",
"\"",
"^",
"\\\\",
"s",
"+(?",
"P",
"<",
"recip",
"ient",
">.+)",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"line_",
"in_",
"out_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"re_",
"._",
"match_",
"(_",
"'",
"^",
"[-",
"|",
"post",
"queue",
":|",
"Mail",
"]'_",
",_",
"line_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"discard",
" ",
"in",
"-",
"queue",
" ",
"wrapper_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"continue_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"re_",
"._",
"match_",
"(_",
"queue",
"\\u",
"pattern_",
",_",
"line_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"m_",
"=_",
"re_",
"._",
"match_",
"(_",
"queue",
"\\u",
"pattern_",
",_",
"line_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"queue",
"\\u",
"id_",
"=_",
"m_",
"._",
"group_",
"(_",
"'",
"queue",
"\\u",
"id",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"size_",
"=_",
"m_",
"._",
"group_",
"(_",
"'",
"size",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"timestamp_",
"=_",
"m_",
"._",
"group_",
"(_",
"'",
"timestamp",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"sender_",
"=_",
"m_",
"._",
"group_",
"(_",
"'",
"sender",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"re_",
"._",
"match_",
"(_",
"recip",
"ient",
"\\u",
"pattern_",
",_",
"line_",
")_",
":_",
"#",
" ",
"recip",
"ient",
"/",
"s_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"m_",
"=_",
"re_",
"._",
"match_",
"(_",
"recip",
"ient",
"\\u",
"pattern_",
",_",
"line_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"recipient_",
"=_",
"m_",
"._",
"group_",
"(_",
"'",
"recip",
"ient",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"not_",
"line_",
":_",
"#",
" ",
"end",
" ",
"of",
" ",
"record_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"queue_",
"._",
"append_",
"(_",
"{_",
"'",
"queue",
"\\u",
"id",
"'_",
":_",
"queue",
"\\u",
"id_",
",_",
"'",
"size",
"'_",
":_",
"size_",
",_",
"'",
"timestamp",
"'_",
":_",
"timestamp_",
",_",
"'",
"sender",
"'_",
":_",
"sender_",
",_",
"'",
"recip",
"ient",
"'_",
":_",
"recipient_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"queue_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2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ansui/karesansui/gadget/hostby1storagepoolby1status.py | [
{
"content": "# -*- coding: utf-8 -*-\n#\n# This file is part of Karesansui.\n#\n# Copyright (C) 2009-2012 HDE, Inc.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n#\n\nimport web\nfrom web.utils import Storage\n\nimport karesansui\nfrom karesansui.lib.rest import Rest, auth\nfrom karesansui.lib.virt.virt import KaresansuiVirtConnection\nfrom karesansui.lib.const import VIRT_COMMAND_START_STORAGE_POOL, \\\n VIRT_COMMAND_DESTROY_STORAGE_POOL, ISCSI_COMMAND_START\n\nfrom karesansui.db.access.machine import findbyhost1\nfrom karesansui.db.access._2pysilhouette import save_job_collaboration\nfrom karesansui.db.access.machine2jobgroup import new as m2j_new\nfrom karesansui.db.model._2pysilhouette import JobGroup, Job\n\nfrom pysilhouette.command import dict2command\n\nfrom karesansui.lib.checker import Checker, CHECK_EMPTY, CHECK_VALID\n\n# storage pool status\nSTORAGE_POOL_START = 0;\nSTORAGE_POOL_STOP = 1;\n\n\n\n\nurls = (\n '/host/(\\d+)/storagepool/([a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})/status/?(\\.part)$', HostBy1StoragePoolBy1Status,\n )\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": " @auth\n def _PUT(self, *param, **params):\n host_id = self.chk_hostby1(param)\n if host_id is None: return web.notfound()\n\n self.view.host_id = host_id\n uuid = param[1]\n\n if not validates_storage_pool(self, uuid):\n self.logger.debug(\"Set storage pool status failed. Did not validate.\")\n return web.badrequest(self.view.alert)\n\n model = findbyhost1(self.orm, host_id)\n\n # Pool\n try:\n kvc = KaresansuiVirtConnection()\n inactive_pool = kvc.list_inactive_storage_pool()\n active_pool = kvc.list_active_storage_pool()\n pools = inactive_pool + active_pool\n pools.sort()\n\n self.view.pools = pools\n\n pools_obj = kvc.get_storage_pool_UUIDString2kvn_storage_pool(uuid)\n if len(pools_obj) <= 0:\n self.logger.debug(\"Set storage pool status failed. Target storage pool not found.\")\n return web.notfound()\n\n status = int(self.input.status)\n if status == STORAGE_POOL_START:\n storagepool_start_stop_job(self, model, pools_obj[0], 'start')\n elif status == STORAGE_POOL_STOP:\n if kvc.is_used_storage_pool(name=pools_obj[0].get_storage_name(),\n active_only=True) is True:\n self.logger.debug(\"Stop storage pool failed. Target storage pool is used by guest.\")\n return web.badrequest(\"Target storage pool is used by guest.\")\n else:\n storagepool_start_stop_job(self, model, pools_obj[0], 'stop')\n else:\n self.logger.debug(\"Set storage pool status failed. Unknown status type.\")\n return web.badrequest()\n\n return web.accepted()\n finally:\n kvc.close()",
"metadata": "root.HostBy1StoragePoolBy1Status._PUT",
"header": "['class', 'HostBy1StoragePoolBy1Status', '(', 'Rest', ')', ':', '___EOS___']",
"index": 108
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Compari",
"son_",
"using_",
"is_",
"when_",
"operands_",
"support_",
" _",
"`_",
"\\u\\u",
"eq\\u\\u_",
"`_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#",
" ",
"-*-",
" ",
"codi",
"ng",
":",
" ",
"utf",
"-",
"8",
" ",
"-*-",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Thi",
"s",
" ",
"file",
" ",
"is",
" ",
"part",
" ",
"of",
" ",
"Kar",
"esa",
"nsu",
"i",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Copy",
"right",
" ",
"(",
"C",
")",
" ",
"200",
"9",
"-",
"2012",
" ",
"HD",
"E",
",",
" ",
"Inc",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Permi",
"ssion",
" ",
"is",
" ",
"here",
"by",
" ",
"grant",
"ed",
",",
" ",
"free",
" ",
"of",
" ",
"charge",
",",
" ",
"to",
" ",
"any",
" ",
"person",
" ",
"obtain",
"ing",
" ",
"a",
" ",
"copy_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"of",
" ",
"this",
" ",
"software",
" ",
"and",
" ",
"associate",
"d",
" ",
"documentation",
" ",
"files",
" ",
"(",
"the",
" ",
"\"",
"Sof",
"twa",
"re",
"\")",
",",
" ",
"to",
" ",
"deal",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"in",
" ",
"the",
" ",
"Sof",
"twa",
"re",
" ",
"with",
"out",
" ",
"restriction",
",",
" ",
"inclu",
"ding",
" ",
"with",
"out",
" ",
"limit",
"ation",
" ",
"the",
" ",
"rights_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"to",
" ",
"use",
",",
" ",
"copy",
",",
" ",
"modif",
"y",
",",
" ",
"merge",
",",
" ",
"publi",
"sh",
",",
" ",
"distribute",
",",
" ",
"subli",
"cens",
"e",
",",
" ",
"and",
"/",
"or",
" ",
"sell",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"copie",
"s",
" ",
"of",
" ",
"the",
" ",
"Sof",
"twa",
"re",
",",
" ",
"and",
" ",
"to",
" ",
"permit",
" ",
"person",
"s",
" ",
"to",
" ",
"who",
"m",
" ",
"the",
" ",
"Sof",
"twa",
"re",
" ",
"is_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"fur",
"nish",
"ed",
" ",
"to",
" ",
"do",
" ",
"so",
",",
" ",
"subject",
" ",
"to",
" ",
"the",
" ",
"follow",
"ing",
" ",
"condition",
"s",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"above",
" ",
"copyr",
"ight",
" ",
"notice",
" ",
"and",
" ",
"this",
" ",
"permissi",
"on",
" ",
"notice",
" ",
"sha",
"ll",
" ",
"be",
" ",
"include",
"d",
" ",
"in_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"all",
" ",
"copie",
"s",
" ",
"or",
" ",
"substa",
"nti",
"al",
" ",
"porti",
"ons",
" ",
"of",
" ",
"the",
" ",
"Sof",
"twa",
"re",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"THE",
" ",
"SOFT",
"WARE",
" ",
"IS",
" ",
"PROVI",
"DED",
" ",
"\"",
"AS",
" ",
"IS",
"\",",
" ",
"WITH",
"OUT",
" ",
"WAR",
"RAN",
"TY",
" ",
"OF",
" ",
"ANY",
" ",
"KIND",
",",
" ",
"EXPR",
"ESS",
" ",
"OR_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"IMPL",
"IED",
",",
" ",
"INC",
"LU",
"DING",
" ",
"BUT",
" ",
"NOT",
" ",
"LIMIT",
"ED",
" ",
"TO",
" ",
"THE",
" ",
"WAR",
"RAN",
"TIES",
" ",
"OF",
" ",
"MER",
"CHAN",
"TAB",
"ILI",
"TY",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"FIT",
"NESS",
" ",
"FOR",
" ",
"A",
" ",
"PARTI",
"CUL",
"AR",
" ",
"PUR",
"POS",
"E",
" ",
"AND",
" ",
"NON",
"INF",
"RING",
"EME",
"NT",
".",
" ",
"IN",
" ",
"NO",
" ",
"EVENT",
" ",
"SHA",
"LL",
" ",
"THE",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"AUTHOR",
"S",
" ",
"OR",
" ",
"COPY",
"RIG",
"HT",
" ",
"HOLD",
"ERS",
" ",
"BE",
" ",
"LI",
"AB",
"LE",
" ",
"FOR",
" ",
"ANY",
" ",
"CLA",
"IM",
",",
" ",
"DA",
"MAGE",
"S",
" ",
"OR",
" ",
"OTHER",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"LI",
"ABI",
"LIT",
"Y",
",",
" ",
"WHE",
"THER",
" ",
"IN",
" ",
"AN",
" ",
"ACTI",
"ON",
" ",
"OF",
" ",
"CONTR",
"ACT",
",",
" ",
"TOR",
"T",
" ",
"OR",
" ",
"OTHER",
"WI",
"SE",
",",
" ",
"ARI",
"SIN",
"G",
" ",
"FROM",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"OUT",
" ",
"OF",
" ",
"OR",
" ",
"IN",
" ",
"CONNECTION",
" ",
"WITH",
" ",
"THE",
" ",
"SOFT",
"WARE",
" ",
"OR",
" ",
"THE",
" ",
"USE",
" ",
"OR",
" ",
"OTHER",
" ",
"DEA",
"LING",
"S",
" ",
"IN_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"THE",
" ",
"SOFT",
"WARE",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"web_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"web_",
"._",
"utils_",
"import_",
"Storage_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"kar",
"esa",
"nsu",
"i_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"kar",
"esa",
"nsu",
"i_",
"._",
"lib_",
"._",
"rest_",
"import_",
"Rest",
"_",
",_",
"auth_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"kar",
"esa",
"nsu",
"i_",
"._",
"lib_",
"._",
"virt_",
"._",
"virt_",
"import_",
"Kar",
"esa",
"nsu",
"i",
"Virt",
"Connection_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"kar",
"esa",
"nsu",
"i_",
"._",
"lib_",
"._",
"const_",
"import_",
"VIR",
"T",
"\\u",
"COMMA",
"ND",
"\\u",
"START",
"\\u",
"STOR",
"AGE",
"\\u",
"POOL",
"_",
",_",
"VIR",
"T",
"\\u",
"COMMA",
"ND",
"\\u",
"DEST",
"ROY",
"\\u",
"STOR",
"AGE",
"\\u",
"POOL",
"_",
",_",
"ISCSI",
"\\u",
"COMMA",
"ND",
"\\u",
"START_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"kar",
"esa",
"nsu",
"i_",
"._",
"db_",
"._",
"access_",
"._",
"machine_",
"import_",
"find",
"by",
"host",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"kar",
"esa",
"nsu",
"i_",
"._",
"db_",
"._",
"access_",
"._",
"\\u",
"2py",
"sil",
"hou",
"ette",
"_",
"import_",
"save",
"\\u",
"job",
"\\u",
"collaborat",
"ion_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"kar",
"esa",
"nsu",
"i_",
"._",
"db_",
"._",
"access_",
"._",
"machine",
"2j",
"ob",
"group_",
"import_",
"new_",
"as_",
"m2",
"j",
"\\u",
"new_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"kar",
"esa",
"nsu",
"i_",
"._",
"db_",
"._",
"model_",
"._",
"\\u",
"2py",
"sil",
"hou",
"ette",
"_",
"import_",
"Jo",
"b",
"Group_",
",_",
"Job_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"pys",
"il",
"hou",
"ette",
"_",
"._",
"command_",
"import_",
"dict2",
"command_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"kar",
"esa",
"nsu",
"i_",
"._",
"lib_",
"._",
"checker_",
"import_",
"Checker_",
",_",
"CHECK",
"\\u",
"EMPTY_",
",_",
"CHECK",
"\\u",
"VALID",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"storage",
" ",
"pool",
" ",
"status_",
"\\u\\u\\uNL\\u\\u\\u_",
"STOR",
"AGE",
"\\u",
"POOL",
"\\u",
"START_",
"=_",
"0_",
";_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"STOR",
"AGE",
"\\u",
"POOL",
"\\u",
"STOP_",
"=_",
"1_",
";_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"urls_",
"=_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"'/",
"host",
"/(",
"\\\\",
"d",
"+)",
"/",
"storage",
"pool",
"/([",
"a",
"-",
"z",
"0",
"-",
"9",
"]{",
"8",
"}-",
"[",
"a",
"-",
"z",
"0",
"-",
"9",
"]{",
"4",
"}-",
"[",
"a",
"-",
"z",
"0",
"-",
"9",
"]{",
"4",
"}-",
"[",
"a",
"-",
"z",
"0",
"-",
"9",
"]{",
"4",
"}-",
"[",
"a",
"-",
"z",
"0",
"-",
"9",
"]{",
"1",
"2",
"})",
"/",
"status",
"/?",
"(\\\\",
".",
"part",
")$'_",
",_",
"Host",
"By",
"1",
"Stor",
"age",
"Poo",
"l",
"By",
"1",
"Status_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"[SEP]_",
"class_",
"Host",
"By",
"1",
"Stor",
"age",
"Poo",
"l",
"By",
"1",
"Status_",
"(_",
"Rest",
"_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"auth_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"\\u",
"PUT_",
"(_",
"self_",
",_",
"*_",
"param_",
",_",
"**_",
"params_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"host",
"\\u",
"id_",
"=_",
"self_",
"._",
"chk",
"\\u",
"host",
"by",
"1_",
"(_",
"param_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"host",
"\\u",
"id_",
"is_",
"None_",
":_",
"return_",
"web_",
"._",
"notfound",
"_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"view_",
"._",
"host",
"\\u",
"id_",
"=_",
"host",
"\\u",
"id_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"uuid_",
"=_",
"param_",
"[_",
"1_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"not_",
"validates",
"\\u",
"storage",
"\\u",
"pool_",
"(_",
"self_",
",_",
"uuid_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"logger_",
"._",
"debug_",
"(_",
"\"",
"Set",
" ",
"storage",
" ",
"pool",
" ",
"status",
" ",
"fail",
"ed",
".",
" ",
"Di",
"d",
" ",
"not",
" ",
"validat",
"e",
".\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"web_",
"._",
"bad",
"request_",
"(_",
"self_",
"._",
"view_",
"._",
"alert_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"model_",
"=_",
"find",
"by",
"host",
"1_",
"(_",
"self_",
"._",
"orm_",
",_",
"host",
"\\u",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Pool_",
"\\u\\u\\uNL\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"kv",
"c_",
"=_",
"Kar",
"esa",
"nsu",
"i",
"Virt",
"Connection_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"inact",
"ive",
"\\u",
"pool_",
"=_",
"kv",
"c_",
"._",
"list",
"\\u",
"inact",
"ive",
"\\u",
"storage",
"\\u",
"pool_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"active",
"\\u",
"pool_",
"=_",
"kv",
"c_",
"._",
"list",
"\\u",
"active",
"\\u",
"storage",
"\\u",
"pool_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pools_",
"=_",
"inact",
"ive",
"\\u",
"pool_",
"+_",
"active",
"\\u",
"pool_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pools_",
"._",
"sort_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"view_",
"._",
"pools_",
"=_",
"pools_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"pools",
"\\u",
"obj_",
"=_",
"kv",
"c_",
"._",
"get",
"\\u",
"storage",
"\\u",
"pool",
"\\u",
"UU",
"IDS",
"tring",
"2",
"kv",
"n",
"\\u",
"storage",
"\\u",
"pool_",
"(_",
"uuid_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"len_",
"(_",
"pools",
"\\u",
"obj_",
")_",
"<=_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"logger_",
"._",
"debug_",
"(_",
"\"",
"Set",
" ",
"storage",
" ",
"pool",
" ",
"status",
" ",
"fail",
"ed",
".",
" ",
"Target",
" ",
"storage",
" ",
"pool",
" ",
"not",
" ",
"found",
".\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"web_",
"._",
"notfound",
"_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"status_",
"=_",
"int_",
"(_",
"self_",
"._",
"input_",
"._",
"status_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"status_",
"==_",
"STOR",
"AGE",
"\\u",
"POOL",
"\\u",
"START_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"storage",
"pool",
"\\u",
"start",
"\\u",
"stop",
"\\u",
"job_",
"(_",
"self_",
",_",
"model_",
",_",
"pools",
"\\u",
"obj_",
"[_",
"0_",
"]_",
",_",
"'",
"start",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"status_",
"==_",
"STOR",
"AGE",
"\\u",
"POOL",
"\\u",
"STOP_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"kv",
"c_",
"._",
"is",
"\\u",
"used",
"\\u",
"storage",
"\\u",
"pool_",
"(_",
"name_",
"=_",
"pools",
"\\u",
"obj_",
"[_",
"0_",
"]_",
"._",
"get",
"\\u",
"storage",
"\\u",
"name_",
"(_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"active",
"\\u",
"only_",
"=_",
"True_",
")_",
"is_",
"True_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"logger_",
"._",
"debug_",
"(_",
"\"",
"Sto",
"p",
" ",
"storage",
" ",
"pool",
" ",
"fail",
"ed",
".",
" ",
"Target",
" ",
"storage",
" ",
"pool",
" ",
"is",
" ",
"used",
" ",
"by",
" ",
"guest",
".\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"web_",
"._",
"bad",
"request_",
"(_",
"\"",
"Target",
" ",
"storage",
" ",
"pool",
" ",
"is",
" ",
"used",
" ",
"by",
" ",
"guest",
".\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"storage",
"pool",
"\\u",
"start",
"\\u",
"stop",
"\\u",
"job_",
"(_",
"self_",
",_",
"model_",
",_",
"pools",
"\\u",
"obj_",
"[_",
"0_",
"]_",
",_",
"'",
"stop",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"logger_",
"._",
"debug_",
"(_",
"\"",
"Set",
" ",
"storage",
" ",
"pool",
" ",
"status",
" ",
"fail",
"ed",
".",
" ",
"Un",
"know",
"n",
" ",
"status",
" ",
"type",
".\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"web_",
"._",
"bad",
"request_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"web_",
"._",
"accepted_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"finally_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"kv",
"c_",
"._",
"close_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Variable defined multiple times | quantopian/zipline/tests/test_algorithm.py | [
{
"content": " def test_get_open_orders(self):\n def initialize(algo):\n algo.minute = 0\n\n def handle_data(algo, data):\n if algo.minute == 0:\n\n # Should be filled by the next minute\n algo.order(algo.sid(1), 1)\n\n # Won't be filled because the price is too low.\n algo.order(algo.sid(2), 1, style=LimitOrder(0.01))\n algo.order(algo.sid(2), 1, style=LimitOrder(0.01))\n algo.order(algo.sid(2), 1, style=LimitOrder(0.01))\n\n all_orders = algo.get_open_orders()\n self.assertEqual(list(all_orders.keys()), [1, 2])\n\n self.assertEqual(all_orders[1], algo.get_open_orders(1))\n self.assertEqual(len(all_orders[1]), 1)\n\n self.assertEqual(all_orders[2], algo.get_open_orders(2))\n self.assertEqual(len(all_orders[2]), 3)\n\n if algo.minute == 1:\n # First order should have filled.\n # Second order should still be open.\n all_orders = algo.get_open_orders()\n self.assertEqual(list(all_orders.keys()), [2])\n\n self.assertEqual([], algo.get_open_orders(1))\n\n orders_2 = algo.get_open_orders(2)\n self.assertEqual(all_orders[2], orders_2)\n self.assertEqual(len(all_orders[2]), 3)\n\n for order_ in orders_2:\n algo.cancel_order(order_)\n\n all_orders = algo.get_open_orders()\n self.assertEqual(all_orders, {})\n\n algo.minute += 1\n\n algo = TradingAlgorithm(initialize=initialize,\n handle_data=handle_data,\n sim_params=self.sim_params,\n env=self.env)\n algo.run(self.data_portal)",
"metadata": "root.TestMiscellaneousAPI.test_get_open_orders",
"header": "['class', 'TestMiscellaneousAPI', '(', 'WithLogger', ',', '___NL___', 'WithSimParams', ',', '___NL___', 'WithDataPortal', ',', '___NL___', 'ZiplineTestCase', ')', ':', '___EOS___']",
"index": 341
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Variable_",
"defined_",
"multiple_",
"times_",
"[SEP]_",
"class_",
"Test",
"Mis",
"cell",
"ane",
"ous",
"API_",
"(_",
"With",
"Logger_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"With",
"Sim",
"Params_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"With",
"Data",
"Porta",
"l_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Zip",
"line",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"get",
"\\u",
"open",
"\\u",
"orders_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"initialize_",
"(_",
"algo_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"algo_",
"._",
"minute_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"handle",
"\\u",
"data_",
"(_",
"algo_",
",_",
"data_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"algo_",
"._",
"minute_",
"==_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Sho",
"ul",
"d",
" ",
"be",
" ",
"filled",
" ",
"by",
" ",
"the",
" ",
"next",
" ",
"minute_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"algo_",
"._",
"order_",
"(_",
"algo_",
"._",
"sid_",
"(_",
"1_",
")_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Wo",
"n",
"'",
"t",
" ",
"be",
" ",
"filled",
" ",
"bec",
"aus",
"e",
" ",
"the",
" ",
"price",
" ",
"is",
" ",
"too",
" ",
"low",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"algo_",
"._",
"order_",
"(_",
"algo_",
"._",
"sid_",
"(_",
"2_",
")_",
",_",
"1_",
",_",
"style_",
"=_",
"Limit",
"Order_",
"(_",
"0.01_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"algo_",
"._",
"order_",
"(_",
"algo_",
"._",
"sid_",
"(_",
"2_",
")_",
",_",
"1_",
",_",
"style_",
"=_",
"Limit",
"Order_",
"(_",
"0.01_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"algo_",
"._",
"order_",
"(_",
"algo_",
"._",
"sid_",
"(_",
"2_",
")_",
",_",
"1_",
",_",
"style_",
"=_",
"Limit",
"Order_",
"(_",
"0.01_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"all",
"\\u",
"orders_",
"=_",
"algo_",
"._",
"get",
"\\u",
"open",
"\\u",
"orders_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"list_",
"(_",
"all",
"\\u",
"orders_",
"._",
"keys_",
"(_",
")_",
")_",
",_",
"[_",
"1_",
",_",
"2_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"all",
"\\u",
"orders_",
"[_",
"1_",
"]_",
",_",
"algo_",
"._",
"get",
"\\u",
"open",
"\\u",
"orders_",
"(_",
"1_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"len_",
"(_",
"all",
"\\u",
"orders_",
"[_",
"1_",
"]_",
")_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"all",
"\\u",
"orders_",
"[_",
"2_",
"]_",
",_",
"algo_",
"._",
"get",
"\\u",
"open",
"\\u",
"orders_",
"(_",
"2_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"len_",
"(_",
"all",
"\\u",
"orders_",
"[_",
"2_",
"]_",
")_",
",_",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"algo_",
"._",
"minute_",
"==_",
"1_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Fi",
"rst",
" ",
"order",
" ",
"shou",
"ld",
" ",
"have",
" ",
"filled",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Second",
" ",
"order",
" ",
"shou",
"ld",
" ",
"still",
" ",
"be",
" ",
"open",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"all",
"\\u",
"orders_",
"=_",
"algo_",
"._",
"get",
"\\u",
"open",
"\\u",
"orders_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"list_",
"(_",
"all",
"\\u",
"orders_",
"._",
"keys_",
"(_",
")_",
")_",
",_",
"[_",
"2_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"[_",
"]_",
",_",
"algo_",
"._",
"get",
"\\u",
"open",
"\\u",
"orders_",
"(_",
"1_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"order",
"s",
"\\u",
"2_",
"=_",
"algo_",
"._",
"get",
"\\u",
"open",
"\\u",
"orders_",
"(_",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"all",
"\\u",
"orders_",
"[_",
"2_",
"]_",
",_",
"order",
"s",
"\\u",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"len_",
"(_",
"all",
"\\u",
"orders_",
"[_",
"2_",
"]_",
")_",
",_",
"3_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"order",
"\\u_",
"in_",
"order",
"s",
"\\u",
"2_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"algo_",
"._",
"cancel",
"\\u",
"order_",
"(_",
"order",
"\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"all",
"\\u",
"orders_",
"=_",
"algo_",
"._",
"get",
"\\u",
"open",
"\\u",
"orders_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"all",
"\\u",
"orders_",
",_",
"{_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"algo_",
"._",
"minute_",
"+=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"algo_",
"=_",
"Tra",
"ding",
"Algorithm_",
"(_",
"initialize_",
"=_",
"initialize_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"handle",
"\\u",
"data_",
"=_",
"handle",
"\\u",
"data_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"sim",
"\\u",
"params_",
"=_",
"self_",
"._",
"sim",
"\\u",
"params_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"env_",
"=_",
"self_",
"._",
"env_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"algo_",
"._",
"run_",
"(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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
First parameter of a method is not named 'self' | jamesmawm/Mastering-Python-for-Finance-source-codes/B03898_05_Codes/VasicekCZCB.py | [
{
"content": " def check_exercise(self, V, eex):\n return V > eex",
"metadata": "root.VasicekCZCB.check_exercise",
"header": "['class', 'VasicekCZCB', ':', '___EOS___']",
"index": 99
}
] | [] | [] | 0 | true | [
"[CLS]_",
"First_",
"parameter_",
"of_",
"a_",
"method_",
"is_",
"not_",
"named_",
"'",
"self",
"'_",
"[SEP]_",
"class_",
"Va",
"sic",
"ek",
"CZ",
"CB_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"check",
"\\u",
"exercise",
"_",
"(_",
"self_",
",_",
"V_",
",_",
"ee",
"x_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"V_",
">_",
"ee",
"x_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unreachable code | nlloyd/SubliminalCollaborator/libs/twisted/test/test_strerror.py | [
{
"content": " def test_correctLookups(self):\n \"\"\"\n Given an known-good errno, make sure that formatMessage gives results\n matching either C{socket.errorTab}, C{ctypes.WinError}, or\n C{win32api.FormatMessage}.\n \"\"\"\n acceptable = [socket.errorTab[ECONNABORTED]]\n try:\n from ctypes import WinError\n acceptable.append(WinError(ECONNABORTED).strerror)\n except ImportError:\n pass\n try:\n from win32api import FormatMessage\n acceptable.append(FormatMessage(ECONNABORTED))\n except ImportError:\n pass\n\n self.assertIn(formatError(ECONNABORTED), acceptable)",
"metadata": "root.ErrorFormatingTestCase.test_correctLookups",
"header": "['class', 'ErrorFormatingTestCase', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 129
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Unrea",
"chab",
"le_",
"code_",
"[SEP]_",
"class_",
"Error",
"Format",
"ing",
"Test",
"Case_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"correct",
"Look",
"ups_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Give",
"n",
" ",
"an",
" ",
"know",
"n",
"-",
"good",
" ",
"errno",
",",
" ",
"make",
" ",
"sure",
" ",
"tha",
"t",
" ",
"format",
"Messag",
"e",
" ",
"give",
"s",
" ",
"results",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"matchi",
"ng",
" ",
"eit",
"her",
" ",
"C",
"{",
"socket",
".",
"error",
"Tab",
"},",
" ",
"C",
"{",
"ctype",
"s",
".",
"Win",
"Error",
"},",
" ",
"or",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"C",
"{",
"win32",
"api",
".",
"Format",
"Messag",
"e",
"}.",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"acceptabl",
"e_",
"=_",
"[_",
"socket_",
"._",
"error",
"Tab_",
"[_",
"ECO",
"NN",
"ABORT",
"ED_",
"]_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"ctypes_",
"import_",
"Win",
"Error_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"acceptabl",
"e_",
"._",
"append_",
"(_",
"Win",
"Error_",
"(_",
"ECO",
"NN",
"ABORT",
"ED_",
")_",
"._",
"strerror_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Import",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"win32",
"api_",
"import_",
"Format",
"Message_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"acceptabl",
"e_",
"._",
"append_",
"(_",
"Format",
"Message_",
"(_",
"ECO",
"NN",
"ABORT",
"ED_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Import",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"assert",
"In_",
"(_",
"format",
"Error_",
"(_",
"ECO",
"NN",
"ABORT",
"ED_",
")_",
",_",
"acceptabl",
"e_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | carljm/django-secure/djangosecure/check/run.py | [
{
"content": "from django.utils.importlib import import_module\n\nfrom ..conf import conf\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "def get_check(func_path):\n mod_name, func_name = func_path.rsplit(\".\", 1)\n module = import_module(mod_name)\n return getattr(module, func_name)",
"metadata": "root.get_check",
"header": "['module', '___EOS___']",
"index": 6
},
{
"content": "def run_checks():\n warnings = set()\n\n for func_path in conf.SECURE_CHECKS:\n warnings.update(get_check(func_path)())\n\n return warnings",
"metadata": "root.run_checks",
"header": "['module', '___EOS___']",
"index": 13
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"from_",
"django_",
"._",
"utils_",
"._",
"importlib_",
"import_",
"import",
"\\u",
"module_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"._",
"._",
"conf_",
"import_",
"conf_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"get",
"\\u",
"check_",
"(_",
"func",
"\\u",
"path_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mod",
"\\u",
"name_",
",_",
"func",
"\\u",
"name_",
"=_",
"func",
"\\u",
"path_",
"._",
"rsplit_",
"(_",
"\".\"_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"module_",
"=_",
"import",
"\\u",
"module_",
"(_",
"mod",
"\\u",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"getattr_",
"(_",
"module_",
",_",
"func",
"\\u",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"run",
"\\u",
"checks_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"warnings_",
"=_",
"set_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"func",
"\\u",
"path_",
"in_",
"conf_",
"._",
"SECU",
"RE",
"\\u",
"CHECKS",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"warnings_",
"._",
"update_",
"(_",
"get",
"\\u",
"check_",
"(_",
"func",
"\\u",
"path_",
")_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"warnings_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | cloudera/hue/desktop/core/ext-py/Mako-0.8.1/mako/pyparser.py | [
{
"content": "# mako/pyparser.py\n# Copyright (C) 2006-2012 the Mako authors and contributors <see AUTHORS file>\n#\n# This module is part of Mako and is released under\n# the MIT License: http://www.opensource.org/licenses/mit-license.php\n\n\"\"\"Handles parsing of Python code.\n\nParsing to AST is done via _ast on Python > 2.5, otherwise the compiler\nmodule is used.\n\"\"\"\n\nfrom mako import exceptions, util, compat\nfrom mako.compat import StringIO\nimport operator\n\nif compat.py3k:\n # words that cannot be assigned to (notably\n # smaller than the total keys in __builtins__)\n reserved = set(['True', 'False', 'None', 'print'])\n\n # the \"id\" attribute on a function node\n arg_id = operator.attrgetter('arg')\nelse:\n # words that cannot be assigned to (notably\n # smaller than the total keys in __builtins__)\n reserved = set(['True', 'False', 'None'])\n\n # the \"id\" attribute on a function node\n arg_id = operator.attrgetter('id')\n\n\ntry:\n import _ast\n util.restore__ast(_ast)\n from mako import _ast_util\nexcept ImportError:\n _ast = None\n from compiler import parse as compiler_parse\n from compiler import visitor\n\n\n\n\nif _ast:\n\n\n\n\n\n\nelse:\n\n\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "def parse(code, mode='exec', **exception_kwargs):\n \"\"\"Parse an expression into AST\"\"\"\n\n\n try:\n if _ast:\n return _ast_util.parse(code, '<unknown>', mode)\n else:\n if isinstance(code, compat.text_type):\n code = code.encode('ascii', 'backslashreplace')\n return compiler_parse(code, mode)\n except Exception:\n raise exceptions.SyntaxException(\n \"(%s) %s (%r)\" % (\n compat.exception_as().__class__.__name__,\n compat.exception_as(),\n code[0:50]\n ), **exception_kwargs)",
"metadata": "root.parse",
"header": "['module', '___EOS___']",
"index": 42
},
{
"content": " class FindIdentifiers(_ast_util.NodeVisitor):\n\n\n\n\n\n if compat.py3k:\n\n # ExceptHandler is in Python 2, but this block only works in\n # Python 3 (and is required there)\n\n\n\n\n\n\n\n\n",
"metadata": "root.FindIdentifiers",
"header": "['module', '___EOS___']",
"index": 63
},
{
"content": " def __init__(self, listener, **exception_kwargs):\n self.in_function = False\n self.in_assign_targets = False\n self.local_ident_stack = set()\n self.listener = listener\n self.exception_kwargs = exception_kwargs",
"metadata": "root.FindIdentifiers.__init__",
"header": "['class', 'FindIdentifiers', '(', '_ast_util', '.', 'NodeVisitor', ')', ':', '___EOS___']",
"index": 65
},
{
"content": " def _add_declared(self, name):\n if not self.in_function:\n self.listener.declared_identifiers.add(name)\n else:\n self.local_ident_stack.add(name)",
"metadata": "root.FindIdentifiers._add_declared",
"header": "['class', 'FindIdentifiers', '(', '_ast_util', '.', 'NodeVisitor', ')', ':', '___EOS___']",
"index": 72
},
{
"content": " def visit_ClassDef(self, node):\n self._add_declared(node.name)",
"metadata": "root.FindIdentifiers.visit_ClassDef",
"header": "['class', 'FindIdentifiers', '(', '_ast_util', '.', 'NodeVisitor', ')', ':', '___EOS___']",
"index": 78
},
{
"content": " def visit_Assign(self, node):\n\n # flip around the visiting of Assign so the expression gets\n # evaluated first, in the case of a clause like \"x=x+5\" (x\n # is undeclared)\n\n self.visit(node.value)\n in_a = self.in_assign_targets\n self.in_assign_targets = True\n for n in node.targets:\n self.visit(n)\n self.in_assign_targets = in_a",
"metadata": "root.FindIdentifiers.visit_Assign",
"header": "['class', 'FindIdentifiers', '(', '_ast_util', '.', 'NodeVisitor', ')', ':', '___EOS___']",
"index": 81
},
{
"content": " def visit_ExceptHandler(self, node):\n if node.name is not None:\n self._add_declared(node.name)\n if node.type is not None:\n self.listener.undeclared_identifiers.add(node.type.id)\n for statement in node.body:\n self.visit(statement)",
"metadata": "root.FindIdentifiers.visit_ExceptHandler",
"header": "['class', 'FindIdentifiers', '(', '_ast_util', '.', 'NodeVisitor', ')', ':', '___EOS___']",
"index": 99
},
{
"content": " def visit_Lambda(self, node, *args):\n self._visit_function(node, True)",
"metadata": "root.FindIdentifiers.visit_Lambda",
"header": "['class', 'FindIdentifiers', '(', '_ast_util', '.', 'NodeVisitor', ')', ':', '___EOS___']",
"index": 107
},
{
"content": " def visit_FunctionDef(self, node):\n self._add_declared(node.name)\n self._visit_function(node, False)",
"metadata": "root.FindIdentifiers.visit_FunctionDef",
"header": "['class', 'FindIdentifiers', '(', '_ast_util', '.', 'NodeVisitor', ')', ':', '___EOS___']",
"index": 110
},
{
"content": " def _expand_tuples(self, args):\n for arg in args:\n if isinstance(arg, _ast.Tuple):\n for n in arg.elts:\n yield n\n else:\n yield arg",
"metadata": "root.FindIdentifiers._expand_tuples",
"header": "['class', 'FindIdentifiers', '(', '_ast_util', '.', 'NodeVisitor', ')', ':', '___EOS___']",
"index": 114
},
{
"content": " def _visit_function(self, node, islambda):\n\n # push function state onto stack. dont log any more\n # identifiers as \"declared\" until outside of the function,\n # but keep logging identifiers as \"undeclared\". track\n # argument names in each function header so they arent\n # counted as \"undeclared\"\n\n inf = self.in_function\n self.in_function = True\n\n local_ident_stack = self.local_ident_stack\n self.local_ident_stack = local_ident_stack.union([\n arg_id(arg) for arg in self._expand_tuples(node.args.args)\n ])\n if islambda:\n self.visit(node.body)\n else:\n for n in node.body:\n self.visit(n)\n self.in_function = inf\n self.local_ident_stack = local_ident_stack",
"metadata": "root.FindIdentifiers._visit_function",
"header": "['class', 'FindIdentifiers', '(', '_ast_util', '.', 'NodeVisitor', ')', ':', '___EOS___']",
"index": 122
},
{
"content": " def visit_For(self, node):\n\n # flip around visit\n\n self.visit(node.iter)\n self.visit(node.target)\n for statement in node.body:\n self.visit(statement)\n for statement in node.orelse:\n self.visit(statement)",
"metadata": "root.FindIdentifiers.visit_For",
"header": "['class', 'FindIdentifiers', '(', '_ast_util', '.', 'NodeVisitor', ')', ':', '___EOS___']",
"index": 145
},
{
"content": " def visit_Name(self, node):\n if isinstance(node.ctx, _ast.Store):\n # this is eqiuvalent to visit_AssName in\n # compiler\n self._add_declared(node.id)\n elif node.id not in reserved and node.id \\\n not in self.listener.declared_identifiers and node.id \\\n not in self.local_ident_stack:\n self.listener.undeclared_identifiers.add(node.id)",
"metadata": "root.FindIdentifiers.visit_Name",
"header": "['class', 'FindIdentifiers', '(', '_ast_util', '.', 'NodeVisitor', ')', ':', '___EOS___']",
"index": 156
},
{
"content": " def visit_Import(self, node):\n for name in node.names:\n if name.asname is not None:\n self._add_declared(name.asname)\n else:\n self._add_declared(name.name.split('.')[0])",
"metadata": "root.FindIdentifiers.visit_Import",
"header": "['class', 'FindIdentifiers', '(', '_ast_util', '.', 'NodeVisitor', ')', ':', '___EOS___']",
"index": 166
},
{
"content": " def visit_ImportFrom(self, node):\n for name in node.names:\n if name.asname is not None:\n self._add_declared(name.asname)\n else:\n if name.name == '*':\n raise exceptions.CompileException(\n \"'import *' is not supported, since all identifier \"\n \"names must be explicitly declared. Please use the \"\n \"form 'from <modulename> import <name1>, <name2>, \"\n \"...' instead.\", **self.exception_kwargs)\n self._add_declared(name.name)",
"metadata": "root.FindIdentifiers.visit_ImportFrom",
"header": "['class', 'FindIdentifiers', '(', '_ast_util', '.', 'NodeVisitor', ')', ':', '___EOS___']",
"index": 173
},
{
"content": " class FindTuple(_ast_util.NodeVisitor):\n\n",
"metadata": "root.FindTuple",
"header": "['module', '___EOS___']",
"index": 187
},
{
"content": " def __init__(self, listener, code_factory, **exception_kwargs):\n self.listener = listener\n self.exception_kwargs = exception_kwargs\n self.code_factory = code_factory",
"metadata": "root.FindTuple.__init__",
"header": "['class', 'FindTuple', '(', '_ast_util', '.', 'NodeVisitor', ')', ':', '___EOS___']",
"index": 189
},
{
"content": " def visit_Tuple(self, node):\n for n in node.elts:\n p = self.code_factory(n, **self.exception_kwargs)\n self.listener.codeargs.append(p)\n self.listener.args.append(ExpressionGenerator(n).value())\n self.listener.declared_identifiers = \\\n self.listener.declared_identifiers.union(\n p.declared_identifiers)\n self.listener.undeclared_identifiers = \\\n self.listener.undeclared_identifiers.union(\n p.undeclared_identifiers)",
"metadata": "root.FindTuple.visit_Tuple",
"header": "['class', 'FindTuple', '(', '_ast_util', '.', 'NodeVisitor', ')', ':', '___EOS___']",
"index": 194
},
{
"content": " class ParseFunc(_ast_util.NodeVisitor):\n\n",
"metadata": "root.ParseFunc",
"header": "['module', '___EOS___']",
"index": 207
},
{
"content": " def __init__(self, listener, **exception_kwargs):\n self.listener = listener\n self.exception_kwargs = exception_kwargs",
"metadata": "root.ParseFunc.__init__",
"header": "['class', 'ParseFunc', '(', '_ast_util', '.', 'NodeVisitor', ')', ':', '___EOS___']",
"index": 209
},
{
"content": " def visit_FunctionDef(self, node):\n self.listener.funcname = node.name\n argnames = [arg_id(arg) for arg in node.args.args]\n if node.args.vararg:\n argnames.append(node.args.vararg)\n if node.args.kwarg:\n argnames.append(node.args.kwarg)\n self.listener.argnames = argnames\n self.listener.defaults = node.args.defaults # ast\n self.listener.varargs = node.args.vararg\n self.listener.kwargs = node.args.kwarg",
"metadata": "root.ParseFunc.visit_FunctionDef",
"header": "['class', 'ParseFunc', '(', '_ast_util', '.', 'NodeVisitor', ')', ':', '___EOS___']",
"index": 213
},
{
"content": " class ExpressionGenerator(object):\n\n",
"metadata": "root.ExpressionGenerator",
"header": "['module', '___EOS___']",
"index": 226
},
{
"content": " def __init__(self, astnode):\n self.generator = _ast_util.SourceGenerator(' ' * 4)\n self.generator.visit(astnode)",
"metadata": "root.ExpressionGenerator.__init__",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 228
},
{
"content": " def value(self):\n return ''.join(self.generator.result)",
"metadata": "root.ExpressionGenerator.value",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 232
},
{
"content": " class FindIdentifiers(object):\n\n\n\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root.FindIdentifiers",
"header": "['module', '___EOS___']",
"index": 235
},
{
"content": " def __init__(self, listener, **exception_kwargs):\n self.in_function = False\n self.local_ident_stack = set()\n self.listener = listener\n self.exception_kwargs = exception_kwargs",
"metadata": "root.FindIdentifiers.__init__",
"header": "['class', 'FindIdentifiers', '(', 'object', ')', ':', '___EOS___']",
"index": 237
},
{
"content": " def _add_declared(self, name):\n if not self.in_function:\n self.listener.declared_identifiers.add(name)\n else:\n self.local_ident_stack.add(name)",
"metadata": "root.FindIdentifiers._add_declared",
"header": "['class', 'FindIdentifiers', '(', 'object', ')', ':', '___EOS___']",
"index": 243
},
{
"content": " def visitClass(self, node, *args):\n self._add_declared(node.name)",
"metadata": "root.FindIdentifiers.visitClass",
"header": "['class', 'FindIdentifiers', '(', 'object', ')', ':', '___EOS___']",
"index": 249
},
{
"content": " def visitAssName(self, node, *args):\n self._add_declared(node.name)",
"metadata": "root.FindIdentifiers.visitAssName",
"header": "['class', 'FindIdentifiers', '(', 'object', ')', ':', '___EOS___']",
"index": 252
},
{
"content": " def visitAssign(self, node, *args):\n\n # flip around the visiting of Assign so the expression gets\n # evaluated first, in the case of a clause like \"x=x+5\" (x\n # is undeclared)\n self.visit(node.expr, *args)\n for n in node.nodes:\n self.visit(n, *args)",
"metadata": "root.FindIdentifiers.visitAssign",
"header": "['class', 'FindIdentifiers', '(', 'object', ')', ':', '___EOS___']",
"index": 255
},
{
"content": " def visitLambda(self, node, *args):\n self._visit_function(node, args)",
"metadata": "root.FindIdentifiers.visitLambda",
"header": "['class', 'FindIdentifiers', '(', 'object', ')', ':', '___EOS___']",
"index": 264
},
{
"content": " def visitFunction(self, node, *args):\n self._add_declared(node.name)\n self._visit_function(node, args)",
"metadata": "root.FindIdentifiers.visitFunction",
"header": "['class', 'FindIdentifiers', '(', 'object', ')', ':', '___EOS___']",
"index": 267
},
{
"content": " def _expand_tuples(self, args):\n for arg in args:\n if isinstance(arg, tuple):\n for n in arg:\n yield n\n else:\n yield arg",
"metadata": "root.FindIdentifiers._expand_tuples",
"header": "['class', 'FindIdentifiers', '(', 'object', ')', ':', '___EOS___']",
"index": 271
},
{
"content": " def _visit_function(self, node, args):\n\n # push function state onto stack. dont log any more\n # identifiers as \"declared\" until outside of the function,\n # but keep logging identifiers as \"undeclared\". track\n # argument names in each function header so they arent\n # counted as \"undeclared\"\n\n inf = self.in_function\n self.in_function = True\n\n local_ident_stack = self.local_ident_stack\n self.local_ident_stack = local_ident_stack.union([\n arg for arg in self._expand_tuples(node.argnames)\n ])\n\n for n in node.getChildNodes():\n self.visit(n, *args)\n self.in_function = inf\n self.local_ident_stack = local_ident_stack",
"metadata": "root.FindIdentifiers._visit_function",
"header": "['class', 'FindIdentifiers', '(', 'object', ')', ':', '___EOS___']",
"index": 279
},
{
"content": " def visitFor(self, node, *args):\n\n # flip around visit\n\n self.visit(node.list, *args)\n self.visit(node.assign, *args)\n self.visit(node.body, *args)",
"metadata": "root.FindIdentifiers.visitFor",
"header": "['class', 'FindIdentifiers', '(', 'object', ')', ':', '___EOS___']",
"index": 300
},
{
"content": " def visitName(self, node, *args):\n if node.name not in reserved and node.name \\\n not in self.listener.declared_identifiers and node.name \\\n not in self.local_ident_stack:\n self.listener.undeclared_identifiers.add(node.name)",
"metadata": "root.FindIdentifiers.visitName",
"header": "['class', 'FindIdentifiers', '(', 'object', ')', ':', '___EOS___']",
"index": 308
},
{
"content": " def visitImport(self, node, *args):\n for mod, alias in node.names:\n if alias is not None:\n self._add_declared(alias)\n else:\n self._add_declared(mod.split('.')[0])",
"metadata": "root.FindIdentifiers.visitImport",
"header": "['class', 'FindIdentifiers', '(', 'object', ')', ':', '___EOS___']",
"index": 314
},
{
"content": " def visitFrom(self, node, *args):\n for mod, alias in node.names:\n if alias is not None:\n self._add_declared(alias)\n else:\n if mod == '*':\n raise exceptions.CompileException(\n \"'import *' is not supported, since all identifier \"\n \"names must be explicitly declared. Please use the \"\n \"form 'from <modulename> import <name1>, <name2>, \"\n \"...' instead.\", **self.exception_kwargs)\n self._add_declared(mod)",
"metadata": "root.FindIdentifiers.visitFrom",
"header": "['class', 'FindIdentifiers', '(', 'object', ')', ':', '___EOS___']",
"index": 321
},
{
"content": " def visit(self, expr):\n visitor.walk(expr, self) # , walker=walker())",
"metadata": "root.FindIdentifiers.visit",
"header": "['class', 'FindIdentifiers', '(', 'object', ')', ':', '___EOS___']",
"index": 334
},
{
"content": " class FindTuple(object):\n\n\n",
"metadata": "root.FindTuple",
"header": "['module', '___EOS___']",
"index": 338
},
{
"content": " def __init__(self, listener, code_factory, **exception_kwargs):\n self.listener = listener\n self.exception_kwargs = exception_kwargs\n self.code_factory = code_factory",
"metadata": "root.FindTuple.__init__",
"header": "['class', 'FindTuple', '(', 'object', ')', ':', '___EOS___']",
"index": 340
},
{
"content": " def visitTuple(self, node, *args):\n for n in node.nodes:\n p = self.code_factory(n, **self.exception_kwargs)\n self.listener.codeargs.append(p)\n self.listener.args.append(ExpressionGenerator(n).value())\n self.listener.declared_identifiers = \\\n self.listener.declared_identifiers.union(\n p.declared_identifiers)\n self.listener.undeclared_identifiers = \\\n self.listener.undeclared_identifiers.union(\n p.undeclared_identifiers)",
"metadata": "root.FindTuple.visitTuple",
"header": "['class', 'FindTuple', '(', 'object', ')', ':', '___EOS___']",
"index": 345
},
{
"content": " def visit(self, expr):\n visitor.walk(expr, self) # , walker=walker())",
"metadata": "root.FindTuple.visit",
"header": "['class', 'FindTuple', '(', 'object', ')', ':', '___EOS___']",
"index": 357
},
{
"content": " class ParseFunc(object):\n\n\n",
"metadata": "root.ParseFunc",
"header": "['module', '___EOS___']",
"index": 361
},
{
"content": " def __init__(self, listener, **exception_kwargs):\n self.listener = listener\n self.exception_kwargs = exception_kwargs",
"metadata": "root.ParseFunc.__init__",
"header": "['class', 'ParseFunc', '(', 'object', ')', ':', '___EOS___']",
"index": 363
},
{
"content": " def visitFunction(self, node, *args):\n self.listener.funcname = node.name\n self.listener.argnames = node.argnames\n self.listener.defaults = node.defaults\n self.listener.varargs = node.varargs\n self.listener.kwargs = node.kwargs",
"metadata": "root.ParseFunc.visitFunction",
"header": "['class', 'ParseFunc', '(', 'object', ')', ':', '___EOS___']",
"index": 367
},
{
"content": " def visit(self, expr):\n visitor.walk(expr, self)",
"metadata": "root.ParseFunc.visit",
"header": "['class', 'ParseFunc', '(', 'object', ')', ':', '___EOS___']",
"index": 374
},
{
"content": " class ExpressionGenerator(object):\n\n \"\"\"given an AST node, generates an equivalent literal Python\n expression.\"\"\"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root.ExpressionGenerator",
"header": "['module', '___EOS___']",
"index": 378
},
{
"content": " def __init__(self, astnode):\n self.buf = StringIO()\n visitor.walk(astnode, self) # , walker=walker())",
"metadata": "root.ExpressionGenerator.__init__",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 383
},
{
"content": " def value(self):\n return self.buf.getvalue()",
"metadata": "root.ExpressionGenerator.value",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 387
},
{
"content": " def operator(self, op, node, *args):\n self.buf.write('(')\n self.visit(node.left, *args)\n self.buf.write(' %s ' % op)\n self.visit(node.right, *args)\n self.buf.write(')')",
"metadata": "root.ExpressionGenerator.operator",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 390
},
{
"content": " def booleanop(self, op, node, *args):\n self.visit(node.nodes[0])\n for n in node.nodes[1:]:\n self.buf.write(' ' + op + ' ')\n self.visit(n, *args)",
"metadata": "root.ExpressionGenerator.booleanop",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 397
},
{
"content": " def visitConst(self, node, *args):\n self.buf.write(repr(node.value))",
"metadata": "root.ExpressionGenerator.visitConst",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 403
},
{
"content": " def visitAssName(self, node, *args):\n\n # TODO: figure out OP_ASSIGN, other OP_s\n\n self.buf.write(node.name)",
"metadata": "root.ExpressionGenerator.visitAssName",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 406
},
{
"content": " def visitName(self, node, *args):\n self.buf.write(node.name)",
"metadata": "root.ExpressionGenerator.visitName",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 412
},
{
"content": " def visitMul(self, node, *args):\n self.operator('*', node, *args)",
"metadata": "root.ExpressionGenerator.visitMul",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 415
},
{
"content": " def visitAnd(self, node, *args):\n self.booleanop('and', node, *args)",
"metadata": "root.ExpressionGenerator.visitAnd",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 418
},
{
"content": " def visitOr(self, node, *args):\n self.booleanop('or', node, *args)",
"metadata": "root.ExpressionGenerator.visitOr",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 421
},
{
"content": " def visitBitand(self, node, *args):\n self.booleanop('&', node, *args)",
"metadata": "root.ExpressionGenerator.visitBitand",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 424
},
{
"content": " def visitBitor(self, node, *args):\n self.booleanop('|', node, *args)",
"metadata": "root.ExpressionGenerator.visitBitor",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 427
},
{
"content": " def visitBitxor(self, node, *args):\n self.booleanop('^', node, *args)",
"metadata": "root.ExpressionGenerator.visitBitxor",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 430
},
{
"content": " def visitAdd(self, node, *args):\n self.operator('+', node, *args)",
"metadata": "root.ExpressionGenerator.visitAdd",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 433
},
{
"content": " def visitGetattr(self, node, *args):\n self.visit(node.expr, *args)\n self.buf.write('.%s' % node.attrname)",
"metadata": "root.ExpressionGenerator.visitGetattr",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 436
},
{
"content": " def visitSub(self, node, *args):\n self.operator('-', node, *args)",
"metadata": "root.ExpressionGenerator.visitSub",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 440
},
{
"content": " def visitNot(self, node, *args):\n self.buf.write('not ')\n self.visit(node.expr)",
"metadata": "root.ExpressionGenerator.visitNot",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 443
},
{
"content": " def visitDiv(self, node, *args):\n self.operator('/', node, *args)",
"metadata": "root.ExpressionGenerator.visitDiv",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 447
},
{
"content": " def visitFloorDiv(self, node, *args):\n self.operator('//', node, *args)",
"metadata": "root.ExpressionGenerator.visitFloorDiv",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 450
},
{
"content": " def visitSubscript(self, node, *args):\n self.visit(node.expr)\n self.buf.write('[')\n [self.visit(x) for x in node.subs]\n self.buf.write(']')",
"metadata": "root.ExpressionGenerator.visitSubscript",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 453
},
{
"content": " def visitUnarySub(self, node, *args):\n self.buf.write('-')\n self.visit(node.expr)",
"metadata": "root.ExpressionGenerator.visitUnarySub",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 459
},
{
"content": " def visitUnaryAdd(self, node, *args):\n self.buf.write('-')\n self.visit(node.expr)",
"metadata": "root.ExpressionGenerator.visitUnaryAdd",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 463
},
{
"content": " def visitSlice(self, node, *args):\n self.visit(node.expr)\n self.buf.write('[')\n if node.lower is not None:\n self.visit(node.lower)\n self.buf.write(':')\n if node.upper is not None:\n self.visit(node.upper)\n self.buf.write(']')",
"metadata": "root.ExpressionGenerator.visitSlice",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 467
},
{
"content": " def visitDict(self, node):\n self.buf.write('{')\n c = node.getChildren()\n for i in range(0, len(c), 2):\n self.visit(c[i])\n self.buf.write(': ')\n self.visit(c[i + 1])\n if i < len(c) - 2:\n self.buf.write(', ')\n self.buf.write('}')",
"metadata": "root.ExpressionGenerator.visitDict",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 477
},
{
"content": " def visitTuple(self, node):\n self.buf.write('(')\n c = node.getChildren()\n for i in range(0, len(c)):\n self.visit(c[i])\n if i < len(c) - 1:\n self.buf.write(', ')\n self.buf.write(')')",
"metadata": "root.ExpressionGenerator.visitTuple",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 488
},
{
"content": " def visitList(self, node):\n self.buf.write('[')\n c = node.getChildren()\n for i in range(0, len(c)):\n self.visit(c[i])\n if i < len(c) - 1:\n self.buf.write(', ')\n self.buf.write(']')",
"metadata": "root.ExpressionGenerator.visitList",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 497
},
{
"content": " def visitListComp(self, node):\n self.buf.write('[')\n self.visit(node.expr)\n self.buf.write(' ')\n for n in node.quals:\n self.visit(n)\n self.buf.write(']')",
"metadata": "root.ExpressionGenerator.visitListComp",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 506
},
{
"content": " def visitListCompFor(self, node):\n self.buf.write(' for ')\n self.visit(node.assign)\n self.buf.write(' in ')\n self.visit(node.list)\n for n in node.ifs:\n self.visit(n)",
"metadata": "root.ExpressionGenerator.visitListCompFor",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 514
},
{
"content": " def visitListCompIf(self, node):\n self.buf.write(' if ')\n self.visit(node.test)",
"metadata": "root.ExpressionGenerator.visitListCompIf",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 522
},
{
"content": " def visitCompare(self, node):\n self.visit(node.expr)\n for tup in node.ops:\n self.buf.write(tup[0])\n self.visit(tup[1])",
"metadata": "root.ExpressionGenerator.visitCompare",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 526
},
{
"content": " def visitCallFunc(self, node, *args):\n self.visit(node.node)\n self.buf.write('(')\n if len(node.args):\n self.visit(node.args[0])\n for a in node.args[1:]:\n self.buf.write(', ')\n self.visit(a)\n self.buf.write(')')",
"metadata": "root.ExpressionGenerator.visitCallFunc",
"header": "['class', 'ExpressionGenerator', '(', 'object', ')', ':', '___EOS___']",
"index": 532
},
{
"content": " class walker(visitor.ASTVisitor):\n",
"metadata": "root.walker",
"header": "['module', '___EOS___']",
"index": 543
},
{
"content": " def dispatch(self, node, *args):\n print('Node:', str(node))\n\n # print \"dir:\", dir(node)\n\n return visitor.ASTVisitor.dispatch(self, node, *args)",
"metadata": "root.walker.dispatch",
"header": "['class', 'walker', '(', 'visitor', '.', 'ASTVisitor', ')', ':', '___EOS___']",
"index": 545
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#",
" ",
"mak",
"o",
"/",
"pypa",
"rse",
"r",
".",
"py_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Copy",
"right",
" ",
"(",
"C",
")",
" ",
"2006",
"-",
"2012",
" ",
"the",
" ",
"Ma",
"ko",
" ",
"author",
"s",
" ",
"and",
" ",
"contributor",
"s",
" ",
"<",
"see",
" ",
"AUTHOR",
"S",
" ",
"file",
">_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Thi",
"s",
" ",
"module",
" ",
"is",
" ",
"part",
" ",
"of",
" ",
"Ma",
"ko",
" ",
"and",
" ",
"is",
" ",
"released",
" ",
"under",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"the",
" ",
"MIT",
" ",
"License",
":",
" ",
"http",
"://",
"www",
".",
"opens",
"ource",
".",
"org",
"/",
"license",
"s",
"/",
"mit",
"-",
"license",
".",
"php",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"\"\"",
"Handle",
"s",
" ",
"pars",
"ing",
" ",
"of",
" ",
"Pyth",
"on",
" ",
"code",
".",
"\\",
"10",
";",
"\\",
"10",
";",
"Pars",
"ing",
" ",
"to",
" ",
"AST",
" ",
"is",
" ",
"don",
"e",
" ",
"via",
" ",
"\\u",
"ast",
" ",
"on",
" ",
"Pyth",
"on",
" ",
">",
" ",
"2.5",
",",
" ",
"other",
"wis",
"e",
" ",
"the",
" ",
"compiler",
"\\",
"10",
";",
"module",
" ",
"is",
" ",
"used",
".",
"\\",
"10",
";\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"mak",
"o_",
"import_",
"exceptions_",
",_",
"util_",
",_",
"compat_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"mak",
"o_",
"._",
"compat_",
"import_",
"String",
"IO_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"operator_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"compat_",
"._",
"py3",
"k_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"words",
" ",
"tha",
"t",
" ",
"cann",
"ot",
" ",
"be",
" ",
"assign",
"ed",
" ",
"to",
" ",
"(",
"nota",
"bly",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"small",
"er",
" ",
"than",
" ",
"the",
" ",
"total",
" ",
"keys",
" ",
"in",
" ",
"\\u\\u",
"bui",
"lti",
"ns",
"\\u\\u)",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"reserved_",
"=_",
"set_",
"(_",
"[_",
"'",
"Tru",
"e",
"'_",
",_",
"'",
"Fal",
"se",
"'_",
",_",
"'",
"Non",
"e",
"'_",
",_",
"'",
"print",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"the",
" ",
"\"",
"id",
"\"",
" ",
"attribute",
" ",
"on",
" ",
"a",
" ",
"function",
" ",
"node_",
"\\u\\u\\uNL\\u\\u\\u_",
"arg",
"\\u",
"id_",
"=_",
"operator_",
"._",
"attrgetter_",
"(_",
"'",
"arg",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"words",
" ",
"tha",
"t",
" ",
"cann",
"ot",
" ",
"be",
" ",
"assign",
"ed",
" ",
"to",
" ",
"(",
"nota",
"bly",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"small",
"er",
" ",
"than",
" ",
"the",
" ",
"total",
" ",
"keys",
" ",
"in",
" ",
"\\u\\u",
"bui",
"lti",
"ns",
"\\u\\u)",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"reserved_",
"=_",
"set_",
"(_",
"[_",
"'",
"Tru",
"e",
"'_",
",_",
"'",
"Fal",
"se",
"'_",
",_",
"'",
"Non",
"e",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"the",
" ",
"\"",
"id",
"\"",
" ",
"attribute",
" ",
"on",
" ",
"a",
" ",
"function",
" ",
"node_",
"\\u\\u\\uNL\\u\\u\\u_",
"arg",
"\\u",
"id_",
"=_",
"operator_",
"._",
"attrgetter_",
"(_",
"'",
"id",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"\\u",
"ast_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"util_",
"._",
"restore",
"\\u\\u",
"ast_",
"(_",
"\\u",
"ast_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"mak",
"o_",
"import_",
"\\u",
"ast",
"\\u",
"util_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Import",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\\u",
"ast_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"compiler_",
"import_",
"parse_",
"as_",
"compiler",
"\\u",
"parse_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"compiler_",
"import_",
"visitor_",
"\\u\\u\\uNEWLINE\\u\\u\\u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u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"parse_",
"(_",
"code_",
",_",
"mode_",
"=_",
"'",
"exec",
"'_",
",_",
"**_",
"exception",
"\\u",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Pars",
"e",
" ",
"an",
" ",
"express",
"ion",
" ",
"int",
"o",
" ",
"AST",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"\\u",
"ast_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"parse_",
"(_",
"code_",
",_",
"'<",
"unknown",
">'_",
",_",
"mode_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"code_",
",_",
"compat_",
"._",
"text",
"\\u",
"type_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"code_",
"=_",
"code_",
"._",
"encode_",
"(_",
"'",
"ascii",
"'_",
",_",
"'",
"backslash",
"replace",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"compiler",
"\\u",
"parse_",
"(_",
"code_",
",_",
"mode_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Exception_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"exceptions_",
"._",
"Syntax",
"Exception_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"(",
"%",
"s",
")",
" ",
"%",
"s",
" ",
"(%",
"r",
")\"_",
"%_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"compat_",
"._",
"exception",
"\\u",
"as_",
"(_",
")_",
"._",
"\\u\\u",
"class\\u\\u_",
"._",
"\\u\\u",
"name\\u\\u_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"compat_",
"._",
"exception",
"\\u",
"as_",
"(_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"code_",
"[_",
"0_",
":_",
"50_",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"**_",
"exception",
"\\u",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"compat_",
"._",
"py3",
"k_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Except",
"Handle",
"r",
" ",
"is",
" ",
"in",
" ",
"Pyth",
"on",
" ",
"2",
",",
" ",
"but",
" ",
"this",
" ",
"block",
" ",
"only",
" ",
"works",
" ",
"in_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Pyth",
"on",
" ",
"3",
" ",
"(",
"and",
" ",
"is",
" ",
"require",
"d",
" ",
"there",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"listener_",
",_",
"**_",
"exception",
"\\u",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"in",
"\\u",
"function_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"in",
"\\u",
"assign",
"\\u",
"targets_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"local",
"\\u",
"ident",
"\\u",
"stack_",
"=_",
"set_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"listener_",
"=_",
"listener_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"exception",
"\\u",
"kwargs_",
"=_",
"exception",
"\\u",
"kwargs_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"add",
"\\u",
"declared",
"_",
"(_",
"self_",
",_",
"name_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"self_",
"._",
"in",
"\\u",
"function_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"listener_",
"._",
"declared",
"\\u",
"identifiers_",
"._",
"add_",
"(_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"local",
"\\u",
"ident",
"\\u",
"stack_",
"._",
"add_",
"(_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"\\u",
"Class",
"Def_",
"(_",
"self_",
",_",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"add",
"\\u",
"declared",
"_",
"(_",
"node_",
"._",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"\\u",
"Assign_",
"(_",
"self_",
",_",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"flip",
" ",
"aro",
"und",
" ",
"the",
" ",
"visit",
"ing",
" ",
"of",
" ",
"Assign",
" ",
"so",
" ",
"the",
" ",
"express",
"ion",
" ",
"gets",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"evaluate",
"d",
" ",
"first",
",",
" ",
"in",
" ",
"the",
" ",
"case",
" ",
"of",
" ",
"a",
" ",
"clause",
" ",
"like",
" ",
"\"",
"x",
"=",
"x",
"+",
"5",
"\"",
" ",
"(",
"x_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"is",
" ",
"unde",
"clar",
"ed",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"in",
"\\u",
"a_",
"=_",
"self_",
"._",
"in",
"\\u",
"assign",
"\\u",
"targets_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"in",
"\\u",
"assign",
"\\u",
"targets_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"n_",
"in_",
"node_",
"._",
"targets_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"n_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"in",
"\\u",
"assign",
"\\u",
"targets_",
"=_",
"in",
"\\u",
"a_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"visit",
"\\u",
"Except",
"Handler_",
"(_",
"self_",
",_",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"node_",
"._",
"name_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"\\u",
"add",
"\\u",
"declared",
"_",
"(_",
"node_",
"._",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"node_",
"._",
"type_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"listener_",
"._",
"unde",
"clar",
"ed",
"\\u",
"identifiers_",
"._",
"add_",
"(_",
"node_",
"._",
"type_",
"._",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"statement_",
"in_",
"node_",
"._",
"body_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"visit_",
"(_",
"statement_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"\\u",
"Lambda_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"visit",
"\\u",
"function_",
"(_",
"node_",
",_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"\\u",
"Function",
"Def_",
"(_",
"self_",
",_",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"add",
"\\u",
"declared",
"_",
"(_",
"node_",
"._",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"visit",
"\\u",
"function_",
"(_",
"node_",
",_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"expand",
"\\u",
"tuples_",
"(_",
"self_",
",_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"arg_",
"in_",
"args_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"arg_",
",_",
"\\u",
"ast_",
"._",
"Tuple_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"for_",
"n_",
"in_",
"arg_",
"._",
"elts",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"yield_",
"n_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"yield_",
"arg_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"visit",
"\\u",
"function_",
"(_",
"self_",
",_",
"node_",
",_",
"isl",
"amb",
"da_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"push",
" ",
"function",
" ",
"state",
" ",
"onto",
" ",
"stack",
".",
" ",
" ",
"don",
"t",
" ",
"log",
" ",
"any",
" ",
"more_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"identifi",
"ers",
" ",
"as",
" ",
"\"",
"declared",
"\"",
" ",
"unti",
"l",
" ",
"outsi",
"de",
" ",
"of",
" ",
"the",
" ",
"function",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"but",
" ",
"keep",
" ",
"logg",
"ing",
" ",
"identifi",
"ers",
" ",
"as",
" ",
"\"",
"unde",
"clar",
"ed",
"\".",
" ",
"track_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"argu",
"ment",
" ",
"names",
" ",
"in",
" ",
"each",
" ",
"function",
" ",
"header",
" ",
"so",
" ",
"the",
"y",
" ",
"arent",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"counted",
" ",
"as",
" ",
"\"",
"unde",
"clar",
"ed",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"inf_",
"=_",
"self_",
"._",
"in",
"\\u",
"function_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"in",
"\\u",
"function_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"local",
"\\u",
"ident",
"\\u",
"stack_",
"=_",
"self_",
"._",
"local",
"\\u",
"ident",
"\\u",
"stack_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"local",
"\\u",
"ident",
"\\u",
"stack_",
"=_",
"local",
"\\u",
"ident",
"\\u",
"stack_",
"._",
"union_",
"(_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"arg",
"\\u",
"id_",
"(_",
"arg_",
")_",
"for_",
"arg_",
"in_",
"self_",
"._",
"\\u",
"expand",
"\\u",
"tuples_",
"(_",
"node_",
"._",
"args_",
"._",
"args_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"isl",
"amb",
"da_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"body_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"n_",
"in_",
"node_",
"._",
"body_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"visit_",
"(_",
"n_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"in",
"\\u",
"function_",
"=_",
"inf_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"local",
"\\u",
"ident",
"\\u",
"stack_",
"=_",
"local",
"\\u",
"ident",
"\\u",
"stack_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"\\u",
"For_",
"(_",
"self_",
",_",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"flip",
" ",
"aro",
"und",
" ",
"visit_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"iter_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"target_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"statement_",
"in_",
"node_",
"._",
"body_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"statement_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"statement_",
"in_",
"node_",
"._",
"ore",
"lse",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"statement_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"\\u",
"Name_",
"(_",
"self_",
",_",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"node_",
"._",
"ctx_",
",_",
"\\u",
"ast_",
"._",
"Store_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"this",
" ",
"is",
" ",
"eq",
"iu",
"vale",
"nt",
" ",
"to",
" ",
"visit",
"\\u",
"Ass",
"Name",
" ",
"in_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"compiler_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"add",
"\\u",
"declared",
"_",
"(_",
"node_",
"._",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"node_",
"._",
"id_",
"not_",
"in_",
"reserved_",
"and_",
"node_",
"._",
"id_",
"not_",
"in_",
"self_",
"._",
"listener_",
"._",
"declared",
"\\u",
"identifiers_",
"and_",
"node_",
"._",
"id_",
"not_",
"in_",
"self_",
"._",
"local",
"\\u",
"ident",
"\\u",
"stack_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"listener_",
"._",
"unde",
"clar",
"ed",
"\\u",
"identifiers_",
"._",
"add_",
"(_",
"node_",
"._",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"\\u",
"Import_",
"(_",
"self_",
",_",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"name_",
"in_",
"node_",
"._",
"names_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"name_",
"._",
"asn",
"ame_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"\\u",
"add",
"\\u",
"declared",
"_",
"(_",
"name_",
"._",
"asn",
"ame_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"\\u",
"add",
"\\u",
"declared",
"_",
"(_",
"name_",
"._",
"name_",
"._",
"split_",
"(_",
"'.'_",
")_",
"[_",
"0_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"\\u",
"Import",
"From_",
"(_",
"self_",
",_",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"name_",
"in_",
"node_",
"._",
"names_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"name_",
"._",
"asn",
"ame_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"\\u",
"add",
"\\u",
"declared",
"_",
"(_",
"name_",
"._",
"asn",
"ame_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"if_",
"name_",
"._",
"name_",
"==_",
"'*'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"raise_",
"exceptions_",
"._",
"Compil",
"e",
"Exception_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"'",
"import",
" ",
"*'",
" ",
"is",
" ",
"not",
" ",
"support",
"ed",
",",
" ",
"sinc",
"e",
" ",
"all",
" ",
"identifi",
"er",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"names",
" ",
"must",
" ",
"be",
" ",
"explicit",
"ly",
" ",
"declared",
".",
" ",
" ",
"Ple",
"ase",
" ",
"use",
" ",
"the",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"form",
" ",
"'",
"from",
" ",
"<",
"modulename",
">",
" ",
"import",
" ",
"<",
"name",
"1",
">",
",",
" ",
"<",
"name2",
">",
",",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"...",
"'",
" ",
"inst",
"ead",
".\"_",
",_",
"**_",
"self_",
"._",
"exception",
"\\u",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"add",
"\\u",
"declared",
"_",
"(_",
"name_",
"._",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Fin",
"d",
"Tuple_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Tuple_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"listener_",
",_",
"code",
"\\u",
"factory_",
",_",
"**_",
"exception",
"\\u",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"listener_",
"=_",
"listener_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"exception",
"\\u",
"kwargs_",
"=_",
"exception",
"\\u",
"kwargs_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"code",
"\\u",
"factory_",
"=_",
"code",
"\\u",
"factory_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Tuple_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"\\u",
"Tuple_",
"(_",
"self_",
",_",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"n_",
"in_",
"node_",
"._",
"elts",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"p_",
"=_",
"self_",
"._",
"code",
"\\u",
"factory_",
"(_",
"n_",
",_",
"**_",
"self_",
"._",
"exception",
"\\u",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"listener_",
"._",
"code",
"args_",
"._",
"append_",
"(_",
"p_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"listener_",
"._",
"args_",
"._",
"append_",
"(_",
"Expression",
"Generator_",
"(_",
"n_",
")_",
"._",
"value_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"listener_",
"._",
"declared",
"\\u",
"identifiers_",
"=_",
"self_",
"._",
"listener_",
"._",
"declared",
"\\u",
"identifiers_",
"._",
"union_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"p_",
"._",
"declared",
"\\u",
"identifiers_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"listener_",
"._",
"unde",
"clar",
"ed",
"\\u",
"identifiers_",
"=_",
"self_",
"._",
"listener_",
"._",
"unde",
"clar",
"ed",
"\\u",
"identifiers_",
"._",
"union_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"p_",
"._",
"unde",
"clar",
"ed",
"\\u",
"identifiers_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Pars",
"e",
"Func_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Pars",
"e",
"Func_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"listener_",
",_",
"**_",
"exception",
"\\u",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"listener_",
"=_",
"listener_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"exception",
"\\u",
"kwargs_",
"=_",
"exception",
"\\u",
"kwargs_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Pars",
"e",
"Func_",
"(_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Node",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"\\u",
"Function",
"Def_",
"(_",
"self_",
",_",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"listener_",
"._",
"funcname_",
"=_",
"node_",
"._",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"argname",
"s_",
"=_",
"[_",
"arg",
"\\u",
"id_",
"(_",
"arg_",
")_",
"for_",
"arg_",
"in_",
"node_",
"._",
"args_",
"._",
"args_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"node_",
"._",
"args_",
"._",
"vara",
"rg_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"argname",
"s_",
"._",
"append_",
"(_",
"node_",
"._",
"args_",
"._",
"vara",
"rg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"node_",
"._",
"args_",
"._",
"kwarg_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"argname",
"s_",
"._",
"append_",
"(_",
"node_",
"._",
"args_",
"._",
"kwarg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"listener_",
"._",
"argname",
"s_",
"=_",
"argname",
"s_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"listener_",
"._",
"defaults_",
"=_",
"node_",
"._",
"args_",
"._",
"defaults_",
"#",
" ",
"ast_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"listener_",
"._",
"varargs",
"_",
"=_",
"node_",
"._",
"args_",
"._",
"vara",
"rg_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"listener_",
"._",
"kwargs_",
"=_",
"node_",
"._",
"args_",
"._",
"kwarg_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"ast",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"generator_",
"=_",
"\\u",
"ast",
"\\u",
"util_",
"._",
"Sou",
"rce",
"Generator_",
"(_",
"'",
" ",
"'_",
"*_",
"4_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"generator_",
"._",
"visit_",
"(_",
"ast",
"node_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"value_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"''_",
"._",
"join_",
"(_",
"self_",
"._",
"generator_",
"._",
"result_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"listener_",
",_",
"**_",
"exception",
"\\u",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"in",
"\\u",
"function_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"local",
"\\u",
"ident",
"\\u",
"stack_",
"=_",
"set_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"listener_",
"=_",
"listener_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"exception",
"\\u",
"kwargs_",
"=_",
"exception",
"\\u",
"kwargs_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"add",
"\\u",
"declared",
"_",
"(_",
"self_",
",_",
"name_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"self_",
"._",
"in",
"\\u",
"function_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"listener_",
"._",
"declared",
"\\u",
"identifiers_",
"._",
"add_",
"(_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"local",
"\\u",
"ident",
"\\u",
"stack_",
"._",
"add_",
"(_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Class_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"add",
"\\u",
"declared",
"_",
"(_",
"node_",
"._",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Ass",
"Name_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"add",
"\\u",
"declared",
"_",
"(_",
"node_",
"._",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Assign_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"flip",
" ",
"aro",
"und",
" ",
"the",
" ",
"visit",
"ing",
" ",
"of",
" ",
"Assign",
" ",
"so",
" ",
"the",
" ",
"express",
"ion",
" ",
"gets",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"evaluate",
"d",
" ",
"first",
",",
" ",
"in",
" ",
"the",
" ",
"case",
" ",
"of",
" ",
"a",
" ",
"clause",
" ",
"like",
" ",
"\"",
"x",
"=",
"x",
"+",
"5",
"\"",
" ",
"(",
"x_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"is",
" ",
"unde",
"clar",
"ed",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"expr_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"n_",
"in_",
"node_",
"._",
"nodes_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"n_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Lambda_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"visit",
"\\u",
"function_",
"(_",
"node_",
",_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Function_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"add",
"\\u",
"declared",
"_",
"(_",
"node_",
"._",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"visit",
"\\u",
"function_",
"(_",
"node_",
",_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"expand",
"\\u",
"tuples_",
"(_",
"self_",
",_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"arg_",
"in_",
"args_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"arg_",
",_",
"tuple_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"for_",
"n_",
"in_",
"arg_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"yield_",
"n_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"yield_",
"arg_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"visit",
"\\u",
"function_",
"(_",
"self_",
",_",
"node_",
",_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"push",
" ",
"function",
" ",
"state",
" ",
"onto",
" ",
"stack",
".",
" ",
" ",
"don",
"t",
" ",
"log",
" ",
"any",
" ",
"more_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"identifi",
"ers",
" ",
"as",
" ",
"\"",
"declared",
"\"",
" ",
"unti",
"l",
" ",
"outsi",
"de",
" ",
"of",
" ",
"the",
" ",
"function",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"but",
" ",
"keep",
" ",
"logg",
"ing",
" ",
"identifi",
"ers",
" ",
"as",
" ",
"\"",
"unde",
"clar",
"ed",
"\".",
" ",
"track_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"argu",
"ment",
" ",
"names",
" ",
"in",
" ",
"each",
" ",
"function",
" ",
"header",
" ",
"so",
" ",
"the",
"y",
" ",
"arent",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"counted",
" ",
"as",
" ",
"\"",
"unde",
"clar",
"ed",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"inf_",
"=_",
"self_",
"._",
"in",
"\\u",
"function_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"in",
"\\u",
"function_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"local",
"\\u",
"ident",
"\\u",
"stack_",
"=_",
"self_",
"._",
"local",
"\\u",
"ident",
"\\u",
"stack_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"local",
"\\u",
"ident",
"\\u",
"stack_",
"=_",
"local",
"\\u",
"ident",
"\\u",
"stack_",
"._",
"union_",
"(_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"arg_",
"for_",
"arg_",
"in_",
"self_",
"._",
"\\u",
"expand",
"\\u",
"tuples_",
"(_",
"node_",
"._",
"argname",
"s_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"n_",
"in_",
"node_",
"._",
"get",
"Chil",
"d",
"Nodes_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"n_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"in",
"\\u",
"function_",
"=_",
"inf_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"local",
"\\u",
"ident",
"\\u",
"stack_",
"=_",
"local",
"\\u",
"ident",
"\\u",
"stack_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"For_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"flip",
" ",
"aro",
"und",
" ",
"visit_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"list_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"assign_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"body_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Name_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"node_",
"._",
"name_",
"not_",
"in_",
"reserved_",
"and_",
"node_",
"._",
"name_",
"not_",
"in_",
"self_",
"._",
"listener_",
"._",
"declared",
"\\u",
"identifiers_",
"and_",
"node_",
"._",
"name_",
"not_",
"in_",
"self_",
"._",
"local",
"\\u",
"ident",
"\\u",
"stack_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"listener_",
"._",
"unde",
"clar",
"ed",
"\\u",
"identifiers_",
"._",
"add_",
"(_",
"node_",
"._",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Import_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"mod_",
",_",
"alias_",
"in_",
"node_",
"._",
"names_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"alias_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"\\u",
"add",
"\\u",
"declared",
"_",
"(_",
"alias_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"\\u",
"add",
"\\u",
"declared",
"_",
"(_",
"mod_",
"._",
"split_",
"(_",
"'.'_",
")_",
"[_",
"0_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"From_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"mod_",
",_",
"alias_",
"in_",
"node_",
"._",
"names_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"alias_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"\\u",
"add",
"\\u",
"declared",
"_",
"(_",
"alias_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"if_",
"mod_",
"==_",
"'*'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"raise_",
"exceptions_",
"._",
"Compil",
"e",
"Exception_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"'",
"import",
" ",
"*'",
" ",
"is",
" ",
"not",
" ",
"support",
"ed",
",",
" ",
"sinc",
"e",
" ",
"all",
" ",
"identifi",
"er",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"names",
" ",
"must",
" ",
"be",
" ",
"explicit",
"ly",
" ",
"declared",
".",
" ",
" ",
"Ple",
"ase",
" ",
"use",
" ",
"the",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"form",
" ",
"'",
"from",
" ",
"<",
"modulename",
">",
" ",
"import",
" ",
"<",
"name",
"1",
">",
",",
" ",
"<",
"name2",
">",
",",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"...",
"'",
" ",
"inst",
"ead",
".\"_",
",_",
"**_",
"self_",
"._",
"exception",
"\\u",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"add",
"\\u",
"declared",
"_",
"(_",
"mod_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Identifiers_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit_",
"(_",
"self_",
",_",
"expr_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"visitor_",
"._",
"walk_",
"(_",
"expr_",
",_",
"self_",
")_",
"#",
" ",
",",
" ",
"walker",
"=",
"walker",
"())",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Fin",
"d",
"Tuple_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Tuple_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"listener_",
",_",
"code",
"\\u",
"factory_",
",_",
"**_",
"exception",
"\\u",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"listener_",
"=_",
"listener_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"exception",
"\\u",
"kwargs_",
"=_",
"exception",
"\\u",
"kwargs_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"code",
"\\u",
"factory_",
"=_",
"code",
"\\u",
"factory_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Tuple_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Tuple_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"n_",
"in_",
"node_",
"._",
"nodes_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"p_",
"=_",
"self_",
"._",
"code",
"\\u",
"factory_",
"(_",
"n_",
",_",
"**_",
"self_",
"._",
"exception",
"\\u",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"listener_",
"._",
"code",
"args_",
"._",
"append_",
"(_",
"p_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"listener_",
"._",
"args_",
"._",
"append_",
"(_",
"Expression",
"Generator_",
"(_",
"n_",
")_",
"._",
"value_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"listener_",
"._",
"declared",
"\\u",
"identifiers_",
"=_",
"self_",
"._",
"listener_",
"._",
"declared",
"\\u",
"identifiers_",
"._",
"union_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"p_",
"._",
"declared",
"\\u",
"identifiers_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"listener_",
"._",
"unde",
"clar",
"ed",
"\\u",
"identifiers_",
"=_",
"self_",
"._",
"listener_",
"._",
"unde",
"clar",
"ed",
"\\u",
"identifiers_",
"._",
"union_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"p_",
"._",
"unde",
"clar",
"ed",
"\\u",
"identifiers_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Fin",
"d",
"Tuple_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit_",
"(_",
"self_",
",_",
"expr_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"visitor_",
"._",
"walk_",
"(_",
"expr_",
",_",
"self_",
")_",
"#",
" ",
",",
" ",
"walker",
"=",
"walker",
"())",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Pars",
"e",
"Func_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Pars",
"e",
"Func_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"listener_",
",_",
"**_",
"exception",
"\\u",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"listener_",
"=_",
"listener_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"exception",
"\\u",
"kwargs_",
"=_",
"exception",
"\\u",
"kwargs_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Pars",
"e",
"Func_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Function_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"listener_",
"._",
"funcname_",
"=_",
"node_",
"._",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"listener_",
"._",
"argname",
"s_",
"=_",
"node_",
"._",
"argname",
"s_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"listener_",
"._",
"defaults_",
"=_",
"node_",
"._",
"defaults_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"listener_",
"._",
"varargs",
"_",
"=_",
"node_",
"._",
"varargs",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"listener_",
"._",
"kwargs_",
"=_",
"node_",
"._",
"kwargs_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Pars",
"e",
"Func_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit_",
"(_",
"self_",
",_",
"expr_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"visitor_",
"._",
"walk_",
"(_",
"expr_",
",_",
"self_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"give",
"n",
" ",
"an",
" ",
"AST",
" ",
"node",
",",
" ",
"generat",
"es",
" ",
"an",
" ",
"equivalent",
" ",
"literal",
" ",
"Pyth",
"on",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"express",
"ion",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"ast",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"buf_",
"=_",
"String",
"IO_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"visitor_",
"._",
"walk_",
"(_",
"ast",
"node_",
",_",
"self_",
")_",
"#",
" ",
",",
" ",
"walker",
"=",
"walker",
"())",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"value_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"buf_",
"._",
"getvalue_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"operator_",
"(_",
"self_",
",_",
"op_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'('_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"left_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'",
" ",
"%",
"s",
" ",
"'_",
"%_",
"op_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"right_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"')'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"boolean",
"op_",
"(_",
"self_",
",_",
"op_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"nodes_",
"[_",
"0_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"n_",
"in_",
"node_",
"._",
"nodes_",
"[_",
"1_",
":_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'",
" ",
"'_",
"+_",
"op_",
"+_",
"'",
" ",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"visit_",
"(_",
"n_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Const_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"repr_",
"(_",
"node_",
"._",
"value_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Ass",
"Name_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"TOD",
"O",
":",
" ",
"figure",
" ",
"out",
" ",
"OP",
"\\u",
"ASSIGN",
",",
" ",
"other",
" ",
"OP",
"\\u",
"s_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"node_",
"._",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Name_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"node_",
"._",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Mul",
"_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"operator_",
"(_",
"'*'_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"And_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"boolean",
"op_",
"(_",
"'",
"and",
"'_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Or_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"boolean",
"op_",
"(_",
"'",
"or",
"'_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Bit",
"and_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"boolean",
"op_",
"(_",
"'&'_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Bit",
"or_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"boolean",
"op_",
"(_",
"'|'_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Bit",
"xor_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"boolean",
"op_",
"(_",
"'",
"^",
"'_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Add_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"operator_",
"(_",
"'+'_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Get",
"attr_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"expr_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'.",
"%",
"s",
"'_",
"%_",
"node_",
"._",
"attrname_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Sub_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"operator_",
"(_",
"'-'_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Not_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'",
"not",
" ",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"expr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Div_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"operator_",
"(_",
"'/'_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Flo",
"or",
"Div_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"operator_",
"(_",
"'//'_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Subs",
"cript_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"expr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'['_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[_",
"self_",
"._",
"visit_",
"(_",
"x_",
")_",
"for_",
"x_",
"in_",
"node_",
"._",
"subs_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"']'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Una",
"ry",
"Sub_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'-'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"expr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Una",
"ry",
"Add_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'-'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"expr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Slice_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"expr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'['_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"node_",
"._",
"lower_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"lower_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"':'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"node_",
"._",
"upper_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"upper_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"']'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Dict_",
"(_",
"self_",
",_",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'{'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"c_",
"=_",
"node_",
"._",
"get",
"Children_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"i_",
"in_",
"range_",
"(_",
"0_",
",_",
"len_",
"(_",
"c_",
")_",
",_",
"2_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"c_",
"[_",
"i_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"':",
" ",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"visit_",
"(_",
"c_",
"[_",
"i_",
"+_",
"1_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"i_",
"<_",
"len_",
"(_",
"c_",
")_",
"-_",
"2_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"',",
" ",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'}'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Tuple_",
"(_",
"self_",
",_",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'('_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"c_",
"=_",
"node_",
"._",
"get",
"Children_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"i_",
"in_",
"range_",
"(_",
"0_",
",_",
"len_",
"(_",
"c_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"c_",
"[_",
"i_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"i_",
"<_",
"len_",
"(_",
"c_",
")_",
"-_",
"1_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"',",
" ",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"')'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"List_",
"(_",
"self_",
",_",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'['_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"c_",
"=_",
"node_",
"._",
"get",
"Children_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"i_",
"in_",
"range_",
"(_",
"0_",
",_",
"len_",
"(_",
"c_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"c_",
"[_",
"i_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"i_",
"<_",
"len_",
"(_",
"c_",
")_",
"-_",
"1_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"',",
" ",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"']'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"List",
"Comp_",
"(_",
"self_",
",_",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'['_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"expr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'",
" ",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"n_",
"in_",
"node_",
"._",
"qual",
"s_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"n_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"']'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"List",
"Comp",
"For_",
"(_",
"self_",
",_",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'",
" ",
"for",
" ",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"assign_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'",
" ",
"in",
" ",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"list_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"n_",
"in_",
"node_",
"._",
"ifs",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"n_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"List",
"Comp",
"If_",
"(_",
"self_",
",_",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'",
" ",
"if",
" ",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"test_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Compare",
"_",
"(_",
"self_",
",_",
"node_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"expr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"tup_",
"in_",
"node_",
"._",
"ops_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"tup_",
"[_",
"0_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"visit_",
"(_",
"tup_",
"[_",
"1_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Expression",
"Generator_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"visit",
"Call",
"Func_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"node_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"'('_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"len_",
"(_",
"node_",
"._",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"visit_",
"(_",
"node_",
"._",
"args_",
"[_",
"0_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"a_",
"in_",
"node_",
"._",
"args_",
"[_",
"1_",
":_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"',",
" ",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"visit_",
"(_",
"a_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"buf_",
"._",
"write_",
"(_",
"')'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"walker_",
"(_",
"visitor_",
"._",
"AST",
"Visitor_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"walker_",
"(_",
"visitor_",
"._",
"AST",
"Visitor_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"dispatch_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"(_",
"'",
"Node",
":'_",
",_",
"str_",
"(_",
"node_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"print",
" ",
"\"",
"dir",
":\"",
",",
" ",
"dir",
"(",
"node",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"visitor_",
"._",
"AST",
"Visitor_",
"._",
"dispatch_",
"(_",
"self_",
",_",
"node_",
",_",
"*_",
"args_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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= self._get_table_reference()\n created = self.service.create_table(table_name1) # True\n\n # Fail on exist\n table_name2 = self._get_table_reference()\n created = self.service.create_table(table_name2) # True \n created = self.service.create_table(table_name2) # False\n try:\n self.service.create_table(table_name2, fail_on_exist=True)\n except AzureConflictHttpError:\n pass\n\n self.service.delete_table(table_name1)\n self.service.delete_table(table_name2)",
"metadata": "root.TableSamples.create_table",
"header": "['class', 'TableSamples', '(', ')', ':', '___EOS___']",
"index": 74
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Except",
"_",
"block_",
"handles_",
"'",
"Base",
"Except",
"ion",
"'_",
"[SEP]_",
"class_",
"Table",
"Samples_",
"(_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"create",
"\\u",
"table_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Basic_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"table",
"\\u",
"name1_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"table",
"\\u",
"reference_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"created_",
"=_",
"self_",
"._",
"service_",
"._",
"create",
"\\u",
"table_",
"(_",
"table",
"\\u",
"name1_",
")_",
"#",
" ",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Fail",
" ",
"on",
" ",
"exist_",
"\\u\\u\\uNL\\u\\u\\u_",
"table",
"\\u",
"name2_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"table",
"\\u",
"reference_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"created_",
"=_",
"self_",
"._",
"service_",
"._",
"create",
"\\u",
"table_",
"(_",
"table",
"\\u",
"name2_",
")_",
"#",
" ",
"Tru",
"e",
" _",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"created_",
"=_",
"self_",
"._",
"service_",
"._",
"create",
"\\u",
"table_",
"(_",
"table",
"\\u",
"name2_",
")_",
"#",
" ",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"service_",
"._",
"create",
"\\u",
"table_",
"(_",
"table",
"\\u",
"name2_",
",_",
"fail",
"\\u",
"on",
"\\u",
"exist_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Az",
"ure",
"Confl",
"ict",
"Http",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"service_",
"._",
"delete",
"\\u",
"table_",
"(_",
"table",
"\\u",
"name1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"service_",
"._",
"delete",
"\\u",
"table_",
"(_",
"table",
"\\u",
"name2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Duplicate key in dict literal | mozilla/addons-server/src/olympia/paypal/__init__.py | [
{
"content": "def get_paykey(data):\n \"\"\"\n Gets a paykey from Paypal. Need to pass in the following in data:\n pattern: the reverse pattern to resolve\n email: who the money is going to (required)\n amount: the amount of money (required)\n ip: ip address of end user (required)\n uuid: contribution_uuid (required)\n memo: any nice message (optional)\n qs: anything you want to append to the complete or cancel (optional)\n currency: valid paypal currency, defaults to USD (optional)\n \"\"\"\n if data['pattern']:\n complete = reverse(data['pattern'], args=[data['slug'], 'complete'])\n cancel = reverse(data['pattern'], args=[data['slug'], 'cancel'])\n else:\n # If there's no pattern given, just fake some urls.\n complete = cancel = settings.SITE_URL + '/paypal/dummy/'\n\n qs = {'uuid': data['uuid']}\n if 'qs' in data:\n qs.update(data['qs'])\n uuid_qs = urllib.urlencode(qs)\n\n paypal_data = {\n 'actionType': 'PAY',\n 'currencyCode': data.get('currency', 'USD'),\n 'cancelUrl': absolutify('%s?%s' % (cancel, uuid_qs)),\n 'returnUrl': absolutify('%s?%s' % (complete, uuid_qs)),\n 'trackingId': data['uuid'],\n 'ipnNotificationUrl': absolutify(reverse('amo.paypal')),\n 'receiverList.receiver(0).email': data['email'],\n 'receiverList.receiver(0).amount': data['amount'],\n 'receiverList.receiver(0).invoiceID': 'mozilla-%s' % data['uuid'],\n 'receiverList.receiver(0).primary': 'TRUE',\n 'receiverList.receiver(0).paymentType': 'DIGITALGOODS',\n 'requestEnvelope.errorLanguage': 'US'\n }\n\n if data.get('memo'):\n paypal_data['memo'] = data['memo']\n\n with statsd.timer('paypal.paykey.retrieval'):\n response = _call(settings.PAYPAL_PAY_URL + 'Pay', paypal_data,\n ip=data['ip'])\n\n return response['payKey'], response['paymentExecStatus']",
"metadata": "root.get_paykey",
"header": "['module', '___EOS___']",
"index": 85
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Duplicate",
"_",
"key_",
"in_",
"dict_",
"literal_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"pay",
"key_",
"(_",
"data_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Get",
"s",
" ",
"a",
" ",
"pay",
"key",
" ",
"from",
" ",
"Pay",
"pal",
".",
" ",
"Ne",
"ed",
" ",
"to",
" ",
"pass",
" ",
"in",
" ",
"the",
" ",
"follow",
"ing",
" ",
"in",
" ",
"data",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"pattern",
":",
" ",
"the",
" ",
"reverse",
" ",
"pattern",
" ",
"to",
" ",
"resolve",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"email",
":",
" ",
"who",
" ",
"the",
" ",
"money",
" ",
"is",
" ",
"goi",
"ng",
" ",
"to",
" ",
"(",
"require",
"d",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"amo",
"unt",
":",
" ",
"the",
" ",
"amo",
"unt",
" ",
"of",
" ",
"money",
" ",
"(",
"require",
"d",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"ip",
":",
" ",
"ip",
" ",
"address",
" ",
"of",
" ",
"end",
" ",
"user",
" ",
"(",
"require",
"d",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"uuid",
":",
" ",
"contribution",
"\\u",
"uuid",
" ",
"(",
"require",
"d",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"memo",
":",
" ",
"any",
" ",
"nice",
" ",
"message",
" ",
"(",
"option",
"al",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"qs",
":",
" ",
"anyt",
"hing",
" ",
"you",
" ",
"want",
" ",
"to",
" ",
"append",
" ",
"to",
" ",
"the",
" ",
"complete",
" ",
"or",
" ",
"cancel",
" ",
"(",
"option",
"al",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"curr",
"ency",
":",
" ",
"valid",
" ",
"paypal",
" ",
"curr",
"ency",
",",
" ",
"default",
"s",
" ",
"to",
" ",
"US",
"D",
" ",
"(",
"option",
"al",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"data_",
"[_",
"'",
"pattern",
"'_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"complete_",
"=_",
"reverse_",
"(_",
"data_",
"[_",
"'",
"pattern",
"'_",
"]_",
",_",
"args_",
"=_",
"[_",
"data_",
"[_",
"'",
"slug",
"'_",
"]_",
",_",
"'",
"complete",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"cancel_",
"=_",
"reverse_",
"(_",
"data_",
"[_",
"'",
"pattern",
"'_",
"]_",
",_",
"args_",
"=_",
"[_",
"data_",
"[_",
"'",
"slug",
"'_",
"]_",
",_",
"'",
"cancel",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"If",
" ",
"there",
"'",
"s",
" ",
"no",
" ",
"pattern",
" ",
"give",
"n",
",",
" ",
"just",
" ",
"fake",
" ",
"some",
" ",
"urls",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"complete_",
"=_",
"cancel_",
"=_",
"settings_",
"._",
"SITE",
"\\u",
"URL_",
"+_",
"'/",
"paypal",
"/",
"dummy",
"/'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"qs_",
"=_",
"{_",
"'",
"uuid",
"'_",
":_",
"data_",
"[_",
"'",
"uuid",
"'_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"'",
"qs",
"'_",
"in_",
"data_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"qs_",
"._",
"update_",
"(_",
"data_",
"[_",
"'",
"qs",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"uuid",
"\\u",
"qs_",
"=_",
"urllib_",
"._",
"urlencode_",
"(_",
"qs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"paypal",
"\\u",
"data_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"action",
"Type",
"'_",
":_",
"'",
"PAY",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"curr",
"ency",
"Code",
"'_",
":_",
"data_",
"._",
"get_",
"(_",
"'",
"curr",
"ency",
"'_",
",_",
"'",
"US",
"D",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"cancel",
"Ur",
"l",
"'_",
":_",
"abs",
"oluti",
"fy_",
"(_",
"'%",
"s",
"?",
"%",
"s",
"'_",
"%_",
"(_",
"cancel_",
",_",
"uuid",
"\\u",
"qs_",
")_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"return",
"Ur",
"l",
"'_",
":_",
"abs",
"oluti",
"fy_",
"(_",
"'%",
"s",
"?",
"%",
"s",
"'_",
"%_",
"(_",
"complete_",
",_",
"uuid",
"\\u",
"qs_",
")_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"track",
"ing",
"Id",
"'_",
":_",
"data_",
"[_",
"'",
"uuid",
"'_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"ip",
"n",
"Notifi",
"cation",
"Ur",
"l",
"'_",
":_",
"abs",
"oluti",
"fy_",
"(_",
"reverse_",
"(_",
"'",
"amo",
".",
"paypal",
"'_",
")_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"receive",
"r",
"List",
".",
"receive",
"r",
"(",
"0",
").",
"email",
"'_",
":_",
"data_",
"[_",
"'",
"email",
"'_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"receive",
"r",
"List",
".",
"receive",
"r",
"(",
"0",
").",
"amo",
"unt",
"'_",
":_",
"data_",
"[_",
"'",
"amo",
"unt",
"'_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"receive",
"r",
"List",
".",
"receive",
"r",
"(",
"0",
").",
"invoic",
"e",
"ID",
"'_",
":_",
"'",
"moz",
"illa",
"-%",
"s",
"'_",
"%_",
"data_",
"[_",
"'",
"uuid",
"'_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"receive",
"r",
"List",
".",
"receive",
"r",
"(",
"0",
").",
"primary",
"'_",
":_",
"'",
"TRU",
"E",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"receive",
"r",
"List",
".",
"receive",
"r",
"(",
"0",
").",
"pay",
"ment",
"Type",
"'_",
":_",
"'",
"DIGIT",
"ALGO",
"OD",
"S",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"request",
"Env",
"elope",
".",
"error",
"Lang",
"ua",
"ge",
"'_",
":_",
"'",
"US",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"data_",
"._",
"get_",
"(_",
"'",
"memo",
"'_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"paypal",
"\\u",
"data_",
"[_",
"'",
"memo",
"'_",
"]_",
"=_",
"data_",
"[_",
"'",
"memo",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"statsd",
"_",
"._",
"timer_",
"(_",
"'",
"paypal",
".",
"pay",
"key",
".",
"retrie",
"val",
"'_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"response_",
"=_",
"\\u",
"call_",
"(_",
"settings_",
"._",
"PAY",
"PAL",
"\\u",
"PAY",
"\\u",
"URL_",
"+_",
"'",
"Pay",
"'_",
",_",
"paypal",
"\\u",
"data_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"ip_",
"=_",
"data_",
"[_",
"'",
"ip",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"response_",
"[_",
"'",
"pay",
"Key",
"'_",
"]_",
",_",
"response_",
"[_",
"'",
"pay",
"ment",
"Exe",
"c",
"Status",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Variable defined multiple times | 4Catalyzer/flask-resty/flask_resty/pagination.py | [
{
"content": " def __call__(self, query, view):\n limit = self.get_limit()\n if limit is not None:\n query = query.limit(limit + 1)\n\n items = query.all()\n\n if limit is not None and len(items) > limit:\n has_next_page = True\n items = items[:limit]\n else:\n has_next_page = False\n\n meta.set_response_meta(has_next_page=has_next_page)\n return items",
"metadata": "root.LimitPagination.__call__",
"header": "['class', 'LimitPagination', '(', 'object', ')', ':', '___EOS___']",
"index": 26
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Variable_",
"defined_",
"multiple_",
"times_",
"[SEP]_",
"class_",
"Limit",
"Pagination",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"call\\u\\u_",
"(_",
"self_",
",_",
"query_",
",_",
"view_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"limit_",
"=_",
"self_",
"._",
"get",
"\\u",
"limit_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"limit_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"query_",
"=_",
"query_",
"._",
"limit_",
"(_",
"limit_",
"+_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"items_",
"=_",
"query_",
"._",
"all_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"limit_",
"is_",
"not_",
"None_",
"and_",
"len_",
"(_",
"items_",
")_",
">_",
"limit_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"has",
"\\u",
"next",
"\\u",
"page_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"items_",
"=_",
"items_",
"[_",
":_",
"limit_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"has",
"\\u",
"next",
"\\u",
"page_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"meta_",
"._",
"set\\u",
"response",
"\\u",
"meta_",
"(_",
"has",
"\\u",
"next",
"\\u",
"page_",
"=_",
"has",
"\\u",
"next",
"\\u",
"page_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"items_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Nested loops with same variable | JohnDoee/autotorrent/autotorrent/db.py | [
{
"content": " def rebuild(self, paths=None):\n \"\"\"\n Scans the paths for files and rebuilds the database.\n \"\"\"\n if paths:\n logger.info('Just adding new paths')\n else:\n logger.info('Rebuilding database')\n self.truncate()\n paths = self.paths\n \n unsplitable_paths = set()\n if self.unsplitable_mode or self.exact_mode:\n logger.info('Special modes enabled, doing a preliminary scan')\n for root_path in paths:\n logger.info('Preliminary scanning %s' % root_path)\n for root, dirs, files in os.walk(root_path):\n if is_unsplitable(files):\n sep_root = root.split(os.sep)\n name = get_root_of_unsplitable(root.split(os.sep))\n while sep_root[-1] != name:\n sep_root.pop()\n path = os.path.join(*sep_root)\n logger.debug('Found unsplitable path %r' % path)\n unsplitable_paths.add(path)\n logger.info('Done preliminary scanning %s' % root_path)\n \n for root_path in paths:\n logger.info('Scanning %s' % root_path)\n for root, dirs, files in os.walk(root_path):\n unsplitable = False\n if self.unsplitable_mode or self.exact_mode:\n sep_root = root.split(os.sep)\n while sep_root:\n if os.path.join(*sep_root) in unsplitable_paths:\n break\n sep_root.pop()\n \n if sep_root:\n unsplitable = True\n if self.unsplitable_mode:\n unsplitable_name = sep_root[-1]\n logger.info('Looks like we found a unsplitable release in %r' % (os.sep.join(sep_root)))\n for f in files:\n self.insert_into_database(root, f, 'unsplitable', unsplitable_name=unsplitable_name)\n continue\n \n if not unsplitable:\n if self.normal_mode:\n for f in files:\n if self.skip_file(f):\n continue\n \n self.insert_into_database(root, f, 'normal')\n \n if self.exact_mode:\n for f in files:\n self.insert_into_database(root, f, 'exact', 'f')\n \n for d in dirs:\n self.insert_into_database(root, d, 'exact', 'd')\n \n if self.hash_name_mode or self.hash_size_mode or self.hash_slow_mode:\n for f in files:\n if self.hash_size_mode or self.hash_slow_mode:\n self.insert_into_database(root, f, 'hash_store_size')\n \n if self.hash_name_mode:\n self.insert_into_database(root, f, 'hash_store_name')\n\n \n logger.info('Done scanning %s' % root_path)\n self.db.sync()",
"metadata": "root.Database.rebuild",
"header": "['class', 'Database', '(', 'object', ')', ':', '___EOS___']",
"index": 105
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Nest",
"ed_",
"loops_",
"with_",
"same_",
"variable_",
"[SEP]_",
"class_",
"Database_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"rebuild_",
"(_",
"self_",
",_",
"paths_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Sca",
"ns",
" ",
"the",
" ",
"path",
"s",
" ",
"for",
" ",
"files",
" ",
"and",
" ",
"rebu",
"ild",
"s",
" ",
"the",
" ",
"databa",
"se",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"paths_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"logger_",
"._",
"info_",
"(_",
"'",
"Ju",
"st",
" ",
"addin",
"g",
" ",
"new",
" ",
"path",
"s",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"logger_",
"._",
"info_",
"(_",
"'",
"Reb",
"uild",
"ing",
" ",
"databa",
"se",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"truncate_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"paths_",
"=_",
"self_",
"._",
"paths_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"uns",
"plit",
"able",
"\\u",
"paths_",
"=_",
"set_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"self_",
"._",
"uns",
"plit",
"able",
"\\u",
"mode_",
"or_",
"self_",
"._",
"exact",
"\\u",
"mode_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"logger_",
"._",
"info_",
"(_",
"'",
"Special",
" ",
"mode",
"s",
" ",
"enable",
"d",
",",
" ",
"doi",
"ng",
" ",
"a",
" ",
"prel",
"imina",
"ry",
" ",
"scan",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"root",
"\\u",
"path_",
"in_",
"paths_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"logger_",
"._",
"info_",
"(_",
"'",
"Pre",
"lim",
"inary",
" ",
"scanning",
" ",
"%",
"s",
"'_",
"%_",
"root",
"\\u",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"root_",
",_",
"dirs_",
",_",
"files_",
"in_",
"os_",
"._",
"walk_",
"(_",
"root",
"\\u",
"path_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"if_",
"is",
"\\u",
"uns",
"plit",
"able_",
"(_",
"files_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"sep",
"\\u",
"root_",
"=_",
"root_",
"._",
"split_",
"(_",
"os_",
"._",
"sep_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"name_",
"=_",
"get",
"\\u",
"root",
"\\u",
"of",
"\\u",
"uns",
"plit",
"able_",
"(_",
"root_",
"._",
"split_",
"(_",
"os_",
"._",
"sep_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"while_",
"sep",
"\\u",
"root_",
"[_",
"-_",
"1_",
"]_",
"!=_",
"name_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"sep",
"\\u",
"root_",
"._",
"pop_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"path_",
"=_",
"os_",
"._",
"path_",
"._",
"join_",
"(_",
"*_",
"sep",
"\\u",
"root_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"logger_",
"._",
"debug_",
"(_",
"'",
"Foun",
"d",
" ",
"uns",
"plit",
"able",
" ",
"path",
" ",
"%",
"r",
"'_",
"%_",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"uns",
"plit",
"able",
"\\u",
"paths_",
"._",
"add_",
"(_",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"logger_",
"._",
"info_",
"(_",
"'",
"Don",
"e",
" ",
"prel",
"imina",
"ry",
" ",
"scanning",
" ",
"%",
"s",
"'_",
"%_",
"root",
"\\u",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"root",
"\\u",
"path_",
"in_",
"paths_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"logger_",
"._",
"info_",
"(_",
"'",
"Scann",
"ing",
" ",
"%",
"s",
"'_",
"%_",
"root",
"\\u",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"root_",
",_",
"dirs_",
",_",
"files_",
"in_",
"os_",
"._",
"walk_",
"(_",
"root",
"\\u",
"path_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"uns",
"plit",
"able_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"self_",
"._",
"uns",
"plit",
"able",
"\\u",
"mode_",
"or_",
"self_",
"._",
"exact",
"\\u",
"mode_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"sep",
"\\u",
"root_",
"=_",
"root_",
"._",
"split_",
"(_",
"os_",
"._",
"sep_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"while_",
"sep",
"\\u",
"root_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"if_",
"os_",
"._",
"path_",
"._",
"join_",
"(_",
"*_",
"sep",
"\\u",
"root_",
")_",
"in_",
"uns",
"plit",
"able",
"\\u",
"paths_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"sep",
"\\u",
"root_",
"._",
"pop_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"sep",
"\\u",
"root_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"uns",
"plit",
"able_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"self_",
"._",
"uns",
"plit",
"able",
"\\u",
"mode_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"uns",
"plit",
"able",
"\\u",
"name_",
"=_",
"sep",
"\\u",
"root_",
"[_",
"-_",
"1_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"logger_",
"._",
"info_",
"(_",
"'",
"Look",
"s",
" ",
"like",
" ",
"we",
" ",
"found",
" ",
"a",
" ",
"uns",
"plit",
"able",
" ",
"release",
" ",
"in",
" ",
"%",
"r",
"'_",
"%_",
"(_",
"os_",
"._",
"sep_",
"._",
"join_",
"(_",
"sep",
"\\u",
"root_",
")_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"f_",
"in_",
"files_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"self_",
"._",
"insert",
"\\u",
"int",
"o",
"\\u",
"database_",
"(_",
"root_",
",_",
"f_",
",_",
"'",
"uns",
"plit",
"able",
"'_",
",_",
"uns",
"plit",
"able",
"\\u",
"name_",
"=_",
"uns",
"plit",
"able",
"\\u",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"continue_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"uns",
"plit",
"able_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"if_",
"self_",
"._",
"normal",
"\\u",
"mode_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"for_",
"f_",
"in_",
"files_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"if_",
"self_",
"._",
"skip",
"\\u",
"file_",
"(_",
"f_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"continue_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"insert",
"\\u",
"int",
"o",
"\\u",
"database_",
"(_",
"root_",
",_",
"f_",
",_",
"'",
"normal",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"self_",
"._",
"exact",
"\\u",
"mode_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"for_",
"f_",
"in_",
"files_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"self_",
"._",
"insert",
"\\u",
"int",
"o",
"\\u",
"database_",
"(_",
"root_",
",_",
"f_",
",_",
"'",
"exact",
"'_",
",_",
"'",
"f",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"d_",
"in_",
"dirs_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"self_",
"._",
"insert",
"\\u",
"int",
"o",
"\\u",
"database_",
"(_",
"root_",
",_",
"d_",
",_",
"'",
"exact",
"'_",
",_",
"'",
"d",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"self_",
"._",
"hash",
"\\u",
"name",
"\\u",
"mode_",
"or_",
"self_",
"._",
"hash",
"\\u",
"size",
"\\u",
"mode_",
"or_",
"self_",
"._",
"hash",
"\\u",
"slow",
"\\u",
"mode_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"for_",
"f_",
"in_",
"files_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"if_",
"self_",
"._",
"hash",
"\\u",
"size",
"\\u",
"mode_",
"or_",
"self_",
"._",
"hash",
"\\u",
"slow",
"\\u",
"mode_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"self_",
"._",
"insert",
"\\u",
"int",
"o",
"\\u",
"database_",
"(_",
"root_",
",_",
"f_",
",_",
"'",
"hash",
"\\u",
"store",
"\\u",
"size",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"self_",
"._",
"hash",
"\\u",
"name",
"\\u",
"mode_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"self_",
"._",
"insert",
"\\u",
"int",
"o",
"\\u",
"database_",
"(_",
"root_",
",_",
"f_",
",_",
"'",
"hash",
"\\u",
"store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
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Variable defined multiple times | impactlab/eemeter/eemeter/consumption.py | [
{
"content": " def __init__(self, records, fuel_type, unit_name,\n record_type=\"interval\", freq=None, pulse_value=None, name=None,\n data=None, estimated=None):\n\n # verify and save unit name\n if unit_name in self.UNITS:\n self.unit_name = self.UNITS[unit_name][\"target_unit\"]\n\n # we'll need this later to convert to the proper units.\n multiplier = self.UNITS[unit_name][\"multiplier\"]\n else:\n message = 'Unsupported unit name: \"{}\".'.format(unit_name)\n raise ValueError(message)\n\n\n # verify and save fuel type\n if fuel_type not in [\"electricity\", \"natural_gas\", \"fuel_oil\",\n \"propane\", \"liquid_propane\", \"kerosene\", \"diesel\",\n \"fuel_cell\"]:\n message = 'Unsupported fuel type: \"{}\".'.format(fuel_type)\n raise ValueError(message)\n else:\n self.fuel_type = fuel_type\n\n # set misc attributes\n self.freq = freq\n self.pulse_value = pulse_value\n self.name = name\n\n # import data directly (skipping record parsing) if available.\n if data is not None:\n if not records is None:\n message = \"Please provide either data or records, but not both.\"\n raise ValueError(message)\n if estimated is None:\n message = \"Please provide the the `estimated` attribute,\" \\\n \" which contains boolean values indicating whether\" \\\n \" or not the data is estimated. Should have the same\" \\\n \" index as `data`\"\n raise ValueError(message)\n self.data = data\n self.estimated = estimated\n\n # set frequency, if supplied.\n if freq is None:\n self.freq_timedelta = None\n elif freq[-1] not in [\"D\",\"H\",\"T\",\"S\"]:\n # Improper configuration\n message = 'Invalid frequency specification: \"{}\".'.format(freq)\n raise ValueError(message)\n else:\n try:\n dummy_start_date = datetime(1970,1,1,tzinfo=pytz.utc)\n dummy_date_range = pd.date_range(dummy_start_date,\n periods=2, freq=freq)\n freq_timedelta = dummy_date_range[1] - dummy_date_range[0]\n except ValueError:\n message = 'Invalid frequency specification: \"{}\".'\\\n .format(freq)\n raise ValueError(message)\n self.freq_timedelta = freq_timedelta\n return\n\n # import records\n if \"interval\" == record_type:\n if freq is None or freq[-1] not in [\"D\",\"H\",\"T\",\"S\"]:\n # Improper configuration\n message = 'Invalid frequency specification: \"{}\".'.format(freq)\n raise ValueError(message)\n else:\n try:\n dummy_start_date = datetime(1970,1,1,tzinfo=pytz.utc)\n dummy_date_range = pd.date_range(dummy_start_date,\n periods=2, freq=freq)\n freq_timedelta = dummy_date_range[1] - dummy_date_range[0]\n except ValueError:\n message = 'Invalid frequency specification: \"{}\".'\\\n .format(freq)\n raise ValueError(message)\n self.freq_timedelta = freq_timedelta\n self.data, self.estimated = self._import_interval(records)\n elif record_type in [\"arbitrary\", \"billing\"]:\n self.freq_timedelta = None\n self.data, self.estimated = self._import_arbitrary(records)\n elif record_type in [\"arbitrary_start\", \"billing_start\"]:\n self.freq_timedelta = None\n self.data, self.estimated = self._import_arbitrary_start(records)\n elif record_type in [\"arbitrary_end\", \"billing_end\"]:\n self.freq_timedelta = None\n self.data, self.estimated = self._import_arbitrary_end(records)\n elif \"pulse\" == record_type:\n if pulse_value is None or pulse_value <= 0:\n # incorrectly configured\n message = 'Expected pulse_value to be a positive float, '\\\n 'but got {} instead.'.format(pulse_value)\n raise ValueError(message)\n self.freq_timedelta = None\n self.data, self.estimated = self._import_pulse(records)\n else:\n message('Invalid record_type: \"{}\".'.format(record_type))\n raise ValueError\n\n # convert units, as necessary\n self.data *= multiplier",
"metadata": "root.ConsumptionData.__init__",
"header": "['class', 'ConsumptionData', '(', 'object', ')', ':', '___EOS___']",
"index": 283
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Variable_",
"defined_",
"multiple_",
"times_",
"[SEP]_",
"class_",
"Consu",
"mption",
"Data_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"records_",
",_",
"fuel",
"\\u",
"type_",
",_",
"unit",
"\\u",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"record",
"\\u",
"type_",
"=_",
"\"",
"interval",
"\"_",
",_",
"freq_",
"=_",
"None_",
",_",
"pulse",
"\\u",
"value_",
"=_",
"None_",
",_",
"name_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"data_",
"=_",
"None_",
",_",
"estimate",
"d_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"verify",
" ",
"and",
" ",
"save",
" ",
"unit",
" ",
"name_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"unit",
"\\u",
"name_",
"in_",
"self_",
"._",
"UNITS_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"unit",
"\\u",
"name_",
"=_",
"self_",
"._",
"UNITS_",
"[_",
"unit",
"\\u",
"name_",
"]_",
"[_",
"\"",
"target",
"\\u",
"unit",
"\"_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"we",
"'",
"ll",
" ",
"need",
" ",
"this",
" ",
"late",
"r",
" ",
"to",
" ",
"convert",
" ",
"to",
" ",
"the",
" ",
"proper",
" ",
"unit",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"multiplier_",
"=_",
"self_",
"._",
"UNITS_",
"[_",
"unit",
"\\u",
"name_",
"]_",
"[_",
"\"",
"multiplie",
"r",
"\"_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"message_",
"=_",
"'",
"Unsu",
"ppo",
"rted",
" ",
"unit",
" ",
"name",
":",
" ",
"\"{}\"",
".'_",
"._",
"format_",
"(_",
"unit",
"\\u",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Value",
"Error_",
"(_",
"message_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"verify",
" ",
"and",
" ",
"save",
" ",
"fuel",
" ",
"type_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"fuel",
"\\u",
"type_",
"not_",
"in_",
"[_",
"\"",
"electric",
"it",
"y",
"\"_",
",_",
"\"",
"natur",
"al",
"\\u",
"gas",
"\"_",
",_",
"\"",
"fuel",
"\\u",
"oil",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"prop",
"ane",
"\"_",
",_",
"\"",
"liquid",
"\\u",
"prop",
"ane",
"\"_",
",_",
"\"",
"ker",
"ose",
"ne",
"\"_",
",_",
"\"",
"diese",
"l",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"fuel",
"\\u",
"cell",
"\"_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"message_",
"=_",
"'",
"Unsu",
"ppo",
"rted",
" ",
"fuel",
" ",
"type",
":",
" ",
"\"{}\"",
".'_",
"._",
"format_",
"(_",
"fuel",
"\\u",
"type_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Value",
"Error_",
"(_",
"message_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"fuel",
"\\u",
"type_",
"=_",
"fuel",
"\\u",
"type_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"set",
" ",
"misc",
" ",
"attributes_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"freq_",
"=_",
"freq_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"pulse",
"\\u",
"value_",
"=_",
"pulse",
"\\u",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"name_",
"=_",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"import",
" ",
"data",
" ",
"direct",
"ly",
" ",
"(",
"skip",
"ping",
" ",
"record",
" ",
"pars",
"ing",
")",
" ",
"if",
" ",
"avail",
"able",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"data_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"records_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"message_",
"=_",
"\"",
"Ple",
"ase",
" ",
"provide",
" ",
"eit",
"her",
" ",
"data",
" ",
"or",
" ",
"record",
"s",
",",
" ",
"but",
" ",
"not",
" ",
"bot",
"h",
".\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Value",
"Error_",
"(_",
"message_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"estimate",
"d_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"message_",
"=_",
"\"",
"Ple",
"ase",
" ",
"provide",
" ",
"the",
" ",
"the",
" ",
"`",
"estimate",
"d",
"`",
" ",
"attribute",
",\"_",
"\"",
" ",
"whi",
"ch",
" ",
"contain",
"s",
" ",
"boolean",
" ",
"values",
" ",
"indicati",
"ng",
" ",
"whe",
"ther",
"\"_",
"\"",
" ",
"or",
" ",
"not",
" ",
"the",
" ",
"data",
" ",
"is",
" ",
"estimate",
"d",
".",
" ",
"Sho",
"ul",
"d",
" ",
"have",
" ",
"the",
" ",
"same",
"\"_",
"\"",
" ",
"index",
" ",
"as",
" ",
"`",
"data",
"`\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Value",
"Error_",
"(_",
"message_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"data_",
"=_",
"data_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"estimate",
"d_",
"=_",
"estimate",
"d_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"set",
" ",
"freque",
"nc",
"y",
",",
" ",
"if",
" ",
"supplie",
"d",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"freq_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"freq",
"\\u",
"timedelta_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"freq_",
"[_",
"-_",
"1_",
"]_",
"not_",
"in_",
"[_",
"\"",
"D",
"\"_",
",_",
"\"",
"H",
"\"_",
",_",
"\"",
"T",
"\"_",
",_",
"\"",
"S",
"\"_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Impro",
"per",
" ",
"configuration_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"message_",
"=_",
"'",
"Inva",
"lid",
" ",
"freque",
"nc",
"y",
" ",
"specifica",
"tion",
":",
" ",
"\"{}\"",
".'_",
"._",
"format_",
"(_",
"freq_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Value",
"Error_",
"(_",
"message_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"dummy",
"\\u",
"start",
"\\u",
"date_",
"=_",
"datetime_",
"(_",
"1970_",
",_",
"1_",
",_",
"1_",
",_",
"tzinfo_",
"=_",
"pytz_",
"._",
"utc_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"dummy",
"\\u",
"date",
"\\u",
"range_",
"=_",
"pd_",
"._",
"date",
"\\u",
"range_",
"(_",
"dummy",
"\\u",
"start",
"\\u",
"date_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"periods_",
"=_",
"2_",
",_",
"freq_",
"=_",
"freq_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"freq",
"\\u",
"timedelta_",
"=_",
"dummy",
"\\u",
"date",
"\\u",
"range_",
"[_",
"1_",
"]_",
"-_",
"dummy",
"\\u",
"date",
"\\u",
"range_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Value",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"message_",
"=_",
"'",
"Inva",
"lid",
" ",
"freque",
"nc",
"y",
" ",
"specifica",
"tion",
":",
" ",
"\"{}\"",
".'_",
"._",
"format_",
"(_",
"freq_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Value",
"Error_",
"(_",
"message_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"freq",
"\\u",
"timedelta_",
"=_",
"freq",
"\\u",
"timedelta_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"import",
" ",
"records_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"\"",
"interval",
"\"_",
"==_",
"record",
"\\u",
"type_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"freq_",
"is_",
"None_",
"or_",
"freq_",
"[_",
"-_",
"1_",
"]_",
"not_",
"in_",
"[_",
"\"",
"D",
"\"_",
",_",
"\"",
"H",
"\"_",
",_",
"\"",
"T",
"\"_",
",_",
"\"",
"S",
"\"_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Impro",
"per",
" ",
"configuration_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"message_",
"=_",
"'",
"Inva",
"lid",
" ",
"freque",
"nc",
"y",
" ",
"specifica",
"tion",
":",
" ",
"\"{}\"",
".'_",
"._",
"format_",
"(_",
"freq_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Value",
"Error_",
"(_",
"message_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"dummy",
"\\u",
"start",
"\\u",
"date_",
"=_",
"datetime_",
"(_",
"1970_",
",_",
"1_",
",_",
"1_",
",_",
"tzinfo_",
"=_",
"pytz_",
"._",
"utc_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"dummy",
"\\u",
"date",
"\\u",
"range_",
"=_",
"pd_",
"._",
"date",
"\\u",
"range_",
"(_",
"dummy",
"\\u",
"start",
"\\u",
"date_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"periods_",
"=_",
"2_",
",_",
"freq_",
"=_",
"freq_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"freq",
"\\u",
"timedelta_",
"=_",
"dummy",
"\\u",
"date",
"\\u",
"range_",
"[_",
"1_",
"]_",
"-_",
"dummy",
"\\u",
"date",
"\\u",
"range_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Value",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"message_",
"=_",
"'",
"Inva",
"lid",
" ",
"freque",
"nc",
"y",
" ",
"specifica",
"tion",
":",
" ",
"\"{}\"",
".'_",
"._",
"format_",
"(_",
"freq_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Value",
"Error_",
"(_",
"message_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"freq",
"\\u",
"timedelta_",
"=_",
"freq",
"\\u",
"timedelta_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"data_",
",_",
"self_",
"._",
"estimate",
"d_",
"=_",
"self_",
"._",
"\\u",
"import",
"\\u",
"interval_",
"(_",
"records_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"record",
"\\u",
"type_",
"in_",
"[_",
"\"",
"arbitra",
"ry",
"\"_",
",_",
"\"",
"bill",
"ing",
"\"_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"freq",
"\\u",
"timedelta_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"data_",
",_",
"self_",
"._",
"estimate",
"d_",
"=_",
"self_",
"._",
"\\u",
"import",
"\\u",
"arbitra",
"ry_",
"(_",
"records_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"record",
"\\u",
"type_",
"in_",
"[_",
"\"",
"arbitra",
"ry",
"\\u",
"start",
"\"_",
",_",
"\"",
"bill",
"ing",
"\\u",
"start",
"\"_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"freq",
"\\u",
"timedelta_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"data_",
",_",
"self_",
"._",
"estimate",
"d_",
"=_",
"self_",
"._",
"\\u",
"import",
"\\u",
"arbitra",
"ry",
"\\u",
"start_",
"(_",
"records_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"record",
"\\u",
"type_",
"in_",
"[_",
"\"",
"arbitra",
"ry",
"\\u",
"end",
"\"_",
",_",
"\"",
"bill",
"ing",
"\\u",
"end",
"\"_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"freq",
"\\u",
"timedelta_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"data_",
",_",
"self_",
"._",
"estimate",
"d_",
"=_",
"self_",
"._",
"\\u",
"import",
"\\u",
"arbitra",
"ry",
"\\u",
"end_",
"(_",
"records_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"\"",
"pulse",
"\"_",
"==_",
"record",
"\\u",
"type_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"pulse",
"\\u",
"value_",
"is_",
"None_",
"or_",
"pulse",
"\\u",
"value_",
"<=_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"incorrect",
"ly",
" ",
"configured_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"message_",
"=_",
"'",
"Expect",
"ed",
" ",
"pulse",
"\\u",
"value",
" ",
"to",
" ",
"be",
" ",
"a",
" ",
"posit",
"ive",
" ",
"float",
",",
" ",
"'_",
"'",
"but",
" ",
"got",
" ",
"{}",
" ",
"inst",
"ead",
".'_",
"._",
"format_",
"(_",
"pulse",
"\\u",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Value",
"Error_",
"(_",
"message_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"freq",
"\\u",
"timedelta_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"data_",
",_",
"self_",
"._",
"estimate",
"d_",
"=_",
"self_",
"._",
"\\u",
"import",
"\\u",
"pulse_",
"(_",
"records_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"message_",
"(_",
"'",
"Inva",
"lid",
" ",
"record",
"\\u",
"type",
":",
" ",
"\"{}\"",
".'_",
"._",
"format_",
"(_",
"record",
"\\u",
"type_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Value",
"Error_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"convert",
" ",
"unit",
"s",
",",
" ",
"as",
" ",
"necessar",
"y_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"data_",
"*=_",
"multiplier_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unreachable code | eldarion/brabeion/brabeion/base.py | [
{
"content": " def possibly_award(self, **state):\n \"\"\"\n Will see if the user should be awarded a badge. If this badge is\n asynchronous it just queues up the badge awarding.\n \"\"\"\n assert \"user\" in state\n if self.async:\n from brabeion.tasks import AsyncBadgeAward\n state = self.freeze(**state)\n AsyncBadgeAward.delay(self, state)\n return\n self.actually_possibly_award(**state)",
"metadata": "root.Badge.possibly_award",
"header": "['class', 'Badge', '(', 'object', ')', ':', '___EOS___']",
"index": 25
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Unrea",
"chab",
"le_",
"code_",
"[SEP]_",
"class_",
"Badge",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"possib",
"ly",
"\\u",
"award",
"_",
"(_",
"self_",
",_",
"**_",
"state_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Wil",
"l",
" ",
"see",
" ",
"if",
" ",
"the",
" ",
"user",
" ",
"shou",
"ld",
" ",
"be",
" ",
"award",
"ed",
" ",
"a",
" ",
"badge",
".",
" ",
" ",
"If",
" ",
"this",
" ",
"badge",
" ",
"is",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"async",
"hronous",
" ",
"it",
" ",
"just",
" ",
"queue",
"s",
" ",
"up",
" ",
"the",
" ",
"badge",
" ",
"award",
"ing",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"\"",
"user",
"\"_",
"in_",
"state_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"self_",
"._",
"async_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"bra",
"bei",
"on_",
"._",
"tasks_",
"import_",
"Async",
"Badge",
"Award",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"state_",
"=_",
"self_",
"._",
"freeze_",
"(_",
"**_",
"state_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Async",
"Badge",
"Award",
"_",
"._",
"delay_",
"(_",
"self_",
",_",
"state_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"actual",
"ly",
"\\u",
"possib",
"ly",
"\\u",
"award",
"_",
"(_",
"**_",
"state_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Module is imported with 'import' and 'import from' | mne-tools/mne-python/mne/preprocessing/xdawn.py | [
{
"content": "\"\"\"Xdawn implementation.\"\"\"\n# Authors: Alexandre Barachant <[email protected]>\n#\n# License: BSD (3-clause)\n\nimport copy as cp\n\nimport numpy as np\nfrom scipy import linalg\n\nfrom ..io.base import _BaseRaw\nfrom ..epochs import _BaseEpochs\nfrom .. import Covariance, EvokedArray, Evoked, EpochsArray\nfrom ..io.pick import pick_types\nfrom .ica import _get_fast_dot\nfrom ..utils import logger\nfrom ..decoding.mixin import TransformerMixin\nfrom ..cov import _regularized_covariance\nfrom ..channels.channels import ContainsMixin\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Module_",
"is_",
"imported_",
"with_",
"'",
"import",
"'_",
"and_",
"'",
"import",
" ",
"from",
"'_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\"\"\"",
"Xd",
"awn",
" ",
"implementation",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Author",
"s",
":",
" ",
"Alexa",
"ndr",
"e",
" ",
"Bar",
"ach",
"ant",
" ",
"<",
"alex",
"andr",
"e",
".",
"bar",
"ach",
"ant",
"@",
"gma",
"il",
".",
"com",
">_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"License",
":",
" ",
"BS",
"D",
" ",
"(",
"3",
"-",
"clause",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"copy_",
"as_",
"cp_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"numpy_",
"as_",
"np_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"scipy_",
"import_",
"linalg_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"._",
"._",
"io_",
"._",
"base_",
"import_",
"\\u",
"Base",
"Raw_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"._",
"epochs_",
"import_",
"\\u",
"Base",
"Epoch",
"s_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"._",
"import_",
"Covar",
"iance",
"_",
",_",
"Ev",
"oke",
"d",
"Array_",
",_",
"Ev",
"oke",
"d_",
",_",
"Epoch",
"s",
"Array_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"._",
"io_",
"._",
"pick_",
"import_",
"pick",
"\\u",
"types_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"ica",
"_",
"import_",
"\\u",
"get",
"\\u",
"fast",
"\\u",
"dot_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"._",
"utils_",
"import_",
"logger_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"._",
"deco",
"ding_",
"._",
"mixin_",
"import_",
"Transform",
"er",
"Mixin_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"._",
"cov_",
"import_",
"\\u",
"regulari",
"zed",
"\\u",
"covariance_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"._",
"channels_",
"._",
"channels_",
"import_",
"Contain",
"s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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Missing call to `__init__` during object initialization | treasure-data/td-client-python/tdclient/errors.py | [
{
"content": "class NotFoundError(APIError):\n pass",
"metadata": "root.NotFoundError",
"header": "['module', '___EOS___']",
"index": 25
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Missing",
"_",
"call_",
"to_",
" _",
"`_",
"\\u\\u",
"init\\u\\u_",
"`_",
"dur",
"ing_",
"object_",
"initialization",
"_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Not",
"Foun",
"d",
"Error_",
"(_",
"API",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | mne-tools/mne-python/mne/forward/__init__.py | [
{
"content": "from .forward import (Forward, read_forward_solution, write_forward_solution,\n is_fixed_orient, _read_forward_meas_info,\n write_forward_meas_info,\n compute_orient_prior, compute_depth_prior,\n apply_forward, apply_forward_raw,\n restrict_forward_to_stc, restrict_forward_to_label,\n do_forward_solution, average_forward_solutions,\n _restrict_gain_matrix, _stc_src_sel,\n _fill_measurement_info, _apply_forward,\n _subject_from_forward, convert_forward_solution,\n _to_fixed_ori, prepare_bem_model, _merge_meg_eeg_fwds,\n _do_forward_solution)\nfrom ._make_forward import (make_forward_solution, _prepare_for_forward,\n _prep_meg_channels, _prep_eeg_channels,\n _to_forward_dict, _create_meg_coils,\n _read_coil_defs, _transform_orig_meg_coils,\n make_forward_dipole)\nfrom ._compute_forward import (_magnetic_dipole_field_vec, _compute_forwards,\n _concatenate_coils)\nfrom ._field_interpolation import (_make_surface_mapping, make_field_map,\n _as_meg_type_evoked, _map_meg_channels)\nfrom . import _lead_dots # for testing purposes\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"from_",
"._",
"forward_",
"import_",
"(_",
"Forward_",
",_",
"read",
"\\u",
"forward",
"\\u",
"solution_",
",_",
"write",
"\\u",
"forward",
"\\u",
"solution_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"is",
"\\u",
"fixed",
"\\u",
"orient_",
",_",
"\\u",
"read",
"\\u",
"forward",
"\\u",
"meas",
"\\u",
"info_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"write",
"\\u",
"forward",
"\\u",
"meas",
"\\u",
"info_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"compute",
"\\u",
"orient",
"\\u",
"prior_",
",_",
"compute",
"\\u",
"depth",
"\\u",
"prior_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"appl",
"y",
"\\u",
"forward_",
",_",
"appl",
"y",
"\\u",
"forward",
"\\u",
"raw_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"restrict",
"\\u",
"forward",
"\\u",
"to",
"\\u",
"stc_",
",_",
"restrict",
"\\u",
"forward",
"\\u",
"to",
"\\u",
"label_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"do",
"\\u",
"forward",
"\\u",
"solution_",
",_",
"averag",
"e\\u",
"forward",
"\\u",
"solutions_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"restrict",
"\\u",
"gain",
"\\u",
"matrix_",
",_",
"\\u",
"stc",
"\\u",
"src",
"\\u",
"sel_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"fill",
"\\u",
"measure",
"ment",
"\\u",
"info_",
",_",
"\\u",
"appl",
"y",
"\\u",
"forward_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"subject",
"\\u",
"from",
"\\u",
"forward_",
",_",
"convert",
"\\u",
"forward",
"\\u",
"solution_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"to",
"\\u",
"fixed",
"\\u",
"ori_",
",_",
"prepar",
"e\\u",
"bem",
"\\u",
"model_",
",_",
"\\u",
"merge",
"\\u",
"me",
"g",
"\\u",
"ee",
"g",
"\\u",
"fw",
"ds_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"do",
"\\u",
"forward",
"\\u",
"solution_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"\\u",
"make",
"\\u",
"forward_",
"import_",
"(_",
"make",
"\\u",
"forward",
"\\u",
"solution_",
",_",
"\\u",
"prepar",
"e\\u",
"for",
"\\u",
"forward_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"prep",
"\\u",
"me",
"g",
"\\u",
"channels_",
",_",
"\\u",
"prep",
"\\u",
"ee",
"g",
"\\u",
"channels_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"to",
"\\u",
"forward",
"\\u",
"dict_",
",_",
"\\u",
"create",
"\\u",
"me",
"g",
"\\u",
"coil",
"s_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"read",
"\\u",
"coil",
"\\u",
"defs_",
",_",
"\\u",
"transform",
"\\u",
"orig",
"\\u",
"me",
"g",
"\\u",
"coil",
"s_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"make",
"\\u",
"forward",
"\\u",
"dipole",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"\\u",
"compute",
"\\u",
"forward_",
"import_",
"(_",
"\\u",
"magnet",
"ic",
"\\u",
"dipole",
"\\u",
"field",
"\\u",
"vec_",
",_",
"\\u",
"compute",
"\\u",
"forwards_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"concatenate",
"\\u",
"coil",
"s_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"\\u",
"field",
"\\u",
"interpolation_",
"import_",
"(_",
"\\u",
"make",
"\\u",
"surf",
"ace",
"\\u",
"mapping_",
",_",
"make",
"\\u",
"field",
"\\u",
"map_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"as",
"\\u",
"me",
"g",
"\\u",
"type",
"\\u",
"evo",
"ked",
"_",
",_",
"\\u",
"map",
"\\u",
"me",
"g",
"\\u",
"channels_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"._",
"import_",
"\\u",
"lead",
"\\u",
"dots_",
"#",
" ",
"for",
" ",
"testi",
"ng",
" ",
"purpose",
"s_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Non-callable called | openstack/neutron/neutron/tests/functional/agent/test_ovs_lib.py | [
{
"content": "# Copyright (c) 2015 Red Hat, Inc.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n# License for the specific language governing permissions and limitations\n# under the License.\n\nimport collections\nimport uuid\n\nimport mock\n\nfrom neutron.agent.common import ovs_lib\nfrom neutron.agent.linux import ip_lib\nfrom neutron.tests import base as tests_base\nfrom neutron.tests.common import net_helpers\nfrom neutron.tests.functional.agent.linux import base\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": " def test_get_vif_port_set(self):\n for i in range(2):\n self.create_ovs_port()\n vif_ports = [self.create_ovs_vif_port() for i in range(2)]\n ports = self.br.get_vif_port_set()\n expected = set([x.vif_id for x in vif_ports])\n self.assertEqual(expected, ports)",
"metadata": "root.OVSBridgeTestCase.test_get_vif_port_set",
"header": "['class', 'OVSBridgeTestCase', '(', 'OVSBridgeTestBase', ')', ':', '___EOS___']",
"index": 214
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Non",
"_",
"-_",
"callable_",
"called_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#",
" ",
"Copy",
"right",
" ",
"(",
"c",
")",
" ",
"201",
"5",
" ",
"Red",
" ",
"Hat",
",",
" ",
"Inc",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"All",
" ",
"Rig",
"hts",
" ",
"Reserve",
"d",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"License",
"d",
" ",
"under",
" ",
"the",
" ",
"Ap",
"ache",
" ",
"License",
",",
" ",
"Version",
" ",
"2.0",
" ",
"(",
"the",
" ",
"\"",
"License",
"\");",
" ",
"you",
" ",
"may",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"not",
" ",
"use",
" ",
"this",
" ",
"file",
" ",
"except",
" ",
"in",
" ",
"compli",
"anc",
"e",
" ",
"with",
" ",
"the",
" ",
"License",
".",
" ",
"You",
" ",
"may",
" ",
"obtain",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"a",
" ",
"copy",
" ",
"of",
" ",
"the",
" ",
"License",
" ",
"at_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
" ",
"http",
"://",
"www",
".",
"apa",
"che",
".",
"org",
"/",
"license",
"s",
"/",
"LICENSE",
"-",
"2.0_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"Un",
"less",
" ",
"require",
"d",
" ",
"by",
" ",
"applica",
"ble",
" ",
"law",
" ",
"or",
" ",
"agree",
"d",
" ",
"to",
" ",
"in",
" ",
"writ",
"ing",
",",
" ",
"software",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"distributed",
" ",
"under",
" ",
"the",
" ",
"License",
" ",
"is",
" ",
"distributed",
" ",
"on",
" ",
"an",
" ",
"\"",
"AS",
" ",
"IS",
"\"",
" ",
"BAS",
"IS",
",",
" ",
"WITH",
"OUT_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"WAR",
"RAN",
"TIES",
" ",
"OR",
" ",
"CONDITION",
"S",
" ",
"OF",
" ",
"ANY",
" ",
"KIND",
",",
" ",
"eit",
"her",
" ",
"express",
" ",
"or",
" ",
"impli",
"ed",
".",
" ",
"See",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"License",
" ",
"for",
" ",
"the",
" ",
"specific",
" ",
"language",
" ",
"govern",
"ing",
" ",
"permissi",
"ons",
" ",
"and",
" ",
"limit",
"ations_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"under",
" ",
"the",
" ",
"License",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"collections_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"uuid_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"mock_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"neutron_",
"._",
"agent_",
"._",
"common_",
"import_",
"ovs",
"\\u",
"lib_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"neutron_",
"._",
"agent_",
"._",
"linux_",
"import_",
"ip",
"\\u",
"lib_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"neutron_",
"._",
"tests_",
"import_",
"base_",
"as_",
"tests",
"\\u",
"base_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"neutron_",
"._",
"tests_",
"._",
"common_",
"import_",
"net",
"\\u",
"helpers_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"neutron_",
"._",
"tests_",
"._",
"functional_",
"._",
"agent_",
"._",
"linux_",
"import_",
"base_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"class_",
"OVS",
"Bridge",
"Test",
"Case_",
"(_",
"OVS",
"Bridge",
"Test",
"Base_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"get",
"\\u",
"vi",
"f",
"\\u",
"port",
"\\u",
"set_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"i_",
"in_",
"range_",
"(_",
"2_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"create",
"\\u",
"ovs",
"\\u",
"port_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"vi",
"f",
"\\u",
"ports_",
"=_",
"[_",
"self_",
"._",
"create",
"\\u",
"ovs",
"\\u",
"vi",
"f",
"\\u",
"port_",
"(_",
")_",
"for_",
"i_",
"in_",
"range_",
"(_",
"2_",
")_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ports_",
"=_",
"self_",
"._",
"br_",
"._",
"get",
"\\u",
"vi",
"f",
"\\u",
"port",
"\\u",
"set_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"set_",
"(_",
"[_",
"x_",
"._",
"vi",
"f",
"\\u",
"id_",
"for_",
"x_",
"in_",
"vi",
"f",
"\\u",
"ports_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"expected_",
",_",
"ports_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2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"from __future__ import unicode_literals\nimport binascii\n\nfrom cryptography.hazmat.primitives import padding\nfrom cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes\nfrom cryptography.hazmat.backends import default_backend\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.shortcuts import redirect\n\nfrom ..core import BasicProvider\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class SagepayProvider(BasicProvider):\n '''\n sagepay.com payment provider\n\n vendor:\n vendor name\n encryption_key:\n encryption key\n endpoint:\n gateway URL to post transaction data to\n '''\n _version = '3.00'\n _action = 'https://test.sagepay.com/Simulator/VSPFormGateway.asp'\n\n\n\n\n\n\n",
"metadata": "root.SagepayProvider",
"header": "['module', '___EOS___']",
"index": 12
},
{
"content": " def __init__(self, vendor, encryption_key, endpoint=_action, **kwargs):\n self._vendor = vendor\n self._enckey = encryption_key.encode('utf-8')\n self._action = endpoint\n super(SagepayProvider, self).__init__(**kwargs)\n if not self._capture:\n raise ImproperlyConfigured(\n 'Sagepay does not support pre-authorization.')",
"metadata": "root.SagepayProvider.__init__",
"header": "['class', 'SagepayProvider', '(', 'BasicProvider', ')', ':', '___EOS___']",
"index": 26
},
{
"content": " def _get_cipher(self):\n backend = default_backend()\n return Cipher(algorithms.AES(self._enckey), modes.CBC(self._enckey),\n backend=backend)",
"metadata": "root.SagepayProvider._get_cipher",
"header": "['class', 'SagepayProvider', '(', 'BasicProvider', ')', ':', '___EOS___']",
"index": 35
},
{
"content": " def _get_padding(self):\n return padding.PKCS7(128)",
"metadata": "root.SagepayProvider._get_padding",
"header": "['class', 'SagepayProvider', '(', 'BasicProvider', ')', ':', '___EOS___']",
"index": 40
},
{
"content": " def aes_enc(self, data):\n data = data.encode('utf-8')\n padder = self._get_padding().padder()\n data = padder.update(data) + padder.finalize()\n encryptor = self._get_cipher().encryptor()\n enc = encryptor.update(data) + encryptor.finalize()\n return b\"@\" + binascii.hexlify(enc)",
"metadata": "root.SagepayProvider.aes_enc",
"header": "['class', 'SagepayProvider', '(', 'BasicProvider', ')', ':', '___EOS___']",
"index": 43
},
{
"content": " def aes_dec(self, data):\n data = data.lstrip(b'@')\n data = binascii.unhexlify(data)\n decryptor = self._get_cipher().decryptor()\n data = decryptor.update(data) + decryptor.finalize()\n return data.decode('utf-8')",
"metadata": "root.SagepayProvider.aes_dec",
"header": "['class', 'SagepayProvider', '(', 'BasicProvider', ')', ':', '___EOS___']",
"index": 51
},
{
"content": " def get_hidden_fields(self, payment):\n payment.save()\n return_url = self.get_return_url(payment)\n data = {\n 'VendorTxCode': payment.pk,\n 'Amount': \"%.2f\" % (payment.total,),\n 'Currency': payment.currency,\n 'Description': \"Payment #%s\" % (payment.pk,),\n 'SuccessURL': return_url,\n 'FailureURL': return_url,\n 'BillingSurname': payment.billing_last_name,\n 'BillingFirstnames': payment.billing_first_name,\n 'BillingAddress1': payment.billing_address_1,\n 'BillingAddress2': payment.billing_address_2,\n 'BillingCity': payment.billing_city,\n 'BillingPostCode': payment.billing_postcode,\n 'BillingCountry': payment.billing_country_code,\n 'DeliverySurname': payment.billing_last_name,\n 'DeliveryFirstnames': payment.billing_first_name,\n 'DeliveryAddress1': payment.billing_address_1,\n 'DeliveryAddress2': payment.billing_address_2,\n 'DeliveryCity': payment.billing_city,\n 'DeliveryPostCode': payment.billing_postcode,\n 'DeliveryCountry': payment.billing_country_code}\n if payment.billing_country_code == 'US':\n data['BillingState'] = payment.billing_country_area\n data['DeliveryState'] = payment.billing_country_area\n udata = \"&\".join(\"%s=%s\" % kv for kv in data.items())\n crypt = self.aes_enc(udata)\n return {'VPSProtocol': self._version, 'TxType': 'PAYMENT',\n 'Vendor': self._vendor, 'Crypt': crypt}",
"metadata": "root.SagepayProvider.get_hidden_fields",
"header": "['class', 'SagepayProvider', '(', 'BasicProvider', ')', ':', '___EOS___']",
"index": 58
},
{
"content": " def process_data(self, payment, request):\n udata = self.aes_dec(request.GET['crypt'])\n data = {}\n for kv in udata.split('&'):\n k, v = kv.split('=')\n data[k] = v\n success_url = payment.get_success_url()\n if payment.status == 'waiting':\n # If the payment is not in waiting state, we probably have a page reload.\n # We should neither throw 404 nor alter the payment again in such case.\n if data['Status'] == 'OK':\n payment.captured_amount = payment.total\n payment.change_status('confirmed')\n return redirect(success_url)\n else:\n # XXX: We should recognize AUTHENTICATED and REGISTERED in the future.\n payment.change_status('rejected')\n return redirect(payment.get_failure_url())\n return redirect(success_url)",
"metadata": "root.SagepayProvider.process_data",
"header": "['class', 'SagepayProvider', '(', 'BasicProvider', ')', ':', '___EOS___']",
"index": 90
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"from_",
"\\u\\u",
"future\\u\\u_",
"import_",
"unicode",
"\\u",
"literals_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"binascii_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"cryptography",
"_",
"._",
"haz",
"mat_",
"._",
"primitives_",
"import_",
"padding_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"cryptography",
"_",
"._",
"haz",
"mat_",
"._",
"primitives_",
"._",
"ciphers",
"_",
"import_",
"Cipher_",
",_",
"algorithms_",
",_",
"modes_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"cryptography",
"_",
"._",
"haz",
"mat_",
"._",
"backends_",
"import_",
"default",
"\\u",
"backend_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"core_",
"._",
"exceptions_",
"import_",
"Impro",
"perl",
"y",
"Configured_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"shortcuts_",
"import_",
"redirect_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"._",
"._",
"core_",
"import_",
"Basic",
"Provider_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Sag",
"epa",
"y",
"Provider_",
"(_",
"Basic",
"Provider_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"sage",
"pay",
".",
"com",
" ",
"pay",
"ment",
" ",
"provide",
"r",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"vendor",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"vendor",
" ",
"name",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"encrypt",
"ion",
"\\u",
"key",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"encrypt",
"ion",
" ",
"key",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"endpoint",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"gateway",
" ",
"URL",
" ",
"to",
" ",
"post",
" ",
"transaction",
" ",
"data",
" ",
"to",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"version_",
"=_",
"'",
"3.0",
"0",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"action_",
"=_",
"'",
"https",
"://",
"test",
".",
"sage",
"pay",
".",
"com",
"/",
"Simul",
"ator",
"/",
"VS",
"PF",
"orm",
"Gat",
"ewa",
"y",
".",
"asp",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Sag",
"epa",
"y",
"Provider_",
"(_",
"Basic",
"Provider_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"vendor_",
",_",
"encrypt",
"ion",
"\\u",
"key_",
",_",
"endpoint_",
"=_",
"\\u",
"action_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"vendor_",
"=_",
"vendor_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"enc",
"key_",
"=_",
"encrypt",
"ion",
"\\u",
"key_",
"._",
"encode_",
"(_",
"'",
"utf",
"-",
"8",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"action_",
"=_",
"endpoint_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"super_",
"(_",
"Sag",
"epa",
"y",
"Provider_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"self_",
"._",
"\\u",
"capture_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Impro",
"perl",
"y",
"Configured_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Sag",
"epa",
"y",
" ",
"doe",
"s",
" ",
"not",
" ",
"support",
" ",
"pre",
"-",
"authoriz",
"ation",
".'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Sag",
"epa",
"y",
"Provider_",
"(_",
"Basic",
"Provider_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get",
"\\u",
"cipher_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"backend_",
"=_",
"default",
"\\u",
"backend_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"Cipher_",
"(_",
"algorithms_",
"._",
"AES_",
"(_",
"self_",
"._",
"\\u",
"enc",
"key_",
")_",
",_",
"modes_",
"._",
"CBC",
"_",
"(_",
"self_",
"._",
"\\u",
"enc",
"key_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"backend_",
"=_",
"backend_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Sag",
"epa",
"y",
"Provider_",
"(_",
"Basic",
"Provider_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get",
"\\u",
"padding_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"padding_",
"._",
"PKC",
"S",
"7_",
"(_",
"128_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Sag",
"epa",
"y",
"Provider_",
"(_",
"Basic",
"Provider_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"aes",
"\\u",
"enc_",
"(_",
"self_",
",_",
"data_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"=_",
"data_",
"._",
"encode_",
"(_",
"'",
"utf",
"-",
"8",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"padde",
"r_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"padding_",
"(_",
")_",
"._",
"padde",
"r_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"data_",
"=_",
"padde",
"r_",
"._",
"update_",
"(_",
"data_",
")_",
"+_",
"padde",
"r_",
"._",
"finalize_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"encrypt",
"or_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"cipher_",
"(_",
")_",
"._",
"encrypt",
"or_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"enc_",
"=_",
"encrypt",
"or_",
"._",
"update_",
"(_",
"data_",
")_",
"+_",
"encrypt",
"or_",
"._",
"finalize_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"b",
"\"@\"_",
"+_",
"binascii_",
"._",
"hexlify_",
"(_",
"enc_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Sag",
"epa",
"y",
"Provider_",
"(_",
"Basic",
"Provider_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"aes",
"\\u",
"dec_",
"(_",
"self_",
",_",
"data_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"=_",
"data_",
"._",
"lstrip_",
"(_",
"b",
"'@'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"data_",
"=_",
"binascii_",
"._",
"unhexlify_",
"(_",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"decrypt",
"or_",
"=_",
"self_",
"._",
"\\u",
"get",
"\\u",
"cipher_",
"(_",
")_",
"._",
"decrypt",
"or_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"data_",
"=_",
"decrypt",
"or_",
"._",
"update_",
"(_",
"data_",
")_",
"+_",
"decrypt",
"or_",
"._",
"finalize_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"data_",
"._",
"decode_",
"(_",
"'",
"utf",
"-",
"8",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Sag",
"epa",
"y",
"Provider_",
"(_",
"Basic",
"Provider_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"hidden",
"\\u",
"fields_",
"(_",
"self_",
",_",
"payment_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"payment_",
"._",
"save_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return",
"\\u",
"url_",
"=_",
"self_",
"._",
"get",
"\\u",
"return",
"\\u",
"url_",
"(_",
"payment_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"data_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Vend",
"or",
"Tx",
"Code",
"'_",
":_",
"payment_",
"._",
"pk_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Amo",
"unt",
"'_",
":_",
"\"%",
".2",
"f",
"\"_",
"%_",
"(_",
"payment_",
"._",
"total_",
",_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Currenc",
"y",
"'_",
":_",
"payment_",
"._",
"currency_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Descripti",
"on",
"'_",
":_",
"\"",
"Payment",
" ",
"#",
"%",
"s",
"\"_",
"%_",
"(_",
"payment_",
"._",
"pk_",
",_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Success",
"URL",
"'_",
":_",
"return",
"\\u",
"url_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Fail",
"ure",
"URL",
"'_",
":_",
"return",
"\\u",
"url_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Bill",
"ing",
"Sur",
"name",
"'_",
":_",
"payment_",
"._",
"bill",
"ing",
"\\u",
"last",
"\\u",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Bill",
"ing",
"Fi",
"rst",
"names",
"'_",
":_",
"payment_",
"._",
"bill",
"ing",
"\\u",
"first",
"\\u",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Bill",
"ing",
"Address",
"1",
"'_",
":_",
"payment_",
"._",
"bill",
"ing",
"\\u",
"address",
"\\u",
"1_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Bill",
"ing",
"Address",
"2",
"'_",
":_",
"payment_",
"._",
"bill",
"ing",
"\\u",
"address",
"\\u",
"2_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Bill",
"ing",
"Cit",
"y",
"'_",
":_",
"payment_",
"._",
"bill",
"ing",
"\\u",
"city_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Bill",
"ing",
"Post",
"Code",
"'_",
":_",
"payment_",
"._",
"bill",
"ing",
"\\u",
"postcode",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Bill",
"ing",
"Count",
"ry",
"'_",
":_",
"payment_",
"._",
"bill",
"ing",
"\\u",
"countr",
"y",
"\\u",
"code_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Deliver",
"y",
"Sur",
"name",
"'_",
":_",
"payment_",
"._",
"bill",
"ing",
"\\u",
"last",
"\\u",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Deliver",
"y",
"Fi",
"rst",
"names",
"'_",
":_",
"payment_",
"._",
"bill",
"ing",
"\\u",
"first",
"\\u",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Deliver",
"y",
"Address",
"1",
"'_",
":_",
"payment_",
"._",
"bill",
"ing",
"\\u",
"address",
"\\u",
"1_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Deliver",
"y",
"Address",
"2",
"'_",
":_",
"payment_",
"._",
"bill",
"ing",
"\\u",
"address",
"\\u",
"2_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Deliver",
"y",
"Cit",
"y",
"'_",
":_",
"payment_",
"._",
"bill",
"ing",
"\\u",
"city_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Deliver",
"y",
"Post",
"Code",
"'_",
":_",
"payment_",
"._",
"bill",
"ing",
"\\u",
"postcode",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Deliver",
"y",
"Count",
"ry",
"'_",
":_",
"payment_",
"._",
"bill",
"ing",
"\\u",
"countr",
"y",
"\\u",
"code_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"payment_",
"._",
"bill",
"ing",
"\\u",
"countr",
"y",
"\\u",
"code_",
"==_",
"'",
"US",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"[_",
"'",
"Bill",
"ing",
"State",
"'_",
"]_",
"=_",
"payment_",
"._",
"bill",
"ing",
"\\u",
"countr",
"y",
"\\u",
"area_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"data_",
"[_",
"'",
"Deliver",
"y",
"State",
"'_",
"]_",
"=_",
"payment_",
"._",
"bill",
"ing",
"\\u",
"countr",
"y",
"\\u",
"area_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"uda",
"ta_",
"=_",
"\"&\"_",
"._",
"join_",
"(_",
"\"%",
"s",
"=",
"%",
"s",
"\"_",
"%_",
"kv_",
"for_",
"kv_",
"in_",
"data_",
"._",
"items_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"crypt_",
"=_",
"self_",
"._",
"aes",
"\\u",
"enc_",
"(_",
"uda",
"ta_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"{_",
"'",
"VP",
"SP",
"roto",
"col",
"'_",
":_",
"self_",
"._",
"\\u",
"version_",
",_",
"'",
"Tx",
"Type",
"'_",
":_",
"'",
"PAY",
"MENT",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Vend",
"or",
"'_",
":_",
"self_",
"._",
"\\u",
"vendor_",
",_",
"'",
"Crypt",
"'_",
":_",
"crypt_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Sag",
"epa",
"y",
"Provider_",
"(_",
"Basic",
"Provider_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"process",
"\\u",
"data_",
"(_",
"self_",
",_",
"payment_",
",_",
"request_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"uda",
"ta_",
"=_",
"self_",
"._",
"aes",
"\\u",
"dec_",
"(_",
"request_",
"._",
"GET_",
"[_",
"'",
"crypt",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"data_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"kv_",
"in_",
"uda",
"ta_",
"._",
"split_",
"(_",
"'&'_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"k_",
",_",
"v_",
"=_",
"kv_",
"._",
"split_",
"(_",
"'='_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"data_",
"[_",
"k_",
"]_",
"=_",
"v_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"success",
"\\u",
"url_",
"=_",
"payment_",
"._",
"get",
"\\u",
"success",
"\\u",
"url_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"payment_",
"._",
"status_",
"==_",
"'",
"wait",
"ing",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"If",
" ",
"the",
" ",
"pay",
"ment",
" ",
"is",
" ",
"not",
" ",
"in",
" ",
"wait",
"ing",
" ",
"state",
",",
" ",
"we",
" ",
"probab",
"ly",
" ",
"have",
" ",
"a",
" ",
"page",
" ",
"relo",
"ad",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"We",
" ",
"shou",
"ld",
" ",
"nei",
"ther",
" ",
"throw",
" ",
"404",
" ",
"nor",
" ",
"alter",
" ",
"the",
" ",
"pay",
"ment",
" ",
"again",
" ",
"in",
" ",
"suc",
"h",
" ",
"case",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"data_",
"[_",
"'",
"Status",
"'_",
"]_",
"==_",
"'",
"OK",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"payment_",
"._",
"captured",
"\\u",
"amount_",
"=_",
"payment_",
"._",
"total_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"payment_",
"._",
"change",
"\\u",
"status_",
"(_",
"'",
"confirm",
"ed",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"redirect_",
"(_",
"success",
"\\u",
"url_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"XX",
"X",
":",
" ",
"We",
" ",
"shou",
"ld",
" ",
"recognize",
" ",
"AUTH",
"ENTI",
"CATE",
"D",
" ",
"and",
" ",
"REGISTER",
"ED",
" ",
"in",
" ",
"the",
" ",
"future",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"payment_",
"._",
"change",
"\\u",
"status_",
"(_",
"'",
"reject",
"ed",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"redirect_",
"(_",
"payment_",
"._",
"get",
"\\u",
"fail",
"ure",
"\\u",
"url_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"redirect_",
"(_",
"success",
"\\u",
"url_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | log2timeline/dfvfs/tests/resolver/tsk_resolver_helper.py | [
{
"content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\"\"\"Tests for the SleuthKit (TSK) resolver helper implementation.\"\"\"\n\nimport unittest\n\nfrom dfvfs.resolver import tsk_resolver_helper\nfrom tests.resolver import test_lib\n\n\n\n\nif __name__ == '__main__':\n unittest.main()\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class TSKResolverHelperTest(test_lib.ResolverHelperTestCase):\n \"\"\"Tests for the SleuthKit (TSK) resolver helper implementation.\"\"\"\n\n",
"metadata": "root.TSKResolverHelperTest",
"header": "['module', '___EOS___']",
"index": 10
},
{
"content": " def testNewFileObject(self):\n \"\"\"Tests the NewFileObject function.\"\"\"\n resolver_helper_object = tsk_resolver_helper.TSKResolverHelper()\n self._TestNewFileObject(resolver_helper_object)",
"metadata": "root.TSKResolverHelperTest.testNewFileObject",
"header": "['class', 'TSKResolverHelperTest', '(', 'test_lib', '.', 'ResolverHelperTestCase', ')', ':', '___EOS___']",
"index": 13
},
{
"content": " def testNewFileSystem(self):\n \"\"\"Tests the NewFileSystem function.\"\"\"\n resolver_helper_object = tsk_resolver_helper.TSKResolverHelper()\n self._TestNewFileSystem(resolver_helper_object)",
"metadata": "root.TSKResolverHelperTest.testNewFileSystem",
"header": "['class', 'TSKResolverHelperTest', '(', 'test_lib', '.', 'ResolverHelperTestCase', ')', ':', '___EOS___']",
"index": 18
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#!",
"/",
"usr",
"/",
"bin",
"/",
"python_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"-*-",
" ",
"codi",
"ng",
":",
" ",
"utf",
"-",
"8",
" ",
"-*-",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"\"\"",
"Test",
"s",
" ",
"for",
" ",
"the",
" ",
"Sl",
"eu",
"th",
"Kit",
" ",
"(",
"TS",
"K",
")",
" ",
"resolver",
" ",
"help",
"er",
" ",
"implementation",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"unittest_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"df",
"vfs_",
"._",
"resolver_",
"import_",
"tsk",
"\\u",
"resolver",
"\\u",
"helper_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"tests_",
"._",
"resolver_",
"import_",
"test\\u",
"lib_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"\\u\\u",
"name\\u\\u_",
"==_",
"'\\u",
"\\u",
"main",
"\\u\\u'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"unittest_",
"._",
"main_",
"(_",
")_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"TS",
"KR",
"eso",
"lver",
"Help",
"er",
"Test_",
"(_",
"test\\u",
"lib_",
"._",
"Resolv",
"er",
"Help",
"er",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Test",
"s",
" ",
"for",
" ",
"the",
" ",
"Sl",
"eu",
"th",
"Kit",
" ",
"(",
"TS",
"K",
")",
" ",
"resolver",
" ",
"help",
"er",
" ",
"implementation",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"TS",
"KR",
"eso",
"lver",
"Help",
"er",
"Test_",
"(_",
"test\\u",
"lib_",
"._",
"Resolv",
"er",
"Help",
"er",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"test",
"New",
"File",
"Object_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Test",
"s",
" ",
"the",
" ",
"New",
"File",
"Object",
" ",
"function",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"resolver",
"\\u",
"help",
"er",
"\\u",
"object_",
"=_",
"tsk",
"\\u",
"resolver",
"\\u",
"helper_",
"._",
"TS",
"KR",
"eso",
"lver",
"Helper_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"Test",
"New",
"File",
"Object_",
"(_",
"resolver",
"\\u",
"help",
"er",
"\\u",
"object_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"TS",
"KR",
"eso",
"lver",
"Help",
"er",
"Test_",
"(_",
"test\\u",
"lib_",
"._",
"Resolv",
"er",
"Help",
"er",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"New",
"File",
"System_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Test",
"s",
" ",
"the",
" ",
"New",
"File",
"System",
" ",
"function",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"resolver",
"\\u",
"help",
"er",
"\\u",
"object_",
"=_",
"tsk",
"\\u",
"resolver",
"\\u",
"helper_",
"._",
"TS",
"KR",
"eso",
"lver",
"Helper_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"Test",
"New",
"File",
"System_",
"(_",
"resolver",
"\\u",
"help",
"er",
"\\u",
"object_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unnecessary 'else' clause in loop | sympy/sympy/sympy/core/exprtools.py | [
{
"content": "def factor_nc(expr):\n \"\"\"Return the factored form of ``expr`` while handling non-commutative\n expressions.\n\n Examples\n ========\n\n >>> from sympy.core.exprtools import factor_nc\n >>> from sympy import Symbol\n >>> from sympy.abc import x\n >>> A = Symbol('A', commutative=False)\n >>> B = Symbol('B', commutative=False)\n >>> factor_nc((x**2 + 2*A*x + A**2).expand())\n (x + A)**2\n >>> factor_nc(((x + A)*(x + B)).expand())\n (x + A)*(x + B)\n \"\"\"\n from sympy.simplify.simplify import powsimp\n from sympy.polys import gcd, factor\n\n def _pemexpand(expr):\n \"Expand with the minimal set of hints necessary to check the result.\"\n return expr.expand(deep=True, mul=True, power_exp=True,\n power_base=False, basic=False, multinomial=True, log=False)\n\n expr = sympify(expr)\n if not isinstance(expr, Expr) or not expr.args:\n return expr\n if not expr.is_Add:\n return expr.func(*[factor_nc(a) for a in expr.args])\n\n expr, rep, nc_symbols = _mask_nc(expr)\n if rep:\n return factor(expr).subs(rep)\n else:\n args = [a.args_cnc() for a in Add.make_args(expr)]\n c = g = l = r = S.One\n hit = False\n # find any commutative gcd term\n for i, a in enumerate(args):\n if i == 0:\n c = Mul._from_args(a[0])\n elif a[0]:\n c = gcd(c, Mul._from_args(a[0]))\n else:\n c = S.One\n if c is not S.One:\n hit = True\n c, g = c.as_coeff_Mul()\n if g is not S.One:\n for i, (cc, _) in enumerate(args):\n cc = list(Mul.make_args(Mul._from_args(list(cc))/g))\n args[i][0] = cc\n for i, (cc, _) in enumerate(args):\n cc[0] = cc[0]/c\n args[i][0] = cc\n # find any noncommutative common prefix\n for i, a in enumerate(args):\n if i == 0:\n n = a[1][:]\n else:\n n = common_prefix(n, a[1])\n if not n:\n # is there a power that can be extracted?\n if not args[0][1]:\n break\n b, e = args[0][1][0].as_base_exp()\n ok = False\n if e.is_Integer:\n for t in args:\n if not t[1]:\n break\n bt, et = t[1][0].as_base_exp()\n if et.is_Integer and bt == b:\n e = min(e, et)\n else:\n break\n else:\n ok = hit = True\n l = b**e\n il = b**-e\n for i, a in enumerate(args):\n args[i][1][0] = il*args[i][1][0]\n break\n if not ok:\n break\n else:\n hit = True\n lenn = len(n)\n l = Mul(*n)\n for i, a in enumerate(args):\n args[i][1] = args[i][1][lenn:]\n # find any noncommutative common suffix\n for i, a in enumerate(args):\n if i == 0:\n n = a[1][:]\n else:\n n = common_suffix(n, a[1])\n if not n:\n # is there a power that can be extracted?\n if not args[0][1]:\n break\n b, e = args[0][1][-1].as_base_exp()\n ok = False\n if e.is_Integer:\n for t in args:\n if not t[1]:\n break\n bt, et = t[1][-1].as_base_exp()\n if et.is_Integer and bt == b:\n e = min(e, et)\n else:\n break\n else:\n ok = hit = True\n r = b**e\n il = b**-e\n for i, a in enumerate(args):\n args[i][1][-1] = args[i][1][-1]*il\n break\n if not ok:\n break\n else:\n hit = True\n lenn = len(n)\n r = Mul(*n)\n for i, a in enumerate(args):\n args[i][1] = a[1][:len(a[1]) - lenn]\n if hit:\n mid = Add(*[Mul(*cc)*Mul(*nc) for cc, nc in args])\n else:\n mid = expr\n\n # sort the symbols so the Dummys would appear in the same\n # order as the original symbols, otherwise you may introduce\n # a factor of -1, e.g. A**2 - B**2) -- {A:y, B:x} --> y**2 - x**2\n # and the former factors into two terms, (A - B)*(A + B) while the\n # latter factors into 3 terms, (-1)*(x - y)*(x + y)\n rep1 = [(n, Dummy()) for n in sorted(nc_symbols, key=default_sort_key)]\n unrep1 = [(v, k) for k, v in rep1]\n unrep1.reverse()\n new_mid, r2, _ = _mask_nc(mid.subs(rep1))\n new_mid = powsimp(factor(new_mid))\n\n new_mid = new_mid.subs(r2).subs(unrep1)\n\n if new_mid.is_Pow:\n return _keep_coeff(c, g*l*new_mid*r)\n\n if new_mid.is_Mul:\n # XXX TODO there should be a way to inspect what order the terms\n # must be in and just select the plausible ordering without\n # checking permutations\n cfac = []\n ncfac = []\n for f in new_mid.args:\n if f.is_commutative:\n cfac.append(f)\n else:\n b, e = f.as_base_exp()\n if e.is_Integer:\n ncfac.extend([b]*e)\n else:\n ncfac.append(f)\n pre_mid = g*Mul(*cfac)*l\n target = _pemexpand(expr/c)\n for s in variations(ncfac, len(ncfac)):\n ok = pre_mid*Mul(*s)*r\n if _pemexpand(ok) == target:\n return _keep_coeff(c, ok)\n\n # mid was an Add that didn't factor successfully\n return _keep_coeff(c, g*l*mid*r)",
"metadata": "root.factor_nc",
"header": "['module', '___EOS___']",
"index": 1327
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"necessar",
"y_",
"'",
"else",
"'_",
"clause_",
"in_",
"loop_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"factor",
"\\u",
"nc_",
"(_",
"expr_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Return",
" ",
"the",
" ",
"factor",
"ed",
" ",
"form",
" ",
"of",
" ",
"``",
"expr",
"``",
" ",
"whi",
"le",
" ",
"handling",
" ",
"non",
"-",
"commu",
"tative",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"express",
"ion",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Exam",
"ples",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"=======",
"=",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
">>>",
" ",
"from",
" ",
"symp",
"y",
".",
"core",
".",
"expr",
"tool",
"s",
" ",
"import",
" ",
"factor",
"\\u",
"nc",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
">>>",
" ",
"from",
" ",
"symp",
"y",
" ",
"import",
" ",
"Sym",
"bol",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
">>>",
" ",
"from",
" ",
"symp",
"y",
".",
"abc",
" ",
"import",
" ",
"x",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
">>>",
" ",
"A",
" ",
"=",
" ",
"Sym",
"bol",
"('",
"A",
"',",
" ",
"commu",
"tative",
"=",
"Fal",
"se",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
">>>",
" ",
"B",
" ",
"=",
" ",
"Sym",
"bol",
"('",
"B",
"',",
" ",
"commu",
"tative",
"=",
"Fal",
"se",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
">>>",
" ",
"factor",
"\\u",
"nc",
"((",
"x",
"**",
"2",
" ",
"+",
" ",
"2",
"*",
"A",
"*",
"x",
" ",
"+",
" ",
"A",
"**",
"2",
").",
"expand",
"())",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"(",
"x",
" ",
"+",
" ",
"A",
")**",
"2",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
">>>",
" ",
"factor",
"\\u",
"nc",
"(((",
"x",
" ",
"+",
" ",
"A",
")*",
"(",
"x",
" ",
"+",
" ",
"B",
"))",
".",
"expand",
"())",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"(",
"x",
" ",
"+",
" ",
"A",
")*",
"(",
"x",
" ",
"+",
" ",
"B",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"sympy_",
"._",
"simplify_",
"._",
"simplify_",
"import_",
"pow",
"simp",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"sympy_",
"._",
"polys",
"_",
"import_",
"gcd_",
",_",
"factor_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u",
"pe",
"me",
"xpa",
"nd_",
"(_",
"expr_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"",
"Expand",
" ",
"with",
" ",
"the",
" ",
"minima",
"l",
" ",
"set",
" ",
"of",
" ",
"hin",
"ts",
" ",
"necessar",
"y",
" ",
"to",
" ",
"check",
" ",
"the",
" ",
"result",
".\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"expr_",
"._",
"expand_",
"(_",
"deep_",
"=_",
"True_",
",_",
"mul_",
"=_",
"True_",
",_",
"power",
"\\u",
"exp_",
"=_",
"True_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"power",
"\\u",
"base_",
"=_",
"False_",
",_",
"basic_",
"=_",
"False_",
",_",
"multin",
"omial",
"_",
"=_",
"True_",
",_",
"log_",
"=_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"expr_",
"=_",
"symp",
"ify_",
"(_",
"expr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"isinstance_",
"(_",
"expr_",
",_",
"Expr_",
")_",
"or_",
"not_",
"expr_",
"._",
"args_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"expr_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"expr_",
"._",
"is",
"\\u",
"Add_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"expr_",
"._",
"func_",
"(_",
"*_",
"[_",
"factor",
"\\u",
"nc_",
"(_",
"a_",
")_",
"for_",
"a_",
"in_",
"expr_",
"._",
"args_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"expr_",
",_",
"rep_",
",_",
"nc",
"\\u",
"symbols_",
"=_",
"\\u",
"mask",
"\\u",
"nc_",
"(_",
"expr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"rep_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"factor_",
"(_",
"expr_",
")_",
"._",
"subs_",
"(_",
"rep_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"args_",
"=_",
"[_",
"a_",
"._",
"args",
"\\u",
"cnc",
"_",
"(_",
")_",
"for_",
"a_",
"in_",
"Add_",
"._",
"make",
"\\u",
"args_",
"(_",
"expr_",
")_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"c_",
"=_",
"g_",
"=_",
"l_",
"=_",
"r_",
"=_",
"S_",
"._",
"One_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"hit_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"find",
" ",
"any",
" ",
"commu",
"tative",
" ",
"gc",
"d",
" ",
"term_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"i_",
",_",
"a_",
"in_",
"enumerate_",
"(_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"i_",
"==_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"c_",
"=_",
"Mul",
"_",
"._",
"\\u",
"from",
"\\u",
"args_",
"(_",
"a_",
"[_",
"0_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"a_",
"[_",
"0_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"c_",
"=_",
"gcd_",
"(_",
"c_",
",_",
"Mul",
"_",
"._",
"\\u",
"from",
"\\u",
"args_",
"(_",
"a_",
"[_",
"0_",
"]_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"c_",
"=_",
"S_",
"._",
"One_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"c_",
"is_",
"not_",
"S_",
"._",
"One_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"hit_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"c_",
",_",
"g_",
"=_",
"c_",
"._",
"as",
"\\u",
"coef",
"f",
"\\u",
"Mul",
"_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"g_",
"is_",
"not_",
"S_",
"._",
"One_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"i_",
",_",
"(_",
"cc_",
",_",
"\\u_",
")_",
"in_",
"enumerate_",
"(_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"cc_",
"=_",
"list_",
"(_",
"Mul",
"_",
"._",
"make",
"\\u",
"args_",
"(_",
"Mul",
"_",
"._",
"\\u",
"from",
"\\u",
"args_",
"(_",
"list_",
"(_",
"cc_",
")_",
")_",
"/_",
"g_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"args_",
"[_",
"i_",
"]_",
"[_",
"0_",
"]_",
"=_",
"cc_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"i_",
",_",
"(_",
"cc_",
",_",
"\\u_",
")_",
"in_",
"enumerate_",
"(_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"cc_",
"[_",
"0_",
"]_",
"=_",
"cc_",
"[_",
"0_",
"]_",
"/_",
"c_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"args_",
"[_",
"i_",
"]_",
"[_",
"0_",
"]_",
"=_",
"cc_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"find",
" ",
"any",
" ",
"nonc",
"omm",
"utat",
"ive",
" ",
"common",
" ",
"prefix_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"i_",
",_",
"a_",
"in_",
"enumerate_",
"(_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"i_",
"==_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"n_",
"=_",
"a_",
"[_",
"1_",
"]_",
"[_",
":_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"n_",
"=_",
"common",
"\\u",
"prefix_",
"(_",
"n_",
",_",
"a_",
"[_",
"1_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"n_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"is",
" ",
"there",
" ",
"a",
" ",
"power",
" ",
"tha",
"t",
" ",
"can",
" ",
"be",
" ",
"extracted",
"?",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"args_",
"[_",
"0_",
"]_",
"[_",
"1_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"b_",
",_",
"e_",
"=_",
"args_",
"[_",
"0_",
"]_",
"[_",
"1_",
"]_",
"[_",
"0_",
"]_",
"._",
"as",
"\\u",
"base",
"\\u",
"exp_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ok_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"e_",
"._",
"is",
"\\u",
"Integer_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"for_",
"t_",
"in_",
"args_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"if_",
"not_",
"t_",
"[_",
"1_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"bt_",
",_",
"et_",
"=_",
"t_",
"[_",
"1_",
"]_",
"[_",
"0_",
"]_",
"._",
"as",
"\\u",
"base",
"\\u",
"exp_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"et_",
"._",
"is",
"\\u",
"Integer_",
"and_",
"bt_",
"==_",
"b_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"e_",
"=_",
"min_",
"(_",
"e_",
",_",
"et_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"ok_",
"=_",
"hit_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"l_",
"=_",
"b_",
"**_",
"e_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"il_",
"=_",
"b_",
"**_",
"-_",
"e_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"i_",
",_",
"a_",
"in_",
"enumerate_",
"(_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"args_",
"[_",
"i_",
"]_",
"[_",
"1_",
"]_",
"[_",
"0_",
"]_",
"=_",
"il_",
"*_",
"args_",
"[_",
"i_",
"]_",
"[_",
"1_",
"]_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"ok_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"hit_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"len",
"n_",
"=_",
"len_",
"(_",
"n_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"l_",
"=_",
"Mul",
"_",
"(_",
"*_",
"n_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"i_",
",_",
"a_",
"in_",
"enumerate_",
"(_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"args_",
"[_",
"i_",
"]_",
"[_",
"1_",
"]_",
"=_",
"args_",
"[_",
"i_",
"]_",
"[_",
"1_",
"]_",
"[_",
"len",
"n_",
":_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"find",
" ",
"any",
" ",
"nonc",
"omm",
"utat",
"ive",
" ",
"common",
" ",
"suffix_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"i_",
",_",
"a_",
"in_",
"enumerate_",
"(_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"i_",
"==_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"n_",
"=_",
"a_",
"[_",
"1_",
"]_",
"[_",
":_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"n_",
"=_",
"common",
"\\u",
"suffix_",
"(_",
"n_",
",_",
"a_",
"[_",
"1_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"n_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"is",
" ",
"there",
" ",
"a",
" ",
"power",
" ",
"tha",
"t",
" ",
"can",
" ",
"be",
" ",
"extracted",
"?",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"args_",
"[_",
"0_",
"]_",
"[_",
"1_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"b_",
",_",
"e_",
"=_",
"args_",
"[_",
"0_",
"]_",
"[_",
"1_",
"]_",
"[_",
"-_",
"1_",
"]_",
"._",
"as",
"\\u",
"base",
"\\u",
"exp_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ok_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"e_",
"._",
"is",
"\\u",
"Integer_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"for_",
"t_",
"in_",
"args_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"if_",
"not_",
"t_",
"[_",
"1_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"bt_",
",_",
"et_",
"=_",
"t_",
"[_",
"1_",
"]_",
"[_",
"-_",
"1_",
"]_",
"._",
"as",
"\\u",
"base",
"\\u",
"exp_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"et_",
"._",
"is",
"\\u",
"Integer_",
"and_",
"bt_",
"==_",
"b_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"e_",
"=_",
"min_",
"(_",
"e_",
",_",
"et_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"ok_",
"=_",
"hit_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"r_",
"=_",
"b_",
"**_",
"e_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"il_",
"=_",
"b_",
"**_",
"-_",
"e_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"i_",
",_",
"a_",
"in_",
"enumerate_",
"(_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"args_",
"[_",
"i_",
"]_",
"[_",
"1_",
"]_",
"[_",
"-_",
"1_",
"]_",
"=_",
"args_",
"[_",
"i_",
"]_",
"[_",
"1_",
"]_",
"[_",
"-_",
"1_",
"]_",
"*_",
"il_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"ok_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"hit_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"len",
"n_",
"=_",
"len_",
"(_",
"n_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"r_",
"=_",
"Mul",
"_",
"(_",
"*_",
"n_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"i_",
",_",
"a_",
"in_",
"enumerate_",
"(_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"args_",
"[_",
"i_",
"]_",
"[_",
"1_",
"]_",
"=_",
"a_",
"[_",
"1_",
"]_",
"[_",
":_",
"len_",
"(_",
"a_",
"[_",
"1_",
"]_",
")_",
"-_",
"len",
"n_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"hit_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mid_",
"=_",
"Add_",
"(_",
"*_",
"[_",
"Mul",
"_",
"(_",
"*_",
"cc_",
")_",
"*_",
"Mul",
"_",
"(_",
"*_",
"nc_",
")_",
"for_",
"cc_",
",_",
"nc_",
"in_",
"args_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mid_",
"=_",
"expr_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"sort",
" ",
"the",
" ",
"symbols",
" ",
"so",
" ",
"the",
" ",
"Du",
"mm",
"ys",
" ",
"wou",
"ld",
" ",
"appear",
" ",
"in",
" ",
"the",
" ",
"same_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"order",
" ",
"as",
" ",
"the",
" ",
"original",
" ",
"symbols",
",",
" ",
"other",
"wis",
"e",
" ",
"you",
" ",
"may",
" ",
"introduce",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"a",
" ",
"factor",
" ",
"of",
" ",
"-1",
",",
" ",
"e",
".",
"g",
".",
" ",
"A",
"**",
"2",
" ",
"-",
" ",
"B",
"**",
"2",
")",
" ",
"--",
" ",
"{",
"A",
":",
"y",
",",
" ",
"B",
":",
"x",
"}",
" ",
"-->",
" ",
"y",
"**",
"2",
" ",
"-",
" ",
"x",
"**",
"2_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"and",
" ",
"the",
" ",
"former",
" ",
"factor",
"s",
" ",
"int",
"o",
" ",
"two",
" ",
"term",
"s",
",",
" ",
"(",
"A",
" ",
"-",
" ",
"B",
")*",
"(",
"A",
" ",
"+",
" ",
"B",
")",
" ",
"whi",
"le",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"latt",
"er",
" ",
"factor",
"s",
" ",
"int",
"o",
" ",
"3",
" ",
"term",
"s",
",",
" ",
"(-",
"1",
")*",
"(",
"x",
" ",
"-",
" ",
"y",
")*",
"(",
"x",
" ",
"+",
" ",
"y",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"rep",
"1_",
"=_",
"[_",
"(_",
"n_",
",_",
"Dummy_",
"(_",
")_",
")_",
"for_",
"n_",
"in_",
"sorted_",
"(_",
"nc",
"\\u",
"symbols_",
",_",
"key_",
"=_",
"default",
"\\u",
"sort",
"\\u",
"key_",
")_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"unre",
"p1_",
"=_",
"[_",
"(_",
"v_",
",_",
"k_",
")_",
"for_",
"k_",
",_",
"v_",
"in_",
"rep",
"1_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"unre",
"p1_",
"._",
"reverse_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"new",
"\\u",
"mid_",
",_",
"r2_",
",_",
"\\u_",
"=_",
"\\u",
"mask",
"\\u",
"nc_",
"(_",
"mid_",
"._",
"subs_",
"(_",
"rep",
"1_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"new",
"\\u",
"mid_",
"=_",
"pow",
"simp",
"_",
"(_",
"factor_",
"(_",
"new",
"\\u",
"mid_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"new",
"\\u",
"mid_",
"=_",
"new",
"\\u",
"mid_",
"._",
"subs_",
"(_",
"r2_",
")_",
"._",
"subs_",
"(_",
"unre",
"p1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"new",
"\\u",
"mid_",
"._",
"is",
"\\u",
"Pow",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"\\u",
"keep",
"\\u",
"coeff_",
"(_",
"c_",
",_",
"g_",
"*_",
"l_",
"*_",
"new",
"\\u",
"mid_",
"*_",
"r_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"new",
"\\u",
"mid_",
"._",
"is",
"\\u",
"Mul",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"XX",
"X",
" ",
"TOD",
"O",
" ",
"there",
" ",
"shou",
"ld",
" ",
"be",
" ",
"a",
" ",
"way",
" ",
"to",
" ",
"inspect",
" ",
"what",
" ",
"order",
" ",
"the",
" ",
"terms_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"must",
" ",
"be",
" ",
"in",
" ",
"and",
" ",
"just",
" ",
"select",
" ",
"the",
" ",
"pla",
"usi",
"ble",
" ",
"orderi",
"ng",
" ",
"with",
"out_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"checking",
" ",
"permutations_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"cfa",
"c_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ncf",
"ac_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"f_",
"in_",
"new",
"\\u",
"mid_",
"._",
"args_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"f_",
"._",
"is",
"\\u",
"commu",
"tative",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"cfa",
"c_",
"._",
"append_",
"(_",
"f_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"b_",
",_",
"e_",
"=_",
"f_",
"._",
"as",
"\\u",
"base",
"\\u",
"exp_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"e_",
"._",
"is",
"\\u",
"Integer_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"ncf",
"ac_",
"._",
"extend_",
"(_",
"[_",
"b_",
"]_",
"*_",
"e_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"ncf",
"ac_",
"._",
"append_",
"(_",
"f_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"pre",
"\\u",
"mid_",
"=_",
"g_",
"*_",
"Mul",
"_",
"(_",
"*_",
"cfa",
"c_",
")_",
"*_",
"l_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"target_",
"=_",
"\\u",
"pe",
"me",
"xpa",
"nd_",
"(_",
"expr_",
"/_",
"c_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"s_",
"in_",
"variations",
"_",
"(_",
"ncf",
"ac_",
",_",
"len_",
"(_",
"ncf",
"ac_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ok_",
"=_",
"pre",
"\\u",
"mid_",
"*_",
"Mul",
"_",
"(_",
"*_",
"s_",
")_",
"*_",
"r_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"\\u",
"pe",
"me",
"xpa",
"nd_",
"(_",
"ok_",
")_",
"==_",
"target_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"return_",
"\\u",
"keep",
"\\u",
"coeff_",
"(_",
"c_",
",_",
"ok_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"mid",
" ",
"was",
" ",
"an",
" ",
"Add",
" ",
"tha",
"t",
" ",
"did",
"n",
"'",
"t",
" ",
"factor",
" ",
"success",
"full",
"y_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"\\u",
"keep",
"\\u",
"coeff_",
"(_",
"c_",
",_",
"g_",
"*_",
"l_",
"*_",
"mid_",
"*_",
"r_",
")_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,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
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Imprecise assert | hasgeek/coaster/tests/test_assets.py | [
{
"content": " def test_single_requires_which_is_dict(self):\n bundle = self.assets.require('jquery.form.1.js')\n self.assertEqual(bundle.contents, ('jquery-1.8.3.js',))",
"metadata": "root.TestAssets.test_single_requires_which_is_dict",
"header": "['class', 'TestAssets', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 42
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Imp",
"reci",
"se_",
"assert_",
"[SEP]_",
"class_",
"Test",
"Asset",
"s_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"single",
"\\u",
"require",
"s",
"\\u",
"whi",
"ch",
"\\u",
"is",
"\\u",
"dict_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"bundle_",
"=_",
"self_",
"._",
"assets_",
"._",
"require_",
"(_",
"'",
"jq",
"uer",
"y",
".",
"form",
".1",
".",
"js",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"bundle_",
"._",
"contents_",
",_",
"(_",
"'",
"jq",
"uer",
"y",
"-1",
".8",
".3",
".",
"js",
"'_",
",_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unreachable code | cloudera/ibis/ibis/impala/tests/test_pandas_interop.py | [
{
"content": " def test_dtype_float32(self):\n df = pd.DataFrame({'col': np.float32([45e-3, -0.4, 99.])})\n inferred = pandas_to_ibis_schema(df)\n expected = ibis.schema([('col', 'float')])\n assert inferred == expected",
"metadata": "root.TestPandasSchemaInference.test_dtype_float32",
"header": "['class', 'TestPandasSchemaInference', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 73
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Unrea",
"chab",
"le_",
"code_",
"[SEP]_",
"class_",
"Test",
"Pan",
"das",
"Schema",
"Infer",
"ence_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"dt",
"ype",
"\\u",
"float32_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"df_",
"=_",
"pd_",
"._",
"Data",
"Frame_",
"(_",
"{_",
"'",
"col",
"'_",
":_",
"np_",
"._",
"float32_",
"(_",
"[_",
"4",
"5e-",
"3_",
",_",
"-_",
"0.4_",
",_",
"99.",
"_",
"]_",
")_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"inferred",
"_",
"=_",
"panda",
"s",
"\\u",
"to",
"\\u",
"ibi",
"s",
"\\u",
"schema_",
"(_",
"df_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"ibi",
"s_",
"._",
"schema_",
"(_",
"[_",
"(_",
"'",
"col",
"'_",
",_",
"'",
"float",
"'_",
")_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"inferred",
"_",
"==_",
"expected_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Signature mismatch in overriding method | sahana/eden/modules/s3/s3navigation.py | [
{
"content": "class S3NavigationItem(object):\n \"\"\"\n Base class and API for navigation items.\n\n Navigation items are GUI elements to navigate the application,\n typically represented as hyperlinks. Besides form elements,\n navigation items are most common type of GUI controls.\n\n This base class can be used to implement both nagivation items\n and navigation item containers (e.g. menus), each as subclasses.\n\n Subclasses should implement the layout() method to render the item as\n HTML (ideally using the web2py helpers). There is no default layout,\n items will not be rendered at all unless the subclass implements a\n layout method or the particular instance receives a renderer as\n parameter.\n\n Additionally, subclasses should implement the check_*() methods:\n\n Method: Checks whether:\n\n check_active this item belongs to the requested page\n check_enabled this item is enabled\n check_permission the user is permitted to access this item\n check_selected the item has been selected to request the page\n\n check_active is the first check run, and the only method that\n actually deactivates the item completely, whereas the other\n methods just set flags for the renderer. All of these methods\n must return True or False for the respective condition.\n\n There are default check_*() methods in this base class which support\n a menu-alike behavior of the item - which may though not fit for all\n navigation elements.\n\n For more details, see the S3Navigation wiki page:\n http://eden.sahanafoundation.org/wiki/S3/S3Navigation\n \"\"\"\n\n # -------------------------------------------------------------------------\n # Construction\n #\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n # Check methods\n #\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n # Tag methods, allows to enable/disable/alter items by tag\n #\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n # Activation methods\n #\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n # Representation methods\n #\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n # Tree construction methods\n #\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n # Tree introspection and manipulation methods\n #\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n # List methods\n #\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------",
"metadata": "root.S3NavigationItem",
"header": "['module', '___EOS___']",
"index": 48
},
{
"content": " def __init__(self,\n label=None,\n c=None,\n f=None,\n args=None,\n vars=None,\n extension=None,\n a=None,\n r=None,\n m=None,\n p=None,\n t=None,\n url=None,\n tags=None,\n parent=None,\n translate=True,\n layout=None,\n check=None,\n restrict=None,\n link=True,\n mandatory=False,\n ltr=False,\n **attributes):\n \"\"\"\n Constructor\n\n @param label: the label\n\n @param c: the controller\n @param f: the function\n @param args: the arguments list\n @param vars: the variables Storage\n @param extension: the request extension\n @param a: the application (defaults to current.request.application)\n @param r: the request to default to\n\n @param m: the URL method (will be appended to args)\n @param p: the method to check authorization for\n (will not be appended to args)\n @param t: the table concerned by this request\n (overrides c_f for auth)\n\n @param url: a URL to use instead of building one manually\n - e.g. for external websites or mailto: links\n\n @param tags: list of tags for this item\n @param parent: the parent item\n\n @param translate: translate the label\n @param layout: the layout\n @param check: a condition or list of conditions to automatically\n enable/disable this item\n @param restrict: restrict to roles (role UID or list of role UIDs)\n @param link: item has its own URL\n @param mandatory: item is always active\n @param ltr: item is always rendered LTR\n\n @param attributes: attributes to use in layout\n \"\"\"\n\n # Label\n if isinstance(label, basestring) and translate:\n self.label = current.T(label)\n else:\n self.label = label\n\n # Register tags\n if tags:\n if type(tags) is not list:\n tags = [tags]\n self.tags = tags\n else:\n self.tags = []\n\n # Request parameters\n if r is not None:\n self.r = r\n if a is None:\n a = r.application\n if c is None:\n c = r.controller\n if f is None:\n f = r.function\n if args is None:\n args = r.args\n if vars is None:\n vars = r.vars\n else:\n self.r = current.request\n\n # Application, controller, function, args, vars, extension\n self.application = a\n\n if isinstance(c, (list, tuple)) and len(c):\n self.controller = c[0]\n self.match_controller = c\n else:\n self.controller = c\n self.match_controller = [c]\n\n if isinstance(f, (list, tuple)) and len(f):\n self.function = f[0]\n self.match_function = f\n else:\n self.function = f\n self.match_function = [f]\n\n if args is None:\n args = []\n elif isinstance(args, str):\n args = args.split(\"/\")\n self.args = args\n if vars:\n self.vars = vars\n else:\n self.vars = Storage()\n self.extension = extension\n\n # Table and method\n self.tablename = t\n self.method = m\n if m is not None:\n if not len(args):\n self.args = [m]\n elif args[-1] != m:\n self.args.append(m)\n if p is not None:\n self.p = p\n else:\n self.p = m\n\n self.override_url = url\n\n # Layout attributes and options\n attr = Storage()\n opts = Storage()\n for k, v in attributes.iteritems():\n if k[0] == \"_\":\n attr[k] = v\n else:\n opts[k] = v\n self.attr = attr\n self.opts = opts\n\n # Initialize parent and components\n self.parent = parent\n self.components = []\n\n # Flags\n self.enabled = True # Item is enabled/disabled\n self.selected = None # Item is in the current selected-path\n self.visible = None # Item is visible\n self.link = link # Item shall be linked\n self.mandatory = mandatory # Item is always active\n self.ltr = ltr # Item is always rendered LTR\n\n # Role restriction\n self.restrict = restrict\n if restrict is not None:\n if not isinstance(restrict, (list, tuple)):\n self.restrict = [restrict]\n\n # Hook in custom-checks\n self.check = check\n\n # Set the renderer (override with set_layout())\n renderer = None\n if layout is not None:\n # Custom layout for this particular instance\n renderer = layout\n elif hasattr(self.__class__, \"OVERRIDE\"):\n # Theme layout\n renderer = self.get_layout(self.OVERRIDE)\n if renderer is None and hasattr(self.__class__, \"layout\"):\n # Default layout\n renderer = self.layout\n self.renderer = renderer",
"metadata": "root.S3NavigationItem.__init__",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 90
},
{
"content": " @staticmethod\n def get_layout(name):\n \"\"\"\n Check whether the current theme has a custom layout for this\n class, and if so, store it in current.layouts\n\n @param: the name of the custom layout\n @return: the layout or None if not present\n \"\"\"\n\n if hasattr(current, \"layouts\"):\n layouts = current.layouts\n else:\n layouts = {}\n if layouts is False:\n return None\n if name in layouts:\n return layouts[name]\n\n # Try to find custom layout in theme\n application = current.request.application\n settings = current.deployment_settings\n theme = settings.get_theme()\n theme_location = current.response.s3.theme_location\n if theme_location:\n theme_location = \"%s.\" % theme_location[:-1]\n package = \"applications.%s.modules.templates.%s%s.layouts\" % \\\n (application, theme_location, theme)\n try:\n override = getattr(__import__(package, fromlist=[name]), name)\n except ImportError:\n # No layouts in theme - no point to try again\n current.layouts = False\n return None\n except AttributeError:\n override = None\n\n if override and \\\n hasattr(override, \"layout\") and \\\n type(override.layout) == type(lambda:None):\n layout = override.layout\n else:\n layout = None\n\n layouts[name] = layout\n current.layouts = layouts\n\n return layout",
"metadata": "root.S3NavigationItem.get_layout",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 269
},
{
"content": " def clone(self):\n \"\"\" Clone this item and its components \"\"\"\n\n item = self.__class__()\n item.label = self.label\n item.tags = self.tags\n\n item.r = self.r\n\n item.application = self.application\n item.controller = self.controller\n item.function = self.function\n\n item.match_controller = [c for c in self.match_controller]\n item.match_function = [f for f in self.match_function]\n\n item.args = [a for a in self.args]\n item.vars = Storage(**self.vars)\n\n item.extension = self.extension\n item.tablename = self.tablename\n item.method = self.method\n item.p = self.p\n\n item.override_url = self.override_url\n\n item.attr = Storage(**self.attr)\n item.opts = Storage(**self.opts)\n\n item.parent = self.parent\n item.components = [i.clone() for i in self.components]\n\n item.enabled = self.enabled\n item.selected = self.selected\n item.visible = self.visible\n item.link = self.link\n item.mandatory = self.mandatory\n if self.restrict is not None:\n item.restrict = [r for r in self.restrict]\n else:\n item.restrict = None\n\n item.check = self.check\n item.renderer = self.renderer\n\n return item",
"metadata": "root.S3NavigationItem.clone",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 319
},
{
"content": " def check_active(self, request=None):\n \"\"\"\n Check whether this item belongs to the requested page (request).\n\n If this check returns False, then the item will be deactivated\n entirely, i.e. no further checks will be run and the renderer\n will never be called.\n\n @param request: the request object (defaults to current.request)\n \"\"\"\n\n # Deactivate the item if its target controller is deactivated\n c = self.get(\"controller\")\n if c:\n return current.deployment_settings.has_module(c)\n return True\n\n # Fall back to current.request\n if request is None:\n request = current.request\n\n parent = self.parent\n if parent is not None:\n # For component items, the parent's status applies\n return parent.check_active(request)\n\n elif self.mandatory:\n # mandatory flag overrides request match\n return True\n\n elif self.match(request):\n # item is active if it matches the request\n return True\n\n return False",
"metadata": "root.S3NavigationItem.check_active",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 369
},
{
"content": " def check_enabled(self):\n \"\"\"\n Check whether this item is enabled.\n\n This check does not directly disable the item, but rather\n sets the enabled-flag in the item which can then be used\n by the renderer.\n\n This function is called as the very last action immediately\n before rendering the item. If it returns True, then the\n enabled-flag of the item remains unchanged, otherwise\n it gets set to False (False-override).\n \"\"\"\n\n # to be implemented in subclass, default True\n return True",
"metadata": "root.S3NavigationItem.check_enabled",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 406
},
{
"content": " def check_permission(self):\n \"\"\"\n Check whether the user is permitted to access this item.\n\n This check does not directly disable the item, but rather\n sets the authorized-flag in the item which can then be used\n by the renderer.\n \"\"\"\n\n has_role = current.auth.s3_has_role\n\n authorized = False\n\n restrict = self.restrict\n if restrict:\n for role in restrict:\n if has_role(role):\n authorized = True\n break\n else:\n authorized = True\n\n if self.accessible_url() == False:\n authorized = False\n return authorized",
"metadata": "root.S3NavigationItem.check_permission",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 424
},
{
"content": " def check_selected(self, request=None):\n \"\"\"\n Check whether this item is in the selected path (i.e. whether it\n is or contains the item used to trigger the request).\n\n This check doesn't change the processing of the item, but\n rather sets the selected-flag which can then be used by the\n renderer\n\n If this is a top-level item, then this check sets the\n selected-flags for the whole selected path down to the leaf\n item that has triggered the request.\n\n Note that this doesn't currently reset selected-flags, so this\n check can be performed only once per subtree and request. If\n it would be really neccessary to perform this check more than\n once, then it should be easy to implement a reset_flags method.\n\n @param request: the request object, defaults to current.request\n \"\"\"\n\n if self.selected is not None:\n # Already selected\n return self.selected\n if request is None:\n request = current.request\n if self.parent is None:\n # If this is the root item, then set the selected path\n branch = self.branch(request)\n if branch is not None:\n branch.select()\n if not self.selected:\n self.selected = False\n else:\n # Otherwise: check the root item\n root = self.get_root()\n if root.selected is None:\n root.check_selected(request)\n\n return True if self.selected else False",
"metadata": "root.S3NavigationItem.check_selected",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 451
},
{
"content": " def check_hook(self):\n \"\"\"\n Run hooked-in checks\n \"\"\"\n\n cond = True\n check = self.check\n if check is not None:\n if not isinstance(check, (list, tuple)):\n check = [check]\n for condition in check:\n if callable(condition) and not condition(self):\n cond = False\n elif not condition:\n cond = False\n return cond",
"metadata": "root.S3NavigationItem.check_hook",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 493
},
{
"content": " def __contains__(self, tag):\n \"\"\" Check whether a tag is present in any item of the subtree \"\"\"\n\n components = self.components\n for i in components:\n if tag in i.tags or tag in i:\n return 1\n return 0",
"metadata": "root.S3NavigationItem.__contains__",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 513
},
{
"content": " def findall(self, tag):\n \"\"\"\n Find all items within the tree with the specified tag\n\n @param tag: the tag\n \"\"\"\n\n items = []\n if tag in self.tags:\n items.append(self)\n components = self.components\n for c in components:\n _items = c.findall(tag)\n items.extend(_items)\n return items",
"metadata": "root.S3NavigationItem.findall",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 523
},
{
"content": " def enable(self, tag=None):\n \"\"\"\n Enable items\n\n @param tag: enable all items in the subtree with this tag\n (no tag enables only this item)\n \"\"\"\n\n if tag is not None:\n items = self.findall(tag)\n for item in items:\n item.enable()\n else:\n self.enabled = True\n return",
"metadata": "root.S3NavigationItem.enable",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 540
},
{
"content": " def disable(self, tag=None):\n \"\"\"\n Disable items\n\n @param tag: disable all items in the subtree with this tag\n (no tag disables only this item)\n \"\"\"\n\n if tag is not None:\n items = self.findall(tag)\n for item in items:\n item.disable()\n else:\n self.enabled = False\n return",
"metadata": "root.S3NavigationItem.disable",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 557
},
{
"content": " def select(self, tag=None):\n \"\"\"\n Select an item. If given a tag, this selects the first matching\n descendant (depth-first search), otherwise selects this item.\n\n Propagates the selection up the path to the root item (including\n the root item)\n\n @param tag: a string\n \"\"\"\n\n selected = None\n if tag is None:\n parent = self.parent\n if parent:\n parent.select()\n else:\n self.deselect_all()\n selected = True\n else:\n for item in self.components:\n if not selected:\n selected = item.select(tag=tag)\n else:\n item.deselect_all()\n if not selected and tag in self.tags:\n selected = True\n self.selected = selected\n return selected",
"metadata": "root.S3NavigationItem.select",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 574
},
{
"content": " def deselect_all(self):\n \"\"\" De-select this item and all its descendants \"\"\"\n\n self.selected = None\n for item in self.components:\n item.deselect_all()\n return",
"metadata": "root.S3NavigationItem.deselect_all",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 605
},
{
"content": " def set_layout(self, layout, recursive=False, tag=None):\n \"\"\"\n Alter the renderer for a tagged subset of items in the subtree.\n\n @param layout: the layout (renderer)\n @param recursive: set this layout recursively for the subtree\n @param tag: set this layout only for items with this tag\n \"\"\"\n\n if layout is not None:\n if tag is None or tag in self.tags:\n self.renderer = layout\n if recursive:\n for c in self.components:\n if tag is None or tag in c.tags:\n c.set_layout(layout, recursive=recursive, tag=tag)\n return",
"metadata": "root.S3NavigationItem.set_layout",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 614
},
{
"content": " def get(self, name, default=None):\n \"\"\"\n Get a Python-attribute of this item instance, falls back\n to the same attribute in the parent item if not set in\n this instance, used to inherit attributes to components\n\n @param name: the attribute name\n \"\"\"\n\n if name in self.__dict__:\n value = self.__dict__[name]\n else:\n value = None\n if value is not None:\n return value\n if name[:2] == \"__\":\n raise AttributeError\n parent = self.parent\n if parent is not None:\n return parent.get(name)\n return default",
"metadata": "root.S3NavigationItem.get",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 636
},
{
"content": " def match(self, request=None):\n \"\"\"\n Match this item against request (uses GET vars)\n\n @param request: the request object (defaults to current.request)\n\n @return: the match level (integer):\n 0=no match\n 1=controller\n 2=controller+function\n 3=controller+function+args\n 4=controller+function+args+vars\n\n @note: currently ignores numerical arguments in the request,\n which is though subject to change (in order to support\n numerical arguments in the item)\n \"\"\"\n\n level = 0\n args = self.args\n link_vars = self.vars\n\n if self.application is not None and \\\n self.application != request.application:\n # Foreign application links never match\n return 0\n\n if self.opts.selectable is False:\n return 0\n\n # Check hook and enabled\n check = self.check_hook()\n if check:\n enabled = self.check_enabled()\n if not enabled:\n check = False\n if not check:\n # Hook failed or disabled: doesn't match in any case\n return 0\n\n if request is None:\n request = current.request\n\n c = self.get(\"controller\")\n mc = self.get(\"match_controller\")\n\n # Top-level items with no controller setting\n # (=application level items) match any controller, but not more\n if not c and self.parent is None:\n return 1\n\n\n rvars = request.get_vars\n controller = request.controller\n function = request.function\n\n # Handle \"viewing\" (foreign controller in a tab)\n # NOTE: this tries to match the item against the resource name\n # in \"viewing\", so if the target controller/function of the item\n # are different from prefix/name in the resource name, then this\n # may require additional match_controller/match_function to be\n # set for this item! (beware ambiguity then, though)\n if \"viewing\" in rvars:\n try:\n tn, record_id = rvars[\"viewing\"].split(\".\")\n controller, function = tn.split(\"_\", 1)\n except:\n pass\n\n # Controller\n if controller == c or controller in mc:\n level = 1\n\n # Function\n if level == 1:\n f = self.get(\"function\")\n mf = self.get(\"match_function\")\n if function == f or function in mf:\n level = 2\n elif f == \"index\":\n # \"weak\" match: homepage link matches any function\n return 1\n elif f is not None:\n return 0\n\n # Args and vars\n # Match levels (=order of preference):\n # 0 = args mismatch\n # 1 = last arg mismatch (numeric instead of method)\n # 2 = no args in item and vars mismatch\n # 3 = no args and no vars in item\n # 4 = no args in item but vars match\n # 5 = args match but vars mismatch\n # 6 = args match and no vars in item\n # 7 = args match and vars match\n if level == 2:\n extra = 1\n for k, v in link_vars.iteritems():\n if k not in rvars or k in rvars and rvars[k] != s3_unicode(v):\n extra = 0\n break\n else:\n extra = 2\n rargs = request.args\n if rargs:\n if args:\n largs = [a for a in request.args if not a.isdigit()]\n if len(args) == len(largs) and \\\n all([args[i] == largs[i] for i in xrange(len(args))]):\n level = 5\n else:\n if len(rargs) >= len(args) > 0 and \\\n rargs[len(args)-1].isdigit() and \\\n not str(args[-1]).isdigit():\n level = 1\n else:\n return 0\n else:\n level = 3\n elif args:\n return 0\n else:\n level = 5\n level += extra\n\n return level",
"metadata": "root.S3NavigationItem.match",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 659
},
{
"content": " def branch(self, request=None):\n \"\"\"\n Get the matching branch item for request\n\n @param request: the request object (defaults to current.request)\n \"\"\"\n\n if request is None:\n request = current.request\n\n leaf, level = self.__branch(request)\n if level:\n return leaf\n else:\n return None",
"metadata": "root.S3NavigationItem.branch",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 787
},
{
"content": " def __branch(self, request):\n \"\"\"\n Find the best match for request within the subtree, recursive\n helper method for branch().\n\n @param request: the request object\n \"\"\"\n\n items = self.get_all(enabled=True)\n l = self.match(request)\n if not items:\n return self, l\n else:\n match, maxlevel = None, l - 1\n for i in items:\n item, level = i.__branch(request)\n if item is not None and level > maxlevel:\n match = item\n maxlevel = level\n if match is not None:\n return match, maxlevel\n else:\n return self, l",
"metadata": "root.S3NavigationItem.__branch",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 804
},
{
"content": " def __repr__(self):\n \"\"\" String representation of this item \"\"\"\n\n components = [str(c) for c in self.components]\n if self.enabled:\n label = str(self.label)\n else:\n label = \"%s (disabled)\" % self.label\n label = \"%s:%s\" % (self.__class__.__name__, label)\n if components:\n return \"<%s {%s}>\" % (label, \",\".join(components))\n else:\n return \"<%s>\" % label",
"metadata": "root.S3NavigationItem.__repr__",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 832
},
{
"content": " def url(self, extension=None, **kwargs):\n \"\"\"\n Return the target URL for this item, doesn't check permissions\n\n @param extension: override the format extension\n @param kwargs: override URL query vars\n \"\"\"\n\n if not self.link:\n return None\n\n if self.override_url:\n return self.override_url\n\n args = self.args\n if self.vars:\n link_vars = Storage(self.vars)\n link_vars.update(kwargs)\n else:\n link_vars = Storage(kwargs)\n if extension is None:\n extension = self.extension\n a = self.get(\"application\")\n if a is None:\n a = current.request.application\n c = self.get(\"controller\")\n if c is None:\n c = \"default\"\n f = self.get(\"function\")\n if f is None:\n f = \"index\"\n f, args = self.__format(f, args, extension)\n return URL(a=a, c=c, f=f, args=args, vars=link_vars)",
"metadata": "root.S3NavigationItem.url",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 847
},
{
"content": " def accessible_url(self, extension=None, **kwargs):\n \"\"\"\n Return the target URL for this item if accessible by the\n current user, otherwise False\n\n @param extension: override the format extension\n @param kwargs: override URL query vars\n \"\"\"\n\n aURL = current.auth.permission.accessible_url\n\n if not self.link:\n return None\n\n args = self.args\n if self.vars:\n link_vars = Storage(self.vars)\n link_vars.update(kwargs)\n else:\n link_vars = Storage(kwargs)\n if extension is None:\n extension = self.extension\n a = self.get(\"application\")\n if a is None:\n a = current.request.application\n c = self.get(\"controller\")\n if c is None:\n c = \"default\"\n f = self.get(\"function\")\n if f is None:\n f = \"index\"\n f, args = self.__format(f, args, extension)\n return aURL(c=c, f=f, p=self.p, a=a, t=self.tablename,\n args=args, vars=link_vars)",
"metadata": "root.S3NavigationItem.accessible_url",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 882
},
{
"content": " @staticmethod\n def __format(f, args, ext):\n \"\"\"\n Append the format extension to the last argument\n\n @param f: the function\n @param args: argument list\n @param ext: the format extension\n\n @return: tuple (f, args)\n \"\"\"\n\n if not ext or ext == \"html\":\n return f, args\n items = [f]\n if args:\n items += args\n items = [i.rsplit(\".\", 1)[0] for i in items]\n items.append(\"%s.%s\" % (items.pop(), ext))\n return (items[0], items[1:])",
"metadata": "root.S3NavigationItem.__format",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 918
},
{
"content": " def render(self, request=None):\n \"\"\"\n Perform the checks and render this item.\n\n @param request: the request object (defaults to current.request)\n \"\"\"\n\n renderer = self.renderer\n output = None\n\n if request is None:\n request = current.request\n\n if self.check_active(request):\n\n # Run the class' check_permission method\n self.authorized = self.check_permission()\n\n # Run check_selected\n self.selected = self.check_selected()\n\n # Check custom conditions (hook), these methods\n # can alter any prior flags, which can then only be\n # overridden by the class' check_enabled method\n cond = self.check_hook()\n\n if cond:\n # Run the class' check_enabled method:\n # if this returns False, then this overrides any prior status\n enabled = self.check_enabled()\n if not enabled:\n self.enabled = False\n\n # Render the item\n if renderer is not None:\n output = renderer(self)\n\n return output",
"metadata": "root.S3NavigationItem.render",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 940
},
{
"content": " def render_components(self):\n \"\"\"\n Render the components of this item and return the results as list\n \"\"\"\n\n items = []\n for c in self.components:\n i = c.render()\n if i is not None:\n if type(i) is list:\n items.extend(i)\n else:\n items.append(i)\n return items",
"metadata": "root.S3NavigationItem.render_components",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 980
},
{
"content": " def xml(self):\n \"\"\"\n Invokes the renderer and serializes the output for the web2py\n template parser, returns a string to be written to the response\n body, uses the xml() method of the renderer output, if present.\n \"\"\"\n\n output = self.render()\n if output is None:\n return \"\"\n elif hasattr(output, \"xml\"):\n return output.xml()\n else:\n return str(output)",
"metadata": "root.S3NavigationItem.xml",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 996
},
{
"content": " def set_parent(self, p=None, i=None):\n \"\"\"\n Set a parent for this item, base method for tree construction\n\n @param p: the parent\n @param i: the list index where to insert the item\n \"\"\"\n\n if p is None:\n p = self.parent\n if p is None:\n return\n parent = self.parent\n if parent is not None and parent !=p:\n while self in parent.components:\n parent.components.remove(self)\n if i is not None:\n p.component.insert(i, self)\n else:\n p.components.append(self)\n self.parent = p\n return",
"metadata": "root.S3NavigationItem.set_parent",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1014
},
{
"content": " def append(self, item=None):\n \"\"\"\n Append a component\n\n @param item: the component\n \"\"\"\n\n if item is not None:\n if type(item) is list:\n for i in item:\n self.append(i)\n else:\n item.set_parent(self)\n return self",
"metadata": "root.S3NavigationItem.append",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1038
},
{
"content": " def insert(self, i, item=None):\n \"\"\"\n Insert a component item at position i\n\n @param i: the index position\n @param item: the component item\n \"\"\"\n\n if item is not None:\n item.set_parent(self, i=i)\n return self",
"metadata": "root.S3NavigationItem.insert",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1054
},
{
"content": " def extend(self, items):\n \"\"\"\n Extend this item with a list of components\n\n @param items: list of component items\n \"\"\"\n\n if items:\n for item in items:\n self.append(item)\n return self",
"metadata": "root.S3NavigationItem.extend",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1067
},
{
"content": " def __call__(self, *components):\n \"\"\"\n Convenience shortcut for extend\n\n @param components: list of components\n \"\"\"\n\n self.extend(components)\n return self",
"metadata": "root.S3NavigationItem.__call__",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1080
},
{
"content": " def __add__(self, items):\n \"\"\"\n Append component items to this item\n\n @param items: the items to append\n \"\"\"\n\n if isinstance(items, (list, tuple)):\n self.extend(items)\n else:\n self.append(items)\n return self",
"metadata": "root.S3NavigationItem.__add__",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1091
},
{
"content": " def __getitem__(self, i):\n \"\"\"\n Get the component item at position i\n\n @param i: the index of the component item\n \"\"\"\n\n return self.components.__getitem__(i)",
"metadata": "root.S3NavigationItem.__getitem__",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1107
},
{
"content": " def __setitem__(self, i, item):\n \"\"\"\n Overwrite the component item at position i with item\n\n @param i: the index within the component list\n @param item: the item\n \"\"\"\n\n self.components.__setitem__(i, item)",
"metadata": "root.S3NavigationItem.__setitem__",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1117
},
{
"content": " def pop(self, i=-1):\n \"\"\"\n Return the component at index i and remove it from the list\n\n @param i: the component index\n \"\"\"\n\n return self.components.pop(i)",
"metadata": "root.S3NavigationItem.pop",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1128
},
{
"content": " def get_root(self):\n \"\"\"\n Get the top level item of this navigation tree\n \"\"\"\n\n parent = self.parent\n if parent:\n return parent.get_root()\n else:\n return self",
"metadata": "root.S3NavigationItem.get_root",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1138
},
{
"content": " def path(self, sub=None):\n \"\"\"\n Get the full path to this item (=a list of items from the root\n item down to this item).\n \"\"\"\n\n path = [self]\n if sub:\n path.extend(sub)\n if self.parent:\n return self.parent.path(sub=path)\n else:\n return path",
"metadata": "root.S3NavigationItem.path",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1150
},
{
"content": " def get_all(self, **flags):\n \"\"\"\n Get all components with these flags\n\n @param flags: dictionary of flags\n \"\"\"\n\n items = []\n for item in self.components:\n if not flags or \\\n all([getattr(item, f) == flags[f] for f in flags]):\n items.append(item)\n return items",
"metadata": "root.S3NavigationItem.get_all",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1165
},
{
"content": " def get_first(self, **flags):\n \"\"\"\n Get the first component item with these flags\n\n @param flags: dictionary of flags\n \"\"\"\n\n for item in self.components:\n if not flags or \\\n all([getattr(item, f) == flags[f] for f in flags]):\n return item\n return None",
"metadata": "root.S3NavigationItem.get_first",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1180
},
{
"content": " def get_last(self, **flags):\n \"\"\"\n Get the first component item with these flags\n\n @param flags: dictionary of flags\n \"\"\"\n\n components = list(self.components)\n components.reverse()\n for item in components:\n if not flags or \\\n all([getattr(item, f) == flags[f] for f in flags]):\n return item\n return None",
"metadata": "root.S3NavigationItem.get_last",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1194
},
{
"content": " def __len__(self):\n \"\"\" The total number of components of this item \"\"\"\n\n return len(self.components)",
"metadata": "root.S3NavigationItem.__len__",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1212
},
{
"content": " def __nonzero__(self):\n \"\"\"\n To be used instead of __len__ to determine the boolean value\n if this item, should always return True for instances\n \"\"\"\n\n return self is not None",
"metadata": "root.S3NavigationItem.__nonzero__",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1218
},
{
"content": " def index(self, item):\n \"\"\"\n Get the index of a component item within the component list\n\n @param item: the item\n \"\"\"\n\n return self.components.index(item)",
"metadata": "root.S3NavigationItem.index",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1227
},
{
"content": " def pos(self):\n \"\"\"\n Get the position of this item within the parent's component\n list, reverse method for index()\n \"\"\"\n\n if self.parent:\n return self.parent.index(self)\n else:\n return None",
"metadata": "root.S3NavigationItem.pos",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1237
},
{
"content": " def is_first(self, **flags):\n \"\"\"\n Check whether this is the first item within the parent's\n components list with these flags\n\n @param flags: dictionary of flags\n \"\"\"\n\n if not flags:\n return len(self.preceding()) == 0\n if not all([getattr(self, f) == flags[f] for f in flags]):\n return False\n preceding = self.preceding()\n if preceding:\n for item in preceding:\n if all([getattr(item, f) == flags[f] for f in flags]):\n return False\n return True",
"metadata": "root.S3NavigationItem.is_first",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1249
},
{
"content": " def is_last(self, **flags):\n \"\"\"\n Check whether this is the last item within the parent's\n components list with these flags\n\n @param flags: dictionary of flags\n \"\"\"\n\n if not flags:\n return len(self.following()) == 0\n if not all([getattr(self, f) == flags[f] for f in flags]):\n return False\n following = self.following()\n if following:\n for item in following:\n if all([getattr(item, f) == flags[f] for f in flags]):\n return False\n return True",
"metadata": "root.S3NavigationItem.is_last",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1269
},
{
"content": " def preceding(self):\n \"\"\" Get the preceding siblings within the parent's component list \"\"\"\n\n parent = self.parent\n if parent:\n pos = self.pos()\n if pos is not None:\n return parent.components[:pos]\n return []",
"metadata": "root.S3NavigationItem.preceding",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1289
},
{
"content": " def following(self):\n \"\"\" Get the following siblings within the parent's component list \"\"\"\n\n parent = self.parent\n if parent:\n items = parent.components\n pos = self.pos()\n if pos is not None:\n pos = pos + 1\n if pos < len(items):\n return items[pos:]\n return []",
"metadata": "root.S3NavigationItem.following",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1300
},
{
"content": " def get_prev(self, **flags):\n \"\"\"\n Get the previous item in the parent's component list with these\n flags\n\n @param flags: dictionary of flags\n \"\"\"\n\n preceding = self.preceding()\n preceding.reverse()\n for item in preceding:\n if not flags or \\\n all([getattr(item, f) == flags[f] for f in flags]):\n return item\n return None",
"metadata": "root.S3NavigationItem.get_prev",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1314
},
{
"content": " def get_next(self, **flags):\n \"\"\"\n Get the next item in the parent's component list with these flags\n\n @param flags: dictionary of flags\n \"\"\"\n\n following = self.following()\n for item in following:\n if not flags or \\\n all([getattr(item, f) == flags[f] for f in flags]):\n return item\n return None",
"metadata": "root.S3NavigationItem.get_next",
"header": "['class', 'S3NavigationItem', '(', 'object', ')', ':', '___EOS___']",
"index": 1331
},
{
"content": "class S3ScriptItem(S3NavigationItem):\n \"\"\"\n Simple Navigation Item just for injecting scripts into HTML forms\n \"\"\"\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------\n\n # -------------------------------------------------------------------------",
"metadata": "root.S3ScriptItem",
"header": "['module', '___EOS___']",
"index": 1642
},
{
"content": " def __init__(self,\n script=None,\n **attributes):\n \"\"\"\n @param script: script to inject into jquery_ready when rendered\n \"\"\"\n\n self.script = script\n return super(S3ScriptItem, self).__init__(attributes)",
"metadata": "root.S3ScriptItem.__init__",
"header": "['class', 'S3ScriptItem', '(', 'S3NavigationItem', ')', ':', '___EOS___']",
"index": 1648
},
{
"content": " def xml(self):\n \"\"\"\n Injects associated script into jquery_ready.\n \"\"\"\n\n if self.script:\n current.response.s3.jquery_ready.append(self.script)\n return \"\"",
"metadata": "root.S3ScriptItem.xml",
"header": "['class', 'S3ScriptItem', '(', 'S3NavigationItem', ')', ':', '___EOS___']",
"index": 1659
},
{
"content": " @staticmethod\n def inline(item):\n \"\"\"\n Present to ensure that script injected even in inline forms\n \"\"\"\n\n return \"\"",
"metadata": "root.S3ScriptItem.inline",
"header": "['class', 'S3ScriptItem', '(', 'S3NavigationItem', ')', ':', '___EOS___']",
"index": 1669
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Signature_",
"mismatch_",
"in_",
"overrid",
"ing_",
"method_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Base",
" ",
"class",
" ",
"and",
" ",
"API",
" ",
"for",
" ",
"navigation",
" ",
"items",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Navigat",
"ion",
" ",
"items",
" ",
"are",
" ",
"GU",
"I",
" ",
"element",
"s",
" ",
"to",
" ",
"navigate",
" ",
"the",
" ",
"applica",
"tion",
",",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"typical",
"ly",
" ",
"represent",
"ed",
" ",
"as",
" ",
"hyperlink",
"s",
".",
" ",
"Bes",
"ides",
" ",
"form",
" ",
"element",
"s",
",",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"navigation",
" ",
"items",
" ",
"are",
" ",
"most",
" ",
"common",
" ",
"type",
" ",
"of",
" ",
"GU",
"I",
" ",
"controls",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"base",
" ",
"class",
" ",
"can",
" ",
"be",
" ",
"used",
" ",
"to",
" ",
"implement",
" ",
"bot",
"h",
" ",
"nag",
"iva",
"tion",
" ",
"items",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"and",
" ",
"navigation",
" ",
"item",
" ",
"container",
"s",
" ",
"(",
"e",
".",
"g",
".",
" ",
"menus",
"),",
" ",
"each",
" ",
"as",
" ",
"subclasses",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Subc",
"lasse",
"s",
" ",
"shou",
"ld",
" ",
"implement",
" ",
"the",
" ",
"layout",
"()",
" ",
"method",
" ",
"to",
" ",
"render",
" ",
"the",
" ",
"item",
" ",
"as",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"HTM",
"L",
" ",
"(",
"ideal",
"ly",
" ",
"usi",
"ng",
" ",
"the",
" ",
"web",
"2py",
" ",
"help",
"ers",
").",
" ",
"There",
" ",
"is",
" ",
"no",
" ",
"default",
" ",
"layout",
",",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"items",
" ",
"will",
" ",
"not",
" ",
"be",
" ",
"render",
"ed",
" ",
"at",
" ",
"all",
" ",
"unl",
"ess",
" ",
"the",
" ",
"subclass",
" ",
"implement",
"s",
" ",
"a",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"layout",
" ",
"method",
" ",
"or",
" ",
"the",
" ",
"partic",
"ular",
" ",
"instance",
" ",
"receive",
"s",
" ",
"a",
" ",
"render",
"er",
" ",
"as",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"parameter",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Addition",
"ally",
",",
" ",
"subclasses",
" ",
"shou",
"ld",
" ",
"implement",
" ",
"the",
" ",
"check",
"\\u*",
"()",
" ",
"method",
"s",
":",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Meth",
"od",
":",
" ",
" ",
" ",
" ",
" ",
"Check",
"s",
" ",
"whe",
"ther",
":",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"check",
"\\u",
"active",
" ",
" ",
" ",
" ",
"this",
" ",
"item",
" ",
"belo",
"ngs",
" ",
"to",
" ",
"the",
" ",
"request",
"ed",
" ",
"page",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"check",
"\\u",
"enable",
"d",
" ",
" ",
" ",
"this",
" ",
"item",
" ",
"is",
" ",
"enable",
"d",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"check",
"\\u",
"permissi",
"on",
" ",
" ",
" ",
" ",
"the",
" ",
"user",
" ",
"is",
" ",
"permit",
"ted",
" ",
"to",
" ",
"access",
" ",
"this",
" ",
"item",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"check",
"\\u",
"selecte",
"d",
" ",
" ",
"the",
" ",
"item",
" ",
"has",
" ",
"bee",
"n",
" ",
"selecte",
"d",
" ",
"to",
" ",
"request",
" ",
"the",
" ",
"page",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"check",
"\\u",
"active",
" ",
"is",
" ",
"the",
" ",
"first",
" ",
"check",
" ",
"run",
",",
" ",
"and",
" ",
"the",
" ",
"only",
" ",
"method",
" ",
"tha",
"t",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"actual",
"ly",
" ",
"deactivate",
"s",
" ",
"the",
" ",
"item",
" ",
"complete",
"ly",
",",
" ",
"where",
"as",
" ",
"the",
" ",
"other",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"method",
"s",
" ",
"just",
" ",
"set",
" ",
"flags",
" ",
"for",
" ",
"the",
" ",
"render",
"er",
".",
" ",
"All",
" ",
"of",
" ",
"these",
" ",
"method",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"must",
" ",
"return",
" ",
"Tru",
"e",
" ",
"or",
" ",
"Fal",
"se",
" ",
"for",
" ",
"the",
" ",
"respec",
"tiv",
"e",
" ",
"condition",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"There",
" ",
"are",
" ",
"default",
" ",
"check",
"\\u*",
"()",
" ",
"method",
"s",
" ",
"in",
" ",
"this",
" ",
"base",
" ",
"class",
" ",
"whi",
"ch",
" ",
"support",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"a",
" ",
"menu",
"-",
"ali",
"ke",
" ",
"behavior",
" ",
"of",
" ",
"the",
" ",
"item",
" ",
"-",
" ",
"whi",
"ch",
" ",
"may",
" ",
"tho",
"ugh",
" ",
"not",
" ",
"fit",
" ",
"for",
" ",
"all",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"navigation",
" ",
"element",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"For",
" ",
"more",
" ",
"deta",
"il",
"s",
",",
" ",
"see",
" ",
"the",
" ",
"S",
"3",
"Navigat",
"ion",
" ",
"wiki",
" ",
"page",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"http",
"://",
"eden",
".",
"sa",
"han",
"af",
"ound",
"ation",
".",
"org",
"/",
"wiki",
"/",
"S",
"3",
"/",
"S",
"3",
"Navigat",
"ion",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Construct",
"ion_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Check",
" ",
"methods_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Ta",
"g",
" ",
"method",
"s",
",",
" ",
"allow",
"s",
" ",
"to",
" ",
"enable",
"/",
"disable",
"/",
"alter",
" ",
"items",
" ",
"by",
" ",
"tag_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Activat",
"ion",
" ",
"methods_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Representation",
" ",
"methods_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tree",
" ",
"constructi",
"on",
" ",
"methods_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tree",
" ",
"introspect",
"ion",
" ",
"and",
" ",
"manipulati",
"on",
" ",
"methods_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"List",
" ",
"methods_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"label_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"c_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"f_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"args_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"vars_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"extension_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"a_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"r_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"m_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"p_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"t_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"url_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"tags_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"parent_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"translate_",
"=_",
"True_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"layout_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"restrict",
"_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"link_",
"=_",
"True_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"mandatory_",
"=_",
"False_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"ltr",
"_",
"=_",
"False_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"**_",
"attributes_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Constructor",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"label",
":",
" ",
"the",
" ",
"label",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"c",
":",
" ",
"the",
" ",
"controlle",
"r",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"f",
":",
" ",
"the",
" ",
"function",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"args",
":",
" ",
"the",
" ",
"argu",
"ment",
"s",
" ",
"list",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"vars",
":",
" ",
"the",
" ",
"variab",
"les",
" ",
"Stor",
"age",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"extensi",
"on",
":",
" ",
"the",
" ",
"request",
" ",
"extensi",
"on",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"a",
":",
" ",
"the",
" ",
"applica",
"tion",
" ",
"(",
"default",
"s",
" ",
"to",
" ",
"current",
".",
"request",
".",
"applica",
"tion",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"r",
":",
" ",
"the",
" ",
"request",
" ",
"to",
" ",
"default",
" ",
"to",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"m",
":",
" ",
"the",
" ",
"URL",
" ",
"method",
" ",
"(",
"will",
" ",
"be",
" ",
"append",
"ed",
" ",
"to",
" ",
"args",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"p",
":",
" ",
"the",
" ",
"method",
" ",
"to",
" ",
"check",
" ",
"authoriz",
"ation",
" ",
"for",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"(",
"will",
" ",
"not",
" ",
"be",
" ",
"append",
"ed",
" ",
"to",
" ",
"args",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"t",
":",
" ",
"the",
" ",
"table",
" ",
"concern",
"ed",
" ",
"by",
" ",
"this",
" ",
"request",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"(",
"override",
"s",
" ",
"c\\u",
"f",
" ",
"for",
" ",
"auth",
")",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"url",
":",
" ",
"a",
" ",
"URL",
" ",
"to",
" ",
"use",
" ",
"inst",
"ead",
" ",
"of",
" ",
"buildi",
"ng",
" ",
"one",
" ",
"manu",
"ally",
"\\",
"10",
";",
" ",
" ",
"-",
" ",
"e",
".",
"g",
".",
" ",
"for",
" ",
"external",
" ",
"webs",
"ites",
" ",
"or",
" ",
"mail",
"to",
":",
" ",
"link",
"s",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"tags",
":",
" ",
"list",
" ",
"of",
" ",
"tags",
" ",
"for",
" ",
"this",
" ",
"item",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"parent",
":",
" ",
"the",
" ",
"parent",
" ",
"item",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"translat",
"e",
":",
" ",
"translat",
"e",
" ",
"the",
" ",
"label",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"layout",
":",
" ",
"the",
" ",
"layout",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"check",
":",
" ",
"a",
" ",
"condition",
" ",
"or",
" ",
"list",
" ",
"of",
" ",
"condition",
"s",
" ",
"to",
" ",
"automati",
"call",
"y",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"enable",
"/",
"disable",
" ",
"this",
" ",
"item",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"restrict",
":",
" ",
"restrict",
" ",
"to",
" ",
"role",
"s",
" ",
"(",
"role",
" ",
"UI",
"D",
" ",
"or",
" ",
"list",
" ",
"of",
" ",
"role",
" ",
"UI",
"Ds",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"link",
":",
" ",
"item",
" ",
"has",
" ",
"its",
" ",
"own",
" ",
"URL",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"mandat",
"ory",
":",
" ",
"item",
" ",
"is",
" ",
"alw",
"ay",
"s",
" ",
"active",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"ltr",
":",
" ",
"item",
" ",
"is",
" ",
"alw",
"ay",
"s",
" ",
"render",
"ed",
" ",
"LT",
"R",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"attribute",
"s",
":",
" ",
"attribute",
"s",
" ",
"to",
" ",
"use",
" ",
"in",
" ",
"layout",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Label_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"isinstance_",
"(_",
"label_",
",_",
"basestring_",
")_",
"and_",
"translate_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"label_",
"=_",
"current_",
"._",
"T_",
"(_",
"label_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"label_",
"=_",
"label_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Register",
" ",
"tags_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"tags_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"type_",
"(_",
"tags_",
")_",
"is_",
"not_",
"list_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"tags_",
"=_",
"[_",
"tags_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"tags_",
"=_",
"tags_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"tags_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Request",
" ",
"parameters_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"r_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"r_",
"=_",
"r_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"a_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"a_",
"=_",
"r_",
"._",
"application_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"c_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"c_",
"=_",
"r_",
"._",
"controller_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"f_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"=_",
"r_",
"._",
"function_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"args_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"args_",
"=_",
"r_",
"._",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"vars_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"vars_",
"=_",
"r_",
"._",
"vars_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"r_",
"=_",
"current_",
"._",
"request_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Applica",
"tion",
",",
" ",
"controlle",
"r",
",",
" ",
"function",
",",
" ",
"args",
",",
" ",
"vars",
",",
" ",
"extension_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"application_",
"=_",
"a_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"isinstance_",
"(_",
"c_",
",_",
"(_",
"list_",
",_",
"tuple_",
")_",
")_",
"and_",
"len_",
"(_",
"c_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"controller_",
"=_",
"c_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"match",
"\\u",
"controller_",
"=_",
"c_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"controller_",
"=_",
"c_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"match",
"\\u",
"controller_",
"=_",
"[_",
"c_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"isinstance_",
"(_",
"f_",
",_",
"(_",
"list_",
",_",
"tuple_",
")_",
")_",
"and_",
"len_",
"(_",
"f_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"function_",
"=_",
"f_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"match",
"\\u",
"function_",
"=_",
"f_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"function_",
"=_",
"f_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"match",
"\\u",
"function_",
"=_",
"[_",
"f_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"args_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"args_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"isinstance_",
"(_",
"args_",
",_",
"str_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"args_",
"=_",
"args_",
"._",
"split_",
"(_",
"\"/\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"args_",
"=_",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"vars_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"vars_",
"=_",
"vars_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"vars_",
"=_",
"Storage_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"extension_",
"=_",
"extension_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Table",
" ",
"and",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"tablename_",
"=_",
"t_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"method_",
"=_",
"m_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"m_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"len_",
"(_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"args_",
"=_",
"[_",
"m_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"args_",
"[_",
"-_",
"1_",
"]_",
"!=_",
"m_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"args_",
"._",
"append_",
"(_",
"m_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"p_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"p_",
"=_",
"p_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"p_",
"=_",
"m_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"override",
"\\u",
"url_",
"=_",
"url_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Lay",
"out",
" ",
"attribute",
"s",
" ",
"and",
" ",
"options_",
"\\u\\u\\uNL\\u\\u\\u_",
"attr_",
"=_",
"Storage_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"opts_",
"=_",
"Storage_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"k_",
",_",
"v_",
"in_",
"attributes_",
"._",
"iteritems_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"k_",
"[_",
"0_",
"]_",
"==_",
"\"\\u\"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"attr_",
"[_",
"k_",
"]_",
"=_",
"v_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"opts_",
"[_",
"k_",
"]_",
"=_",
"v_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"attr_",
"=_",
"attr_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"opts_",
"=_",
"opts_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Initializ",
"e",
" ",
"parent",
" ",
"and",
" ",
"components_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"parent_",
"=_",
"parent_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"components_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Flags_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"enabled_",
"=_",
"True_",
"#",
" ",
"Item",
" ",
"is",
" ",
"enable",
"d",
"/",
"disabled_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"selected_",
"=_",
"None_",
"#",
" ",
"Item",
" ",
"is",
" ",
"in",
" ",
"the",
" ",
"current",
" ",
"selecte",
"d",
"-",
"path_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"visible_",
"=_",
"None_",
"#",
" ",
"Item",
" ",
"is",
" ",
"visible_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"link_",
"=_",
"link_",
"#",
" ",
"Item",
" ",
"sha",
"ll",
" ",
"be",
" ",
"linked_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"mandatory_",
"=_",
"mandatory_",
"#",
" ",
"Item",
" ",
"is",
" ",
"alw",
"ay",
"s",
" ",
"active_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"ltr",
"_",
"=_",
"ltr",
"_",
"#",
" ",
"Item",
" ",
"is",
" ",
"alw",
"ay",
"s",
" ",
"render",
"ed",
" ",
"LT",
"R_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Ro",
"le",
" ",
"restriction",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"restrict",
"_",
"=_",
"restrict",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"restrict",
"_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"isinstance_",
"(_",
"restrict",
"_",
",_",
"(_",
"list_",
",_",
"tuple_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"restrict",
"_",
"=_",
"[_",
"restrict",
"_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Hook",
" ",
"in",
" ",
"custom",
"-",
"checks_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"check_",
"=_",
"check_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Set",
" ",
"the",
" ",
"render",
"er",
" ",
"(",
"override",
" ",
"with",
" ",
"set\\u",
"layout",
"())",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"renderer_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"layout_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Custom",
" ",
"layout",
" ",
"for",
" ",
"this",
" ",
"partic",
"ular",
" ",
"instance_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"renderer_",
"=_",
"layout_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"hasattr_",
"(_",
"self_",
"._",
"\\u\\u",
"class\\u\\u_",
",_",
"\"",
"OVERRIDE",
"\"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Them",
"e",
" ",
"layout_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"renderer_",
"=_",
"self_",
"._",
"get",
"\\u",
"layout_",
"(_",
"self_",
"._",
"OVERRIDE",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"renderer_",
"is_",
"None_",
"and_",
"hasattr_",
"(_",
"self_",
"._",
"\\u\\u",
"class\\u\\u_",
",_",
"\"",
"layout",
"\"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Default",
" ",
"layout_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"renderer_",
"=_",
"self_",
"._",
"layout_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"renderer_",
"=_",
"renderer_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"staticmethod_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"get",
"\\u",
"layout_",
"(_",
"name_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Check",
" ",
"whe",
"ther",
" ",
"the",
" ",
"current",
" ",
"them",
"e",
" ",
"has",
" ",
"a",
" ",
"custom",
" ",
"layout",
" ",
"for",
" ",
"this",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"class",
",",
" ",
"and",
" ",
"if",
" ",
"so",
",",
" ",
"store",
" ",
"it",
" ",
"in",
" ",
"current",
".",
"layouts",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
":",
" ",
"the",
" ",
"name",
" ",
"of",
" ",
"the",
" ",
"custom",
" ",
"layout",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"return",
":",
" ",
"the",
" ",
"layout",
" ",
"or",
" ",
"Non",
"e",
" ",
"if",
" ",
"not",
" ",
"presen",
"t",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"hasattr_",
"(_",
"current_",
",_",
"\"",
"layouts",
"\"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"layouts",
"_",
"=_",
"current_",
"._",
"layouts",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"layouts",
"_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"layouts",
"_",
"is_",
"False_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"name_",
"in_",
"layouts",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"layouts",
"_",
"[_",
"name_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tr",
"y",
" ",
"to",
" ",
"find",
" ",
"custom",
" ",
"layout",
" ",
"in",
" ",
"theme_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"application_",
"=_",
"current_",
"._",
"request_",
"._",
"application_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"settings_",
"=_",
"current_",
"._",
"deploy",
"ment",
"\\u",
"settings_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"theme_",
"=_",
"settings_",
"._",
"get",
"\\u",
"theme_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"them",
"e\\u",
"location_",
"=_",
"current_",
"._",
"response_",
"._",
"s3_",
"._",
"them",
"e\\u",
"location_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"them",
"e\\u",
"location_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"them",
"e\\u",
"location_",
"=_",
"\"%",
"s",
".\"_",
"%_",
"them",
"e\\u",
"location_",
"[_",
":_",
"-_",
"1_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"package_",
"=_",
"\"",
"applica",
"tion",
"s",
".",
"%",
"s",
".",
"module",
"s",
".",
"template",
"s",
".",
"%",
"s",
"%",
"s",
".",
"layouts",
"\"_",
"%_",
"(_",
"application_",
",_",
"them",
"e\\u",
"location_",
",_",
"theme_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"override_",
"=_",
"getattr_",
"(_",
"\\u\\u",
"import\\u\\u_",
"(_",
"package_",
",_",
"froml",
"ist_",
"=_",
"[_",
"name_",
"]_",
")_",
",_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Import",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"No",
" ",
"layouts",
" ",
"in",
" ",
"them",
"e",
" ",
"-",
" ",
"no",
" ",
"point",
" ",
"to",
" ",
"try",
" ",
"again",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"current_",
"._",
"layouts",
"_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Attribute",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"override_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"override_",
"and_",
"hasattr_",
"(_",
"override_",
",_",
"\"",
"layout",
"\"_",
")_",
"and_",
"type_",
"(_",
"override_",
"._",
"layout_",
")_",
"==_",
"type_",
"(_",
"lambda_",
":_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"layout_",
"=_",
"override_",
"._",
"layout_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"layout_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"layouts",
"_",
"[_",
"name_",
"]_",
"=_",
"layout_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"current_",
"._",
"layouts",
"_",
"=_",
"layouts",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"layout_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"clone_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Clone",
" ",
"this",
" ",
"item",
" ",
"and",
" ",
"its",
" ",
"component",
"s",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"item_",
"=_",
"self_",
"._",
"\\u\\u",
"class\\u\\u_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"._",
"label_",
"=_",
"self_",
"._",
"label_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"._",
"tags_",
"=_",
"self_",
"._",
"tags_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"item_",
"._",
"r_",
"=_",
"self_",
"._",
"r_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"item_",
"._",
"application_",
"=_",
"self_",
"._",
"application_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"._",
"controller_",
"=_",
"self_",
"._",
"controller_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"._",
"function_",
"=_",
"self_",
"._",
"function_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"item_",
"._",
"match",
"\\u",
"controller_",
"=_",
"[_",
"c_",
"for_",
"c_",
"in_",
"self_",
"._",
"match",
"\\u",
"controller_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"._",
"match",
"\\u",
"function_",
"=_",
"[_",
"f_",
"for_",
"f_",
"in_",
"self_",
"._",
"match",
"\\u",
"function_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"item_",
"._",
"args_",
"=_",
"[_",
"a_",
"for_",
"a_",
"in_",
"self_",
"._",
"args_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"._",
"vars_",
"=_",
"Storage_",
"(_",
"**_",
"self_",
"._",
"vars_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"item_",
"._",
"extension_",
"=_",
"self_",
"._",
"extension_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"._",
"tablename_",
"=_",
"self_",
"._",
"tablename_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"._",
"method_",
"=_",
"self_",
"._",
"method_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"._",
"p_",
"=_",
"self_",
"._",
"p_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"item_",
"._",
"override",
"\\u",
"url_",
"=_",
"self_",
"._",
"override",
"\\u",
"url_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"item_",
"._",
"attr_",
"=_",
"Storage_",
"(_",
"**_",
"self_",
"._",
"attr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"._",
"opts_",
"=_",
"Storage_",
"(_",
"**_",
"self_",
"._",
"opts_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"item_",
"._",
"parent_",
"=_",
"self_",
"._",
"parent_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"._",
"components_",
"=_",
"[_",
"i_",
"._",
"clone_",
"(_",
")_",
"for_",
"i_",
"in_",
"self_",
"._",
"components_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"item_",
"._",
"enabled_",
"=_",
"self_",
"._",
"enabled_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"._",
"selected_",
"=_",
"self_",
"._",
"selected_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"._",
"visible_",
"=_",
"self_",
"._",
"visible_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"._",
"link_",
"=_",
"self_",
"._",
"link_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"._",
"mandatory_",
"=_",
"self_",
"._",
"mandatory_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"self_",
"._",
"restrict",
"_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"item_",
"._",
"restrict",
"_",
"=_",
"[_",
"r_",
"for_",
"r_",
"in_",
"self_",
"._",
"restrict",
"_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"item_",
"._",
"restrict",
"_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"item_",
"._",
"check_",
"=_",
"self_",
"._",
"check_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"item_",
"._",
"renderer_",
"=_",
"self_",
"._",
"renderer_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"item_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"check",
"\\u",
"active_",
"(_",
"self_",
",_",
"request_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Check",
" ",
"whe",
"ther",
" ",
"this",
" ",
"item",
" ",
"belo",
"ngs",
" ",
"to",
" ",
"the",
" ",
"request",
"ed",
" ",
"page",
" ",
"(",
"request",
").",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"If",
" ",
"this",
" ",
"check",
" ",
"return",
"s",
" ",
"Fal",
"se",
",",
" ",
"then",
" ",
"the",
" ",
"item",
" ",
"will",
" ",
"be",
" ",
"deactivate",
"d",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"entire",
"ly",
",",
" ",
"i",
".",
"e",
".",
" ",
"no",
" ",
"fur",
"ther",
" ",
"checks",
" ",
"will",
" ",
"be",
" ",
"run",
" ",
"and",
" ",
"the",
" ",
"render",
"er",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"will",
" ",
"neve",
"r",
" ",
"be",
" ",
"call",
"ed",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"request",
":",
" ",
"the",
" ",
"request",
" ",
"object",
" ",
"(",
"default",
"s",
" ",
"to",
" ",
"current",
".",
"request",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Dea",
"ctivat",
"e",
" ",
"the",
" ",
"item",
" ",
"if",
" ",
"its",
" ",
"target",
" ",
"controlle",
"r",
" ",
"is",
" ",
"deactivate",
"d_",
"\\u\\u\\uNL\\u\\u\\u_",
"c_",
"=_",
"self_",
"._",
"get_",
"(_",
"\"",
"controlle",
"r",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"c_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"current_",
"._",
"deploy",
"ment",
"\\u",
"settings_",
"._",
"has",
"\\u",
"module_",
"(_",
"c_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Fall",
" ",
"back",
" ",
"to",
" ",
"current",
".",
"request_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"request_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"request_",
"=_",
"current_",
"._",
"request_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"parent_",
"=_",
"self_",
"._",
"parent_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"parent_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"For",
" ",
"component",
" ",
"items",
",",
" ",
"the",
" ",
"parent",
"'",
"s",
" ",
"status",
" ",
"appli",
"es_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"parent_",
"._",
"check",
"\\u",
"active_",
"(_",
"request_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"self_",
"._",
"mandatory_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"mandat",
"ory",
" ",
"flag",
" ",
"override",
"s",
" ",
"request",
" ",
"match_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"self_",
"._",
"match_",
"(_",
"request_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"item",
" ",
"is",
" ",
"active",
" ",
"if",
" ",
"it",
" ",
"matche",
"s",
" ",
"the",
" ",
"request_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"check",
"\\u",
"enabled_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Check",
" ",
"whe",
"ther",
" ",
"this",
" ",
"item",
" ",
"is",
" ",
"enable",
"d",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"check",
" ",
"doe",
"s",
" ",
"not",
" ",
"direct",
"ly",
" ",
"disable",
" ",
"the",
" ",
"item",
",",
" ",
"but",
" ",
"rat",
"her",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"sets",
" ",
"the",
" ",
"enable",
"d",
"-",
"flag",
" ",
"in",
" ",
"the",
" ",
"item",
" ",
"whi",
"ch",
" ",
"can",
" ",
"then",
" ",
"be",
" ",
"used",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"by",
" ",
"the",
" ",
"render",
"er",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"function",
" ",
"is",
" ",
"call",
"ed",
" ",
"as",
" ",
"the",
" ",
"very",
" ",
"last",
" ",
"action",
" ",
"immediate",
"ly",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"bef",
"ore",
" ",
"render",
"ing",
" ",
"the",
" ",
"item",
".",
" ",
"If",
" ",
"it",
" ",
"return",
"s",
" ",
"Tru",
"e",
",",
" ",
"then",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"enable",
"d",
"-",
"flag",
" ",
"of",
" ",
"the",
" ",
"item",
" ",
"remains",
" ",
"unchanged",
",",
" ",
"other",
"wis",
"e",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"it",
" ",
"gets",
" ",
"set",
" ",
"to",
" ",
"Fal",
"se",
" ",
"(",
"Fal",
"se",
"-",
"override",
").",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"to",
" ",
"be",
" ",
"implemented",
" ",
"in",
" ",
"subclass",
",",
" ",
"default",
" ",
"True_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"check",
"\\u",
"permission_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Check",
" ",
"whe",
"ther",
" ",
"the",
" ",
"user",
" ",
"is",
" ",
"permit",
"ted",
" ",
"to",
" ",
"access",
" ",
"this",
" ",
"item",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"check",
" ",
"doe",
"s",
" ",
"not",
" ",
"direct",
"ly",
" ",
"disable",
" ",
"the",
" ",
"item",
",",
" ",
"but",
" ",
"rat",
"her",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"sets",
" ",
"the",
" ",
"authoriz",
"ed",
"-",
"flag",
" ",
"in",
" ",
"the",
" ",
"item",
" ",
"whi",
"ch",
" ",
"can",
" ",
"then",
" ",
"be",
" ",
"used",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"by",
" ",
"the",
" ",
"render",
"er",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"has",
"\\u",
"role_",
"=_",
"current_",
"._",
"auth_",
"._",
"s3",
"\\u",
"has",
"\\u",
"role_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"authorized_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"restrict",
"_",
"=_",
"self_",
"._",
"restrict",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"restrict",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"role_",
"in_",
"restrict",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"has",
"\\u",
"role_",
"(_",
"role_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"authorized_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"authorized_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"self_",
"._",
"accessible",
"\\u",
"url_",
"(_",
")_",
"==_",
"False_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"authorized_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"authorized_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"check",
"\\u",
"selected_",
"(_",
"self_",
",_",
"request_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Check",
" ",
"whe",
"ther",
" ",
"this",
" ",
"item",
" ",
"is",
" ",
"in",
" ",
"the",
" ",
"selecte",
"d",
" ",
"path",
" ",
"(",
"i",
".",
"e",
".",
" ",
"whe",
"ther",
" ",
"it",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"is",
" ",
"or",
" ",
"contain",
"s",
" ",
"the",
" ",
"item",
" ",
"used",
" ",
"to",
" ",
"trigger",
" ",
"the",
" ",
"request",
").",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"check",
" ",
"doe",
"sn",
"'",
"t",
" ",
"change",
" ",
"the",
" ",
"process",
"ing",
" ",
"of",
" ",
"the",
" ",
"item",
",",
" ",
"but",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"rat",
"her",
" ",
"sets",
" ",
"the",
" ",
"selecte",
"d",
"-",
"flag",
" ",
"whi",
"ch",
" ",
"can",
" ",
"then",
" ",
"be",
" ",
"used",
" ",
"by",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"render",
"er",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"If",
" ",
"this",
" ",
"is",
" ",
"a",
" ",
"top",
"-",
"level",
" ",
"item",
",",
" ",
"then",
" ",
"this",
" ",
"check",
" ",
"sets",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"selecte",
"d",
"-",
"flags",
" ",
"for",
" ",
"the",
" ",
"whole",
" ",
"selecte",
"d",
" ",
"path",
" ",
"down",
" ",
"to",
" ",
"the",
" ",
"leaf",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"item",
" ",
"tha",
"t",
" ",
"has",
" ",
"trigger",
"ed",
" ",
"the",
" ",
"request",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Not",
"e",
" ",
"tha",
"t",
" ",
"this",
" ",
"doe",
"sn",
"'",
"t",
" ",
"currentl",
"y",
" ",
"reset",
" ",
"selecte",
"d",
"-",
"flags",
",",
" ",
"so",
" ",
"this",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"check",
" ",
"can",
" ",
"be",
" ",
"perform",
"ed",
" ",
"only",
" ",
"onc",
"e",
" ",
"per",
" ",
"subtree",
" ",
"and",
" ",
"request",
".",
" ",
"If",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"it",
" ",
"wou",
"ld",
" ",
"be",
" ",
"reall",
"y",
" ",
"nec",
"cess",
"ary",
" ",
"to",
" ",
"perform",
" ",
"this",
" ",
"check",
" ",
"more",
" ",
"than",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"onc",
"e",
",",
" ",
"then",
" ",
"it",
" ",
"shou",
"ld",
" ",
"be",
" ",
"easy",
" ",
"to",
" ",
"implement",
" ",
"a",
" ",
"reset",
"\\u",
"flags",
" ",
"method",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"request",
":",
" ",
"the",
" ",
"request",
" ",
"object",
",",
" ",
"default",
"s",
" ",
"to",
" ",
"current",
".",
"request",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"self_",
"._",
"selected_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Al",
"read",
"y",
" ",
"selected_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"selected_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"request_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"request_",
"=_",
"current_",
"._",
"request_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"self_",
"._",
"parent_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"If",
" ",
"this",
" ",
"is",
" ",
"the",
" ",
"root",
" ",
"item",
",",
" ",
"then",
" ",
"set",
" ",
"the",
" ",
"selecte",
"d",
" ",
"path_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"branch_",
"=_",
"self_",
"._",
"branch_",
"(_",
"request_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"branch_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"branch_",
"._",
"select_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"self_",
"._",
"selected_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"selected_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Ot",
"her",
"wis",
"e",
":",
" ",
"check",
" ",
"the",
" ",
"root",
" ",
"item_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"root_",
"=_",
"self_",
"._",
"get",
"\\u",
"root_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"root_",
"._",
"selected_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"root_",
"._",
"check",
"\\u",
"selected_",
"(_",
"request_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"True_",
"if_",
"self_",
"._",
"selected_",
"else_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"check",
"\\u",
"hook_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Run",
" ",
"hooke",
"d",
"-",
"in",
" ",
"checks",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"cond_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"check_",
"=_",
"self_",
"._",
"check_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"check_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"isinstance_",
"(_",
"check_",
",_",
"(_",
"list_",
",_",
"tuple_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"check_",
"=_",
"[_",
"check_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"condition_",
"in_",
"check_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"callable_",
"(_",
"condition_",
")_",
"and_",
"not_",
"condition_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"cond_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"not_",
"condition_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"cond_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"cond_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"contains\\u\\u_",
"(_",
"self_",
",_",
"tag_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Check",
" ",
"whe",
"ther",
" ",
"a",
" ",
"tag",
" ",
"is",
" ",
"presen",
"t",
" ",
"in",
" ",
"any",
" ",
"item",
" ",
"of",
" ",
"the",
" ",
"subtree",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"components_",
"=_",
"self_",
"._",
"components_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"i_",
"in_",
"components_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"tag_",
"in_",
"i_",
"._",
"tags_",
"or_",
"tag_",
"in_",
"i_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"findall_",
"(_",
"self_",
",_",
"tag_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Fin",
"d",
" ",
"all",
" ",
"items",
" ",
"within",
" ",
"the",
" ",
"tree",
" ",
"with",
" ",
"the",
" ",
"specified",
" ",
"tag",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"tag",
":",
" ",
"the",
" ",
"tag",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"items_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"tag_",
"in_",
"self_",
"._",
"tags_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"items_",
"._",
"append_",
"(_",
"self_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"components_",
"=_",
"self_",
"._",
"components_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"c_",
"in_",
"components_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\\u",
"items_",
"=_",
"c_",
"._",
"findall_",
"(_",
"tag_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"items_",
"._",
"extend_",
"(_",
"\\u",
"items_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"items_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"enable_",
"(_",
"self_",
",_",
"tag_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Enable",
" ",
"items",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"tag",
":",
" ",
"enable",
" ",
"all",
" ",
"items",
" ",
"in",
" ",
"the",
" ",
"subtree",
" ",
"with",
" ",
"this",
" ",
"tag",
"\\",
"10",
";",
" ",
" ",
"(",
"no",
" ",
"tag",
" ",
"enable",
"s",
" ",
"only",
" ",
"this",
" ",
"item",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"tag_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"items_",
"=_",
"self_",
"._",
"findall_",
"(_",
"tag_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"item_",
"in_",
"items_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"item_",
"._",
"enable_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"enabled_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"disable_",
"(_",
"self_",
",_",
"tag_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Disa",
"ble",
" ",
"items",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"tag",
":",
" ",
"disable",
" ",
"all",
" ",
"items",
" ",
"in",
" ",
"the",
" ",
"subtree",
" ",
"with",
" ",
"this",
" ",
"tag",
"\\",
"10",
";",
" ",
" ",
"(",
"no",
" ",
"tag",
" ",
"disable",
"s",
" ",
"only",
" ",
"this",
" ",
"item",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"tag_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"items_",
"=_",
"self_",
"._",
"findall_",
"(_",
"tag_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"item_",
"in_",
"items_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"item_",
"._",
"disable_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"enabled_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"select_",
"(_",
"self_",
",_",
"tag_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Select",
" ",
"an",
" ",
"item",
".",
" ",
"If",
" ",
"give",
"n",
" ",
"a",
" ",
"tag",
",",
" ",
"this",
" ",
"select",
"s",
" ",
"the",
" ",
"first",
" ",
"matchi",
"ng",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"descendant",
" ",
"(",
"depth",
"-",
"first",
" ",
"search",
"),",
" ",
"other",
"wis",
"e",
" ",
"select",
"s",
" ",
"this",
" ",
"item",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Propag",
"ates",
" ",
"the",
" ",
"selection",
" ",
"up",
" ",
"the",
" ",
"path",
" ",
"to",
" ",
"the",
" ",
"root",
" ",
"item",
" ",
"(",
"inclu",
"ding",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"the",
" ",
"root",
" ",
"item",
")",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"tag",
":",
" ",
"a",
" ",
"string",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"selected_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"tag_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"parent_",
"=_",
"self_",
"._",
"parent_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"parent_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"parent_",
"._",
"select_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"deselect",
"\\u",
"all_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"selected_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"item_",
"in_",
"self_",
"._",
"components_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"selected_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"selected_",
"=_",
"item_",
"._",
"select_",
"(_",
"tag_",
"=_",
"tag_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"item_",
"._",
"deselect",
"\\u",
"all_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"selected_",
"and_",
"tag_",
"in_",
"self_",
"._",
"tags_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"selected_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"selected_",
"=_",
"selected_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"selected_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"deselect",
"\\u",
"all_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"De",
"-",
"select",
" ",
"this",
" ",
"item",
" ",
"and",
" ",
"all",
" ",
"its",
" ",
"descendants",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"selected_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"item_",
"in_",
"self_",
"._",
"components_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"item_",
"._",
"deselect",
"\\u",
"all_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"set\\u",
"layout_",
"(_",
"self_",
",_",
"layout_",
",_",
"recursive_",
"=_",
"False_",
",_",
"tag_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Alter",
" ",
"the",
" ",
"render",
"er",
" ",
"for",
" ",
"a",
" ",
"tagg",
"ed",
" ",
"subse",
"t",
" ",
"of",
" ",
"items",
" ",
"in",
" ",
"the",
" ",
"subtree",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"layout",
":",
" ",
"the",
" ",
"layout",
" ",
"(",
"render",
"er",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"recurs",
"ive",
":",
" ",
"set",
" ",
"this",
" ",
"layout",
" ",
"recurs",
"ively",
" ",
"for",
" ",
"the",
" ",
"subtree",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"tag",
":",
" ",
"set",
" ",
"this",
" ",
"layout",
" ",
"only",
" ",
"for",
" ",
"items",
" ",
"with",
" ",
"this",
" ",
"tag",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"layout_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"tag_",
"is_",
"None_",
"or_",
"tag_",
"in_",
"self_",
"._",
"tags_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"renderer_",
"=_",
"layout_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"recursive_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"c_",
"in_",
"self_",
"._",
"components_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"if_",
"tag_",
"is_",
"None_",
"or_",
"tag_",
"in_",
"c_",
"._",
"tags_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"c_",
"._",
"set\\u",
"layout_",
"(_",
"layout_",
",_",
"recursive_",
"=_",
"recursive_",
",_",
"tag_",
"=_",
"tag_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get_",
"(_",
"self_",
",_",
"name_",
",_",
"default_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Get",
" ",
"a",
" ",
"Pyth",
"on",
"-",
"attribute",
" ",
"of",
" ",
"this",
" ",
"item",
" ",
"instance",
",",
" ",
"fall",
"s",
" ",
"back",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"to",
" ",
"the",
" ",
"same",
" ",
"attribute",
" ",
"in",
" ",
"the",
" ",
"parent",
" ",
"item",
" ",
"if",
" ",
"not",
" ",
"set",
" ",
"in",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"this",
" ",
"instance",
",",
" ",
"used",
" ",
"to",
" ",
"inherit",
" ",
"attribute",
"s",
" ",
"to",
" ",
"component",
"s",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"name",
":",
" ",
"the",
" ",
"attribute",
" ",
"name",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"name_",
"in_",
"self_",
"._",
"\\u\\u",
"dict\\u\\u_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"value_",
"=_",
"self_",
"._",
"\\u\\u",
"dict\\u\\u_",
"[_",
"name_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"value_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"value_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"name_",
"[_",
":_",
"2_",
"]_",
"==_",
"\"\\u\\u",
"\"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Attribute",
"Error_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"parent_",
"=_",
"self_",
"._",
"parent_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"parent_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"parent_",
"._",
"get_",
"(_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"default_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"match_",
"(_",
"self_",
",_",
"request_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Match",
" ",
"this",
" ",
"item",
" ",
"against",
" ",
"request",
" ",
"(",
"use",
"s",
" ",
"GET",
" ",
"vars",
")",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"request",
":",
" ",
"the",
" ",
"request",
" ",
"object",
" ",
"(",
"default",
"s",
" ",
"to",
" ",
"current",
".",
"request",
")",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"return",
":",
" ",
"the",
" ",
"match",
" ",
"level",
" ",
"(",
"integ",
"er",
"):",
"\\",
"10",
";",
" ",
" ",
"0",
"=",
"no",
" ",
"match",
"\\",
"10",
";",
" ",
" ",
"1",
"=",
"controlle",
"r",
"\\",
"10",
";",
" ",
" ",
"2",
"=",
"controlle",
"r",
"+",
"function",
"\\",
"10",
";",
" ",
" ",
"3",
"=",
"controlle",
"r",
"+",
"function",
"+",
"args",
"\\",
"10",
";",
" ",
" ",
"4",
"=",
"controlle",
"r",
"+",
"function",
"+",
"args",
"+",
"vars",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"note",
":",
" ",
"currentl",
"y",
" ",
"ignores",
" ",
"numerical",
" ",
"argu",
"ment",
"s",
" ",
"in",
" ",
"the",
" ",
"request",
",",
"\\",
"10",
";",
" ",
"whi",
"ch",
" ",
"is",
" ",
"tho",
"ugh",
" ",
"subject",
" ",
"to",
" ",
"change",
" ",
"(",
"in",
" ",
"order",
" ",
"to",
" ",
"support",
"\\",
"10",
";",
" ",
"numerical",
" ",
"argu",
"ment",
"s",
" ",
"in",
" ",
"the",
" ",
"item",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"level_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"args_",
"=_",
"self_",
"._",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"link",
"\\u",
"vars_",
"=_",
"self_",
"._",
"vars_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"self_",
"._",
"application_",
"is_",
"not_",
"None_",
"and_",
"self_",
"._",
"application_",
"!=_",
"request_",
"._",
"application_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Fore",
"ign",
" ",
"applica",
"tion",
" ",
"link",
"s",
" ",
"neve",
"r",
" ",
"match_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"self_",
"._",
"opts_",
"._",
"selectable",
"_",
"is_",
"False_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Check",
" ",
"hook",
" ",
"and",
" ",
"enabled_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"check_",
"=_",
"self_",
"._",
"check",
"\\u",
"hook_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"check_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"enabled_",
"=_",
"self_",
"._",
"check",
"\\u",
"enabled_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"enabled_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"check_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"check_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Hook",
" ",
"fail",
"ed",
" ",
"or",
" ",
"disable",
"d",
":",
" ",
"doe",
"sn",
"'",
"t",
" ",
"match",
" ",
"in",
" ",
"any",
" ",
"case_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"request_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"request_",
"=_",
"current_",
"._",
"request_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"c_",
"=_",
"self_",
"._",
"get_",
"(_",
"\"",
"controlle",
"r",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mc_",
"=_",
"self_",
"._",
"get_",
"(_",
"\"",
"match",
"\\u",
"controlle",
"r",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Top",
"-",
"level",
" ",
"items",
" ",
"with",
" ",
"no",
" ",
"controlle",
"r",
" ",
"setting_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"(",
"=",
"applica",
"tion",
" ",
"level",
" ",
"items",
")",
" ",
"match",
" ",
"any",
" ",
"controlle",
"r",
",",
" ",
"but",
" ",
"not",
" ",
"more_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"not_",
"c_",
"and_",
"self_",
"._",
"parent_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"rva",
"rs_",
"=_",
"request_",
"._",
"get",
"\\u",
"vars_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"controller_",
"=_",
"request_",
"._",
"controller_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"function_",
"=_",
"request_",
"._",
"function_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Handle",
" ",
"\"",
"viewin",
"g",
"\"",
" ",
"(",
"foreign",
" ",
"controlle",
"r",
" ",
"in",
" ",
"a",
" ",
"tab",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"NOTE",
":",
" ",
"this",
" ",
"trie",
"s",
" ",
"to",
" ",
"match",
" ",
"the",
" ",
"item",
" ",
"against",
" ",
"the",
" ",
"resource",
" ",
"name_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"in",
" ",
"\"",
"viewin",
"g",
"\",",
" ",
"so",
" ",
"if",
" ",
"the",
" ",
"target",
" ",
"controlle",
"r",
"/",
"function",
" ",
"of",
" ",
"the",
" ",
"item_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"are",
" ",
"different",
" ",
"from",
" ",
"prefix",
"/",
"name",
" ",
"in",
" ",
"the",
" ",
"resource",
" ",
"name",
",",
" ",
"then",
" ",
"this_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"may",
" ",
"require",
" ",
"addition",
"al",
" ",
"match",
"\\u",
"controlle",
"r",
"/",
"match",
"\\u",
"function",
" ",
"to",
" ",
"be_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"set",
" ",
"for",
" ",
"this",
" ",
"item",
"!",
" ",
"(",
"be",
"ware",
" ",
"ambi",
"guit",
"y",
" ",
"then",
",",
" ",
"tho",
"ugh",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"\"",
"viewin",
"g",
"\"_",
"in_",
"rva",
"rs_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"tn_",
",_",
"record",
"\\u",
"id_",
"=_",
"rva",
"rs_",
"[_",
"\"",
"viewin",
"g",
"\"_",
"]_",
"._",
"split_",
"(_",
"\".\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"controller_",
",_",
"function_",
"=_",
"tn_",
"._",
"split_",
"(_",
"\"\\u\"_",
",_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Controller_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"controller_",
"==_",
"c_",
"or_",
"controller_",
"in_",
"mc_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"level_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Function_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"level_",
"==_",
"1_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"=_",
"self_",
"._",
"get_",
"(_",
"\"",
"function",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mf_",
"=_",
"self_",
"._",
"get_",
"(_",
"\"",
"match",
"\\u",
"function",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"function_",
"==_",
"f_",
"or_",
"function_",
"in_",
"mf_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"level_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"f_",
"==_",
"\"",
"index",
"\"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"\"",
"weak",
"\"",
" ",
"match",
":",
" ",
"home",
"page",
" ",
"link",
" ",
"matche",
"s",
" ",
"any",
" ",
"function_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"f_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Arg",
"s",
" ",
"and",
" ",
"vars_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Match",
" ",
"level",
"s",
" ",
"(",
"=",
"order",
" ",
"of",
" ",
"preference",
"):",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"0",
" ",
"=",
" ",
"args",
" ",
"mismatch_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"1",
" ",
"=",
" ",
"last",
" ",
"arg",
" ",
"mism",
"atch",
" ",
"(",
"numeri",
"c",
" ",
"inst",
"ead",
" ",
"of",
" ",
"method",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"2",
" ",
"=",
" ",
"no",
" ",
"args",
" ",
"in",
" ",
"item",
" ",
"and",
" ",
"vars",
" ",
"mismatch_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"3",
" ",
"=",
" ",
"no",
" ",
"args",
" ",
"and",
" ",
"no",
" ",
"vars",
" ",
"in",
" ",
"item_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"4",
" ",
"=",
" ",
"no",
" ",
"args",
" ",
"in",
" ",
"item",
" ",
"but",
" ",
"vars",
" ",
"match_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"5",
" ",
"=",
" ",
"args",
" ",
"match",
" ",
"but",
" ",
"vars",
" ",
"mismatch_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"6",
" ",
"=",
" ",
"args",
" ",
"match",
" ",
"and",
" ",
"no",
" ",
"vars",
" ",
"in",
" ",
"item_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"7",
" ",
"=",
" ",
"args",
" ",
"match",
" ",
"and",
" ",
"vars",
" ",
"match_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"level_",
"==_",
"2_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"extra_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"k_",
",_",
"v_",
"in_",
"link",
"\\u",
"vars_",
"._",
"iteritems_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"k_",
"not_",
"in_",
"rva",
"rs_",
"or_",
"k_",
"in_",
"rva",
"rs_",
"and_",
"rva",
"rs_",
"[_",
"k_",
"]_",
"!=_",
"s3",
"\\u",
"unicode_",
"(_",
"v_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"extra_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"extra_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"rar",
"gs_",
"=_",
"request_",
"._",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"rar",
"gs_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"args_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"lar",
"gs_",
"=_",
"[_",
"a_",
"for_",
"a_",
"in_",
"request_",
"._",
"args_",
"if_",
"not_",
"a_",
"._",
"isdigit_",
"(_",
")_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"len_",
"(_",
"args_",
")_",
"==_",
"len_",
"(_",
"lar",
"gs_",
")_",
"and_",
"all_",
"(_",
"[_",
"args_",
"[_",
"i_",
"]_",
"==_",
"lar",
"gs_",
"[_",
"i_",
"]_",
"for_",
"i_",
"in_",
"xrange_",
"(_",
"len_",
"(_",
"args_",
")_",
")_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"level_",
"=_",
"5_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"if_",
"len_",
"(_",
"rar",
"gs_",
")_",
">=_",
"len_",
"(_",
"args_",
")_",
">_",
"0_",
"and_",
"rar",
"gs_",
"[_",
"len_",
"(_",
"args_",
")_",
"-_",
"1_",
"]_",
"._",
"isdigit_",
"(_",
")_",
"and_",
"not_",
"str_",
"(_",
"args_",
"[_",
"-_",
"1_",
"]_",
")_",
"._",
"isdigit_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"level_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"return_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"level_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"args_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"level_",
"=_",
"5_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"level_",
"+=_",
"extra_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"level_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"branch_",
"(_",
"self_",
",_",
"request_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Get",
" ",
"the",
" ",
"matchi",
"ng",
" ",
"branch",
" ",
"item",
" ",
"for",
" ",
"request",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"request",
":",
" ",
"the",
" ",
"request",
" ",
"object",
" ",
"(",
"default",
"s",
" ",
"to",
" ",
"current",
".",
"request",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"request_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"request_",
"=_",
"current_",
"._",
"request_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"leaf_",
",_",
"level_",
"=_",
"self_",
"._",
"\\u\\u",
"branch_",
"(_",
"request_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"level_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"leaf_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"branch_",
"(_",
"self_",
",_",
"request_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Fin",
"d",
" ",
"the",
" ",
"best",
" ",
"match",
" ",
"for",
" ",
"request",
" ",
"within",
" ",
"the",
" ",
"subtree",
",",
" ",
"recurs",
"ive",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"help",
"er",
" ",
"method",
" ",
"for",
" ",
"branch",
"()",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"request",
":",
" ",
"the",
" ",
"request",
" ",
"object",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"items_",
"=_",
"self_",
"._",
"get",
"\\u",
"all_",
"(_",
"enabled_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"l_",
"=_",
"self_",
"._",
"match_",
"(_",
"request_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"items_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
",_",
"l_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"match_",
",_",
"maxl",
"evel_",
"=_",
"None_",
",_",
"l_",
"-_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"i_",
"in_",
"items_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"item_",
",_",
"level_",
"=_",
"i_",
"._",
"\\u\\u",
"branch_",
"(_",
"request_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"item_",
"is_",
"not_",
"None_",
"and_",
"level_",
">_",
"maxl",
"evel_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"match_",
"=_",
"item_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"maxl",
"evel_",
"=_",
"level_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"match_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"match_",
",_",
"maxl",
"evel_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
",_",
"l_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"repr\\u\\u_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"String",
" ",
"represent",
"ation",
" ",
"of",
" ",
"this",
" ",
"item",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"components_",
"=_",
"[_",
"str_",
"(_",
"c_",
")_",
"for_",
"c_",
"in_",
"self_",
"._",
"components_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"self_",
"._",
"enabled_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"label_",
"=_",
"str_",
"(_",
"self_",
"._",
"label_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"label_",
"=_",
"\"%",
"s",
" ",
"(",
"disable",
"d",
")\"_",
"%_",
"self_",
"._",
"label_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"label_",
"=_",
"\"%",
"s",
":",
"%",
"s",
"\"_",
"%_",
"(_",
"self_",
"._",
"\\u\\u",
"class\\u\\u_",
"._",
"\\u\\u",
"name\\u\\u_",
",_",
"label_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"components_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"\"<",
"%",
"s",
" ",
"{%",
"s",
"}>",
"\"_",
"%_",
"(_",
"label_",
",_",
"\",\"_",
"._",
"join_",
"(_",
"components_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"\"<",
"%",
"s",
">\"_",
"%_",
"label_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"url_",
"(_",
"self_",
",_",
"extension_",
"=_",
"None_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
" ",
"the",
" ",
"target",
" ",
"URL",
" ",
"for",
" ",
"this",
" ",
"item",
",",
" ",
"doe",
"sn",
"'",
"t",
" ",
"check",
" ",
"permissi",
"ons",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"extensi",
"on",
":",
" ",
"override",
" ",
"the",
" ",
"format",
" ",
"extensi",
"on",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"kwarg",
"s",
":",
" ",
"override",
" ",
"URL",
" ",
"query",
" ",
"vars",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"not_",
"self_",
"._",
"link_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"self_",
"._",
"override",
"\\u",
"url_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"override",
"\\u",
"url_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"args_",
"=_",
"self_",
"._",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"self_",
"._",
"vars_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"link",
"\\u",
"vars_",
"=_",
"Storage_",
"(_",
"self_",
"._",
"vars_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"link",
"\\u",
"vars_",
"._",
"update_",
"(_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"link",
"\\u",
"vars_",
"=_",
"Storage_",
"(_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"extension_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"extension_",
"=_",
"self_",
"._",
"extension_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"a_",
"=_",
"self_",
"._",
"get_",
"(_",
"\"",
"applica",
"tion",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"a_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"a_",
"=_",
"current_",
"._",
"request_",
"._",
"application_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"c_",
"=_",
"self_",
"._",
"get_",
"(_",
"\"",
"controlle",
"r",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"c_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"c_",
"=_",
"\"",
"default",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"f_",
"=_",
"self_",
"._",
"get_",
"(_",
"\"",
"function",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"f_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"=_",
"\"",
"index",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"f_",
",_",
"args_",
"=_",
"self_",
"._",
"\\u\\u",
"format_",
"(_",
"f_",
",_",
"args_",
",_",
"extension_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"URL_",
"(_",
"a_",
"=_",
"a_",
",_",
"c_",
"=_",
"c_",
",_",
"f_",
"=_",
"f_",
",_",
"args_",
"=_",
"args_",
",_",
"vars_",
"=_",
"link",
"\\u",
"vars_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"accessible",
"\\u",
"url_",
"(_",
"self_",
",_",
"extension_",
"=_",
"None_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
" ",
"the",
" ",
"target",
" ",
"URL",
" ",
"for",
" ",
"this",
" ",
"item",
" ",
"if",
" ",
"accessible",
" ",
"by",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"current",
" ",
"user",
",",
" ",
"other",
"wis",
"e",
" ",
"Fal",
"se",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"extensi",
"on",
":",
" ",
"override",
" ",
"the",
" ",
"format",
" ",
"extensi",
"on",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"kwarg",
"s",
":",
" ",
"override",
" ",
"URL",
" ",
"query",
" ",
"vars",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"a",
"URL_",
"=_",
"current_",
"._",
"auth_",
"._",
"permission_",
"._",
"accessible",
"\\u",
"url_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"not_",
"self_",
"._",
"link_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"args_",
"=_",
"self_",
"._",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"self_",
"._",
"vars_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"link",
"\\u",
"vars_",
"=_",
"Storage_",
"(_",
"self_",
"._",
"vars_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"link",
"\\u",
"vars_",
"._",
"update_",
"(_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"link",
"\\u",
"vars_",
"=_",
"Storage_",
"(_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"extension_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"extension_",
"=_",
"self_",
"._",
"extension_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"a_",
"=_",
"self_",
"._",
"get_",
"(_",
"\"",
"applica",
"tion",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"a_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"a_",
"=_",
"current_",
"._",
"request_",
"._",
"application_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"c_",
"=_",
"self_",
"._",
"get_",
"(_",
"\"",
"controlle",
"r",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"c_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"c_",
"=_",
"\"",
"default",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"f_",
"=_",
"self_",
"._",
"get_",
"(_",
"\"",
"function",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"f_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"=_",
"\"",
"index",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"f_",
",_",
"args_",
"=_",
"self_",
"._",
"\\u\\u",
"format_",
"(_",
"f_",
",_",
"args_",
",_",
"extension_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"a",
"URL_",
"(_",
"c_",
"=_",
"c_",
",_",
"f_",
"=_",
"f_",
",_",
"p_",
"=_",
"self_",
"._",
"p_",
",_",
"a_",
"=_",
"a_",
",_",
"t_",
"=_",
"self_",
"._",
"tablename_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"args_",
"=_",
"args_",
",_",
"vars_",
"=_",
"link",
"\\u",
"vars_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"staticmethod_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"\\u\\u",
"format_",
"(_",
"f_",
",_",
"args_",
",_",
"ext_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Append",
" ",
"the",
" ",
"format",
" ",
"extensi",
"on",
" ",
"to",
" ",
"the",
" ",
"last",
" ",
"argu",
"ment",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"f",
":",
" ",
"the",
" ",
"function",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"args",
":",
" ",
"argu",
"ment",
" ",
"list",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"ext",
":",
" ",
"the",
" ",
"format",
" ",
"extensi",
"on",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"return",
":",
" ",
"tuple",
" ",
"(",
"f",
",",
" ",
"args",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"not_",
"ext_",
"or_",
"ext_",
"==_",
"\"",
"html",
"\"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"f_",
",_",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"items_",
"=_",
"[_",
"f_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"args_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"items_",
"+=_",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"items_",
"=_",
"[_",
"i_",
"._",
"rsplit_",
"(_",
"\".\"_",
",_",
"1_",
")_",
"[_",
"0_",
"]_",
"for_",
"i_",
"in_",
"items_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"items_",
"._",
"append_",
"(_",
"\"%",
"s",
".",
"%",
"s",
"\"_",
"%_",
"(_",
"items_",
"._",
"pop_",
"(_",
")_",
",_",
"ext_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"(_",
"items_",
"[_",
"0_",
"]_",
",_",
"items_",
"[_",
"1_",
":_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"render_",
"(_",
"self_",
",_",
"request_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Perform",
" ",
"the",
" ",
"checks",
" ",
"and",
" ",
"render",
" ",
"this",
" ",
"item",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"request",
":",
" ",
"the",
" ",
"request",
" ",
"object",
" ",
"(",
"default",
"s",
" ",
"to",
" ",
"current",
".",
"request",
")",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"renderer_",
"=_",
"self_",
"._",
"renderer_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"output_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"request_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"request_",
"=_",
"current_",
"._",
"request_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"self_",
"._",
"check",
"\\u",
"active_",
"(_",
"request_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Run",
" ",
"the",
" ",
"class",
"'",
" ",
"check",
"\\u",
"permissi",
"on",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"authorized_",
"=_",
"self_",
"._",
"check",
"\\u",
"permission_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Run",
" ",
"check",
"\\u",
"selected_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"selected_",
"=_",
"self_",
"._",
"check",
"\\u",
"selected_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Check",
" ",
"custom",
" ",
"condition",
"s",
" ",
"(",
"hook",
"),",
" ",
"these",
" ",
"methods_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"can",
" ",
"alter",
" ",
"any",
" ",
"prior",
" ",
"flags",
",",
" ",
"whi",
"ch",
" ",
"can",
" ",
"then",
" ",
"only",
" ",
"be_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"overrid",
"den",
" ",
"by",
" ",
"the",
" ",
"class",
"'",
" ",
"check",
"\\u",
"enable",
"d",
" ",
"method_",
"\\u\\u\\uNL\\u\\u\\u_",
"cond_",
"=_",
"self_",
"._",
"check",
"\\u",
"hook_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"cond_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Run",
" ",
"the",
" ",
"class",
"'",
" ",
"check",
"\\u",
"enable",
"d",
" ",
"method",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"if",
" ",
"this",
" ",
"return",
"s",
" ",
"Fal",
"se",
",",
" ",
"then",
" ",
"this",
" ",
"override",
"s",
" ",
"any",
" ",
"prior",
" ",
"status_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"enabled_",
"=_",
"self_",
"._",
"check",
"\\u",
"enabled_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"enabled_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"enabled_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Render",
" ",
"the",
" ",
"item_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"renderer_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"output_",
"=_",
"renderer_",
"(_",
"self_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"output_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"render",
"\\u",
"components_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Render",
" ",
"the",
" ",
"component",
"s",
" ",
"of",
" ",
"this",
" ",
"item",
" ",
"and",
" ",
"return",
" ",
"the",
" ",
"results",
" ",
"as",
" ",
"list",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"items_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"c_",
"in_",
"self_",
"._",
"components_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"i_",
"=_",
"c_",
"._",
"render_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"i_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"type_",
"(_",
"i_",
")_",
"is_",
"list_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"items_",
"._",
"extend_",
"(_",
"i_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"items_",
"._",
"append_",
"(_",
"i_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"items_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"xml_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Invok",
"es",
" ",
"the",
" ",
"render",
"er",
" ",
"and",
" ",
"serialize",
"s",
" ",
"the",
" ",
"output",
" ",
"for",
" ",
"the",
" ",
"web",
"2py",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"template",
" ",
"parser",
",",
" ",
"return",
"s",
" ",
"a",
" ",
"string",
" ",
"to",
" ",
"be",
" ",
"writt",
"en",
" ",
"to",
" ",
"the",
" ",
"response",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"body",
",",
" ",
"use",
"s",
" ",
"the",
" ",
"xml",
"()",
" ",
"method",
" ",
"of",
" ",
"the",
" ",
"render",
"er",
" ",
"output",
",",
" ",
"if",
" ",
"presen",
"t",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"output_",
"=_",
"self_",
"._",
"render_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"output_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"hasattr_",
"(_",
"output_",
",_",
"\"",
"xml",
"\"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"output_",
"._",
"xml_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"str_",
"(_",
"output_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"set\\u",
"parent_",
"(_",
"self_",
",_",
"p_",
"=_",
"None_",
",_",
"i_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Set",
" ",
"a",
" ",
"parent",
" ",
"for",
" ",
"this",
" ",
"item",
",",
" ",
"base",
" ",
"method",
" ",
"for",
" ",
"tree",
" ",
"constructi",
"on",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"p",
":",
" ",
"the",
" ",
"parent",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"i",
":",
" ",
"the",
" ",
"list",
" ",
"index",
" ",
"where",
" ",
"to",
" ",
"insert",
" ",
"the",
" ",
"item",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"p_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"p_",
"=_",
"self_",
"._",
"parent_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"p_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"parent_",
"=_",
"self_",
"._",
"parent_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"parent_",
"is_",
"not_",
"None_",
"and_",
"parent_",
"!=_",
"p_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"while_",
"self_",
"in_",
"parent_",
"._",
"components_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"parent_",
"._",
"components_",
"._",
"remove_",
"(_",
"self_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"i_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"p_",
"._",
"component_",
"._",
"insert_",
"(_",
"i_",
",_",
"self_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"p_",
"._",
"components_",
"._",
"append_",
"(_",
"self_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"parent_",
"=_",
"p_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"append_",
"(_",
"self_",
",_",
"item_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Append",
" ",
"a",
" ",
"component",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"item",
":",
" ",
"the",
" ",
"component",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"item_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"type_",
"(_",
"item_",
")_",
"is_",
"list_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"i_",
"in_",
"item_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"self_",
"._",
"append_",
"(_",
"i_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"item_",
"._",
"set\\u",
"parent_",
"(_",
"self_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"self_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"insert_",
"(_",
"self_",
",_",
"i_",
",_",
"item_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Insert",
" ",
"a",
" ",
"component",
" ",
"item",
" ",
"at",
" ",
"position",
" ",
"i",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"i",
":",
" ",
"the",
" ",
"index",
" ",
"position",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"item",
":",
" ",
"the",
" ",
"component",
" ",
"item",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"item_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"item_",
"._",
"set\\u",
"parent_",
"(_",
"self_",
",_",
"i_",
"=_",
"i_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"self_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"extend_",
"(_",
"self_",
",_",
"items_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Extend",
" ",
"this",
" ",
"item",
" ",
"with",
" ",
"a",
" ",
"list",
" ",
"of",
" ",
"component",
"s",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"items",
":",
" ",
"list",
" ",
"of",
" ",
"component",
" ",
"items",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"items_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"item_",
"in_",
"items_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"append_",
"(_",
"item_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"self_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"call\\u\\u_",
"(_",
"self_",
",_",
"*_",
"components_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Conve",
"nie",
"nce",
" ",
"shortcut",
" ",
"for",
" ",
"extend",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"component",
"s",
":",
" ",
"list",
" ",
"of",
" ",
"component",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"extend_",
"(_",
"components_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"add\\u\\u_",
"(_",
"self_",
",_",
"items_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Append",
" ",
"component",
" ",
"items",
" ",
"to",
" ",
"this",
" ",
"item",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"items",
":",
" ",
"the",
" ",
"items",
" ",
"to",
" ",
"append",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"isinstance_",
"(_",
"items_",
",_",
"(_",
"list_",
",_",
"tuple_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"extend_",
"(_",
"items_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"append_",
"(_",
"items_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"self_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"getitem\\u\\u_",
"(_",
"self_",
",_",
"i_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Get",
" ",
"the",
" ",
"component",
" ",
"item",
" ",
"at",
" ",
"position",
" ",
"i",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"i",
":",
" ",
"the",
" ",
"index",
" ",
"of",
" ",
"the",
" ",
"component",
" ",
"item",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"self_",
"._",
"components_",
"._",
"\\u\\u",
"getitem\\u\\u_",
"(_",
"i_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"setitem\\u\\u_",
"(_",
"self_",
",_",
"i_",
",_",
"item_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Over",
"write",
" ",
"the",
" ",
"component",
" ",
"item",
" ",
"at",
" ",
"position",
" ",
"i",
" ",
"with",
" ",
"item",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"i",
":",
" ",
"the",
" ",
"index",
" ",
"within",
" ",
"the",
" ",
"component",
" ",
"list",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"item",
":",
" ",
"the",
" ",
"item",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"components_",
"._",
"\\u\\u",
"setitem\\u\\u_",
"(_",
"i_",
",_",
"item_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"pop_",
"(_",
"self_",
",_",
"i_",
"=_",
"-_",
"1_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
" ",
"the",
" ",
"component",
" ",
"at",
" ",
"index",
" ",
"i",
" ",
"and",
" ",
"remove",
" ",
"it",
" ",
"from",
" ",
"the",
" ",
"list",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"i",
":",
" ",
"the",
" ",
"component",
" ",
"index",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"self_",
"._",
"components_",
"._",
"pop_",
"(_",
"i_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"root_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Get",
" ",
"the",
" ",
"top",
" ",
"level",
" ",
"item",
" ",
"of",
" ",
"this",
" ",
"navigation",
" ",
"tree",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"parent_",
"=_",
"self_",
"._",
"parent_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"parent_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"parent_",
"._",
"get",
"\\u",
"root_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"path_",
"(_",
"self_",
",_",
"sub_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Get",
" ",
"the",
" ",
"full",
" ",
"path",
" ",
"to",
" ",
"this",
" ",
"item",
" ",
"(",
"=",
"a",
" ",
"list",
" ",
"of",
" ",
"items",
" ",
"from",
" ",
"the",
" ",
"root",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"item",
" ",
"down",
" ",
"to",
" ",
"this",
" ",
"item",
").",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"path_",
"=_",
"[_",
"self_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"sub_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"path_",
"._",
"extend_",
"(_",
"sub_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"self_",
"._",
"parent_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"parent_",
"._",
"path_",
"(_",
"sub_",
"=_",
"path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"path_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"all_",
"(_",
"self_",
",_",
"**_",
"flags_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Get",
" ",
"all",
" ",
"component",
"s",
" ",
"with",
" ",
"these",
" ",
"flags",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"flags",
":",
" ",
"dictionar",
"y",
" ",
"of",
" ",
"flags",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"items_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"item_",
"in_",
"self_",
"._",
"components_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"flags_",
"or_",
"all_",
"(_",
"[_",
"getattr_",
"(_",
"item_",
",_",
"f_",
")_",
"==_",
"flags_",
"[_",
"f_",
"]_",
"for_",
"f_",
"in_",
"flags_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"items_",
"._",
"append_",
"(_",
"item_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"items_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"first_",
"(_",
"self_",
",_",
"**_",
"flags_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Get",
" ",
"the",
" ",
"first",
" ",
"component",
" ",
"item",
" ",
"with",
" ",
"these",
" ",
"flags",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"flags",
":",
" ",
"dictionar",
"y",
" ",
"of",
" ",
"flags",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"item_",
"in_",
"self_",
"._",
"components_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"flags_",
"or_",
"all_",
"(_",
"[_",
"getattr_",
"(_",
"item_",
",_",
"f_",
")_",
"==_",
"flags_",
"[_",
"f_",
"]_",
"for_",
"f_",
"in_",
"flags_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"item_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"last_",
"(_",
"self_",
",_",
"**_",
"flags_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Get",
" ",
"the",
" ",
"first",
" ",
"component",
" ",
"item",
" ",
"with",
" ",
"these",
" ",
"flags",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"flags",
":",
" ",
"dictionar",
"y",
" ",
"of",
" ",
"flags",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"components_",
"=_",
"list_",
"(_",
"self_",
"._",
"components_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"components_",
"._",
"reverse_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"item_",
"in_",
"components_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"flags_",
"or_",
"all_",
"(_",
"[_",
"getattr_",
"(_",
"item_",
",_",
"f_",
")_",
"==_",
"flags_",
"[_",
"f_",
"]_",
"for_",
"f_",
"in_",
"flags_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"item_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"len\\u\\u_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"The",
" ",
"total",
" ",
"number",
" ",
"of",
" ",
"component",
"s",
" ",
"of",
" ",
"this",
" ",
"item",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"len_",
"(_",
"self_",
"._",
"components_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"nonzero\\u",
"\\u_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"To",
" ",
"be",
" ",
"used",
" ",
"inst",
"ead",
" ",
"of",
" ",
"\\u\\u",
"len",
"\\u\\u",
" ",
"to",
" ",
"dete",
"rmin",
"e",
" ",
"the",
" ",
"boolean",
" ",
"value",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"if",
" ",
"this",
" ",
"item",
",",
" ",
"shou",
"ld",
" ",
"alw",
"ay",
"s",
" ",
"return",
" ",
"Tru",
"e",
" ",
"for",
" ",
"instance",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"self_",
"is_",
"not_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"index_",
"(_",
"self_",
",_",
"item_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Get",
" ",
"the",
" ",
"index",
" ",
"of",
" ",
"a",
" ",
"component",
" ",
"item",
" ",
"within",
" ",
"the",
" ",
"component",
" ",
"list",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"item",
":",
" ",
"the",
" ",
"item",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"self_",
"._",
"components_",
"._",
"index_",
"(_",
"item_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"pos_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Get",
" ",
"the",
" ",
"position",
" ",
"of",
" ",
"this",
" ",
"item",
" ",
"within",
" ",
"the",
" ",
"parent",
"'",
"s",
" ",
"component",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"list",
",",
" ",
"reverse",
" ",
"method",
" ",
"for",
" ",
"index",
"()",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"self_",
"._",
"parent_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"parent_",
"._",
"index_",
"(_",
"self_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"is",
"\\u",
"first_",
"(_",
"self_",
",_",
"**_",
"flags_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Check",
" ",
"whe",
"ther",
" ",
"this",
" ",
"is",
" ",
"the",
" ",
"first",
" ",
"item",
" ",
"within",
" ",
"the",
" ",
"parent",
"'",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"component",
"s",
" ",
"list",
" ",
"with",
" ",
"these",
" ",
"flags",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"flags",
":",
" ",
"dictionar",
"y",
" ",
"of",
" ",
"flags",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"not_",
"flags_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"len_",
"(_",
"self_",
"._",
"preceding",
"_",
"(_",
")_",
")_",
"==_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"all_",
"(_",
"[_",
"getattr_",
"(_",
"self_",
",_",
"f_",
")_",
"==_",
"flags_",
"[_",
"f_",
"]_",
"for_",
"f_",
"in_",
"flags_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"preceding",
"_",
"=_",
"self_",
"._",
"preceding",
"_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"preceding",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"item_",
"in_",
"preceding",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"all_",
"(_",
"[_",
"getattr_",
"(_",
"item_",
",_",
"f_",
")_",
"==_",
"flags_",
"[_",
"f_",
"]_",
"for_",
"f_",
"in_",
"flags_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"return_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"is",
"\\u",
"last_",
"(_",
"self_",
",_",
"**_",
"flags_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Check",
" ",
"whe",
"ther",
" ",
"this",
" ",
"is",
" ",
"the",
" ",
"last",
" ",
"item",
" ",
"within",
" ",
"the",
" ",
"parent",
"'",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"component",
"s",
" ",
"list",
" ",
"with",
" ",
"these",
" ",
"flags",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"flags",
":",
" ",
"dictionar",
"y",
" ",
"of",
" ",
"flags",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"not_",
"flags_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"len_",
"(_",
"self_",
"._",
"following_",
"(_",
")_",
")_",
"==_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"all_",
"(_",
"[_",
"getattr_",
"(_",
"self_",
",_",
"f_",
")_",
"==_",
"flags_",
"[_",
"f_",
"]_",
"for_",
"f_",
"in_",
"flags_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"following_",
"=_",
"self_",
"._",
"following_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"following_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"item_",
"in_",
"following_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"all_",
"(_",
"[_",
"getattr_",
"(_",
"item_",
",_",
"f_",
")_",
"==_",
"flags_",
"[_",
"f_",
"]_",
"for_",
"f_",
"in_",
"flags_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"return_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"preceding",
"_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Get",
" ",
"the",
" ",
"preceding",
" ",
"siblings",
" ",
"within",
" ",
"the",
" ",
"parent",
"'",
"s",
" ",
"component",
" ",
"list",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"parent_",
"=_",
"self_",
"._",
"parent_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"parent_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pos_",
"=_",
"self_",
"._",
"pos_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"pos_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"parent_",
"._",
"components_",
"[_",
":_",
"pos_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"following_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Get",
" ",
"the",
" ",
"follow",
"ing",
" ",
"siblings",
" ",
"within",
" ",
"the",
" ",
"parent",
"'",
"s",
" ",
"component",
" ",
"list",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"parent_",
"=_",
"self_",
"._",
"parent_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"parent_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"items_",
"=_",
"parent_",
"._",
"components_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos_",
"=_",
"self_",
"._",
"pos_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"pos_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pos_",
"=_",
"pos_",
"+_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"pos_",
"<_",
"len_",
"(_",
"items_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"return_",
"items_",
"[_",
"pos_",
":_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"prev_",
"(_",
"self_",
",_",
"**_",
"flags_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Get",
" ",
"the",
" ",
"previ",
"ous",
" ",
"item",
" ",
"in",
" ",
"the",
" ",
"parent",
"'",
"s",
" ",
"component",
" ",
"list",
" ",
"with",
" ",
"these",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"flags",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"flags",
":",
" ",
"dictionar",
"y",
" ",
"of",
" ",
"flags",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"preceding",
"_",
"=_",
"self_",
"._",
"preceding",
"_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"preceding",
"_",
"._",
"reverse_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"item_",
"in_",
"preceding",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"flags_",
"or_",
"all_",
"(_",
"[_",
"getattr_",
"(_",
"item_",
",_",
"f_",
")_",
"==_",
"flags_",
"[_",
"f_",
"]_",
"for_",
"f_",
"in_",
"flags_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"item_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Navigat",
"ion",
"Item_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"next_",
"(_",
"self_",
",_",
"**_",
"flags_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Get",
" ",
"the",
" ",
"next",
" ",
"item",
" ",
"in",
" ",
"the",
" ",
"parent",
"'",
"s",
" ",
"component",
" ",
"list",
" ",
"with",
" ",
"these",
" ",
"flags",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"flags",
":",
" ",
"dictionar",
"y",
" ",
"of",
" ",
"flags",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"following_",
"=_",
"self_",
"._",
"following_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"item_",
"in_",
"following_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"flags_",
"or_",
"all_",
"(_",
"[_",
"getattr_",
"(_",
"item_",
",_",
"f_",
")_",
"==_",
"flags_",
"[_",
"f_",
"]_",
"for_",
"f_",
"in_",
"flags_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"item_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"S",
"3",
"Script",
"Item_",
"(_",
"S",
"3",
"Navigat",
"ion",
"Item_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Simple",
" ",
"Navigat",
"ion",
" ",
"Item",
" ",
"just",
" ",
"for",
" ",
"inject",
"ing",
" ",
"scripts",
" ",
"int",
"o",
" ",
"HTM",
"L",
" ",
"forms",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"---",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Script",
"Item_",
"(_",
"S",
"3",
"Navigat",
"ion",
"Item_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"script_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"**_",
"attributes_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"@",
"param",
" ",
"script",
":",
" ",
"script",
" ",
"to",
" ",
"inject",
" ",
"int",
"o",
" ",
"jq",
"uer",
"y",
"\\u",
"read",
"y",
" ",
"whe",
"n",
" ",
"render",
"ed",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"script_",
"=_",
"script_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"super_",
"(_",
"S",
"3",
"Script",
"Item_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"attributes_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Script",
"Item_",
"(_",
"S",
"3",
"Navigat",
"ion",
"Item_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"xml_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Inject",
"s",
" ",
"associate",
"d",
" ",
"script",
" ",
"int",
"o",
" ",
"jq",
"uer",
"y",
"\\u",
"read",
"y",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"self_",
"._",
"script_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"current_",
"._",
"response_",
"._",
"s3_",
"._",
"jq",
"uer",
"y",
"\\u",
"ready_",
"._",
"append_",
"(_",
"self_",
"._",
"script_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"S",
"3",
"Script",
"Item_",
"(_",
"S",
"3",
"Navigat",
"ion",
"Item_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"staticmethod_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"inline_",
"(_",
"item_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Present",
" ",
"to",
" ",
"ensure",
" ",
"tha",
"t",
" ",
"script",
" ",
"injected",
" ",
"even",
" ",
"in",
" ",
"inline",
" ",
"forms",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Illegal raise | AppScale/appscale/AppServer/google/appengine/api/search/query_parser.py | [
{
"content": " def emitErrorMessage(self, msg):\n \"\"\"Raise an exception if the input fails to parse correctly.\n\n Overriding the default, which normally just prints a message to\n stderr.\n\n Arguments:\n msg: the error message\n Raises:\n QueryException: always.\n \"\"\"\n raise QueryException(msg)",
"metadata": "root.QueryParserWithErrors.emitErrorMessage",
"header": "['class', 'QueryParserWithErrors', '(', 'QueryParser', '.', 'QueryParser', ')', ':', '___EOS___']",
"index": 63
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Il",
"lega",
"l_",
"raise_",
"[SEP]_",
"class_",
"Query",
"Parser",
"With",
"Errors_",
"(_",
"Query",
"Parser_",
"._",
"Query",
"Parser_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"emit",
"Error",
"Message_",
"(_",
"self_",
",_",
"msg_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Rai",
"se",
" ",
"an",
" ",
"exception",
" ",
"if",
" ",
"the",
" ",
"input",
" ",
"fail",
"s",
" ",
"to",
" ",
"parse",
" ",
"correct",
"ly",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Over",
"rid",
"ing",
" ",
"the",
" ",
"default",
",",
" ",
"whi",
"ch",
" ",
"normal",
"ly",
" ",
"just",
" ",
"print",
"s",
" ",
"a",
" ",
"message",
" ",
"to",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"std",
"err",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Arg",
"ument",
"s",
":",
"\\",
"10",
";",
" ",
" ",
"msg",
":",
" ",
"the",
" ",
"error",
" ",
"message",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Rai",
"ses",
":",
"\\",
"10",
";",
" ",
" ",
"Query",
"Except",
"ion",
":",
" ",
"alw",
"ay",
"s",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Query",
"Exception_",
"(_",
"msg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Comparison of constants | enthought/traitsui/traitsui/table_filter.py | [
{
"content": " def _anytrait_changed ( self, name, old, new ):\n if ((name not in self.ignored_traits) and\n ((self.name == self._name) or (self.name == ''))):\n self.name = self._name = self.description()",
"metadata": "root.TableFilter._anytrait_changed",
"header": "['class', 'TableFilter', '(', 'HasPrivateTraits', ')', ':', '___EOS___']",
"index": 179
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Compari",
"son_",
"of_",
"constants_",
"[SEP]_",
"class_",
"Table",
"Filter_",
"(_",
"Has",
"Priva",
"te",
"Trait",
"s_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"anyt",
"rai",
"t",
"\\u",
"changed_",
"(_",
"self_",
",_",
"name_",
",_",
"old_",
",_",
"new_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"(_",
"(_",
"name_",
"not_",
"in_",
"self_",
"._",
"ignore",
"d\\u",
"traits_",
")_",
"and_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"(_",
"self_",
"._",
"name_",
"==_",
"self_",
"._",
"\\u",
"name_",
")_",
"or_",
"(_",
"self_",
"._",
"name_",
"==_",
"''_",
")_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"name_",
"=_",
"self_",
"._",
"\\u",
"name_",
"=_",
"self_",
"._",
"description_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | Alephbet/gimel/vendor/redis/client.py | [
{
"content": " def scan_iter(self, match=None, count=None):\n \"\"\"\n Make an iterator using the SCAN command so that the client doesn't\n need to remember the cursor position.\n\n ``match`` allows for filtering the keys by pattern\n\n ``count`` allows for hint the minimum number of returns\n \"\"\"\n cursor = '0'\n while cursor != 0:\n cursor, data = self.scan(cursor=cursor, match=match, count=count)\n for item in data:\n yield item",
"metadata": "root.StrictRedis.scan_iter",
"header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']",
"index": 1371
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Stri",
"ct",
"Redis_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"scan",
"\\u",
"iter_",
"(_",
"self_",
",_",
"match_",
"=_",
"None_",
",_",
"count_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Make",
" ",
"an",
" ",
"iter",
"ator",
" ",
"usi",
"ng",
" ",
"the",
" ",
"SCAN",
" ",
"command",
" ",
"so",
" ",
"tha",
"t",
" ",
"the",
" ",
"client",
" ",
"doe",
"sn",
"'",
"t",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"need",
" ",
"to",
" ",
"remember",
" ",
"the",
" ",
"cursor",
" ",
"position",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"``",
"match",
"``",
" ",
"allow",
"s",
" ",
"for",
" ",
"filtering",
" ",
"the",
" ",
"keys",
" ",
"by",
" ",
"pattern",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"``",
"count",
"``",
" ",
"allow",
"s",
" ",
"for",
" ",
"hin",
"t",
" ",
"the",
" ",
"minim",
"um",
" ",
"number",
" ",
"of",
" ",
"return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"cursor_",
"=_",
"'",
"0",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"while_",
"cursor_",
"!=_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"cursor_",
",_",
"data_",
"=_",
"self_",
"._",
"scan_",
"(_",
"cursor_",
"=_",
"cursor_",
",_",
"match_",
"=_",
"match_",
",_",
"count_",
"=_",
"count_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"item_",
"in_",
"data_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"yield_",
"item_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Module is imported with 'import' and 'import from' | nucleic/enaml/enaml/core/object.py | [
{
"content": "#------------------------------------------------------------------------------\n# Copyright (c) 2013, Nucleic Development Team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n#------------------------------------------------------------------------------\nfrom collections import deque\nimport re\n\nfrom atom.api import Atom, Unicode, Value, List, Event\n\n\nflag_generator = flag_generator()\n\n\n#: A flag indicated that an object has been destroyed.\nDESTROYED_FLAG = flag_generator.next()\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Module_",
"is_",
"imported_",
"with_",
"'",
"import",
"'_",
"and_",
"'",
"import",
" ",
"from",
"'_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#-",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"-------",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Copy",
"right",
" ",
"(",
"c",
")",
" ",
"2013",
",",
" ",
"Nucle",
"ic",
" ",
"Dev",
"elo",
"pme",
"nt",
" ",
"Tea",
"m",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Distribut",
"ed",
" ",
"under",
" ",
"the",
" ",
"term",
"s",
" ",
"of",
" ",
"the",
" ",
"Modifie",
"d",
" ",
"BS",
"D",
" ",
"License",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"full",
" ",
"license",
" ",
"is",
" ",
"in",
" ",
"the",
" ",
"file",
" ",
"COPY",
"ING",
".",
"txt",
",",
" ",
"distributed",
" ",
"with",
" ",
"this",
" ",
"software",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#-",
"--------------",
"--------------",
"--------------",
"--------------",
"--------------",
"-------",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"collections_",
"import_",
"deque_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"re_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"atom_",
"._",
"api_",
"import_",
"Atom_",
",_",
"Unicode_",
",_",
"Value_",
",_",
"List_",
",_",
"Event_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"flag",
"\\u",
"generator_",
"=_",
"flag",
"\\u",
"generator_",
"(_",
")_",
"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
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Variable defined multiple times | FINRAOS/yum-nginx-api/tests/api_test.py | [
{
"content": "#!/usr/bin/python\n# (C) Copyright 2014 yum-nginx-api Contributors.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at \n# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport requests\n\nbaseurl = 'localhost'\n\n''' Post RPM to API end point '''\nposturl = 'http://%s/api/upload' % baseurl\nfiles = {'file': open('yum-nginx-api-test-0.1-1.x86_64.rpm', 'rb')}\npost = requests.post(posturl, files=files)\nif post.status_code == 200:\n print \"SAT: RPM post successful\"\nelse:\n print \"UNSAT: RPM post\"\n\n''' Verify 405 message '''\nif requests.get(posturl).status_code == 405:\n print \"SAT: 405 message recieved\"\nelse:\n print \"UNSAT: 405 message\"\n\n''' Verify 400 message '''\nposturl = 'http://%s/api' % baseurl\nif requests.get(posturl).status_code == 404:\n print \"SAT: 400 message recieved\"\nelse:\n print \"UNSAT: 400 message\"\n\n''' Verify repo list '''\nposturl = 'http://%s/api/repo' % baseurl\nif requests.get(posturl).status_code == 200:\n print \"SAT: repo list worked\"\nelse:\n print \"UNSAT: repo list didn't work\"\n\n''' Verify health check message '''\nposturl = 'http://%s/api/health' % baseurl\nif requests.get(posturl).status_code == 200:\n print \"SAT: health check worked\"\nelse:\n print \"UNSAT: health check didn't work\"\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Variable_",
"defined_",
"multiple_",
"times_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#!",
"/",
"usr",
"/",
"bin",
"/",
"python_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"(",
"C",
")",
" ",
"Copy",
"right",
" ",
"2014",
" ",
"yum",
"-",
"ngin",
"x",
"-",
"api",
" ",
"Contributor",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"License",
"d",
" ",
"under",
" ",
"the",
" ",
"Ap",
"ache",
" ",
"License",
",",
" ",
"Version",
" ",
"2.0",
" ",
"(",
"the",
" ",
"\"",
"License",
"\");",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"you",
" ",
"may",
" ",
"not",
" ",
"use",
" ",
"this",
" ",
"file",
" ",
"except",
" ",
"in",
" ",
"compli",
"anc",
"e",
" ",
"with",
" ",
"the",
" ",
"License",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"You",
" ",
"may",
" ",
"obtain",
" ",
"a",
" ",
"copy",
" ",
"of",
" ",
"the",
" ",
"License",
" ",
"at",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"http",
"://",
"www",
".",
"apa",
"che",
".",
"org",
"/",
"license",
"s",
"/",
"LICENSE",
"-",
"2.0_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"Un",
"less",
" ",
"require",
"d",
" ",
"by",
" ",
"applica",
"ble",
" ",
"law",
" ",
"or",
" ",
"agree",
"d",
" ",
"to",
" ",
"in",
" ",
"writ",
"ing",
",",
" ",
"software",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"distributed",
" ",
"under",
" ",
"the",
" ",
"License",
" ",
"is",
" ",
"distributed",
" ",
"on",
" ",
"an",
" ",
"\"",
"AS",
" ",
"IS",
"\"",
" ",
"BAS",
"IS",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"WITH",
"OUT",
" ",
"WAR",
"RAN",
"TIES",
" ",
"OR",
" ",
"CONDITION",
"S",
" ",
"OF",
" ",
"ANY",
" ",
"KIND",
",",
" ",
"eit",
"her",
" ",
"express",
" ",
"or",
" ",
"impli",
"ed",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"See",
" ",
"the",
" ",
"License",
" ",
"for",
" ",
"the",
" ",
"specific",
" ",
"language",
" ",
"govern",
"ing",
" ",
"permissi",
"ons",
" ",
"and_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"limit",
"ation",
"s",
" ",
"under",
" ",
"the",
" ",
"License",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"requests_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"baseurl_",
"=_",
"'",
"local",
"host",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"'''",
" ",
"Post",
" ",
"RPM",
" ",
"to",
" ",
"API",
" ",
"end",
" ",
"point",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"post",
"url_",
"=_",
"'",
"http",
"://",
"%",
"s",
"/",
"api",
"/",
"upload",
"'_",
"%_",
"baseurl_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"files_",
"=_",
"{_",
"'",
"file",
"'_",
":_",
"open_",
"(_",
"'",
"yum",
"-",
"ngin",
"x",
"-",
"api",
"-",
"test",
"-0",
".1",
"-1",
".",
"x8",
"6",
"\\u",
"64.",
"rpm",
"'_",
",_",
"'",
"rb",
"'_",
")_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"post_",
"=_",
"requests_",
"._",
"post_",
"(_",
"post",
"url_",
",_",
"files_",
"=_",
"files_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"post_",
"._",
"status",
"\\u",
"code_",
"==_",
"200_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"\"",
"SAT",
":",
" ",
"RPM",
" ",
"post",
" ",
"success",
"ful",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"\"",
"UNS",
"AT",
":",
" ",
"RPM",
" ",
"post",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"'''",
" ",
"Verify",
" ",
"405",
" ",
"message",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"requests_",
"._",
"get_",
"(_",
"post",
"url_",
")_",
"._",
"status",
"\\u",
"code_",
"==_",
"405_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"\"",
"SAT",
":",
" ",
"405",
" ",
"message",
" ",
"recieve",
"d",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"\"",
"UNS",
"AT",
":",
" ",
"405",
" ",
"message",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"'''",
" ",
"Verify",
" ",
"400",
" ",
"message",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"post",
"url_",
"=_",
"'",
"http",
"://",
"%",
"s",
"/",
"api",
"'_",
"%_",
"baseurl_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"requests_",
"._",
"get_",
"(_",
"post",
"url_",
")_",
"._",
"status",
"\\u",
"code_",
"==_",
"404_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"\"",
"SAT",
":",
" ",
"400",
" ",
"message",
" ",
"recieve",
"d",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"\"",
"UNS",
"AT",
":",
" ",
"400",
" ",
"message",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"'''",
" ",
"Verify",
" ",
"repo",
" ",
"list",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"post",
"url_",
"=_",
"'",
"http",
"://",
"%",
"s",
"/",
"api",
"/",
"repo",
"'_",
"%_",
"baseurl_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"requests_",
"._",
"get_",
"(_",
"post",
"url_",
")_",
"._",
"status",
"\\u",
"code_",
"==_",
"200_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"\"",
"SAT",
":",
" ",
"repo",
" ",
"list",
" ",
"worked",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"\"",
"UNS",
"AT",
":",
" ",
"repo",
" ",
"list",
" ",
"did",
"n",
"'",
"t",
" ",
"work",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"'''",
" ",
"Verify",
" ",
"health",
" ",
"check",
" ",
"message",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"post",
"url_",
"=_",
"'",
"http",
"://",
"%",
"s",
"/",
"api",
"/",
"health",
"'_",
"%_",
"baseurl_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"requests_",
"._",
"get_",
"(_",
"post",
"url_",
")_",
"._",
"status",
"\\u",
"code_",
"==_",
"200_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"\"",
"SAT",
":",
" ",
"health",
" ",
"check",
" ",
"worked",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"\"",
"UNS",
"AT",
":",
" ",
"health",
" ",
"check",
" ",
"did",
"n",
"'",
"t",
" ",
"work",
"\"_",
"\\u\\u\\uDEDENT\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unreachable code | cweill/GoTests-Sublime/GoTests.py | [
{
"content": "class gotestsCommand(sublime_plugin.TextCommand):\n\n\t# Returns a function signature's line from a point in its body.\n\n\t# Return whether the line is an end bracket.\n\n\t# Returns the name of the function if the given line is a method signature.",
"metadata": "root.gotestsCommand",
"header": "['module', '___EOS___']",
"index": 4
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Unrea",
"chab",
"le_",
"code_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"got",
"ests",
"Command_",
"(_",
"sublim",
"e\\u",
"plugin_",
"._",
"Text",
"Command_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Return",
"s",
" ",
"a",
" ",
"function",
" ",
"signa",
"ture",
"'",
"s",
" ",
"line",
" ",
"from",
" ",
"a",
" ",
"point",
" ",
"in",
" ",
"its",
" ",
"body",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Return",
" ",
"whe",
"ther",
" ",
"the",
" ",
"line",
" ",
"is",
" ",
"an",
" ",
"end",
" ",
"bracket",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Return",
"s",
" ",
"the",
" ",
"name",
" ",
"of",
" ",
"the",
" ",
"function",
" ",
"if",
" ",
"the",
" ",
"give",
"n",
" ",
"line",
" ",
"is",
" ",
"a",
" ",
"method",
" ",
"signa",
"ture",
"._",
"\\u\\u\\uNL\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Use of the return value of a procedure | apache/libcloud/libcloud/storage/drivers/s3.py | [
{
"content": " def add_default_params(self, params):\n expires = str(int(time.time()) + EXPIRATION_SECONDS)\n params['AWSAccessKeyId'] = self.user_id\n params['Expires'] = expires\n return params",
"metadata": "root.BaseS3Connection.add_default_params",
"header": "['class', 'BaseS3Connection', '(', 'ConnectionUserAndKey', ')', ':', '___EOS___']",
"index": 163
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Use_",
"of_",
"the_",
"return_",
"value_",
"of_",
"a_",
"procedure_",
"[SEP]_",
"class_",
"Base",
"S",
"3",
"Connection_",
"(_",
"Connect",
"ion",
"User",
"And",
"Key_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"add",
"\\u",
"default",
"\\u",
"params_",
"(_",
"self_",
",_",
"params_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"expires_",
"=_",
"str_",
"(_",
"int_",
"(_",
"time_",
"._",
"time_",
"(_",
")_",
")_",
"+_",
"EXP",
"IRA",
"TIO",
"N",
"\\u",
"SECONDS_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"params_",
"[_",
"'",
"AW",
"SA",
"ccess",
"Key",
"Id",
"'_",
"]_",
"=_",
"self_",
"._",
"user",
"\\u",
"id_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"params_",
"[_",
"'",
"Expire",
"s",
"'_",
"]_",
"=_",
"expires_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"params_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Variable defined multiple times | AppScale/appscale/AppTaskQueue/distributed_tq.py | [
{
"content": " def get_task_headers(self, request):\n \"\"\" Gets the task headers used for a task web request. \n\n Args:\n request: A taskqueue_service_pb.TaskQueueAddRequest\n Returns:\n A dictionary of key/values for a web request.\n \"\"\" \n headers = {}\n for header in request.header_list():\n headers[header.key()] = header.value()\n\n eta = self.__when_to_run(request)\n \n # This header is how we authenticate that it's an internal request\n secret = appscale_info.get_secret() \n secret_hash = hashlib.sha1(request.app_id() + '/' + \\\n secret).hexdigest()\n headers['X-AppEngine-Fake-Is-Admin'] = secret_hash\n #headers['X-AppEngine-Development-Payload'] = secret_hash\n headers['X-AppEngine-QueueName'] = request.queue_name()\n headers['X-AppEngine-TaskName'] = request.task_name()\n headers['X-AppEngine-TaskRetryCount'] = '0'\n headers['X-AppEngine-TaskExecutionCount'] = '0'\n headers['X-AppEngine-TaskETA'] = str(int(eta.strftime(\"%s\")))\n return headers",
"metadata": "root.DistributedTaskQueue.get_task_headers",
"header": "['class', 'DistributedTaskQueue', '(', ')', ':', '___EOS___']",
"index": 684
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Variable_",
"defined_",
"multiple_",
"times_",
"[SEP]_",
"class_",
"Distribut",
"ed",
"Task",
"Queue_",
"(_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"task",
"\\u",
"headers_",
"(_",
"self_",
",_",
"request_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Get",
"s",
" ",
"the",
" ",
"task",
" ",
"header",
"s",
" ",
"used",
" ",
"for",
" ",
"a",
" ",
"task",
" ",
"web",
" ",
"request",
".",
" ",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Arg",
"s",
":",
"\\",
"10",
";",
" ",
" ",
"request",
":",
" ",
"A",
" ",
"task",
"queue",
"\\u",
"service",
"\\u",
"pb",
".",
"Task",
"Queue",
"Add",
"Request",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
":",
"\\",
"10",
";",
" ",
" ",
"A",
" ",
"dictionar",
"y",
" ",
"of",
" ",
"key",
"/",
"values",
" ",
"for",
" ",
"a",
" ",
"web",
" ",
"request",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"headers_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"header_",
"in_",
"request_",
"._",
"header",
"\\u",
"list_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"headers_",
"[_",
"header_",
"._",
"key_",
"(_",
")_",
"]_",
"=_",
"header_",
"._",
"value_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"eta_",
"=_",
"self_",
"._",
"\\u\\u",
"whe",
"n",
"\\u",
"to",
"\\u",
"run_",
"(_",
"request_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Thi",
"s",
" ",
"header",
" ",
"is",
" ",
"how",
" ",
"we",
" ",
"authenticat",
"e",
" ",
"tha",
"t",
" ",
"it",
"'",
"s",
" ",
"an",
" ",
"internal",
" ",
"request_",
"\\u\\u\\uNL\\u\\u\\u_",
"secret_",
"=_",
"apps",
"cale",
"\\u",
"info_",
"._",
"get",
"\\u",
"secret_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"secret",
"\\u",
"hash_",
"=_",
"hashlib_",
"._",
"sha1_",
"(_",
"request_",
"._",
"app",
"\\u",
"id_",
"(_",
")_",
"+_",
"'/'_",
"+_",
"secret_",
")_",
"._",
"hexdigest_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"headers_",
"[_",
"'",
"X",
"-",
"App",
"Engine",
"-",
"Fake",
"-",
"Is",
"-",
"Admi",
"n",
"'_",
"]_",
"=_",
"secret",
"\\u",
"hash_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
"header",
"s",
"['",
"X",
"-",
"App",
"Engine",
"-",
"Dev",
"elo",
"pme",
"nt",
"-",
"Pay",
"load",
"']",
" ",
"=",
" ",
"secret",
"\\u",
"hash_",
"\\u\\u\\uNL\\u\\u\\u_",
"headers_",
"[_",
"'",
"X",
"-",
"App",
"Engine",
"-",
"Queue",
"Name",
"'_",
"]_",
"=_",
"request_",
"._",
"queue",
"\\u",
"name_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"headers_",
"[_",
"'",
"X",
"-",
"App",
"Engine",
"-",
"Task",
"Name",
"'_",
"]_",
"=_",
"request_",
"._",
"task",
"\\u",
"name_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"headers_",
"[_",
"'",
"X",
"-",
"App",
"Engine",
"-",
"Task",
"Retr",
"y",
"Count",
"'_",
"]_",
"=_",
"'",
"0",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"headers_",
"[_",
"'",
"X",
"-",
"App",
"Engine",
"-",
"Task",
"Execut",
"ion",
"Count",
"'_",
"]_",
"=_",
"'",
"0",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"headers_",
"[_",
"'",
"X",
"-",
"App",
"Engine",
"-",
"Task",
"ETA",
"'_",
"]_",
"=_",
"str_",
"(_",
"int_",
"(_",
"eta_",
"._",
"strftime_",
"(_",
"\"%",
"s",
"\"_",
")_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"headers_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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Module is imported with 'import' and 'import from' | dropbox/changes/tests/changes/jobs/test_sync_job.py | [
{
"content": "from __future__ import absolute_import\n\nfrom datetime import datetime\nfrom flask import current_app\nimport mock\n\nfrom changes.constants import Status, Result\nfrom changes.config import db\nfrom changes.jobs.sync_job import sync_job, _should_retry_jobstep, _find_and_retry_jobsteps\nimport changes.jobs.sync_job\nfrom changes.models import ItemStat, Job, HistoricalImmutableStep, Task\nfrom changes.testutils import TestCase\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Module_",
"is_",
"imported_",
"with_",
"'",
"import",
"'_",
"and_",
"'",
"import",
" ",
"from",
"'_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"from_",
"\\u\\u",
"future\\u\\u_",
"import_",
"abs",
"olute",
"\\u",
"import_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"datetime_",
"import_",
"datetime_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"flask_",
"import_",
"current",
"\\u",
"app_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"mock_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"changes_",
"._",
"constants_",
"import_",
"Status_",
",_",
"Result_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"changes_",
"._",
"config_",
"import_",
"db_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"changes_",
"._",
"jobs_",
"._",
"sync",
"\\u",
"job_",
"import_",
"sync",
"\\u",
"job_",
",_",
"\\u",
"shou",
"ld",
"\\u",
"retr",
"y",
"\\u",
"jobst",
"ep_",
",_",
"\\u",
"find",
"\\u",
"and",
"\\u",
"retr",
"y",
"\\u",
"jobst",
"eps_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"changes_",
"._",
"jobs_",
"._",
"sync",
"\\u",
"job_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"changes_",
"._",
"models_",
"import_",
"Item",
"Stat_",
",_",
"Job_",
",_",
"Histori",
"cal",
"Immu",
"table",
"Step_",
",_",
"Task_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"changes_",
"._",
"testutils_",
"import_",
"Test",
"Case_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | pantsbuild/pants/contrib/android/tests/python/pants_test/contrib/android/tasks/test_sign_apk.py | [
{
"content": " def test_setup_default_config_no_permission(self):\n with temporary_file() as temp:\n os.chmod(temp.name, 0o400)\n with self.assertRaises(TaskError):\n SignApkTask.setup_default_config(temp.name)",
"metadata": "root.SignApkTest.test_setup_default_config_no_permission",
"header": "['class', 'SignApkTest', '(', 'TestAndroidBase', ')', ':', '___EOS___']",
"index": 73
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Sign",
"Ap",
"k",
"Test_",
"(_",
"Test",
"And",
"roid",
"Base_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"setup",
"\\u",
"default",
"\\u",
"config",
"\\u",
"no",
"\\u",
"permission_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"with_",
"temporar",
"y",
"\\u",
"file_",
"(_",
")_",
"as_",
"temp_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"os_",
"._",
"chmod_",
"(_",
"temp_",
"._",
"name_",
",_",
"0o",
"400_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"Task",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"Sign",
"Ap",
"k",
"Task_",
"._",
"setup",
"\\u",
"default",
"\\u",
"config_",
"(_",
"temp_",
"._",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Duplicate key in dict literal | Arelle/Arelle/arelle/FunctionXs.py | [
{
"content": "'''\nCreated on Dec 20, 2010\n\n@author: Mark V Systems Limited\n(c) Copyright 2010 Mark V Systems Limited, All rights reserved.\n'''\nimport datetime, re\nfrom arelle import (XPathContext, ModelValue)\nfrom arelle.FunctionUtil import (anytypeArg, atomicArg, stringArg, numericArg, qnameArg, nodeArg)\nfrom arelle.XPathParser import ProgHeader\nfrom math import isnan, fabs, isinf\nfrom decimal import Decimal, InvalidOperation\n \n\n\n \n \nobjtype = {\n #'untypedAtomic': untypedAtomic,\n 'dateTime': ModelValue.DateTime,\n 'date': ModelValue.DateTime,\n 'time': ModelValue.Time,\n #'duration': duration,\n 'yearMonthDuration': ModelValue.YearMonthDuration,\n 'dayTimeDuration': ModelValue.DayTimeDuration,\n 'float': float,\n 'double': float,\n 'decimal': Decimal,\n 'integer': _INT,\n 'nonPositiveInteger': _INT,\n 'negativeInteger': _INT,\n 'long': _INT,\n 'int': _INT,\n 'short': _INT,\n 'byte': _INT,\n 'nonNegativeInteger': _INT,\n 'unsignedLong': _INT,\n 'unsignedInt': _INT,\n 'unsignedShort': _INT,\n 'unsignedByte': _INT,\n 'positiveInteger': _INT,\n #'gYearMonth': gYearMonth,\n #'gYear': gYear,\n #'gMonthDay': gMonthDay,\n #'gDay': gDay,\n #'gMonth': gMonth,\n 'string': str,\n 'normalizedString': str,\n 'token': str,\n 'language': str,\n 'NMTOKEN': str,\n 'Name': str,\n 'NCName': str,\n 'ID': str,\n 'IDREF': str,\n 'ENTITY': str,\n 'boolean': bool,\n #'base64Binary': byte,\n #'hexBinary': byte,\n 'anyURI': ModelValue.AnyURI,\n 'QName': ModelValue.QName,\n 'NOTATION': str,\n }\n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \ntokenPattern = re.compile(r\"^\\s*([-\\.:\\w]+)\\s*$\")\n \nlanguagePattern = re.compile(\"[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*\")\n \n \n \n \n \n \n \n \n \n \n \n \n\nxsFunctions = {\n 'untypedAtomic': untypedAtomic,\n 'anyType': anyType,\n 'anyAtomicType': anyAtomicType,\n 'dateTime': dateTime,\n 'DATETIME_START': dateTime,\n 'DATETIME_INSTANT_END': dateTimeInstantEnd,\n 'XBRLI_DATEUNION': xbrliDateUnion,\n 'date': date,\n 'time': time,\n 'duration': duration,\n 'yearMonthDuration': yearMonthDuration,\n 'dayTimeDuration': dayTimeDuration,\n 'float': xs_float,\n 'double': double,\n 'decimal': decimal,\n 'integer': integer,\n 'nonPositiveInteger': nonPositiveInteger,\n 'negativeInteger': negativeInteger,\n 'long': long,\n 'int': xs_int,\n 'short': short,\n 'byte': byte,\n 'nonNegativeInteger': nonNegativeInteger,\n 'unsignedLong': unsignedLong,\n 'unsignedInt': unsignedInt,\n 'unsignedShort': unsignedShort,\n 'unsignedByte': unsignedByte,\n 'positiveInteger': positiveInteger,\n 'gYearMonth': gYearMonth,\n 'gYear': gYear,\n 'gMonthDay': gMonthDay,\n 'gDay': gDay,\n 'gMonth': gMonth,\n 'string': xsString,\n 'normalizedString': normalizedString,\n 'token': token,\n 'language': language,\n 'NMTOKEN': NMTOKEN,\n 'Name': Name,\n 'NCName': NCName,\n 'ID': ID,\n 'IDREF': IDREF,\n 'ENTITY': ENTITY,\n 'boolean': boolean,\n 'base64Binary': base64Binary,\n 'hexBinary': hexBinary,\n 'anyURI': anyURI,\n 'QName': QName,\n 'NOTATION': NOTATION,\n }\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Duplicate",
"_",
"key_",
"in_",
"dict_",
"literal_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"'''",
"\\",
"10",
";",
"Creat",
"ed",
" ",
"on",
" ",
"De",
"c",
" ",
"20",
",",
" ",
"2010",
"\\",
"10",
";",
"\\",
"10",
";",
"@",
"author",
":",
" ",
"Mark",
" ",
"V",
" ",
"System",
"s",
" ",
"Limit",
"ed",
"\\",
"10",
";",
"(",
"c",
")",
" ",
"Copy",
"right",
" ",
"2010",
" ",
"Mark",
" ",
"V",
" ",
"System",
"s",
" ",
"Limit",
"ed",
",",
" ",
"All",
" ",
"rights",
" ",
"reserve",
"d",
".",
"\\",
"10",
";'",
"''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"datetime_",
",_",
"re_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"are",
"lle",
"_",
"import_",
"(_",
"XP",
"ath",
"Context_",
",_",
"Model",
"Value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"are",
"lle",
"_",
"._",
"Function",
"Util_",
"import_",
"(_",
"anyt",
"ype",
"Arg_",
",_",
"atomi",
"c",
"Arg_",
",_",
"string",
"Arg_",
",_",
"numeri",
"c",
"Arg_",
",_",
"qna",
"me",
"Arg_",
",_",
"node",
"Arg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"are",
"lle",
"_",
"._",
"XP",
"ath",
"Parser_",
"import_",
"Prog",
"Header_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"math_",
"import_",
"isnan_",
",_",
"fabs_",
",_",
"isinf",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"decimal_",
"import_",
"Decimal_",
",_",
"Inva",
"lid",
"Operation_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"objtype",
"_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"#'",
"unt",
"ype",
"d",
"Atom",
"ic",
"':",
" ",
"unt",
"ype",
"d",
"Atom",
"ic",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"date",
"Time",
"'_",
":_",
"Model",
"Value_",
"._",
"Date",
"Time_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"date",
"'_",
":_",
"Model",
"Value_",
"._",
"Date",
"Time_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"time",
"'_",
":_",
"Model",
"Value_",
"._",
"Time_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#'",
"duration",
"':",
" ",
"duration",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"year",
"Mont",
"h",
"Dur",
"ation",
"'_",
":_",
"Model",
"Value_",
"._",
"Year",
"Mont",
"h",
"Duration_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"day",
"Time",
"Dur",
"ation",
"'_",
":_",
"Model",
"Value_",
"._",
"Day",
"Time",
"Duration_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"float",
"'_",
":_",
"float_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"double",
"'_",
":_",
"float_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"decima",
"l",
"'_",
":_",
"Decimal_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"integ",
"er",
"'_",
":_",
"\\u",
"INT_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"non",
"Posi",
"tiv",
"e",
"Integer",
"'_",
":_",
"\\u",
"INT_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"negati",
"ve",
"Integer",
"'_",
":_",
"\\u",
"INT_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"long",
"'_",
":_",
"\\u",
"INT_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"int",
"'_",
":_",
"\\u",
"INT_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"short",
"'_",
":_",
"\\u",
"INT_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"byte",
"'_",
":_",
"\\u",
"INT_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"non",
"Nega",
"tiv",
"e",
"Integer",
"'_",
":_",
"\\u",
"INT_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"unsigned",
"Long",
"'_",
":_",
"\\u",
"INT_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"unsigned",
"Int",
"'_",
":_",
"\\u",
"INT_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"unsigned",
"Short",
"'_",
":_",
"\\u",
"INT_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"unsigned",
"Byte",
"'_",
":_",
"\\u",
"INT_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"posit",
"ive",
"Integer",
"'_",
":_",
"\\u",
"INT_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#'",
"g",
"Year",
"Mont",
"h",
"':",
" ",
"g",
"Year",
"Mont",
"h",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#'",
"g",
"Year",
"':",
" ",
"g",
"Year",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#'",
"g",
"Mont",
"h",
"Day",
"':",
" ",
"g",
"Mont",
"h",
"Day",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#'",
"g",
"Day",
"':",
" ",
"g",
"Day",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#'",
"g",
"Mont",
"h",
"':",
" ",
"g",
"Mont",
"h",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"string",
"'_",
":_",
"str_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"normali",
"zed",
"String",
"'_",
":_",
"str_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"token",
"'_",
":_",
"str_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"language",
"'_",
":_",
"str_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"NM",
"TOKEN",
"'_",
":_",
"str_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Name",
"'_",
":_",
"str_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"NC",
"Name",
"'_",
":_",
"str_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"ID",
"'_",
":_",
"str_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"ID",
"REF",
"'_",
":_",
"str_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"ENTITY",
"'_",
":_",
"str_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"boolean",
"'_",
":_",
"bool_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#'",
"base64",
"Bin",
"ary",
"':",
" ",
"byte",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#'",
"hex",
"Bin",
"ary",
"':",
" ",
"byte",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"any",
"URI",
"'_",
":_",
"Model",
"Value_",
"._",
"Any",
"URI_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"QN",
"ame",
"'_",
":_",
"Model",
"Value_",
"._",
"QN",
"ame_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"NOT",
"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",
"s",
"*$",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"language",
"Pattern_",
"=_",
"re_",
"._",
"compile_",
"(_",
"\"[",
"a",
"-",
"z",
"A",
"-",
"Z",
"]{",
"1",
",",
"8",
"}(",
"-[",
"a",
"-",
"z",
"A",
"-",
"Z",
"0",
"-",
"9",
"]{",
"1",
",",
"8",
"})",
"*\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"xs",
"Functions_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"unt",
"ype",
"d",
"Atom",
"ic",
"'_",
":_",
"unt",
"ype",
"d",
"Atom",
"ic_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"any",
"Type",
"'_",
":_",
"any",
"Type_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"any",
"Atom",
"ic",
"Type",
"'_",
":_",
"any",
"Atom",
"ic",
"Type_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"date",
"Time",
"'_",
":_",
"date",
"Time_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"DATETIME",
"\\u",
"START",
"'_",
":_",
"date",
"Time_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"DATETIME",
"\\u",
"INSTA",
"NT",
"\\u",
"END",
"'_",
":_",
"date",
"Time",
"Instant",
"End_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"XB",
"RL",
"I",
"\\u",
"DAT",
"EU",
"NI",
"ON",
"'_",
":_",
"xbr",
"li",
"Date",
"Union_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"date",
"'_",
":_",
"date_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"time",
"'_",
":_",
"time_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"duration",
"'_",
":_",
"duration_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"year",
"Mont",
"h",
"Dur",
"ation",
"'_",
":_",
"year",
"Mont",
"h",
"Duration_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"day",
"Time",
"Dur",
"ation",
"'_",
":_",
"day",
"Time",
"Duration_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"float",
"'_",
":_",
"xs",
"\\u",
"float_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"double",
"'_",
":_",
"double_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"decima",
"l",
"'_",
":_",
"decimal_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"integ",
"er",
"'_",
":_",
"integer_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"non",
"Posi",
"tiv",
"e",
"Integer",
"'_",
":_",
"non",
"Posi",
"tiv",
"e",
"Integer_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"negati",
"ve",
"Integer",
"'_",
":_",
"negati",
"ve",
"Integer_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"long",
"'_",
":_",
"long_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"int",
"'_",
":_",
"xs",
"\\u",
"int_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"short",
"'_",
":_",
"short_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"byte",
"'_",
":_",
"byte_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"non",
"Nega",
"tiv",
"e",
"Integer",
"'_",
":_",
"non",
"Nega",
"tiv",
"e",
"Integer_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"unsigned",
"Long",
"'_",
":_",
"unsigned",
"Long_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"unsigned",
"Int",
"'_",
":_",
"unsigned",
"Int_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"unsigned",
"Short",
"'_",
":_",
"unsigned",
"Short_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"unsigned",
"Byte",
"'_",
":_",
"unsigned",
"Byte_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"posit",
"ive",
"Integer",
"'_",
":_",
"posit",
"ive",
"Integer_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"g",
"Year",
"Mont",
"h",
"'_",
":_",
"g",
"Year",
"Month_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"g",
"Year",
"'_",
":_",
"g",
"Year_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"g",
"Mont",
"h",
"Day",
"'_",
":_",
"g",
"Mont",
"h",
"Day_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"g",
"Day",
"'_",
":_",
"g",
"Day_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"g",
"Mont",
"h",
"'_",
":_",
"g",
"Month_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"string",
"'_",
":_",
"xs",
"String_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"normali",
"zed",
"String",
"'_",
":_",
"normali",
"zed",
"String_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"token",
"'_",
":_",
"token_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"language",
"'_",
":_",
"language_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"NM",
"TOKEN",
"'_",
":_",
"NM",
"TOKEN_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"Name",
"'_",
":_",
"Name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"NC",
"Name",
"'_",
":_",
"NC",
"Name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"ID",
"'_",
":_",
"ID_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"ID",
"REF",
"'_",
":_",
"ID",
"REF_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"ENTITY",
"'_",
":_",
"ENTITY",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"boolean",
"'_",
":_",
"boolean_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"base64",
"Bin",
"ary",
"'_",
":_",
"base64",
"Binary_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"hex",
"Bin",
"ary",
"'_",
":_",
"hex",
"Binary_",
",_",
"\\u\\u\\uNL\\u\\u\\u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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Use of the return value of a procedure | erkyrath/tworld/lib/twest/test_propcache.py | [
{
"content": " @tornado.testing.gen_test\n def test_prop_aliasing(self):\n yield self.resetTables()\n \n # Fresh propcache for each test (don't use app.propcache).\n cache = two.propcache.PropCache(self.app)\n\n instq = lambda key: ('instanceprop', self.exiid, self.exlocid, key)\n\n # x = True; y = True; del x; del y\n\n yield cache.set(instq('xx'), True)\n yield cache.set(instq('yy'), True)\n yield cache.delete(instq('xx'))\n yield cache.delete(instq('yy'))\n\n res = yield cache.get(instq('xx'))\n self.assertTrue(res is None)\n res = yield cache.get(instq('yy'))\n self.assertTrue(res is None)\n \n self.assertTrue(cache.get_by_object(True) is None)\n\n self.assertEqual(cache.note_changed_entries(), [])\n yield cache.write_all_dirty()\n self.assertEqual(cache.dirty_entries(), [])\n\n # _t = []; x = _t; y = _t; del x; del y\n \n ls = [2,3,4]\n yield cache.set(instq('xxx'), ls)\n yield cache.set(instq('yyy'), ls)\n\n res = cache.get_by_object(ls) # might get either prop\n self.assertTrue(res.val is ls)\n self.assertTrue(res.key in ('xxx', 'yyy'))\n \n yield cache.delete(instq('xxx'))\n yield cache.delete(instq('yyy'))\n \n self.assertEqual(cache.note_changed_entries(), [])\n yield cache.write_all_dirty()\n self.assertEqual(cache.dirty_entries(), [])\n\n res = yield cache.get(instq('xxx'))\n self.assertTrue(res is None)\n res = yield cache.get(instq('yyy'))\n self.assertTrue(res is None)\n \n # _t = []; x = _t; y = _t; _t.append(1)\n\n ls = [2,3,4]\n yield cache.set(instq('xx'), ls)\n yield cache.set(instq('yy'), ls)\n\n ls.append(1)\n \n res = yield cache.get(instq('xx'))\n self.assertEqual(res.val, [2,3,4,1])\n res = yield cache.get(instq('yy'))\n self.assertEqual(res.val, [2,3,4,1])\n \n ls.insert(0, -1)\n \n self.assertEqual(cache.note_changed_entries(), [])\n yield cache.write_all_dirty()\n self.assertEqual(cache.dirty_entries(), [])\n\n res = yield cache.get(instq('xx'))\n self.assertEqual(res.val, [-1,2,3,4,1])\n res = yield cache.get(instq('yy'))\n self.assertEqual(res.val, [-1,2,3,4,1])\n\n # _t = {}; x = _t; y = _t; x['one'] = 1\n \n map = {}\n yield cache.set(instq('map'), map)\n yield cache.set(instq('map2'), map)\n\n map['one'] = 1\n \n self.assertEqual(cache.note_changed_entries(), [])\n yield cache.write_all_dirty()\n self.assertEqual(cache.dirty_entries(), [])\n\n res = yield cache.get(instq('map'))\n self.assertEqual(res.val, {'one':1})\n res = yield cache.get(instq('map2'))\n self.assertEqual(res.val, {'one':1})",
"metadata": "root.TestPropcache.test_prop_aliasing",
"header": "['class', 'TestPropcache', '(', 'twest', '.', 'mock', '.', 'MockAppTestCase', ')', ':', '___EOS___']",
"index": 274
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Use_",
"of_",
"the_",
"return_",
"value_",
"of_",
"a_",
"procedure_",
"[SEP]_",
"class_",
"Test",
"Prop",
"cache_",
"(_",
"twe",
"st_",
"._",
"mock_",
"._",
"Moc",
"k",
"App",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"tornado_",
"._",
"testing_",
"._",
"gen",
"\\u",
"test_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"test\\u",
"prop",
"\\u",
"alias",
"ing_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"yield_",
"self_",
"._",
"reset",
"Tables_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Fre",
"sh",
" ",
"prop",
"cache",
" ",
"for",
" ",
"each",
" ",
"test",
" ",
"(",
"don",
"'",
"t",
" ",
"use",
" ",
"app",
".",
"prop",
"cache",
").",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"cache_",
"=_",
"two_",
"._",
"prop",
"cache_",
"._",
"Prop",
"Cache_",
"(_",
"self_",
"._",
"app_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"inst",
"q_",
"=_",
"lambda_",
"key_",
":_",
"(_",
"'",
"instance",
"prop",
"'_",
",_",
"self_",
"._",
"exi",
"id_",
",_",
"self_",
"._",
"ex",
"loci",
"d_",
",_",
"key_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"x",
" ",
"=",
" ",
"Tru",
"e",
";",
" ",
"y",
" ",
"=",
" ",
"Tru",
"e",
";",
" ",
"del",
" ",
"x",
";",
" ",
"del",
" ",
"y_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"yield_",
"cache_",
"._",
"set_",
"(_",
"inst",
"q_",
"(_",
"'",
"xx",
"'_",
")_",
",_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"cache_",
"._",
"set_",
"(_",
"inst",
"q_",
"(_",
"'",
"yy",
"'_",
")_",
",_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"cache_",
"._",
"delete_",
"(_",
"inst",
"q_",
"(_",
"'",
"xx",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"cache_",
"._",
"delete_",
"(_",
"inst",
"q_",
"(_",
"'",
"yy",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"xx",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"is_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"yy",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"is_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"cache_",
"._",
"get",
"\\u",
"by",
"\\u",
"object_",
"(_",
"True_",
")_",
"is_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"note",
"\\u",
"change",
"d\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"cache_",
"._",
"write",
"\\u",
"all",
"\\u",
"dirty_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"dir",
"ty",
"\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"\\u",
"t",
" ",
"=",
" ",
"[]",
";",
" ",
"x",
" ",
"=",
" ",
"\\u",
"t",
";",
" ",
"y",
" ",
"=",
" ",
"\\u",
"t",
";",
" ",
"del",
" ",
"x",
";",
" ",
"del",
" ",
"y_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"ls_",
"=_",
"[_",
"2_",
",_",
"3_",
",_",
"4_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"cache_",
"._",
"set_",
"(_",
"inst",
"q_",
"(_",
"'",
"xxx",
"'_",
")_",
",_",
"ls_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"cache_",
"._",
"set_",
"(_",
"inst",
"q_",
"(_",
"'",
"yyy",
"'_",
")_",
",_",
"ls_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"cache_",
"._",
"get",
"\\u",
"by",
"\\u",
"object_",
"(_",
"ls_",
")_",
"#",
" ",
"mig",
"ht",
" ",
"get",
" ",
"eit",
"her",
" ",
"prop_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"._",
"val_",
"is_",
"ls_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"._",
"key_",
"in_",
"(_",
"'",
"xxx",
"'_",
",_",
"'",
"yyy",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"yield_",
"cache_",
"._",
"delete_",
"(_",
"inst",
"q_",
"(_",
"'",
"xxx",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"cache_",
"._",
"delete_",
"(_",
"inst",
"q_",
"(_",
"'",
"yyy",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"note",
"\\u",
"change",
"d\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"cache_",
"._",
"write",
"\\u",
"all",
"\\u",
"dirty_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"dir",
"ty",
"\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"xxx",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"is_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"yyy",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"res_",
"is_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"\\u",
"t",
" ",
"=",
" ",
"[]",
";",
" ",
"x",
" ",
"=",
" ",
"\\u",
"t",
";",
" ",
"y",
" ",
"=",
" ",
"\\u",
"t",
";",
" ",
"\\u",
"t",
".",
"append",
"(",
"1",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"ls_",
"=_",
"[_",
"2_",
",_",
"3_",
",_",
"4_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"cache_",
"._",
"set_",
"(_",
"inst",
"q_",
"(_",
"'",
"xx",
"'_",
")_",
",_",
"ls_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"cache_",
"._",
"set_",
"(_",
"inst",
"q_",
"(_",
"'",
"yy",
"'_",
")_",
",_",
"ls_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"ls_",
"._",
"append_",
"(_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"xx",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"val_",
",_",
"[_",
"2_",
",_",
"3_",
",_",
"4_",
",_",
"1_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"yy",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"val_",
",_",
"[_",
"2_",
",_",
"3_",
",_",
"4_",
",_",
"1_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"ls_",
"._",
"insert_",
"(_",
"0_",
",_",
"-_",
"1_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"note",
"\\u",
"change",
"d\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"cache_",
"._",
"write",
"\\u",
"all",
"\\u",
"dirty_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"dir",
"ty",
"\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"xx",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"val_",
",_",
"[_",
"-_",
"1_",
",_",
"2_",
",_",
"3_",
",_",
"4_",
",_",
"1_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"yy",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"val_",
",_",
"[_",
"-_",
"1_",
",_",
"2_",
",_",
"3_",
",_",
"4_",
",_",
"1_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"\\u",
"t",
" ",
"=",
" ",
"{};",
" ",
"x",
" ",
"=",
" ",
"\\u",
"t",
";",
" ",
"y",
" ",
"=",
" ",
"\\u",
"t",
";",
" ",
"x",
"['",
"one",
"']",
" ",
"=",
" ",
"1_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"map_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"cache_",
"._",
"set_",
"(_",
"inst",
"q_",
"(_",
"'",
"map",
"'_",
")_",
",_",
"map_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"cache_",
"._",
"set_",
"(_",
"inst",
"q_",
"(_",
"'",
"map",
"2",
"'_",
")_",
",_",
"map_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"map_",
"[_",
"'",
"one",
"'_",
"]_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"note",
"\\u",
"change",
"d\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"yield_",
"cache_",
"._",
"write",
"\\u",
"all",
"\\u",
"dirty_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"cache_",
"._",
"dir",
"ty",
"\\u",
"entries_",
"(_",
")_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"map",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"val_",
",_",
"{_",
"'",
"one",
"'_",
":_",
"1_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"yield_",
"cache_",
"._",
"get_",
"(_",
"inst",
"q_",
"(_",
"'",
"map",
"2",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"val_",
",_",
"{_",
"'",
"one",
"'_",
":_",
"1_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Variable defined multiple times | scikit-learn/scikit-learn/sklearn/model_selection/_split.py | [
{
"content": " def get_n_splits(self, X, y, labels):\n \"\"\"Returns the number of splitting iterations in the cross-validator\n\n Parameters\n ----------\n X : object\n Always ignored, exists for compatibility.\n\n y : object\n Always ignored, exists for compatibility.\n\n labels : array-like, with shape (n_samples,), optional\n Group labels for the samples used while splitting the dataset into\n train/test set.\n\n Returns\n -------\n n_splits : int\n Returns the number of splitting iterations in the cross-validator.\n \"\"\"\n if labels is None:\n raise ValueError(\"The labels parameter should not be None\")\n return int(comb(len(np.unique(labels)), self.n_labels, exact=True))",
"metadata": "root.LeavePLabelOut.get_n_splits",
"header": "['class', 'LeavePLabelOut', '(', 'BaseCrossValidator', ')', ':', '___EOS___']",
"index": 778
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Variable_",
"defined_",
"multiple_",
"times_",
"[SEP]_",
"class_",
"Leav",
"e",
"PL",
"abel",
"Out_",
"(_",
"Base",
"Cross",
"Validator_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"n",
"\\u",
"splits_",
"(_",
"self_",
",_",
"X_",
",_",
"y_",
",_",
"labels_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Return",
"s",
" ",
"the",
" ",
"number",
" ",
"of",
" ",
"splitting",
" ",
"iterati",
"ons",
" ",
"in",
" ",
"the",
" ",
"cross",
"-",
"validator",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"X",
" ",
":",
" ",
"object",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Al",
"way",
"s",
" ",
"ignore",
"d",
",",
" ",
"exist",
"s",
" ",
"for",
" ",
"compatibility",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"y",
" ",
":",
" ",
"object",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Al",
"way",
"s",
" ",
"ignore",
"d",
",",
" ",
"exist",
"s",
" ",
"for",
" ",
"compatibility",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"labels",
" ",
":",
" ",
"array",
"-",
"like",
",",
" ",
"with",
" ",
"shape",
" ",
"(",
"n",
"\\u",
"samples",
",)",
",",
" ",
"option",
"al",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Group",
" ",
"labels",
" ",
"for",
" ",
"the",
" ",
"samples",
" ",
"used",
" ",
"whi",
"le",
" ",
"splitting",
" ",
"the",
" ",
"dataset",
" ",
"int",
"o",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"train",
"/",
"test",
" ",
"set",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"n",
"\\u",
"split",
"s",
" ",
":",
" ",
"int",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
" ",
"the",
" ",
"number",
" ",
"of",
" ",
"splitting",
" ",
"iterati",
"ons",
" ",
"in",
" ",
"the",
" ",
"cross",
"-",
"validator",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"labels_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Value",
"Error_",
"(_",
"\"",
"The",
" ",
"labels",
" ",
"parameter",
" ",
"shou",
"ld",
" ",
"not",
" ",
"be",
" ",
"Non",
"e",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"int_",
"(_",
"comb_",
"(_",
"len_",
"(_",
"np_",
"._",
"unique_",
"(_",
"labels_",
")_",
")_",
",_",
"self_",
"._",
"n",
"\\u",
"labels_",
",_",
"exact_",
"=_",
"True_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | basho/riak-python-client/riak/tests/test_btypes.py | [
{
"content": " def test_default_btype_list_buckets(self):\n default_btype = self.client.bucket_type(\"default\")\n bucket = default_btype.bucket(self.bucket_name)\n obj = bucket.new(self.key_name)\n obj.data = [1, 2, 3]\n obj.store()\n\n self.assertIn(bucket, default_btype.get_buckets())\n buckets = []\n for nested_buckets in default_btype.stream_buckets():\n buckets.extend(nested_buckets)\n\n self.assertIn(bucket, buckets)\n\n self.assertItemsEqual(buckets, self.client.get_buckets())",
"metadata": "root.BucketTypeTests.test_default_btype_list_buckets",
"header": "['class', 'BucketTypeTests', '(', 'IntegrationTestBase', ',', 'unittest', '.', 'TestCase', ',', 'Comparison', ')', ':', '___EOS___']",
"index": 103
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Buck",
"et",
"Type",
"Tests_",
"(_",
"Integrati",
"on",
"Test",
"Base_",
",_",
"unittest_",
"._",
"Test",
"Case_",
",_",
"Compari",
"son_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"default",
"\\u",
"bt",
"ype",
"\\u",
"list",
"\\u",
"buckets_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"default",
"\\u",
"bt",
"ype_",
"=_",
"self_",
"._",
"client_",
"._",
"bucket",
"\\u",
"type_",
"(_",
"\"",
"default",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bucket_",
"=_",
"default",
"\\u",
"bt",
"ype_",
"._",
"bucket_",
"(_",
"self_",
"._",
"bucket",
"\\u",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"obj_",
"=_",
"bucket_",
"._",
"new_",
"(_",
"self_",
"._",
"key",
"\\u",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"obj_",
"._",
"data_",
"=_",
"[_",
"1_",
",_",
"2_",
",_",
"3_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"obj_",
"._",
"store_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"In_",
"(_",
"bucket_",
",_",
"default",
"\\u",
"bt",
"ype_",
"._",
"get",
"\\u",
"buckets_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"buckets_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"nest",
"ed",
"\\u",
"buckets_",
"in_",
"default",
"\\u",
"bt",
"ype_",
"._",
"stream",
"\\u",
"buckets_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"buckets_",
"._",
"extend_",
"(_",
"nest",
"ed",
"\\u",
"buckets_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"assert",
"In_",
"(_",
"bucket_",
",_",
"buckets_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Item",
"s",
"Equal_",
"(_",
"buckets_",
",_",
"self_",
"._",
"client_",
"._",
"get",
"\\u",
"buckets_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | axialmarket/fsq/setup.py | [
{
"content": "from setuptools import setup\n\nsetup(\n name='fsq',\n version='0.2.6',\n author='Matthew Story',\n author_email='[email protected]',\n packages=['fsq', 'fsq.tests', 'fsq.remote', ],\n scripts=['bin/fsq'],\n data_files=[('share/man/man1', ['man/man1/fsq.1',\n 'man/man1/fsq-down.1',\n 'man/man1/fsq-enqueue.1',\n 'man/man1/fsq-scan.1',\n 'man/man1/fsq-up.1',\n 'man/man1/fsq-rm-host.1',\n 'man/man1/fsq-add-host.1',\n 'man/man1/fsq-down-host.1',\n 'man/man1/fsq-up-host.1',\n 'man/man1/fsq-push.1',\n 'man/man1/fsq-jsonrpcd.1',\n 'man/man1/fsq-install.1']),\n ('share/man/man7', ['man/man7/fsq.7']),\n ('libexec/fsq', ['libexec/fsq/down.py',\n 'libexec/fsq/enqueue.py',\n 'libexec/fsq/install.py',\n 'libexec/fsq/scan.py',\n 'libexec/fsq/up.py',\n 'libexec/fsq/add-host.py',\n 'libexec/fsq/down-host.py',\n 'libexec/fsq/host-dist.py',\n 'libexec/fsq/push.py',\n 'libexec/fsq/rm-host.py',\n 'libexec/fsq/up-host.py',\n 'libexec/fsq/jsonrpcd.py',\n ]),\n ],\n url='https://github.com/axialmarket/fsq',\n license='3-BSD',\n description='File System Queue',\n long_description=open('./README.rst').read(),\n install_requires= ['jsonrpclib >= 0.1.3']\n)\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"from_",
"setuptools_",
"import_",
"setup_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"setup_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"name_",
"=_",
"'",
"fs",
"q",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"version_",
"=_",
"'",
"0.",
"2.6",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"author_",
"=_",
"'",
"Matt",
"hew",
" ",
"Stor",
"y",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"author",
"\\u",
"email_",
"=_",
"'",
"matt",
".",
"stor",
"y",
"@",
"axi",
"al",
".",
"net",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"packages_",
"=_",
"[_",
"'",
"fs",
"q",
"'_",
",_",
"'",
"fs",
"q",
".",
"tests",
"'_",
",_",
"'",
"fs",
"q",
".",
"remote",
"'_",
",_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"scripts_",
"=_",
"[_",
"'",
"bin",
"/",
"fs",
"q",
"'_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"data\\u",
"files_",
"=_",
"[_",
"(_",
"'",
"share",
"/",
"man",
"/",
"man",
"1",
"'_",
",_",
"[_",
"'",
"man",
"/",
"man",
"1",
"/",
"fs",
"q",
".1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"man",
"/",
"man",
"1",
"/",
"fs",
"q",
"-",
"down",
".1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"man",
"/",
"man",
"1",
"/",
"fs",
"q",
"-",
"enqueue",
".1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"man",
"/",
"man",
"1",
"/",
"fs",
"q",
"-",
"scan",
".1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"man",
"/",
"man",
"1",
"/",
"fs",
"q",
"-",
"up",
".1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"man",
"/",
"man",
"1",
"/",
"fs",
"q",
"-",
"rm",
"-",
"host",
".1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"man",
"/",
"man",
"1",
"/",
"fs",
"q",
"-",
"add",
"-",
"host",
".1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"man",
"/",
"man",
"1",
"/",
"fs",
"q",
"-",
"down",
"-",
"host",
".1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"man",
"/",
"man",
"1",
"/",
"fs",
"q",
"-",
"up",
"-",
"host",
".1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"man",
"/",
"man",
"1",
"/",
"fs",
"q",
"-",
"push",
".1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"man",
"/",
"man",
"1",
"/",
"fs",
"q",
"-",
"jsonrpc",
"d",
".1",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"man",
"/",
"man",
"1",
"/",
"fs",
"q",
"-",
"install",
".1",
"'_",
"]_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"share",
"/",
"man",
"/",
"man",
"7",
"'_",
",_",
"[_",
"'",
"man",
"/",
"man",
"7",
"/",
"fs",
"q",
".7",
"'_",
"]_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"libe",
"xec",
"/",
"fs",
"q",
"'_",
",_",
"[_",
"'",
"libe",
"xec",
"/",
"fs",
"q",
"/",
"down",
".",
"py",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"libe",
"xec",
"/",
"fs",
"q",
"/",
"enqueue",
".",
"py",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"libe",
"xec",
"/",
"fs",
"q",
"/",
"install",
".",
"py",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"libe",
"xec",
"/",
"fs",
"q",
"/",
"scan",
".",
"py",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"libe",
"xec",
"/",
"fs",
"q",
"/",
"up",
".",
"py",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"libe",
"xec",
"/",
"fs",
"q",
"/",
"add",
"-",
"host",
".",
"py",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"libe",
"xec",
"/",
"fs",
"q",
"/",
"down",
"-",
"host",
".",
"py",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"libe",
"xec",
"/",
"fs",
"q",
"/",
"host",
"-",
"dist",
".",
"py",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"libe",
"xec",
"/",
"fs",
"q",
"/",
"push",
".",
"py",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"libe",
"xec",
"/",
"fs",
"q",
"/",
"rm",
"-",
"host",
".",
"py",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"libe",
"xec",
"/",
"fs",
"q",
"/",
"up",
"-",
"host",
".",
"py",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"libe",
"xec",
"/",
"fs",
"q",
"/",
"jsonrpc",
"d",
".",
"py",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"url_",
"=_",
"'",
"https",
"://",
"git",
"hub",
".",
"com",
"/",
"axi",
"alma",
"rke",
"t",
"/",
"fs",
"q",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"license_",
"=_",
"'",
"3",
"-",
"BS",
"D",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"description_",
"=_",
"'",
"File",
" ",
"System",
" ",
"Queue",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"long",
"\\u",
"description_",
"=_",
"open_",
"(_",
"'./",
"READ",
"ME",
".",
"rst",
"'_",
")_",
"._",
"read_",
"(_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"install",
"\\u",
"requires_",
"=_",
"[_",
"'",
"jsonrpc",
"lib",
" ",
">=",
" ",
"0.",
"1.3",
"'_",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2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
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Variable defined multiple times | codeinn/vcs/vcs/backends/git/changeset.py | [
{
"content": " def _get_id_for_path(self, path):\n\n # FIXME: Please, spare a couple of minutes and make those codes cleaner;\n if not path in self._paths:\n path = path.strip('/')\n # set root tree\n tree = self.repository._repo[self._tree_id]\n if path == '':\n self._paths[''] = tree.id\n return tree.id\n splitted = path.split('/')\n dirs, name = splitted[:-1], splitted[-1]\n curdir = ''\n\n # initially extract things from root dir\n for item, stat, id in tree.iteritems():\n if curdir:\n name = '/'.join((curdir, item))\n else:\n name = item\n self._paths[name] = id\n self._stat_modes[name] = stat\n\n for dir in dirs:\n if curdir:\n curdir = '/'.join((curdir, dir))\n else:\n curdir = dir\n dir_id = None\n for item, stat, id in tree.iteritems():\n if dir == item:\n dir_id = id\n if dir_id:\n # Update tree\n tree = self.repository._repo[dir_id]\n if not isinstance(tree, objects.Tree):\n raise ChangesetError('%s is not a directory' % curdir)\n else:\n raise ChangesetError('%s have not been found' % curdir)\n\n # cache all items from the given traversed tree\n for item, stat, id in tree.iteritems():\n if curdir:\n name = '/'.join((curdir, item))\n else:\n name = item\n self._paths[name] = id\n self._stat_modes[name] = stat\n if not path in self._paths:\n raise NodeDoesNotExistError(\"There is no file nor directory \"\n \"at the given path '%s' at revision %s\"\n % (path, self.short_id))\n return self._paths[path]",
"metadata": "root.GitChangeset._get_id_for_path",
"header": "['class', 'GitChangeset', '(', 'BaseChangeset', ')', ':', '___EOS___']",
"index": 105
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Variable_",
"defined_",
"multiple_",
"times_",
"[SEP]_",
"class_",
"Git",
"Change",
"set_",
"(_",
"Base",
"Change",
"set_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get",
"\\u",
"id",
"\\u",
"for",
"\\u",
"path_",
"(_",
"self_",
",_",
"path_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"FIX",
"ME",
":",
" ",
"Ple",
"ase",
",",
" ",
"spare",
" ",
"a",
" ",
"couple",
" ",
"of",
" ",
"minute",
"s",
" ",
"and",
" ",
"make",
" ",
"tho",
"se",
" ",
"codes",
" ",
"cleaner",
";_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"path_",
"in_",
"self_",
"._",
"\\u",
"paths_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"path_",
"=_",
"path_",
"._",
"strip_",
"(_",
"'/'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"set",
" ",
"root",
" ",
"tree_",
"\\u\\u\\uNL\\u\\u\\u_",
"tree_",
"=_",
"self_",
"._",
"repository_",
"._",
"\\u",
"repo_",
"[_",
"self_",
"._",
"\\u",
"tree",
"\\u",
"id_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"path_",
"==_",
"''_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"paths_",
"[_",
"''_",
"]_",
"=_",
"tree_",
"._",
"id_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"tree_",
"._",
"id_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"splitted_",
"=_",
"path_",
"._",
"split_",
"(_",
"'/'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"dirs_",
",_",
"name_",
"=_",
"splitted_",
"[_",
":_",
"-_",
"1_",
"]_",
",_",
"splitted_",
"[_",
"-_",
"1_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"curdir_",
"=_",
"''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"initially",
" ",
"extract",
" ",
"thing",
"s",
" ",
"from",
" ",
"root",
" ",
"dir_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"item_",
",_",
"stat_",
",_",
"id_",
"in_",
"tree_",
"._",
"iteritems_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"curdir_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"name_",
"=_",
"'/'_",
"._",
"join_",
"(_",
"(_",
"curdir_",
",_",
"item_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"name_",
"=_",
"item_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"paths_",
"[_",
"name_",
"]_",
"=_",
"id_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"stat",
"\\u",
"modes_",
"[_",
"name_",
"]_",
"=_",
"stat_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"dir_",
"in_",
"dirs_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"curdir_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"curdir_",
"=_",
"'/'_",
"._",
"join_",
"(_",
"(_",
"curdir_",
",_",
"dir_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"curdir_",
"=_",
"dir_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"dir\\u",
"id_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"item_",
",_",
"stat_",
",_",
"id_",
"in_",
"tree_",
"._",
"iteritems_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"if_",
"dir_",
"==_",
"item_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"dir\\u",
"id_",
"=_",
"id_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"dir\\u",
"id_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Update",
" ",
"tree_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"tree_",
"=_",
"self_",
"._",
"repository_",
"._",
"\\u",
"repo_",
"[_",
"dir\\u",
"id_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"isinstance_",
"(_",
"tree_",
",_",
"objects_",
"._",
"Tree_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"raise_",
"Change",
"set",
"Error_",
"(_",
"'%",
"s",
" ",
"is",
" ",
"not",
" ",
"a",
" ",
"director",
"y",
"'_",
"%_",
"curdir_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"raise_",
"Change",
"set",
"Error_",
"(_",
"'%",
"s",
" ",
"have",
" ",
"not",
" ",
"bee",
"n",
" ",
"found",
"'_",
"%_",
"curdir_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"cache",
" ",
"all",
" ",
"items",
" ",
"from",
" ",
"the",
" ",
"give",
"n",
" ",
"traverse",
"d",
" ",
"tree_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"item_",
",_",
"stat_",
",_",
"id_",
"in_",
"tree_",
"._",
"iteritems_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"if_",
"curdir_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"name_",
"=_",
"'/'_",
"._",
"join_",
"(_",
"(_",
"curdir_",
",_",
"item_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"name_",
"=_",
"item_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"paths_",
"[_",
"name_",
"]_",
"=_",
"id_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"stat",
"\\u",
"modes_",
"[_",
"name_",
"]_",
"=_",
"stat_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"not_",
"path_",
"in_",
"self_",
"._",
"\\u",
"paths_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Node",
"Do",
"es",
"Not",
"Exist",
"Error_",
"(_",
"\"",
"There",
" ",
"is",
" ",
"no",
" ",
"file",
" ",
"nor",
" ",
"director",
"y",
" ",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"at",
" ",
"the",
" ",
"give",
"n",
" ",
"path",
" ",
"'%",
"s",
"'",
" ",
"at",
" ",
"revis",
"ion",
" ",
"%",
"s",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"%_",
"(_",
"path_",
",_",
"self_",
"._",
"short",
"\\u",
"id_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"self_",
"._",
"\\u",
"paths_",
"[_",
"path_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2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
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | acba/elm/elm/elmk.py | [
{
"content": " def _local_train(self, training_patterns, training_expected_targets,\n params):\n\n # If params not provided, uses initialized parameters values\n if not params:\n pass\n else:\n self.param_kernel_function = params[0]\n self.param_c = params[1]\n self.param_kernel_params = params[2]\n\n # Need to save all training patterns to perform kernel calculation at\n # testing and prediction phase\n self.training_patterns = training_patterns\n\n number_training_patterns = self.training_patterns.shape[0]\n\n # Training phase\n\n omega_train = self._kernel_matrix(self.training_patterns,\n self.param_kernel_function,\n self.param_kernel_params)\n\n self.output_weight = np.linalg.solve(\n (omega_train + np.eye(number_training_patterns) /\n (2 ** self.param_c)),\n training_expected_targets).reshape(-1, 1)\n\n training_predicted_targets = np.dot(omega_train, self.output_weight)\n\n return training_predicted_targets",
"metadata": "root.ELMKernel._local_train",
"header": "['class', 'ELMKernel', '(', 'MLTools', ')', ':', '___EOS___']",
"index": 210
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"EL",
"MK",
"ern",
"el_",
"(_",
"ML",
"Tools_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"local",
"\\u",
"train_",
"(_",
"self_",
",_",
"train",
"ing",
"\\u",
"patterns_",
",_",
"train",
"ing",
"\\u",
"expected",
"\\u",
"targets_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"params_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"params",
" ",
"not",
" ",
"provided",
",",
" ",
"use",
"s",
" ",
"initialize",
"d",
" ",
"parameter",
"s",
" ",
"values_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"params_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"param",
"\\u",
"kernel",
"\\u",
"function_",
"=_",
"params_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"param",
"\\u",
"c_",
"=_",
"params_",
"[_",
"1_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"param",
"\\u",
"kernel",
"\\u",
"params_",
"=_",
"params_",
"[_",
"2_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Ne",
"ed",
" ",
"to",
" ",
"save",
" ",
"all",
" ",
"train",
"ing",
" ",
"pattern",
"s",
" ",
"to",
" ",
"perform",
" ",
"kernel",
" ",
"calculati",
"on",
" ",
"at_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"testi",
"ng",
" ",
"and",
" ",
"predicti",
"on",
" ",
"phase_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"train",
"ing",
"\\u",
"patterns_",
"=_",
"train",
"ing",
"\\u",
"patterns_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"number",
"\\u",
"train",
"ing",
"\\u",
"patterns_",
"=_",
"self_",
"._",
"train",
"ing",
"\\u",
"patterns_",
"._",
"shape_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Train",
"ing",
" ",
"phase_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"omega",
"\\u",
"train_",
"=_",
"self_",
"._",
"\\u",
"kernel",
"\\u",
"matrix_",
"(_",
"self_",
"._",
"train",
"ing",
"\\u",
"patterns_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"param",
"\\u",
"kernel",
"\\u",
"function_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"param",
"\\u",
"kernel",
"\\u",
"params_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"output",
"\\u",
"weight_",
"=_",
"np_",
"._",
"linalg_",
"._",
"solve_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"omega",
"\\u",
"train_",
"+_",
"np_",
"._",
"eye_",
"(_",
"number",
"\\u",
"train",
"ing",
"\\u",
"patterns_",
")_",
"/_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"2_",
"**_",
"self_",
"._",
"param",
"\\u",
"c_",
")_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"train",
"ing",
"\\u",
"expected",
"\\u",
"targets_",
")_",
"._",
"reshape_",
"(_",
"-_",
"1_",
",_",
"1_",
")_",
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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | celery/cell/cell/tests/actors/test_results.py | [
{
"content": " def test_to_python(self):\n ok_message = {'ok': 'the quick_brown_fox'}\n ares = self.get_async_result()\n\n # ------------------------------\n # reply is a successful message\n # ------------------------------\n\n # correct format\n res = ares.to_python(ok_message)\n\n self.assertEqual(res, ok_message['ok'])\n\n # correct format with multiple keys in the reply dict\n ok_message = {'ok': 'the quick_brown_fox',\n 'foo': 'the quick_brown_fox'}\n res = ares.to_python(ok_message)\n self.assertEqual(res, ok_message['ok'])\n\n # contains both ok and nok\n ok_message = {'ok': 'the quick_brown_fox',\n 'nok': 'the quick_brown_fox'}\n res = ares.to_python(ok_message)\n self.assertEqual(res, ok_message['ok'])\n\n # ---------------------------\n # reply is an error message\n # ---------------------------\n\n # correct error format with to propagate param set\n error_message = {'nok': [Exception('jump over')]}\n with self.assertRaises(ares.Error):\n ares.to_python(error_message)\n\n # correct error format with to propagate set to True\n with self.assertRaises(ares.Error):\n ares.to_python(error_message, propagate=True)\n\n # correct error format with to propagate set to False\n error_message = {'nok': ['jump over', None]}\n res = ares.to_python(error_message, propagate=False)\n self.assertEquals(res.__dict__,\n ares.Error(*error_message.get('nok')).__dict__)\n\n # neither nok or ok message given\n error_message = {'foo': ['jump over']}\n with self.assertRaises(ares.Error):\n ares.to_python(error_message)\n\n # multiple keys in the reply dics given, one of teh eks is nok\n error_message = {'foo': 'the quick_brown_fox',\n 'nok': ['jump over']}\n res = ares.to_python(error_message, propagate=False)\n self.assertEqual(res.__dict__,\n ares.Error(*error_message['nok']).__dict__)",
"metadata": "root.test_AsyncResuls.test_to_python",
"header": "['class', 'test_AsyncResuls', '(', 'Case', ')', ':', '___EOS___']",
"index": 65
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"test\\u",
"Async",
"Resu",
"ls_",
"(_",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"to",
"\\u",
"python_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ok",
"\\u",
"message_",
"=_",
"{_",
"'",
"ok",
"'_",
":_",
"'",
"the",
" ",
"quick",
"\\u",
"brow",
"n",
"\\u",
"fox",
"'_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ares",
"_",
"=_",
"self_",
"._",
"get",
"\\u",
"async",
"\\u",
"result_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"repl",
"y",
" ",
"is",
" ",
"a",
" ",
"success",
"ful",
" ",
"message_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"--------------",
"--",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"correct",
" ",
"format_",
"\\u\\u\\uNL\\u\\u\\u_",
"res_",
"=_",
"ares",
"_",
"._",
"to",
"\\u",
"python_",
"(_",
"ok",
"\\u",
"message_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
",_",
"ok",
"\\u",
"message_",
"[_",
"'",
"ok",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"correct",
" ",
"format",
" ",
"with",
" ",
"multiple",
" ",
"keys",
" ",
"in",
" ",
"the",
" ",
"repl",
"y",
" ",
"dict_",
"\\u\\u\\uNL\\u\\u\\u_",
"ok",
"\\u",
"message_",
"=_",
"{_",
"'",
"ok",
"'_",
":_",
"'",
"the",
" ",
"quick",
"\\u",
"brow",
"n",
"\\u",
"fox",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"foo",
"'_",
":_",
"'",
"the",
" ",
"quick",
"\\u",
"brow",
"n",
"\\u",
"fox",
"'_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"ares",
"_",
"._",
"to",
"\\u",
"python_",
"(_",
"ok",
"\\u",
"message_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
",_",
"ok",
"\\u",
"message_",
"[_",
"'",
"ok",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"contain",
"s",
" ",
"bot",
"h",
" ",
"ok",
" ",
"and",
" ",
"no",
"k_",
"\\u\\u\\uNL\\u\\u\\u_",
"ok",
"\\u",
"message_",
"=_",
"{_",
"'",
"ok",
"'_",
":_",
"'",
"the",
" ",
"quick",
"\\u",
"brow",
"n",
"\\u",
"fox",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"no",
"k",
"'_",
":_",
"'",
"the",
" ",
"quick",
"\\u",
"brow",
"n",
"\\u",
"fox",
"'_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"ares",
"_",
"._",
"to",
"\\u",
"python_",
"(_",
"ok",
"\\u",
"message_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
",_",
"ok",
"\\u",
"message_",
"[_",
"'",
"ok",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"-------------",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"repl",
"y",
" ",
"is",
" ",
"an",
" ",
"error",
" ",
"message_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"--------------",
"-------------",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"correct",
" ",
"error",
" ",
"format",
" ",
"with",
" ",
"to",
" ",
"propagate",
" ",
"param",
" ",
"set_",
"\\u\\u\\uNL\\u\\u\\u_",
"error",
"\\u",
"message_",
"=_",
"{_",
"'",
"no",
"k",
"'_",
":_",
"[_",
"Exception_",
"(_",
"'",
"jump",
" ",
"over",
"'_",
")_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"ares",
"_",
"._",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ares",
"_",
"._",
"to",
"\\u",
"python_",
"(_",
"error",
"\\u",
"message_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"correct",
" ",
"error",
" ",
"format",
" ",
"with",
" ",
"to",
" ",
"propagate",
" ",
"set",
" ",
"to",
" ",
"True_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"ares",
"_",
"._",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ares",
"_",
"._",
"to",
"\\u",
"python_",
"(_",
"error",
"\\u",
"message_",
",_",
"propagate_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"correct",
" ",
"error",
" ",
"format",
" ",
"with",
" ",
"to",
" ",
"propagate",
" ",
"set",
" ",
"to",
" ",
"False_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"error",
"\\u",
"message_",
"=_",
"{_",
"'",
"no",
"k",
"'_",
":_",
"[_",
"'",
"jump",
" ",
"over",
"'_",
",_",
"None_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"ares",
"_",
"._",
"to",
"\\u",
"python_",
"(_",
"error",
"\\u",
"message_",
",_",
"propagate_",
"=_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equals_",
"(_",
"res_",
"._",
"\\u\\u",
"dict\\u\\u_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"ares",
"_",
"._",
"Error_",
"(_",
"*_",
"error",
"\\u",
"message_",
"._",
"get_",
"(_",
"'",
"no",
"k",
"'_",
")_",
")_",
"._",
"\\u\\u",
"dict\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"nei",
"ther",
" ",
"no",
"k",
" ",
"or",
" ",
"ok",
" ",
"message",
" ",
"given_",
"\\u\\u\\uNL\\u\\u\\u_",
"error",
"\\u",
"message_",
"=_",
"{_",
"'",
"foo",
"'_",
":_",
"[_",
"'",
"jump",
" ",
"over",
"'_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"ares",
"_",
"._",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ares",
"_",
"._",
"to",
"\\u",
"python_",
"(_",
"error",
"\\u",
"message_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"multiple",
" ",
"keys",
" ",
"in",
" ",
"the",
" ",
"repl",
"y",
" ",
"dic",
"s",
" ",
"give",
"n",
",",
" ",
"one",
" ",
"of",
" ",
"te",
"h",
" ",
"ek",
"s",
" ",
"is",
" ",
"no",
"k_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"error",
"\\u",
"message_",
"=_",
"{_",
"'",
"foo",
"'_",
":_",
"'",
"the",
" ",
"quick",
"\\u",
"brow",
"n",
"\\u",
"fox",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"no",
"k",
"'_",
":_",
"[_",
"'",
"jump",
" ",
"over",
"'_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"res_",
"=_",
"ares",
"_",
"._",
"to",
"\\u",
"python_",
"(_",
"error",
"\\u",
"message_",
",_",
"propagate_",
"=_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"res_",
"._",
"\\u\\u",
"dict\\u\\u_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"ares",
"_",
"._",
"Error_",
"(_",
"*_",
"error",
"\\u",
"message_",
"[_",
"'",
"no",
"k",
"'_",
"]_",
")_",
"._",
"\\u\\u",
"dict\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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
2,
2
] |
Variable defined multiple times | slinderman/pyhawkes/pyhawkes/internals/weights.py | [
{
"content": " def rvs(self,size=[]):\n A = np.random.rand(self.K, self.K) < self.network.P\n W = np.random.gamma(self.network.kappa, 1.0/self.network.V,\n size(self.K, self.K))\n\n return A,W",
"metadata": "root.SpikeAndSlabGammaWeights.rvs",
"header": "['class', 'SpikeAndSlabGammaWeights', '(', 'GibbsSampling', ')', ':', '___EOS___']",
"index": 71
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Variable_",
"defined_",
"multiple_",
"times_",
"[SEP]_",
"class_",
"Spike",
"And",
"Sla",
"b",
"Gamma",
"Weights_",
"(_",
"Gi",
"bb",
"s",
"Sampl",
"ing_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"rvs_",
"(_",
"self_",
",_",
"size_",
"=_",
"[_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"A_",
"=_",
"np_",
"._",
"random_",
"._",
"rand_",
"(_",
"self_",
"._",
"K_",
",_",
"self_",
"._",
"K_",
")_",
"<_",
"self_",
"._",
"network_",
"._",
"P_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"W_",
"=_",
"np_",
"._",
"random_",
"._",
"gamma_",
"(_",
"self_",
"._",
"network_",
"._",
"kappa_",
",_",
"1.0_",
"/_",
"self_",
"._",
"network_",
"._",
"V_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"size_",
"(_",
"self_",
"._",
"K_",
",_",
"self_",
"._",
"K_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"A_",
",_",
"W_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Variable defined multiple times | ioflo/ioflo/ioflo/aid/consoling.py | [
{
"content": " def profuse(self, msg):\n \"\"\"Write at profuse verbosity level\n \"\"\"\n self.write(msg, verbosity=self.Wordage.profuse)",
"metadata": "root.Console.profuse",
"header": "['class', 'Console', '(', 'object', ')', ':', '___EOS___']",
"index": 140
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Variable_",
"defined_",
"multiple_",
"times_",
"[SEP]_",
"class_",
"Console_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"prof",
"use_",
"(_",
"self_",
",_",
"msg_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Write",
" ",
"at",
" ",
"prof",
"use",
" ",
"verbo",
"sity",
" ",
"level",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"write_",
"(_",
"msg_",
",_",
"verbosity_",
"=_",
"self_",
"._",
"Word",
"age_",
"._",
"prof",
"use_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Comparison of identical values | astroML/gatspy/doc/sphinxext/numpy_ext/automodapi.py | [
{
"content": "def automodapi_replace(sourcestr, app, dotoctree=True, docname=None,\n warnings=True):\n \"\"\"\n Replaces `sourcestr`'s entries of \".. automdapi::\" with the\n automodapi template form based on provided options.\n\n This is used with the sphinx event 'source-read' to replace\n `automodapi`_ entries before sphinx actually processes them, as\n automodsumm needs the code to be present to generate stub\n documentation.\n\n Parameters\n ----------\n sourcestr : str\n The string with sphinx source to be checked for automodapi\n replacement.\n app : `sphinx.application.Application`\n The sphinx application.\n dotoctree : bool\n If `True`, a \":toctree:\" option will be added in the \"..\n automodsumm::\" sections of the template, pointing to the\n appropriate \"generated\" directory based on the Astropy convention\n (e.g. in ``docs/api``)\n docname : str\n The name of the file for this `sourcestr` (if known - if not, it\n can be `None`). If not provided and `dotoctree` is `True`, the\n generated files may end up in the wrong place.\n warnings : bool\n If `False`, all warnings that would normally be issued are\n silenced.\n\n Returns\n -------\n newstr :str\n The string with automodapi entries replaced with the correct\n sphinx markup.\n \"\"\"\n\n spl = _automodapirex.split(sourcestr)\n if len(spl) > 1: # automodsumm is in this document\n\n if dotoctree:\n toctreestr = ':toctree: '\n dirnm = app.config.automodapi_toctreedirnm\n if not dirnm.endswith(\"/\"):\n dirnm += \"/\"\n if docname is not None:\n toctreestr += '../' * docname.count('/') + dirnm\n else:\n toctreestr += dirnm\n else:\n toctreestr = ''\n\n newstrs = [spl[0]]\n for grp in range(len(spl) // 3):\n modnm = spl[grp * 3 + 1]\n\n # find where this is in the document for warnings\n if docname is None:\n location = None\n else:\n location = (docname, spl[0].count('\\n'))\n\n # initialize default options\n toskip = []\n inhdiag = maindocstr = top_head = True\n hds = '-^'\n allowedpkgnms = []\n\n # look for actual options\n unknownops = []\n for opname, args in _automodapiargsrex.findall(spl[grp * 3 + 2]):\n if opname == 'skip':\n toskip.append(args.strip())\n elif opname == 'no-inheritance-diagram':\n inhdiag = False\n elif opname == 'no-main-docstr':\n maindocstr = False\n elif opname == 'headings':\n hds = args\n elif opname == 'no-heading':\n top_head = False\n elif opname == 'allowed-package-names':\n allowedpkgnms.append(args.strip())\n else:\n unknownops.append(opname)\n\n #join all the allowedpkgnms\n if len(allowedpkgnms) == 0:\n allowedpkgnms = ''\n onlylocals = True\n else:\n allowedpkgnms = ':allowed-package-names: ' + ','.join(allowedpkgnms)\n onlylocals = allowedpkgnms\n\n # get the two heading chars\n if len(hds) < 2:\n msg = 'Not enough headings (got {0}, need 2), using default -^'\n if warnings:\n app.warn(msg.format(len(hds)), location)\n hds = '-^'\n h1, h2 = hds.lstrip()[:2]\n\n # tell sphinx that the remaining args are invalid.\n if len(unknownops) > 0 and app is not None:\n opsstrs = ','.join(unknownops)\n msg = 'Found additional options ' + opsstrs + ' in automodapi.'\n if warnings:\n app.warn(msg, location)\n\n ispkg, hascls, hasfuncs = _mod_info(modnm, toskip, onlylocals=onlylocals)\n\n # add automodule directive only if no-main-docstr isn't present\n if maindocstr:\n automodline = '.. automodule:: {modname}'.format(modname=modnm)\n else:\n automodline = ''\n if top_head:\n newstrs.append(automod_templ_modheader.format(modname=modnm,\n modhds=h1 * len(modnm),\n pkgormod='Package' if ispkg else 'Module',\n pkgormodhds=h1 * (8 if ispkg else 7),\n automoduleline=automodline))\n else:\n newstrs.append(automod_templ_modheader.format(\n modname='',\n modhds='',\n pkgormod='',\n pkgormodhds='',\n automoduleline=automodline))\n\n #construct the options for the class/function sections\n #start out indented at 4 spaces, but need to keep the indentation.\n clsfuncoptions = []\n if toctreestr:\n clsfuncoptions.append(toctreestr)\n if toskip:\n clsfuncoptions.append(':skip: ' + ','.join(toskip))\n if allowedpkgnms:\n clsfuncoptions.append(allowedpkgnms)\n clsfuncoptionstr = '\\n '.join(clsfuncoptions)\n\n if hasfuncs:\n newstrs.append(automod_templ_funcs.format(\n modname=modnm,\n funchds=h2 * 9,\n clsfuncoptions=clsfuncoptionstr))\n\n if hascls:\n newstrs.append(automod_templ_classes.format(\n modname=modnm,\n clshds=h2 * 7,\n clsfuncoptions=clsfuncoptionstr))\n\n if inhdiag and hascls:\n # add inheritance diagram if any classes are in the module\n newstrs.append(automod_templ_inh.format(\n modname=modnm,\n clsinhsechds=h2 * 25,\n allowedpkgnms=allowedpkgnms))\n\n newstrs.append(spl[grp * 3 + 3])\n\n newsourcestr = ''.join(newstrs)\n\n if app.config.automodapi_writereprocessed:\n # sometimes they are unicode, sometimes not, depending on how\n # sphinx has processed things\n if isinstance(newsourcestr, text_type):\n ustr = newsourcestr\n else:\n ustr = newsourcestr.decode(app.config.source_encoding)\n\n if docname is None:\n with open(os.path.join(app.srcdir, 'unknown.automodapi'), 'a') as f:\n f.write('\\n**NEW DOC**\\n\\n')\n f.write(ustr)\n else:\n env = app.builder.env\n # Determine the filename associated with this doc (specifically\n # the extension)\n filename = docname + os.path.splitext(env.doc2path(docname))[1]\n filename += '.automodapi'\n\n with open(os.path.join(app.srcdir, filename), 'w') as f:\n f.write(ustr)\n\n return newsourcestr\n else:\n return sourcestr",
"metadata": "root.automodapi_replace",
"header": "['module', '___EOS___']",
"index": 135
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Compari",
"son_",
"of_",
"identical_",
"values_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"autom",
"oda",
"pi",
"\\u",
"replace_",
"(_",
"source",
"str_",
",_",
"app_",
",_",
"dot",
"oct",
"ree_",
"=_",
"True_",
",_",
"docname_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"warnings_",
"=_",
"True_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Replace",
"s",
" ",
"`",
"source",
"str",
"`",
"'",
"s",
" ",
"entri",
"es",
" ",
"of",
" ",
"\"..",
" ",
"autom",
"dap",
"i",
"::",
"\"",
" ",
"with",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"autom",
"oda",
"pi",
" ",
"template",
" ",
"form",
" ",
"based",
" ",
"on",
" ",
"provided",
" ",
"options",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"is",
" ",
"used",
" ",
"with",
" ",
"the",
" ",
"sphinx",
" ",
"event",
" ",
"'",
"source",
"-",
"read",
"'",
" ",
"to",
" ",
"replace",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"`",
"autom",
"oda",
"pi",
"`\\u",
" ",
"entri",
"es",
" ",
"bef",
"ore",
" ",
"sphinx",
" ",
"actual",
"ly",
" ",
"process",
"es",
" ",
"them",
",",
" ",
"as",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"autom",
"ods",
"umm",
" ",
"need",
"s",
" ",
"the",
" ",
"code",
" ",
"to",
" ",
"be",
" ",
"presen",
"t",
" ",
"to",
" ",
"generat",
"e",
" ",
"stub",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"documentation",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"source",
"str",
" ",
":",
" ",
"str",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"string",
" ",
"with",
" ",
"sphinx",
" ",
"source",
" ",
"to",
" ",
"be",
" ",
"checke",
"d",
" ",
"for",
" ",
"autom",
"oda",
"pi",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"replace",
"ment",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"app",
" ",
":",
" ",
"`",
"sphinx",
".",
"applica",
"tion",
".",
"Applica",
"tion",
"`",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"sphinx",
" ",
"applica",
"tion",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"dot",
"oct",
"ree",
" ",
":",
" ",
"bool",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"If",
" ",
"`",
"Tru",
"e",
"`",
",",
" ",
"a",
" ",
"\":",
"toc",
"tree",
":\"",
" ",
"option",
" ",
"will",
" ",
"be",
" ",
"adde",
"d",
" ",
"in",
" ",
"the",
" ",
"\"..",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"autom",
"ods",
"umm",
"::",
"\"",
" ",
"section",
"s",
" ",
"of",
" ",
"the",
" ",
"template",
",",
" ",
"pointi",
"ng",
" ",
"to",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"appropr",
"iate",
" ",
"\"",
"generat",
"ed",
"\"",
" ",
"director",
"y",
" ",
"based",
" ",
"on",
" ",
"the",
" ",
"Astro",
"py",
" ",
"convention",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"(",
"e",
".",
"g",
".",
" ",
"in",
" ",
"``",
"docs",
"/",
"api",
"``)",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"doc",
"name",
" ",
":",
" ",
"str",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"name",
" ",
"of",
" ",
"the",
" ",
"file",
" ",
"for",
" ",
"this",
" ",
"`",
"source",
"str",
"`",
" ",
"(",
"if",
" ",
"know",
"n",
" ",
"-",
" ",
"if",
" ",
"not",
",",
" ",
"it",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"can",
" ",
"be",
" ",
"`",
"Non",
"e",
"`)",
".",
" ",
"If",
" ",
"not",
" ",
"provided",
" ",
"and",
" ",
"`",
"dot",
"oct",
"ree",
"`",
" ",
"is",
" ",
"`",
"Tru",
"e",
"`",
",",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"generat",
"ed",
" ",
"files",
" ",
"may",
" ",
"end",
" ",
"up",
" ",
"in",
" ",
"the",
" ",
"wrong",
" ",
"place",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"warn",
"ings",
" ",
":",
" ",
"bool",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"If",
" ",
"`",
"Fal",
"se",
"`",
",",
" ",
"all",
" ",
"warn",
"ings",
" ",
"tha",
"t",
" ",
"wou",
"ld",
" ",
"normal",
"ly",
" ",
"be",
" ",
"issue",
"d",
" ",
"are",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"silence",
"d",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"newst",
"r",
" ",
":",
"str",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"string",
" ",
"with",
" ",
"autom",
"oda",
"pi",
" ",
"entri",
"es",
" ",
"replaced",
" ",
"with",
" ",
"the",
" ",
"correct",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"sphinx",
" ",
"markup",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"spl_",
"=_",
"\\u",
"autom",
"oda",
"pir",
"ex_",
"._",
"split_",
"(_",
"source",
"str_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"len_",
"(_",
"spl_",
")_",
">_",
"1_",
":_",
"#",
" ",
"autom",
"ods",
"umm",
" ",
"is",
" ",
"in",
" ",
"this",
" ",
"document_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"dot",
"oct",
"ree_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"toc",
"trees",
"tr_",
"=_",
"':",
"toc",
"tree",
":",
" ",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"dir",
"nm_",
"=_",
"app_",
"._",
"config_",
"._",
"autom",
"oda",
"pi",
"\\u",
"toc",
"tree",
"dir",
"nm_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"dir",
"nm_",
"._",
"endswith_",
"(_",
"\"/\"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"dir",
"nm_",
"+=_",
"\"/\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"docname_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"toc",
"trees",
"tr_",
"+=_",
"'../",
"'_",
"*_",
"docname_",
"._",
"count_",
"(_",
"'/'_",
")_",
"+_",
"dir",
"nm_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"toc",
"trees",
"tr_",
"+=_",
"dir",
"nm_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"toc",
"trees",
"tr_",
"=_",
"''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"newst",
"rs_",
"=_",
"[_",
"spl_",
"[_",
"0_",
"]_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"grp_",
"in_",
"range_",
"(_",
"len_",
"(_",
"spl_",
")_",
"//_",
"3_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mod",
"nm_",
"=_",
"spl_",
"[_",
"grp_",
"*_",
"3_",
"+_",
"1_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"find",
" ",
"where",
" ",
"this",
" ",
"is",
" ",
"in",
" ",
"the",
" ",
"document",
" ",
"for",
" ",
"warnings_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"docname_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"location_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"location_",
"=_",
"(_",
"docname_",
",_",
"spl_",
"[_",
"0_",
"]_",
"._",
"count_",
"(_",
"'\\\\",
"n",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"initialize",
" ",
"default",
" ",
"options_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"tos",
"kip",
"_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"inh",
"diag_",
"=_",
"main",
"docstr",
"_",
"=_",
"top",
"\\u",
"head_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"hd",
"s_",
"=_",
"'-",
"^",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"allow",
"edp",
"kg",
"nms",
"_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"look",
" ",
"for",
" ",
"actual",
" ",
"options_",
"\\u\\u\\uNL\\u\\u\\u_",
"unknown",
"ops_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"opname",
"_",
",_",
"args_",
"in_",
"\\u",
"autom",
"oda",
"pia",
"rg",
"sre",
"x_",
"._",
"findall_",
"(_",
"spl_",
"[_",
"grp_",
"*_",
"3_",
"+_",
"2_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"opname",
"_",
"==_",
"'",
"skip",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"tos",
"kip",
"_",
"._",
"append_",
"(_",
"args_",
"._",
"strip_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"opname",
"_",
"==_",
"'",
"no",
"-",
"inherita",
"nce",
"-",
"diag",
"ram",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"inh",
"diag_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"opname",
"_",
"==_",
"'",
"no",
"-",
"main",
"-",
"docstr",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"main",
"docstr",
"_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"opname",
"_",
"==_",
"'",
"heading",
"s",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"hd",
"s_",
"=_",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"opname",
"_",
"==_",
"'",
"no",
"-",
"heading",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"top",
"\\u",
"head_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"opname",
"_",
"==_",
"'",
"allow",
"ed",
"-",
"package",
"-",
"names",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"allow",
"edp",
"kg",
"nms",
"_",
"._",
"append_",
"(_",
"args_",
"._",
"strip_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"unknown",
"ops_",
"._",
"append_",
"(_",
"opname",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"join",
" ",
"all",
" ",
"the",
" ",
"allow",
"edp",
"kg",
"nms",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"len_",
"(_",
"allow",
"edp",
"kg",
"nms",
"_",
")_",
"==_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"allow",
"edp",
"kg",
"nms",
"_",
"=_",
"''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"only",
"locals_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"allow",
"edp",
"kg",
"nms",
"_",
"=_",
"':",
"allow",
"ed",
"-",
"package",
"-",
"names",
":",
" ",
"'_",
"+_",
"','_",
"._",
"join_",
"(_",
"allow",
"edp",
"kg",
"nms",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"only",
"locals_",
"=_",
"allow",
"edp",
"kg",
"nms",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"get",
" ",
"the",
" ",
"two",
" ",
"heading",
" ",
"chars_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"len_",
"(_",
"hd",
"s_",
")_",
"<_",
"2_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"msg_",
"=_",
"'",
"Not",
" ",
"eno",
"ugh",
" ",
"heading",
"s",
" ",
"(",
"got",
" ",
"{",
"0",
"},",
" ",
"need",
" ",
"2",
"),",
" ",
"usi",
"ng",
" ",
"default",
" ",
"-",
"^",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"warnings_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"app_",
"._",
"warn_",
"(_",
"msg_",
"._",
"format_",
"(_",
"len_",
"(_",
"hd",
"s_",
")_",
")_",
",_",
"location_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"hd",
"s_",
"=_",
"'-",
"^",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"h1_",
",_",
"h2_",
"=_",
"hd",
"s_",
"._",
"lstrip_",
"(_",
")_",
"[_",
":_",
"2_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"tell",
" ",
"sphinx",
" ",
"tha",
"t",
" ",
"the",
" ",
"rema",
"inin",
"g",
" ",
"args",
" ",
"are",
" ",
"invalid",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"len_",
"(_",
"unknown",
"ops_",
")_",
">_",
"0_",
"and_",
"app_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ops",
"strs_",
"=_",
"','_",
"._",
"join_",
"(_",
"unknown",
"ops_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"msg_",
"=_",
"'",
"Foun",
"d",
" ",
"addition",
"al",
" ",
"options",
" ",
"'_",
"+_",
"ops",
"strs_",
"+_",
"'",
" ",
"in",
" ",
"autom",
"oda",
"pi",
".'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"warnings_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"app_",
"._",
"warn_",
"(_",
"msg_",
",_",
"location_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"isp",
"kg_",
",_",
"has",
"cls_",
",_",
"has",
"funcs_",
"=_",
"\\u",
"mod",
"\\u",
"info_",
"(_",
"mod",
"nm_",
",_",
"tos",
"kip",
"_",
",_",
"only",
"locals_",
"=_",
"only",
"locals_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"add",
" ",
"autom",
"odule",
" ",
"directive",
" ",
"only",
" ",
"if",
" ",
"no",
"-",
"main",
"-",
"docstr",
" ",
"isn",
"'",
"t",
" ",
"present_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"main",
"docstr",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"autom",
"odl",
"ine_",
"=_",
"'..",
" ",
"autom",
"odule",
"::",
" ",
"{",
"mod",
"name",
"}'_",
"._",
"format_",
"(_",
"modname_",
"=_",
"mod",
"nm_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"autom",
"odl",
"ine_",
"=_",
"''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"top",
"\\u",
"head_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"newst",
"rs_",
"._",
"append_",
"(_",
"autom",
"od",
"\\u",
"templ",
"\\u",
"mod",
"header_",
"._",
"format_",
"(_",
"modname_",
"=_",
"mod",
"nm_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"mod",
"hd",
"s_",
"=_",
"h1_",
"*_",
"len_",
"(_",
"mod",
"nm_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"pkg",
"orm",
"od_",
"=_",
"'",
"Packa",
"ge",
"'_",
"if_",
"isp",
"kg_",
"else_",
"'",
"Modul",
"e",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"pkg",
"orm",
"od",
"hd",
"s_",
"=_",
"h1_",
"*_",
"(_",
"8_",
"if_",
"isp",
"kg_",
"else_",
"7_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"autom",
"odule",
"line_",
"=_",
"autom",
"odl",
"ine_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"newst",
"rs_",
"._",
"append_",
"(_",
"autom",
"od",
"\\u",
"templ",
"\\u",
"mod",
"header_",
"._",
"format_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"modname_",
"=_",
"''_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"mod",
"hd",
"s_",
"=_",
"''_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"pkg",
"orm",
"od_",
"=_",
"''_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"pkg",
"orm",
"od",
"hd",
"s_",
"=_",
"''_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"autom",
"odule",
"line_",
"=_",
"autom",
"odl",
"ine_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"construct",
" ",
"the",
" ",
"options",
" ",
"for",
" ",
"the",
" ",
"class",
"/",
"function",
" ",
"sections_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"start",
" ",
"out",
" ",
"indented",
" ",
"at",
" ",
"4",
" ",
"space",
"s",
",",
" ",
"but",
" ",
"need",
" ",
"to",
" ",
"keep",
" ",
"the",
" ",
"indent",
"ation",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"cls",
"func",
"options_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"toc",
"trees",
"tr_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"cls",
"func",
"options_",
"._",
"append_",
"(_",
"toc",
"trees",
"tr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"tos",
"kip",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"cls",
"func",
"options_",
"._",
"append_",
"(_",
"':",
"skip",
":",
" ",
"'_",
"+_",
"','_",
"._",
"join_",
"(_",
"tos",
"kip",
"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"allow",
"edp",
"kg",
"nms",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"cls",
"func",
"options_",
"._",
"append_",
"(_",
"allow",
"edp",
"kg",
"nms",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"cls",
"func",
"options",
"tr_",
"=_",
"'\\\\",
"n",
" ",
" ",
" ",
" ",
"'_",
"._",
"join_",
"(_",
"cls",
"func",
"options_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"has",
"funcs_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"newst",
"rs_",
"._",
"append_",
"(_",
"autom",
"od",
"\\u",
"templ",
"\\u",
"funcs_",
"._",
"format_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"modname_",
"=_",
"mod",
"nm_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"func",
"hd",
"s_",
"=_",
"h2_",
"*_",
"9_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"cls",
"func",
"options_",
"=_",
"cls",
"func",
"options",
"tr_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"has",
"cls_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"newst",
"rs_",
"._",
"append_",
"(_",
"autom",
"od",
"\\u",
"templ",
"\\u",
"classes_",
"._",
"format_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"modname_",
"=_",
"mod",
"nm_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"cls",
"hd",
"s_",
"=_",
"h2_",
"*_",
"7_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"cls",
"func",
"options_",
"=_",
"cls",
"func",
"options",
"tr_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"inh",
"diag_",
"and_",
"has",
"cls_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"add",
" ",
"inherita",
"nce",
" ",
"diag",
"ram",
" ",
"if",
" ",
"any",
" ",
"classe",
"s",
" ",
"are",
" ",
"in",
" ",
"the",
" ",
"module_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"newst",
"rs_",
"._",
"append_",
"(_",
"autom",
"od",
"\\u",
"templ",
"\\u",
"inh",
"_",
"._",
"format_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"modname_",
"=_",
"mod",
"nm_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"cls",
"inh",
"sec",
"hd",
"s_",
"=_",
"h2_",
"*_",
"25_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"allow",
"edp",
"kg",
"nms",
"_",
"=_",
"allow",
"edp",
"kg",
"nms",
"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"newst",
"rs_",
"._",
"append_",
"(_",
"spl_",
"[_",
"grp_",
"*_",
"3_",
"+_",
"3_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"news",
"ource",
"str_",
"=_",
"''_",
"._",
"join_",
"(_",
"newst",
"rs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"app_",
"._",
"config_",
"._",
"autom",
"oda",
"pi",
"\\u",
"writer",
"epr",
"oce",
"sse",
"d_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"somet",
"imes",
" ",
"the",
"y",
" ",
"are",
" ",
"unicode",
",",
" ",
"somet",
"imes",
" ",
"not",
",",
" ",
"depend",
"ing",
" ",
"on",
" ",
"how_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"sphinx",
" ",
"has",
" ",
"process",
"ed",
" ",
"things_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"news",
"ource",
"str_",
",_",
"text",
"\\u",
"type_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ustr_",
"=_",
"news",
"ource",
"str_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ustr_",
"=_",
"news",
"ource",
"str_",
"._",
"decode_",
"(_",
"app_",
"._",
"config_",
"._",
"source",
"\\u",
"encoding_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"docname_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"with_",
"open_",
"(_",
"os_",
"._",
"path_",
"._",
"join_",
"(_",
"app_",
"._",
"srcdir_",
",_",
"'",
"unknown",
".",
"autom",
"oda",
"pi",
"'_",
")_",
",_",
"'",
"a",
"'_",
")_",
"as_",
"f_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"f_",
"._",
"write_",
"(_",
"'\\\\",
"n",
"**",
"NEW",
" ",
"DOC",
"**",
"\\\\",
"n",
"\\\\",
"n",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"f_",
"._",
"write_",
"(_",
"ustr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"env_",
"=_",
"app_",
"._",
"builder_",
"._",
"env_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Det",
"erm",
"ine",
" ",
"the",
" ",
"filename",
" ",
"associate",
"d",
" ",
"with",
" ",
"this",
" ",
"doc",
" ",
"(",
"specifica",
"ll",
"y_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"the",
" ",
"extensi",
"on",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"filename_",
"=_",
"docname_",
"+_",
"os_",
"._",
"path_",
"._",
"splitext_",
"(_",
"env_",
"._",
"doc2",
"path_",
"(_",
"docname_",
")_",
")_",
"[_",
"1_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"filename_",
"+=_",
"'.",
"autom",
"oda",
"pi",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"with_",
"open_",
"(_",
"os_",
"._",
"path_",
"._",
"join_",
"(_",
"app_",
"._",
"srcdir_",
",_",
"filename_",
")_",
",_",
"'",
"w",
"'_",
")_",
"as_",
"f_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"f_",
"._",
"write_",
"(_",
"ustr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"news",
"ource",
"str_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"source",
"str_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Testing equality to None | RoseOu/flasky/venv/lib/python2.7/site-packages/sqlalchemy/testing/schema.py | [
{
"content": "def Table(*args, **kw):\n \"\"\"A schema.Table wrapper/hook for dialect-specific tweaks.\"\"\"\n\n test_opts = dict([(k, kw.pop(k)) for k in list(kw)\n if k.startswith('test_')])\n\n kw.update(table_options)\n\n if exclusions.against(config._current, 'mysql'):\n if 'mysql_engine' not in kw and 'mysql_type' not in kw:\n if 'test_needs_fk' in test_opts or 'test_needs_acid' in test_opts:\n kw['mysql_engine'] = 'InnoDB'\n else:\n kw['mysql_engine'] = 'MyISAM'\n\n # Apply some default cascading rules for self-referential foreign keys.\n # MySQL InnoDB has some issues around seleting self-refs too.\n if exclusions.against(config._current, 'firebird'):\n table_name = args[0]\n unpack = (config.db.dialect.\n identifier_preparer.unformat_identifiers)\n\n # Only going after ForeignKeys in Columns. May need to\n # expand to ForeignKeyConstraint too.\n fks = [fk\n for col in args if isinstance(col, schema.Column)\n for fk in col.foreign_keys]\n\n for fk in fks:\n # root around in raw spec\n ref = fk._colspec\n if isinstance(ref, schema.Column):\n name = ref.table.name\n else:\n # take just the table name: on FB there cannot be\n # a schema, so the first element is always the\n # table name, possibly followed by the field name\n name = unpack(ref)[0]\n if name == table_name:\n if fk.ondelete is None:\n fk.ondelete = 'CASCADE'\n if fk.onupdate is None:\n fk.onupdate = 'CASCADE'\n\n return schema.Table(*args, **kw)",
"metadata": "root.Table",
"header": "['module', '___EOS___']",
"index": 16
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Test",
"ing_",
"equality",
"_",
"to_",
"None_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"Table_",
"(_",
"*_",
"args_",
",_",
"**_",
"kw_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"A",
" ",
"schema",
".",
"Table",
" ",
"wrapp",
"er",
"/",
"hook",
" ",
"for",
" ",
"dialect",
"-",
"specific",
" ",
"tweak",
"s",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"test\\u",
"opts_",
"=_",
"dict_",
"(_",
"[_",
"(_",
"k_",
",_",
"kw_",
"._",
"pop_",
"(_",
"k_",
")_",
")_",
"for_",
"k_",
"in_",
"list_",
"(_",
"kw_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"k_",
"._",
"startswith_",
"(_",
"'",
"test\\u",
"'_",
")_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"kw_",
"._",
"update_",
"(_",
"table",
"\\u",
"options_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"exclusions",
"_",
"._",
"against",
"_",
"(_",
"config_",
"._",
"\\u",
"current_",
",_",
"'",
"mysql",
"'_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"'",
"mysql",
"\\u",
"eng",
"ine",
"'_",
"not_",
"in_",
"kw_",
"and_",
"'",
"mysql",
"\\u",
"type",
"'_",
"not_",
"in_",
"kw_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"'",
"test\\u",
"need",
"s",
"\\u",
"fk",
"'_",
"in_",
"test\\u",
"opts_",
"or_",
"'",
"test\\u",
"need",
"s",
"\\u",
"acid",
"'_",
"in_",
"test\\u",
"opts_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"kw_",
"[_",
"'",
"mysql",
"\\u",
"eng",
"ine",
"'_",
"]_",
"=_",
"'",
"Inno",
"DB",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"kw_",
"[_",
"'",
"mysql",
"\\u",
"eng",
"ine",
"'_",
"]_",
"=_",
"'",
"My",
"ISA",
"M",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Apply",
" ",
"some",
" ",
"default",
" ",
"cas",
"cad",
"ing",
" ",
"rule",
"s",
" ",
"for",
" ",
"self",
"-",
"referen",
"tial",
" ",
"foreign",
" ",
"keys",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"My",
"SQL",
" ",
"Inno",
"DB",
" ",
"has",
" ",
"some",
" ",
"issue",
"s",
" ",
"aro",
"und",
" ",
"sele",
"ting",
" ",
"self",
"-",
"refs",
" ",
"too",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"exclusions",
"_",
"._",
"against",
"_",
"(_",
"config_",
"._",
"\\u",
"current_",
",_",
"'",
"fire",
"bird",
"'_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"table",
"\\u",
"name_",
"=_",
"args_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"unpack_",
"=_",
"(_",
"config_",
"._",
"db_",
"._",
"dialect_",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"identifi",
"er",
"\\u",
"prepar",
"er_",
"._",
"unfo",
"rmat",
"\\u",
"identifiers_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"On",
"ly",
" ",
"goi",
"ng",
" ",
"after",
" ",
"Fore",
"ign",
"Keys",
" ",
"in",
" ",
"Colum",
"ns",
".",
" ",
" ",
"Ma",
"y",
" ",
"need",
" ",
"to_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"expand",
" ",
"to",
" ",
"Fore",
"ign",
"Key",
"Constr",
"aint",
" ",
"too",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"fk",
"s_",
"=_",
"[_",
"fk_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"col_",
"in_",
"args_",
"if_",
"isinstance_",
"(_",
"col_",
",_",
"schema_",
"._",
"Column_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"fk_",
"in_",
"col_",
"._",
"foreign",
"\\u",
"keys_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"fk_",
"in_",
"fk",
"s_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"root",
" ",
"aro",
"und",
" ",
"in",
" ",
"raw",
" ",
"spec_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ref_",
"=_",
"fk_",
"._",
"\\u",
"colsp",
"ec_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"isinstance_",
"(_",
"ref_",
",_",
"schema_",
"._",
"Column_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"name_",
"=_",
"ref_",
"._",
"table_",
"._",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"take",
" ",
"just",
" ",
"the",
" ",
"table",
" ",
"name",
":",
" ",
"on",
" ",
"FB",
" ",
"there",
" ",
"cann",
"ot",
" ",
"be_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"a",
" ",
"schema",
",",
" ",
"so",
" ",
"the",
" ",
"first",
" ",
"element",
" ",
"is",
" ",
"alw",
"ay",
"s",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"table",
" ",
"name",
",",
" ",
"possib",
"ly",
" ",
"followe",
"d",
" ",
"by",
" ",
"the",
" ",
"field",
" ",
"name_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"name_",
"=_",
"unpack_",
"(_",
"ref_",
")_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"name_",
"==_",
"table",
"\\u",
"name_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"fk_",
"._",
"ondelete_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
"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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | mintchaos/django_inlines/tests/core/tests/templateinline.py | [
{
"content": " def testYoutubeInlines(self):\n IN = \"\"\"{{ youtube RXJKdh1KZ0w }}\"\"\"\n OUT = \"\"\"<div class=\"youtube_video\">\\n<object width=\"480\" height=\"295\">\\n <param name=\"movie\" value=\"http://www.youtube.com/v/RXJKdh1KZ0w&hl=en&fs=1\"></param>\\n <param name=\"allowFullScreen\" value=\"true\"></param>\\n <param name=\"allowscriptaccess\" value=\"always\"></param>\\n <embed src=\"http://www.youtube.com/v/RXJKdh1KZ0w&hl=en&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"480\" height=\"295\"></embed>\\n</object> \\n</div>\\n\"\"\"\n self.assertEqual(self.inlines.process(IN), OUT)\n IN = \"\"\"{{ youtube RXJKdh1KZ0w width=200 height=100 }}\"\"\"\n OUT = \"\"\"<div class=\"youtube_video\">\\n<object width=\"200\" height=\"100\">\\n <param name=\"movie\" value=\"http://www.youtube.com/v/RXJKdh1KZ0w&hl=en&fs=1\"></param>\\n <param name=\"allowFullScreen\" value=\"true\"></param>\\n <param name=\"allowscriptaccess\" value=\"always\"></param>\\n <embed src=\"http://www.youtube.com/v/RXJKdh1KZ0w&hl=en&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"200\" height=\"100\"></embed>\\n</object> \\n</div>\\n\"\"\"\n self.assertEqual(self.inlines.process(IN), OUT)\n IN = \"\"\"{{ youtube http://www.youtube.com/watch?v=RXJKdh1KZ0w&hd=1&feature=hd }}\"\"\"\n OUT = \"\"\"<div class=\"youtube_video\">\\n<object width=\"480\" height=\"295\">\\n <param name=\"movie\" value=\"http://www.youtube.com/v/RXJKdh1KZ0w&hl=en&fs=1\"></param>\\n <param name=\"allowFullScreen\" value=\"true\"></param>\\n <param name=\"allowscriptaccess\" value=\"always\"></param>\\n <embed src=\"http://www.youtube.com/v/RXJKdh1KZ0w&hl=en&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"480\" height=\"295\"></embed>\\n</object> \\n</div>\\n\"\"\"\n self.assertEqual(self.inlines.process(IN), OUT)",
"metadata": "root.YoutubeTestCase.testYoutubeInlines",
"header": "['class', 'YoutubeTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 12
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"You",
"tube",
"Test",
"Case_",
"(_",
"unittest_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"You",
"tube",
"In",
"lines_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"IN_",
"=_",
"\"\"\"{",
"{",
" ",
"youtu",
"be",
" ",
"RX",
"JK",
"dh",
"1",
"KZ",
"0",
"w",
" ",
"}}",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"OUT_",
"=_",
"\"\"\"",
"<",
"div",
" ",
"class",
"=\"",
"youtu",
"be",
"\\u",
"video",
"\">",
"\\\\",
"n",
"<",
"object",
" ",
"widt",
"h",
"=\"",
"480",
"\"",
" ",
"height",
"=\"",
"295",
"\">",
"\\\\",
"n",
" ",
" ",
"<",
"param",
" ",
"name",
"=\"",
"movie",
"\"",
" ",
"value",
"=\"",
"http",
"://",
"www",
".",
"youtu",
"be",
".",
"com",
"/",
"v",
"/",
"RX",
"JK",
"dh",
"1",
"KZ",
"0",
"w",
"&",
"hl",
"=",
"en",
"&",
"fs",
"=",
"1",
"\">",
"</",
"param",
">\\\\",
"n",
" ",
" ",
"<",
"param",
" ",
"name",
"=\"",
"allow",
"Full",
"Scr",
"een",
"\"",
" ",
"value",
"=\"",
"true",
"\">",
"</",
"param",
">\\\\",
"n",
" ",
" ",
"<",
"param",
" ",
"name",
"=\"",
"allow",
"script",
"access",
"\"",
" ",
"value",
"=\"",
"alw",
"ay",
"s",
"\">",
"</",
"param",
">\\\\",
"n",
" ",
" ",
"<",
"embed",
" ",
"src",
"=\"",
"http",
"://",
"www",
".",
"youtu",
"be",
".",
"com",
"/",
"v",
"/",
"RX",
"JK",
"dh",
"1",
"KZ",
"0",
"w",
"&",
"hl",
"=",
"en",
"&",
"fs",
"=",
"1",
"\"",
" ",
"type",
"=\"",
"applica",
"tion",
"/",
"x",
"-",
"shock",
"wave",
"-",
"flash",
"\"",
" ",
"allow",
"script",
"access",
"=\"",
"alw",
"ay",
"s",
"\"",
" ",
"allow",
"fullscreen",
"=\"",
"true",
"\"",
" ",
"widt",
"h",
"=\"",
"480",
"\"",
" ",
"height",
"=\"",
"295",
"\">",
"</",
"embed",
">\\\\",
"n",
"</",
"object",
">",
" ",
" ",
"\\\\",
"n",
"</",
"div",
">\\\\",
"n",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"self_",
"._",
"inlines_",
"._",
"process_",
"(_",
"IN_",
")_",
",_",
"OUT_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"IN_",
"=_",
"\"\"\"{",
"{",
" ",
"youtu",
"be",
" ",
"RX",
"JK",
"dh",
"1",
"KZ",
"0",
"w",
" ",
"widt",
"h",
"=",
"200",
" ",
"height",
"=",
"100",
" ",
"}}",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"OUT_",
"=_",
"\"\"\"",
"<",
"div",
" ",
"class",
"=\"",
"youtu",
"be",
"\\u",
"video",
"\">",
"\\\\",
"n",
"<",
"object",
" ",
"widt",
"h",
"=\"",
"200",
"\"",
" ",
"height",
"=\"",
"100",
"\">",
"\\\\",
"n",
" ",
" ",
"<",
"param",
" ",
"name",
"=\"",
"movie",
"\"",
" ",
"value",
"=\"",
"http",
"://",
"www",
".",
"youtu",
"be",
".",
"com",
"/",
"v",
"/",
"RX",
"JK",
"dh",
"1",
"KZ",
"0",
"w",
"&",
"hl",
"=",
"en",
"&",
"fs",
"=",
"1",
"\">",
"</",
"param",
">\\\\",
"n",
" ",
" ",
"<",
"param",
" ",
"name",
"=\"",
"allow",
"Full",
"Scr",
"een",
"\"",
" ",
"value",
"=\"",
"true",
"\">",
"</",
"param",
">\\\\",
"n",
" ",
" ",
"<",
"param",
" ",
"name",
"=\"",
"allow",
"script",
"access",
"\"",
" ",
"value",
"=\"",
"alw",
"ay",
"s",
"\">",
"</",
"param",
">\\\\",
"n",
" ",
" ",
"<",
"embed",
" ",
"src",
"=\"",
"http",
"://",
"www",
".",
"youtu",
"be",
".",
"com",
"/",
"v",
"/",
"RX",
"JK",
"dh",
"1",
"KZ",
"0",
"w",
"&",
"hl",
"=",
"en",
"&",
"fs",
"=",
"1",
"\"",
" ",
"type",
"=\"",
"applica",
"tion",
"/",
"x",
"-",
"shock",
"wave",
"-",
"flash",
"\"",
" ",
"allow",
"script",
"access",
"=\"",
"alw",
"ay",
"s",
"\"",
" ",
"allow",
"fullscreen",
"=\"",
"true",
"\"",
" ",
"widt",
"h",
"=\"",
"200",
"\"",
" ",
"height",
"=\"",
"100",
"\">",
"</",
"embed",
">\\\\",
"n",
"</",
"object",
">",
" ",
" ",
"\\\\",
"n",
"</",
"div",
">\\\\",
"n",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"self_",
"._",
"inlines_",
"._",
"process_",
"(_",
"IN_",
")_",
",_",
"OUT_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"IN_",
"=_",
"\"\"\"{",
"{",
" ",
"youtu",
"be",
" ",
"http",
"://",
"www",
".",
"youtu",
"be",
".",
"com",
"/",
"watch",
"?",
"v",
"=",
"RX",
"JK",
"dh",
"1",
"KZ",
"0",
"w",
"&",
"hd",
"=",
"1",
"&",
"feature",
"=",
"hd",
" ",
"}}",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"OUT_",
"=_",
"\"\"\"",
"<",
"div",
" ",
"class",
"=\"",
"youtu",
"be",
"\\u",
"video",
"\">",
"\\\\",
"n",
"<",
"object",
" ",
"widt",
"h",
"=\"",
"480",
"\"",
" ",
"height",
"=\"",
"295",
"\">",
"\\\\",
"n",
" ",
" ",
"<",
"param",
" ",
"name",
"=\"",
"movie",
"\"",
" ",
"value",
"=\"",
"http",
"://",
"www",
".",
"youtu",
"be",
".",
"com",
"/",
"v",
"/",
"RX",
"JK",
"dh",
"1",
"KZ",
"0",
"w",
"&",
"hl",
"=",
"en",
"&",
"fs",
"=",
"1",
"\">",
"</",
"param",
">\\\\",
"n",
" ",
" ",
"<",
"param",
" ",
"name",
"=\"",
"allow",
"Full",
"Scr",
"een",
"\"",
" ",
"value",
"=\"",
"true",
"\">",
"</",
"param",
">\\\\",
"n",
" ",
" ",
"<",
"param",
" ",
"name",
"=\"",
"allow",
"script",
"access",
"\"",
" ",
"value",
"=\"",
"alw",
"ay",
"s",
"\">",
"</",
"param",
">\\\\",
"n",
" ",
" ",
"<",
"embed",
" ",
"src",
"=\"",
"http",
"://",
"www",
".",
"youtu",
"be",
".",
"com",
"/",
"v",
"/",
"RX",
"JK",
"dh",
"1",
"KZ",
"0",
"w",
"&",
"hl",
"=",
"en",
"&",
"fs",
"=",
"1",
"\"",
" ",
"type",
"=\"",
"applica",
"tion",
"/",
"x",
"-",
"shock",
"wave",
"-",
"flash",
"\"",
" ",
"allow",
"script",
"access",
"=\"",
"alw",
"ay",
"s",
"\"",
" ",
"allow",
"fullscreen",
"=\"",
"true",
"\"",
" ",
"widt",
"h",
"=\"",
"480",
"\"",
" ",
"height",
"=\"",
"295",
"\">",
"</",
"embed",
">\\\\",
"n",
"</",
"object",
">",
" ",
" ",
"\\\\",
"n",
"</",
"div",
">\\\\",
"n",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"self_",
"._",
"inlines_",
"._",
"process_",
"(_",
"IN_",
")_",
",_",
"OUT_",
")_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | cloudmatrix/esky/esky/tests/eskytester/script3.py | [
{
"content": "\n# Third entry point for testing an esky install.\n\nimport os\nimport sys\nimport time\nimport esky\nimport esky.util\nfrom esky.util import LOCAL_HTTP_PORT\nimport esky.tests\n\nplatform = esky.util.get_platform()\n\n# Test that the frozen app is actually working\nimport eskytester\neskytester.yes_i_am_working()\neskytester.yes_my_deps_are_working()\neskytester.yes_my_data_is_installed()\n\n# Test that we're at the best possible version\nassert sys.frozen\napp = esky.tests.TestableEsky(sys.executable,\"http://localhost:{0}/dist/\".format(LOCAL_HTTP_PORT))\nassert app.name == \"eskytester\"\nassert app.active_version == app.version == \"0.3\"\nassert app.find_update() is None\n\nif os.environ.get(\"ESKY_NEEDSROOT\",\"\"):\n app.get_root()\n\ntry:\n app.cleanup()\nexcept esky.EskyLockedError:\n print \"LOCKED, SLEEPING\"\n time.sleep(10)\n app.cleanup()\nassert os.path.isdir(os.path.join(app._get_versions_dir(),\"eskytester-0.3.\"+platform))\nassert not os.path.isfile(eskytester.script_path(app,\"script1\"))\nassert os.path.isfile(eskytester.script_path(app,\"script2\"))\nassert os.path.isfile(eskytester.script_path(app,\"script3\"))\n\n# Test that MSVCRT wasn't bundled with this version\nif sys.platform == \"win32\":\n for nm in os.listdir(os.path.dirname(sys.executable)):\n if nm.startswith(\"Microsoft.\") and nm.endswith(\".CRT\"):\n assert False, \"MSVCRT bundled in version dir when it shouldn't be\"\n for nm in os.listdir(app.appdir):\n if nm.startswith(\"Microsoft.\") and nm.endswith(\".CRT\"):\n assert False, \"MSVCRT bundled in appdir when it shouldn't be\"\n\n# On windows, test that we were chainloaded without an execv\nif sys.platform == \"win32\":\n if \"ESKY_NO_CUSTOM_CHAINLOAD\" not in os.environ:\n assert hasattr(sys,\"bootstrap_executable\"), \"didn't chainload in-proc\"\n\n\nopen(os.path.join(app.appdir,\"tests-completed\"),\"w\").close()\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"Thi",
"rd",
" ",
"entry",
" ",
"point",
" ",
"for",
" ",
"testi",
"ng",
" ",
"an",
" ",
"es",
"ky",
" ",
"install",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"os_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"sys_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"time_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"es",
"ky_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"es",
"ky_",
"._",
"util_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"es",
"ky_",
"._",
"util_",
"import_",
"LOCAL",
"\\u",
"HTTP",
"\\u",
"PORT_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"es",
"ky_",
"._",
"tests_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"platform_",
"=_",
"es",
"ky_",
"._",
"util_",
"._",
"get",
"\\u",
"platform_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"Test",
" ",
"tha",
"t",
" ",
"the",
" ",
"frozen",
" ",
"app",
" ",
"is",
" ",
"actual",
"ly",
" ",
"working",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"es",
"ky",
"tester_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"es",
"ky",
"tester_",
"._",
"ye",
"s",
"\\u",
"i",
"\\u",
"am",
"\\u",
"working",
"_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"es",
"ky",
"tester_",
"._",
"ye",
"s",
"\\u",
"my",
"\\u",
"dep",
"s",
"\\u",
"are",
"\\u",
"working",
"_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"es",
"ky",
"tester_",
"._",
"ye",
"s",
"\\u",
"my",
"\\u",
"data\\u",
"is",
"\\u",
"installed_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"Test",
" ",
"tha",
"t",
" ",
"we",
"'",
"re",
" ",
"at",
" ",
"the",
" ",
"best",
" ",
"possib",
"le",
" ",
"version_",
"\\u\\u\\uNL\\u\\u\\u_",
"assert_",
"sys_",
"._",
"frozen_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"app_",
"=_",
"es",
"ky_",
"._",
"tests_",
"._",
"Test",
"able",
"Es",
"ky_",
"(_",
"sys_",
"._",
"executable_",
",_",
"\"",
"http",
"://",
"local",
"host",
":",
"{",
"0",
"}/",
"dist",
"/\"_",
"._",
"format_",
"(_",
"LOCAL",
"\\u",
"HTTP",
"\\u",
"PORT_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"app_",
"._",
"name_",
"==_",
"\"",
"es",
"ky",
"teste",
"r",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"app_",
"._",
"active",
"\\u",
"version_",
"==_",
"app_",
"._",
"version_",
"==_",
"\"",
"0.",
"3",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"app_",
"._",
"find",
"\\u",
"update_",
"(_",
")_",
"is_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"os_",
"._",
"environ_",
"._",
"get_",
"(_",
"\"",
"ES",
"KY",
"\\u",
"NEED",
"SR",
"OOT",
"\"_",
",_",
"\"\"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"app_",
"._",
"get",
"\\u",
"root_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"app_",
"._",
"cleanup_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"es",
"ky_",
"._",
"Es",
"ky",
"Locke",
"d",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"print_",
"\"",
"LOCK",
"ED",
",",
" ",
"SLEEP",
"ING",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"time_",
"._",
"sleep_",
"(_",
"10_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"app_",
"._",
"cleanup_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"assert_",
"os_",
"._",
"path_",
"._",
"isdir_",
"(_",
"os_",
"._",
"path_",
"._",
"join_",
"(_",
"app_",
"._",
"\\u",
"get",
"\\u",
"version",
"s",
"\\u",
"dir_",
"(_",
")_",
",_",
"\"",
"es",
"ky",
"teste",
"r",
"-0",
".3",
".\"_",
"+_",
"platform_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"not_",
"os_",
"._",
"path_",
"._",
"isfile_",
"(_",
"es",
"ky",
"tester_",
"._",
"script",
"\\u",
"path_",
"(_",
"app_",
",_",
"\"",
"script",
"1",
"\"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"os_",
"._",
"path_",
"._",
"isfile_",
"(_",
"es",
"ky",
"tester_",
"._",
"script",
"\\u",
"path_",
"(_",
"app_",
",_",
"\"",
"script",
"2",
"\"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"os_",
"._",
"path_",
"._",
"isfile_",
"(_",
"es",
"ky",
"tester_",
"._",
"script",
"\\u",
"path_",
"(_",
"app_",
",_",
"\"",
"script",
"3",
"\"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"Test",
" ",
"tha",
"t",
" ",
"MS",
"VC",
"RT",
" ",
"was",
"n",
"'",
"t",
" ",
"bundle",
"d",
" ",
"with",
" ",
"this",
" ",
"version_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"sys_",
"._",
"platform_",
"==_",
"\"",
"win32",
"\"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"nm_",
"in_",
"os_",
"._",
"listdir_",
"(_",
"os_",
"._",
"path_",
"._",
"dirname_",
"(_",
"sys_",
"._",
"executable_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"nm_",
"._",
"startswith_",
"(_",
"\"",
"Micro",
"soft",
".\"_",
")_",
"and_",
"nm_",
"._",
"endswith_",
"(_",
"\".",
"CR",
"T",
"\"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"assert_",
"False_",
",_",
"\"",
"MS",
"VC",
"RT",
" ",
"bundle",
"d",
" ",
"in",
" ",
"version",
" ",
"dir",
" ",
"whe",
"n",
" ",
"it",
" ",
"shou",
"ld",
"n",
"'",
"t",
" ",
"be",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"nm_",
"in_",
"os_",
"._",
"listdir_",
"(_",
"app_",
"._",
"appd",
"ir_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"nm_",
"._",
"startswith_",
"(_",
"\"",
"Micro",
"soft",
".\"_",
")_",
"and_",
"nm_",
"._",
"endswith_",
"(_",
"\".",
"CR",
"T",
"\"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"assert_",
"False_",
",_",
"\"",
"MS",
"VC",
"RT",
" ",
"bundle",
"d",
" ",
"in",
" ",
"appd",
"ir",
" ",
"whe",
"n",
" ",
"it",
" ",
"shou",
"ld",
"n",
"'",
"t",
" ",
"be",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"On",
" ",
"windows",
",",
" ",
"test",
" ",
"tha",
"t",
" ",
"we",
" ",
"wer",
"e",
" ",
"chain",
"load",
"ed",
" ",
"with",
"out",
" ",
"an",
" ",
"exec",
"v_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"sys_",
"._",
"platform_",
"==_",
"\"",
"win32",
"\"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"\"",
"ES",
"KY",
"\\u",
"NO",
"\\u",
"CUSTOM",
"\\u",
"CHAIN",
"LOAD",
"\"_",
"not_",
"in_",
"os_",
"._",
"environ_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"assert_",
"hasattr_",
"(_",
"sys_",
",_",
"\"",
"boots",
"trap",
"\\u",
"executable",
"\"_",
")_",
",_",
"\"",
"did",
"n",
"'",
"t",
" ",
"chain",
"load",
" ",
"in",
"-",
"proc",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"open_",
"(_",
"os_",
"._",
"path_",
"._",
"join_",
"(_",
"app_",
"._",
"appd",
"ir_",
",_",
"\"",
"tests",
"-",
"complete",
"d",
"\"_",
")_",
",_",
"\"",
"w",
"\"_",
")_",
"._",
"close_",
"(_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Testing equality to None | sahana/eden/modules/templates/ARC/menus.py | [
{
"content": " @staticmethod\n def vol():\n \"\"\" Volunteer Management \"\"\"\n\n auth = current.auth\n s3 = current.session.s3\n ADMIN = s3.system_roles.ADMIN\n\n # Custom conditions for the check-hook, as lambdas in order\n # to have them checked only immediately before rendering:\n manager_mode = lambda i: s3.hrm.mode is None\n personal_mode = lambda i: s3.hrm.mode is not None\n is_org_admin = lambda i: s3.hrm.orgs and True or \\\n ADMIN in s3.roles\n is_super_editor = lambda i: auth.s3_has_role(\"vol_super\") or \\\n auth.s3_has_role(\"staff_super\")\n\n settings = current.deployment_settings\n show_programmes = lambda i: settings.get_hrm_vol_experience() == \"programme\"\n show_tasks = lambda i: settings.has_module(\"project\") and \\\n settings.get_project_mode_task()\n teams = settings.get_hrm_teams()\n use_teams = lambda i: teams\n\n not_vnrc = lambda i: auth.root_org_name() != \"Viet Nam Red Cross\"\n skills_menu = lambda i: auth.root_org_name() in (\"Afghan Red Crescent Society\",\n \"Indonesian Red Cross Society (Pelang Merah Indonesia)\",\n \"Viet Nam Red Cross\",\n )\n\n check_org_dependent_field = lambda tablename, fieldname: \\\n settings.set_org_dependent_field(tablename, fieldname,\n enable_field = False)\n\n return M(c=\"vol\")(\n M(\"Volunteers\", f=\"volunteer\", m=\"summary\",\n check=[manager_mode])(\n M(\"Create\", m=\"create\"),\n M(\"Import\", f=\"person\", m=\"import\",\n vars={\"group\":\"volunteer\"}, p=\"create\"),\n ),\n M(\"Staff & Volunteers (Combined)\",\n c=\"vol\", f=\"human_resource\", m=\"summary\",\n check=[manager_mode, is_super_editor]),\n M(teams, f=\"group\",\n check=[manager_mode, use_teams])(\n M(\"Create\", m=\"create\"),\n M(\"Search Members\", f=\"group_membership\"),\n M(\"Import\", f=\"group_membership\", m=\"import\"),\n ),\n #M(\"Department Catalog\", f=\"department\",\n # check=manager_mode)(\n # M(\"Create\", m=\"create\"),\n #),\n M(\"Volunteer Role Catalog\", f=\"job_title\",\n check=[manager_mode, not_vnrc])(\n M(\"Create\", m=\"create\"),\n M(\"Import\", m=\"import\", p=\"create\", check=is_org_admin),\n ),\n M(\"Skill Catalog\", f=\"skill\",\n check=[manager_mode, skills_menu])(\n M(\"Create\", m=\"create\"),\n #M(\"Skill Provisions\", f=\"skill_provision\"),\n ),\n M(\"Training Events\", f=\"training_event\",\n check=manager_mode)(\n M(\"Create\", m=\"create\"),\n M(\"Search Training Participants\", f=\"training\"),\n M(\"Import Participant List\", f=\"training\", m=\"import\"),\n ),\n M(\"Training Course Catalog\", f=\"course\",\n check=manager_mode)(\n M(\"Create\", m=\"create\"),\n #M(\"Course Certificates\", f=\"course_certificate\"),\n ),\n M(\"Certificate Catalog\", f=\"certificate\",\n check=manager_mode)(\n M(\"Create\", m=\"create\"),\n #M(\"Skill Equivalence\", f=\"certificate_skill\"),\n ),\n M(\"Programs\", f=\"programme\",\n check=[manager_mode, show_programmes])(\n M(\"Create\", m=\"create\"),\n M(\"Import Hours\", f=\"programme_hours\", m=\"import\"),\n ),\n M(\"Awards\", f=\"award\",\n check=[manager_mode, is_org_admin])(\n M(\"Create\", m=\"create\"),\n ),\n M(\"Volunteer Cluster Type\", f=\"cluster_type\",\n check = check_org_dependent_field(\"vol_volunteer_cluster\",\n \"vol_cluster_type_id\"))(\n M(\"Create\", m=\"create\"),\n ),\n M(\"Volunteer Cluster\", f=\"cluster\",\n check = check_org_dependent_field(\"vol_volunteer_cluster\",\n \"vol_cluster_id\"))(\n M(\"Create\", m=\"create\"),\n ),\n M(\"Volunteer Cluster Position\", f=\"cluster_position\",\n check = check_org_dependent_field(\"vol_volunteer_cluster\",\n \"vol_cluster_position_id\"))(\n M(\"Create\", m=\"create\"),\n ),\n M(\"Reports\", f=\"volunteer\", m=\"report\",\n check=manager_mode)(\n M(\"Volunteer Report\", m=\"report\"),\n M(\"Hours by Role Report\", f=\"programme_hours\", m=\"report\",\n vars=Storage(rows=\"job_title_id\",\n cols=\"month\",\n fact=\"sum(hours)\"),\n check=show_programmes),\n M(\"Hours by Program Report\", f=\"programme_hours\", m=\"report\",\n vars=Storage(rows=\"programme_id\",\n cols=\"month\",\n fact=\"sum(hours)\"),\n check=show_programmes),\n M(\"Training Report\", f=\"training\", m=\"report\"),\n ),\n #M(\"My Profile\", f=\"person\",\n # check=personal_mode, vars=dict(access=\"personal\")),\n M(\"My Tasks\", f=\"task\",\n check=[personal_mode, show_tasks],\n vars=dict(access=\"personal\",\n mine=1)),\n # This provides the link to switch to the manager mode:\n M(\"Volunteer Management\", f=\"index\",\n check=[personal_mode, is_org_admin]),\n # This provides the link to switch to the personal mode:\n #M(\"Personal Profile\", f=\"person\",\n # check=manager_mode, vars=dict(access=\"personal\"))\n )",
"metadata": "root.S3OptionsMenu.vol",
"header": "['class', 'S3OptionsMenu', '(', 'default', '.', 'S3OptionsMenu', ')', ':', '___EOS___']",
"index": 693
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Test",
"ing_",
"equality",
"_",
"to_",
"None_",
"[SEP]_",
"class_",
"S",
"3",
"Optio",
"ns",
"Menu_",
"(_",
"default_",
"._",
"S",
"3",
"Optio",
"ns",
"Menu_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"staticmethod_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"vol_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Volu",
"nte",
"er",
" ",
"Manage",
"ment",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"auth_",
"=_",
"current_",
"._",
"auth_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"s3_",
"=_",
"current_",
"._",
"session_",
"._",
"s3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ADMIN_",
"=_",
"s3_",
"._",
"system",
"\\u",
"roles_",
"._",
"ADMIN_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Custom",
" ",
"condition",
"s",
" ",
"for",
" ",
"the",
" ",
"check",
"-",
"hook",
",",
" ",
"as",
" ",
"lambda",
"s",
" ",
"in",
" ",
"order_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"to",
" ",
"have",
" ",
"them",
" ",
"checke",
"d",
" ",
"only",
" ",
"immediate",
"ly",
" ",
"bef",
"ore",
" ",
"render",
"ing",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"manage",
"r",
"\\u",
"mode_",
"=_",
"lambda_",
"i_",
":_",
"s3_",
"._",
"hrm",
"_",
"._",
"mode_",
"is_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"persona",
"l\\u",
"mode_",
"=_",
"lambda_",
"i_",
":_",
"s3_",
"._",
"hrm",
"_",
"._",
"mode_",
"is_",
"not_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"is",
"\\u",
"org",
"\\u",
"admin_",
"=_",
"lambda_",
"i_",
":_",
"s3_",
"._",
"hrm",
"_",
"._",
"orgs",
"_",
"and_",
"True_",
"or_",
"ADMIN_",
"in_",
"s3_",
"._",
"roles_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"is",
"\\u",
"super",
"\\u",
"editor_",
"=_",
"lambda_",
"i_",
":_",
"auth_",
"._",
"s3",
"\\u",
"has",
"\\u",
"role_",
"(_",
"\"",
"vol",
"\\u",
"super",
"\"_",
")_",
"or_",
"auth_",
"._",
"s3",
"\\u",
"has",
"\\u",
"role_",
"(_",
"\"",
"sta",
"ff",
"\\u",
"super",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"settings_",
"=_",
"current_",
"._",
"deploy",
"ment",
"\\u",
"settings_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"show",
"\\u",
"programme",
"s_",
"=_",
"lambda_",
"i_",
":_",
"settings_",
"._",
"get",
"\\u",
"hrm",
"\\u",
"vol",
"\\u",
"experience",
"_",
"(_",
")_",
"==_",
"\"",
"programme",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"show",
"\\u",
"tasks_",
"=_",
"lambda_",
"i_",
":_",
"settings_",
"._",
"has",
"\\u",
"module_",
"(_",
"\"",
"project",
"\"_",
")_",
"and_",
"settings_",
"._",
"get",
"\\u",
"project",
"\\u",
"mode",
"\\u",
"task_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"teams_",
"=_",
"settings_",
"._",
"get",
"\\u",
"hrm",
"\\u",
"teams_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"use",
"\\u",
"teams_",
"=_",
"lambda_",
"i_",
":_",
"teams_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"not",
"\\u",
"vn",
"rc_",
"=_",
"lambda_",
"i_",
":_",
"auth_",
"._",
"root",
"\\u",
"org",
"\\u",
"name_",
"(_",
")_",
"!=_",
"\"",
"Vie",
"t",
" ",
"Nam",
" ",
"Red",
" ",
"Cross",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ski",
"lls",
"\\u",
"menu_",
"=_",
"lambda_",
"i_",
":_",
"auth_",
"._",
"root",
"\\u",
"org",
"\\u",
"name_",
"(_",
")_",
"in_",
"(_",
"\"",
"Af",
"gha",
"n",
" ",
"Red",
" ",
"Cre",
"scen",
"t",
" ",
"Soci",
"ety",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Ind",
"ones",
"ian",
" ",
"Red",
" ",
"Cross",
" ",
"Soci",
"ety",
" ",
"(",
"Pel",
"ang",
" ",
"Mer",
"ah",
" ",
"Ind",
"ones",
"ia",
")\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"Vie",
"t",
" ",
"Nam",
" ",
"Red",
" ",
"Cross",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"check",
"\\u",
"org",
"\\u",
"dependent",
"\\u",
"field_",
"=_",
"lambda_",
"tablename_",
",_",
"fieldname_",
":_",
"settings_",
"._",
"set\\u",
"org",
"\\u",
"dependent",
"\\u",
"field_",
"(_",
"tablename_",
",_",
"fieldname_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"enable",
"\\u",
"field_",
"=_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"M_",
"(_",
"c_",
"=_",
"\"",
"vol",
"\"_",
")_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Volu",
"nte",
"ers",
"\"_",
",_",
"f_",
"=_",
"\"",
"volunteer",
"\"_",
",_",
"m_",
"=_",
"\"",
"summar",
"y",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"[_",
"manage",
"r",
"\\u",
"mode_",
"]_",
")_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Creat",
"e",
"\"_",
",_",
"m_",
"=_",
"\"",
"create",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Import",
"\"_",
",_",
"f_",
"=_",
"\"",
"person",
"\"_",
",_",
"m_",
"=_",
"\"",
"import",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"vars_",
"=_",
"{_",
"\"",
"group",
"\"_",
":_",
"\"",
"volunteer",
"\"_",
"}_",
",_",
"p_",
"=_",
"\"",
"create",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Sta",
"ff",
" ",
"&",
" ",
"Volu",
"nte",
"ers",
" ",
"(",
"Combine",
"d",
")\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"c_",
"=_",
"\"",
"vol",
"\"_",
",_",
"f_",
"=_",
"\"",
"human",
"\\u",
"resource",
"\"_",
",_",
"m_",
"=_",
"\"",
"summar",
"y",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"[_",
"manage",
"r",
"\\u",
"mode_",
",_",
"is",
"\\u",
"super",
"\\u",
"editor_",
"]_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"teams_",
",_",
"f_",
"=_",
"\"",
"group",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"[_",
"manage",
"r",
"\\u",
"mode_",
",_",
"use",
"\\u",
"teams_",
"]_",
")_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Creat",
"e",
"\"_",
",_",
"m_",
"=_",
"\"",
"create",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Sear",
"ch",
" ",
"Mem",
"bers",
"\"_",
",_",
"f_",
"=_",
"\"",
"group",
"\\u",
"member",
"ship",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Import",
"\"_",
",_",
"f_",
"=_",
"\"",
"group",
"\\u",
"member",
"ship",
"\"_",
",_",
"m_",
"=_",
"\"",
"import",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"M",
"(\"",
"Depart",
"ment",
" ",
"Catalog",
"\",",
" ",
"f",
"=\"",
"department",
"\",",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"check",
"=",
"manage",
"r",
"\\u",
"mode",
")(",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"M",
"(\"",
"Creat",
"e",
"\",",
" ",
"m",
"=\"",
"create",
"\")",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#)",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Volu",
"nte",
"er",
" ",
"Ro",
"le",
" ",
"Catalog",
"\"_",
",_",
"f_",
"=_",
"\"",
"job",
"\\u",
"title",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"[_",
"manage",
"r",
"\\u",
"mode_",
",_",
"not",
"\\u",
"vn",
"rc_",
"]_",
")_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Creat",
"e",
"\"_",
",_",
"m_",
"=_",
"\"",
"create",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Import",
"\"_",
",_",
"m_",
"=_",
"\"",
"import",
"\"_",
",_",
"p_",
"=_",
"\"",
"create",
"\"_",
",_",
"check_",
"=_",
"is",
"\\u",
"org",
"\\u",
"admin_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Ski",
"ll",
" ",
"Catalog",
"\"_",
",_",
"f_",
"=_",
"\"",
"ski",
"ll",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"[_",
"manage",
"r",
"\\u",
"mode_",
",_",
"ski",
"lls",
"\\u",
"menu_",
"]_",
")_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Creat",
"e",
"\"_",
",_",
"m_",
"=_",
"\"",
"create",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"M",
"(\"",
"Ski",
"ll",
" ",
"Provision",
"s",
"\",",
" ",
"f",
"=\"",
"ski",
"ll",
"\\u",
"provision",
"\")",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Train",
"ing",
" ",
"Event",
"s",
"\"_",
",_",
"f_",
"=_",
"\"",
"train",
"ing",
"\\u",
"event",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"manage",
"r",
"\\u",
"mode_",
")_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Creat",
"e",
"\"_",
",_",
"m_",
"=_",
"\"",
"create",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Sear",
"ch",
" ",
"Train",
"ing",
" ",
"Participant",
"s",
"\"_",
",_",
"f_",
"=_",
"\"",
"train",
"ing",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Import",
" ",
"Participant",
" ",
"List",
"\"_",
",_",
"f_",
"=_",
"\"",
"train",
"ing",
"\"_",
",_",
"m_",
"=_",
"\"",
"import",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Train",
"ing",
" ",
"Cour",
"se",
" ",
"Catalog",
"\"_",
",_",
"f_",
"=_",
"\"",
"course",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"manage",
"r",
"\\u",
"mode_",
")_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Creat",
"e",
"\"_",
",_",
"m_",
"=_",
"\"",
"create",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"M",
"(\"",
"Cour",
"se",
" ",
"Certificat",
"es",
"\",",
" ",
"f",
"=\"",
"course",
"\\u",
"certifica",
"te",
"\")",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Certificat",
"e",
" ",
"Catalog",
"\"_",
",_",
"f_",
"=_",
"\"",
"certifica",
"te",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"manage",
"r",
"\\u",
"mode_",
")_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Creat",
"e",
"\"_",
",_",
"m_",
"=_",
"\"",
"create",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"M",
"(\"",
"Ski",
"ll",
" ",
"Equi",
"valence",
"\",",
" ",
"f",
"=\"",
"certifica",
"te",
"\\u",
"ski",
"ll",
"\")",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Program",
"s",
"\"_",
",_",
"f_",
"=_",
"\"",
"programme",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"[_",
"manage",
"r",
"\\u",
"mode_",
",_",
"show",
"\\u",
"programme",
"s_",
"]_",
")_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Creat",
"e",
"\"_",
",_",
"m_",
"=_",
"\"",
"create",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Import",
" ",
"Hour",
"s",
"\"_",
",_",
"f_",
"=_",
"\"",
"programme",
"\\u",
"hour",
"s",
"\"_",
",_",
"m_",
"=_",
"\"",
"import",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Award",
"s",
"\"_",
",_",
"f_",
"=_",
"\"",
"award",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"[_",
"manage",
"r",
"\\u",
"mode_",
",_",
"is",
"\\u",
"org",
"\\u",
"admin_",
"]_",
")_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Creat",
"e",
"\"_",
",_",
"m_",
"=_",
"\"",
"create",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Volu",
"nte",
"er",
" ",
"Cluster",
" ",
"Type",
"\"_",
",_",
"f_",
"=_",
"\"",
"cluster",
"\\u",
"type",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"check",
"\\u",
"org",
"\\u",
"dependent",
"\\u",
"field_",
"(_",
"\"",
"vol",
"\\u",
"volunteer",
"\\u",
"cluster",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"vol",
"\\u",
"cluster",
"\\u",
"type",
"\\u",
"id",
"\"_",
")_",
")_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Creat",
"e",
"\"_",
",_",
"m_",
"=_",
"\"",
"create",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Volu",
"nte",
"er",
" ",
"Cluster",
"\"_",
",_",
"f_",
"=_",
"\"",
"cluster",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"check",
"\\u",
"org",
"\\u",
"dependent",
"\\u",
"field_",
"(_",
"\"",
"vol",
"\\u",
"volunteer",
"\\u",
"cluster",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"vol",
"\\u",
"cluster",
"\\u",
"id",
"\"_",
")_",
")_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Creat",
"e",
"\"_",
",_",
"m_",
"=_",
"\"",
"create",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Volu",
"nte",
"er",
" ",
"Cluster",
" ",
"Position",
"\"_",
",_",
"f_",
"=_",
"\"",
"cluster",
"\\u",
"position",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"check",
"\\u",
"org",
"\\u",
"dependent",
"\\u",
"field_",
"(_",
"\"",
"vol",
"\\u",
"volunteer",
"\\u",
"cluster",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"vol",
"\\u",
"cluster",
"\\u",
"position",
"\\u",
"id",
"\"_",
")_",
")_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Creat",
"e",
"\"_",
",_",
"m_",
"=_",
"\"",
"create",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Report",
"s",
"\"_",
",_",
"f_",
"=_",
"\"",
"volunteer",
"\"_",
",_",
"m_",
"=_",
"\"",
"report",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"manage",
"r",
"\\u",
"mode_",
")_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Volu",
"nte",
"er",
" ",
"Report",
"\"_",
",_",
"m_",
"=_",
"\"",
"report",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Hour",
"s",
" ",
"by",
" ",
"Ro",
"le",
" ",
"Report",
"\"_",
",_",
"f_",
"=_",
"\"",
"programme",
"\\u",
"hour",
"s",
"\"_",
",_",
"m_",
"=_",
"\"",
"report",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"vars_",
"=_",
"Storage_",
"(_",
"rows_",
"=_",
"\"",
"job",
"\\u",
"title",
"\\u",
"id",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"cols_",
"=_",
"\"",
"month",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"fact_",
"=_",
"\"",
"sum",
"(",
"hour",
"s",
")\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"show",
"\\u",
"programme",
"s_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Hour",
"s",
" ",
"by",
" ",
"Program",
" ",
"Report",
"\"_",
",_",
"f_",
"=_",
"\"",
"programme",
"\\u",
"hour",
"s",
"\"_",
",_",
"m_",
"=_",
"\"",
"report",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"vars_",
"=_",
"Storage_",
"(_",
"rows_",
"=_",
"\"",
"programme",
"\\u",
"id",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"cols_",
"=_",
"\"",
"month",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"fact_",
"=_",
"\"",
"sum",
"(",
"hour",
"s",
")\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"show",
"\\u",
"programme",
"s_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Train",
"ing",
" ",
"Report",
"\"_",
",_",
"f_",
"=_",
"\"",
"train",
"ing",
"\"_",
",_",
"m_",
"=_",
"\"",
"report",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"M",
"(\"",
"My",
" ",
"Profil",
"e",
"\",",
" ",
"f",
"=\"",
"person",
"\",",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"check",
"=",
"persona",
"l\\u",
"mode",
",",
" ",
"vars",
"=",
"dict",
"(",
"access",
"=\"",
"persona",
"l",
"\"))",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"My",
" ",
"Task",
"s",
"\"_",
",_",
"f_",
"=_",
"\"",
"task",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"[_",
"persona",
"l\\u",
"mode_",
",_",
"show",
"\\u",
"tasks_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"vars_",
"=_",
"dict_",
"(_",
"access_",
"=_",
"\"",
"persona",
"l",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"mine_",
"=_",
"1_",
")_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Thi",
"s",
" ",
"provide",
"s",
" ",
"the",
" ",
"link",
" ",
"to",
" ",
"switch",
" ",
"to",
" ",
"the",
" ",
"manage",
"r",
" ",
"mode",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"M_",
"(_",
"\"",
"Volu",
"nte",
"er",
" ",
"Manage",
"ment",
"\"_",
",_",
"f_",
"=_",
"\"",
"index",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"check_",
"=_",
"[_",
"persona",
"l\\u",
"mode_",
",_",
"is",
"\\u",
"org",
"\\u",
"admin_",
"]_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Thi",
"s",
" ",
"provide",
"s",
" ",
"the",
" ",
"link",
" ",
"to",
" ",
"switch",
" ",
"to",
" ",
"the",
" ",
"persona",
"l",
" ",
"mode",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"M",
"(\"",
"Persona",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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | home-assistant/home-assistant/homeassistant/components/sensor/rest.py | [
{
"content": "\"\"\"\nSupport for REST API sensors..\n\nFor more details about this platform, please refer to the documentation at\nhttps://home-assistant.io/components/sensor.rest/\n\"\"\"\nimport logging\n\nimport requests\n\nfrom homeassistant.const import CONF_VALUE_TEMPLATE, STATE_UNKNOWN\nfrom homeassistant.helpers.entity import Entity\nfrom homeassistant.helpers import template\n\n_LOGGER = logging.getLogger(__name__)\n\nDEFAULT_NAME = 'REST Sensor'\nDEFAULT_METHOD = 'GET'\n\n\n# pylint: disable=unused-variable\n\n\n# pylint: disable=too-many-arguments\n\n\n# pylint: disable=too-few-public-methods\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "def setup_platform(hass, config, add_devices, discovery_info=None):\n \"\"\"Setup the REST sensor.\"\"\"\n resource = config.get('resource', None)\n method = config.get('method', DEFAULT_METHOD)\n payload = config.get('payload', None)\n verify_ssl = config.get('verify_ssl', True)\n\n rest = RestData(method, resource, payload, verify_ssl)\n rest.update()\n\n if rest.data is None:\n _LOGGER.error('Unable to fetch Rest data')\n return False\n\n add_devices([RestSensor(\n hass, rest, config.get('name', DEFAULT_NAME),\n config.get('unit_of_measurement'), config.get(CONF_VALUE_TEMPLATE))])",
"metadata": "root.setup_platform",
"header": "['module', '___EOS___']",
"index": 21
},
{
"content": "class RestSensor(Entity):\n \"\"\"Implementation of a REST sensor.\"\"\"\n\n\n\n\n",
"metadata": "root.RestSensor",
"header": "['module', '___EOS___']",
"index": 41
},
{
"content": " def __init__(self, hass, rest, name, unit_of_measurement, value_template):\n \"\"\"Initialize the sensor.\"\"\"\n self._hass = hass\n self.rest = rest\n self._name = name\n self._state = STATE_UNKNOWN\n self._unit_of_measurement = unit_of_measurement\n self._value_template = value_template\n self.update()",
"metadata": "root.RestSensor.__init__",
"header": "['class', 'RestSensor', '(', 'Entity', ')', ':', '___EOS___']",
"index": 44
},
{
"content": " @property\n def name(self):\n \"\"\"Return the name of the sensor.\"\"\"\n return self._name",
"metadata": "root.RestSensor.name",
"header": "['class', 'RestSensor', '(', 'Entity', ')', ':', '___EOS___']",
"index": 54
},
{
"content": " @property\n def unit_of_measurement(self):\n \"\"\"Return the unit the value is expressed in.\"\"\"\n return self._unit_of_measurement",
"metadata": "root.RestSensor.unit_of_measurement",
"header": "['class', 'RestSensor', '(', 'Entity', ')', ':', '___EOS___']",
"index": 59
},
{
"content": " @property\n def state(self):\n \"\"\"Return the state of the device.\"\"\"\n return self._state",
"metadata": "root.RestSensor.state",
"header": "['class', 'RestSensor', '(', 'Entity', ')', ':', '___EOS___']",
"index": 64
},
{
"content": " def update(self):\n \"\"\"Get the latest data from REST API and update the state.\"\"\"\n self.rest.update()\n value = self.rest.data\n\n if value is None:\n value = STATE_UNKNOWN\n elif self._value_template is not None:\n value = template.render_with_possible_json_value(\n self._hass, self._value_template, value, STATE_UNKNOWN)\n\n self._state = value",
"metadata": "root.RestSensor.update",
"header": "['class', 'RestSensor', '(', 'Entity', ')', ':', '___EOS___']",
"index": 69
},
{
"content": "class RestData(object):\n \"\"\"Class for handling the data retrieval.\"\"\"\n\n",
"metadata": "root.RestData",
"header": "['module', '___EOS___']",
"index": 84
},
{
"content": " def __init__(self, method, resource, data, verify_ssl):\n \"\"\"Initialize the data object.\"\"\"\n self._request = requests.Request(method, resource, data=data).prepare()\n self._verify_ssl = verify_ssl\n self.data = None",
"metadata": "root.RestData.__init__",
"header": "['class', 'RestData', '(', 'object', ')', ':', '___EOS___']",
"index": 87
},
{
"content": " def update(self):\n \"\"\"Get the latest data from REST service with GET method.\"\"\"\n try:\n with requests.Session() as sess:\n response = sess.send(self._request, timeout=10,\n verify=self._verify_ssl)\n\n self.data = response.text\n except requests.exceptions.RequestException:\n _LOGGER.error(\"Error fetching data: %s\", self._request)\n self.data = None",
"metadata": "root.RestData.update",
"header": "['class', 'RestData', '(', 'object', ')', ':', '___EOS___']",
"index": 93
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\"\"\"",
"\\",
"10",
";",
"Supp",
"ort",
" ",
"for",
" ",
"REST",
" ",
"API",
" ",
"sensor",
"s",
"..",
"\\",
"10",
";",
"\\",
"10",
";",
"For",
" ",
"more",
" ",
"deta",
"il",
"s",
" ",
"abo",
"ut",
" ",
"this",
" ",
"platform",
",",
" ",
"plea",
"se",
" ",
"refer",
" ",
"to",
" ",
"the",
" ",
"documentation",
" ",
"at",
"\\",
"10",
";",
"https",
"://",
"home",
"-",
"assistan",
"t",
".",
"io",
"/",
"component",
"s",
"/",
"sensor",
".",
"rest",
"/",
"\\",
"10",
";\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"logging_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"requests_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"homeassistant_",
"._",
"const_",
"import_",
"CONF",
"\\u",
"VALU",
"E",
"\\u",
"TEMPLATE_",
",_",
"STATE",
"\\u",
"UNKNOWN_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"homeassistant_",
"._",
"helpers_",
"._",
"entity_",
"import_",
"Entity_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"homeassistant_",
"._",
"helpers_",
"import_",
"template_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"LOGGER_",
"=_",
"logging_",
"._",
"get",
"Logger_",
"(_",
"\\u\\u",
"name\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"DEF",
"AUL",
"T",
"\\u",
"NAME_",
"=_",
"'",
"REST",
" ",
"Sen",
"sor",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"DEF",
"AUL",
"T",
"\\u",
"METHOD_",
"=_",
"'",
"GET",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"pylint",
":",
" ",
"disable",
"=",
"unu",
"sed",
"-",
"variable_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"pylint",
":",
" ",
"disable",
"=",
"too",
"-",
"many",
"-",
"arguments_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"pylint",
":",
" ",
"disable",
"=",
"too",
"-",
"few",
"-",
"public",
"-",
"methods_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"setup",
"\\u",
"platform_",
"(_",
"hass_",
",_",
"config_",
",_",
"add",
"\\u",
"devices_",
",_",
"discove",
"ry",
"\\u",
"info_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Set",
"up",
" ",
"the",
" ",
"REST",
" ",
"sensor",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"resource_",
"=_",
"config_",
"._",
"get_",
"(_",
"'",
"resource",
"'_",
",_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"method_",
"=_",
"config_",
"._",
"get_",
"(_",
"'",
"method",
"'_",
",_",
"DEF",
"AUL",
"T",
"\\u",
"METHOD_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"payload_",
"=_",
"config_",
"._",
"get_",
"(_",
"'",
"payload",
"'_",
",_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"verify",
"\\u",
"ssl_",
"=_",
"config_",
"._",
"get_",
"(_",
"'",
"verify",
"\\u",
"ssl",
"'_",
",_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"rest_",
"=_",
"Rest",
"Data_",
"(_",
"method_",
",_",
"resource_",
",_",
"payload_",
",_",
"verify",
"\\u",
"ssl_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"rest_",
"._",
"update_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"rest_",
"._",
"data_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\\u",
"LOGGER_",
"._",
"error_",
"(_",
"'",
"Una",
"ble",
" ",
"to",
" ",
"fetch",
" ",
"Rest",
" ",
"data",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"add",
"\\u",
"devices_",
"(_",
"[_",
"Rest",
"Sensor_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"hass_",
",_",
"rest_",
",_",
"config_",
"._",
"get_",
"(_",
"'",
"name",
"'_",
",_",
"DEF",
"AUL",
"T",
"\\u",
"NAME_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"config_",
"._",
"get_",
"(_",
"'",
"unit",
"\\u",
"of",
"\\u",
"measure",
"ment",
"'_",
")_",
",_",
"config_",
"._",
"get_",
"(_",
"CONF",
"\\u",
"VALU",
"E",
"\\u",
"TEMPLATE_",
")_",
")_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Rest",
"Sensor_",
"(_",
"Entity_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Implementation",
" ",
"of",
" ",
"a",
" ",
"REST",
" ",
"sensor",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Rest",
"Sensor_",
"(_",
"Entity_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"hass_",
",_",
"rest_",
",_",
"name_",
",_",
"unit",
"\\u",
"of",
"\\u",
"measurement_",
",_",
"value",
"\\u",
"template_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Initializ",
"e",
" ",
"the",
" ",
"sensor",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"hass_",
"=_",
"hass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"rest_",
"=_",
"rest_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"name_",
"=_",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"state_",
"=_",
"STATE",
"\\u",
"UNKNOWN_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"unit",
"\\u",
"of",
"\\u",
"measurement_",
"=_",
"unit",
"\\u",
"of",
"\\u",
"measurement_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"value",
"\\u",
"template_",
"=_",
"value",
"\\u",
"template_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"update_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rest",
"Sensor_",
"(_",
"Entity_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"name_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Return",
" ",
"the",
" ",
"name",
" ",
"of",
" ",
"the",
" ",
"sensor",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"\\u",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rest",
"Sensor_",
"(_",
"Entity_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"unit",
"\\u",
"of",
"\\u",
"measurement_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Return",
" ",
"the",
" ",
"unit",
" ",
"the",
" ",
"value",
" ",
"is",
" ",
"express",
"ed",
" ",
"in",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"\\u",
"unit",
"\\u",
"of",
"\\u",
"measurement_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rest",
"Sensor_",
"(_",
"Entity_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"state_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Return",
" ",
"the",
" ",
"state",
" ",
"of",
" ",
"the",
" ",
"device",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"\\u",
"state_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rest",
"Sensor_",
"(_",
"Entity_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"update_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Get",
" ",
"the",
" ",
"late",
"st",
" ",
"data",
" ",
"from",
" ",
"REST",
" ",
"API",
" ",
"and",
" ",
"update",
" ",
"the",
" ",
"state",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"rest_",
"._",
"update_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"value_",
"=_",
"self_",
"._",
"rest_",
"._",
"data_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"value_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"value_",
"=_",
"STATE",
"\\u",
"UNKNOWN_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"self_",
"._",
"\\u",
"value",
"\\u",
"template_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"value_",
"=_",
"template_",
"._",
"render",
"\\u",
"with",
"\\u",
"possib",
"le",
"\\u",
"json",
"\\u",
"value_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"hass_",
",_",
"self_",
"._",
"\\u",
"value",
"\\u",
"template_",
",_",
"value_",
",_",
"STATE",
"\\u",
"UNKNOWN_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"state_",
"=_",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Rest",
"Data_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Class",
" ",
"for",
" ",
"handling",
" ",
"the",
" ",
"data",
" ",
"retrie",
"val",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Rest",
"Data_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"method_",
",_",
"resource_",
",_",
"data_",
",_",
"verify",
"\\u",
"ssl_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Initializ",
"e",
" ",
"the",
" ",
"data",
" ",
"object",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"request_",
"=_",
"requests_",
"._",
"Request_",
"(_",
"method_",
",_",
"resource_",
",_",
"data_",
"=_",
"data_",
")_",
"._",
"prepare_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"verify",
"\\u",
"ssl_",
"=_",
"verify",
"\\u",
"ssl_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"data_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Rest",
"Data_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"update_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Get",
" ",
"the",
" ",
"late",
"st",
" ",
"data",
" ",
"from",
" ",
"REST",
" ",
"service",
" ",
"with",
" ",
"GET",
" ",
"method",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"with_",
"requests_",
"._",
"Session_",
"(_",
")_",
"as_",
"sess_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"response_",
"=_",
"sess_",
"._",
"send_",
"(_",
"self_",
"._",
"\\u",
"request_",
",_",
"timeout_",
"=_",
"10_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"verify_",
"=_",
"self_",
"._",
"\\u",
"verify",
"\\u",
"ssl_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"data_",
"=_",
"response_",
"._",
"text_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"requests_",
"._",
"exceptions_",
"._",
"Request",
"Exception_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\\u",
"LOGGER_",
"._",
"error_",
"(_",
"\"",
"Error",
" ",
"fetch",
"ing",
" ",
"data",
":",
" ",
"%",
"s",
"\"_",
",_",
"self_",
"._",
"\\u",
"request_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"data_",
"=_",
"None_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | dchaplinsky/unshred-tag/tests/__init__.py | [
{
"content": "from flask import url_for\nfrom flask.ext.testing import TestCase\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class BasicTestCase(TestCase):\n\n",
"metadata": "root.BasicTestCase",
"header": "['module', '___EOS___']",
"index": 4
},
{
"content": " def create_app(self):\n # siiiick, sick and stupid\n # We need to redefine some settings in weird way before import Flask\n # app because it got initialized on import. Yes, this is a little bit\n # stupid\n try:\n import local_settings as settings\n except ImportError:\n import settings\n\n settings.MONGODB_SETTINGS[\"DB\"] = \"unshred_test\"\n settings.ENABLE_FIXTURES_ENDPOINTS = True\n import app as unshred\n return unshred.app",
"metadata": "root.BasicTestCase.create_app",
"header": "['class', 'BasicTestCase', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 5
},
{
"content": " def create_user_and_login(self, username=\"user\"):\n self.client.post(url_for(\"fixtures.create_users\"))\n self.client.post(url_for(\"fixtures.login_user\", username=username))",
"metadata": "root.BasicTestCase.create_user_and_login",
"header": "['class', 'BasicTestCase', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 20
},
{
"content": " def is_user_logged(self):\n with self.client.session_transaction() as session:\n return \"user_id\" in session",
"metadata": "root.BasicTestCase.is_user_logged",
"header": "['class', 'BasicTestCase', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 24
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"from_",
"flask_",
"import_",
"url",
"\\u",
"for_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"flask_",
"._",
"ext_",
"._",
"testing_",
"import_",
"Test",
"Case_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Basic",
"Test",
"Case_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Basic",
"Test",
"Case_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"create",
"\\u",
"app_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"si",
"iii",
"ck",
",",
" ",
"sick",
" ",
"and",
" ",
"stu",
"pid_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"We",
" ",
"need",
" ",
"to",
" ",
"rede",
"fine",
" ",
"some",
" ",
"settings",
" ",
"in",
" ",
"weird",
" ",
"way",
" ",
"bef",
"ore",
" ",
"import",
" ",
"Flask_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"app",
" ",
"bec",
"aus",
"e",
" ",
"it",
" ",
"got",
" ",
"initialize",
"d",
" ",
"on",
" ",
"import",
".",
" ",
"Ye",
"s",
",",
" ",
"this",
" ",
"is",
" ",
"a",
" ",
"litt",
"le",
" ",
"bit_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"stu",
"pid_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"local",
"\\u",
"settings_",
"as_",
"settings_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Import",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"settings_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"settings_",
"._",
"MONGO",
"DB",
"\\u",
"SETTINGS_",
"[_",
"\"",
"DB",
"\"_",
"]_",
"=_",
"\"",
"unsh",
"red",
"\\u",
"test",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"settings_",
"._",
"ENABLE",
"\\u",
"FIXTURE",
"S",
"\\u",
"ENDPOINT",
"S_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"app_",
"as_",
"unsh",
"red_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"unsh",
"red_",
"._",
"app_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Basic",
"Test",
"Case_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"create",
"\\u",
"user",
"\\u",
"and",
"\\u",
"login_",
"(_",
"self_",
",_",
"username_",
"=_",
"\"",
"user",
"\"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"client_",
"._",
"post_",
"(_",
"url",
"\\u",
"for_",
"(_",
"\"",
"fixture",
"s",
".",
"create",
"\\u",
"users",
"\"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"client_",
"._",
"post_",
"(_",
"url",
"\\u",
"for_",
"(_",
"\"",
"fixture",
"s",
".",
"login",
"\\u",
"user",
"\"_",
",_",
"username_",
"=_",
"username_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Basic",
"Test",
"Case_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"is",
"\\u",
"user",
"\\u",
"logged",
"_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"with_",
"self_",
"._",
"client_",
"._",
"session",
"\\u",
"transaction_",
"(_",
")_",
"as_",
"session_",
":_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
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | dokterbob/satchmo/satchmo/apps/l10n/bin/posplit.py | [
{
"content": " def add(self, rule):\n rule.parent = self\n self.rules.append(rule)",
"metadata": "root.RuleSet.add",
"header": "['class', 'RuleSet', '(', 'object', ')', ':', '___EOS___']",
"index": 70
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Rule",
"Set_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"add_",
"(_",
"self_",
",_",
"rule_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"rule_",
"._",
"parent_",
"=_",
"self_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"rules_",
"._",
"append_",
"(_",
"rule_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | rizar/attention-lvcsr/libs/Theano/theano/misc/pycuda_init.py | [
{
"content": "import os\nimport warnings\n\nimport theano\nimport theano.sandbox.cuda\nfrom theano import config\n\n\n\n\nset_gpu_from_theano()\npycuda_available = False\n# If theano.sandbox.cuda don't exist, it is because we are importing\n# it and it try to import this file! This mean we must init the device.\nif (not hasattr(theano.sandbox, 'cuda') or\n theano.sandbox.cuda.use.device_number is None):\n try:\n import pycuda\n import pycuda.autoinit\n pycuda_available = True\n except ImportError:\n # presumably, the user wanted to use pycuda, else they wouldn't have\n # imported this module, so issue a warning that the import failed.\n warnings.warn(\"PyCUDA import failed in theano.misc.pycuda_init\")\n except pycuda._driver.LogicError:\n if theano.config.force_device:\n raise\n else:\n if \"CUDA_DEVICE\" in os.environ:\n del os.environ[\"CUDA_DEVICE\"]\n import pycuda.autoinit\n pycuda_available = True\nelse:\n try:\n import pycuda.driver\n pycuda_available = True\n except ImportError:\n pass\n if pycuda_available:\n if hasattr(pycuda.driver.Context, \"attach\"):\n pycuda.driver.Context.attach()\n import atexit\n atexit.register(pycuda.driver.Context.pop)\n else:\n # Now we always import this file when we call\n # theano.sandbox.cuda.use. So this should not happen\n # normally.\n # TODO: make this an error.\n warnings.warn(\"For some unknow reason, theano.misc.pycuda_init was\"\n \" not imported before Theano initialized the GPU and\"\n \" your PyCUDA version is 2011.2.2 or earlier.\"\n \" To fix the problem, import theano.misc.pycuda_init\"\n \" manually before using/initializing the GPU, use the\"\n \" Theano flag pycuda.init=True or use a\"\n \" more recent version of PyCUDA.\")\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "def set_gpu_from_theano():\n \"\"\"\n This set the GPU used by PyCUDA to the same as the one used by Theano.\n \"\"\"\n # Transfer the theano gpu binding to pycuda, for consistency\n if config.device.startswith(\"gpu\") and len(config.device) > 3:\n os.environ[\"CUDA_DEVICE\"] = theano.config.device[3:]\n elif (config.init_gpu_device.startswith(\"gpu\") and\n len(config.init_gpu_device) > 3):\n os.environ[\"CUDA_DEVICE\"] = theano.config.init_gpu_device[3:]",
"metadata": "root.set_gpu_from_theano",
"header": "['module', '___EOS___']",
"index": 8
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"import_",
"os_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"warnings_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"theano_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"theano_",
"._",
"sandbox_",
"._",
"cuda_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"theano_",
"import_",
"config_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"set\\u",
"gpu",
"\\u",
"from",
"\\u",
"theano_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pyc",
"uda",
"\\u",
"available_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"If",
" ",
"theano",
".",
"sand",
"box",
".",
"cud",
"a",
" ",
"don",
"'",
"t",
" ",
"exist",
",",
" ",
"it",
" ",
"is",
" ",
"bec",
"aus",
"e",
" ",
"we",
" ",
"are",
" ",
"import",
"ing_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"it",
" ",
"and",
" ",
"it",
" ",
"try",
" ",
"to",
" ",
"import",
" ",
"this",
" ",
"file",
"!",
" ",
"Thi",
"s",
" ",
"mean",
" ",
"we",
" ",
"must",
" ",
"init",
" ",
"the",
" ",
"device",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"(_",
"not_",
"hasattr_",
"(_",
"theano_",
"._",
"sandbox_",
",_",
"'",
"cud",
"a",
"'_",
")_",
"or_",
"\\u\\u\\uNL\\u\\u\\u_",
"theano_",
"._",
"sandbox_",
"._",
"cuda_",
"._",
"use_",
"._",
"device",
"\\u",
"number_",
"is_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"pyc",
"uda",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"pyc",
"uda",
"_",
"._",
"autoi",
"nit_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pyc",
"uda",
"\\u",
"available_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Import",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"presu",
"mab",
"ly",
",",
" ",
"the",
" ",
"user",
" ",
"want",
"ed",
" ",
"to",
" ",
"use",
" ",
"pyc",
"uda",
",",
" ",
"else",
" ",
"the",
"y",
" ",
"wou",
"ld",
"n",
"'",
"t",
" ",
"have_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"import",
"ed",
" ",
"this",
" ",
"module",
",",
" ",
"so",
" ",
"issue",
" ",
"a",
" ",
"warn",
"ing",
" ",
"tha",
"t",
" ",
"the",
" ",
"import",
" ",
"fail",
"ed",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"warnings_",
"._",
"warn_",
"(_",
"\"",
"Py",
"CU",
"DA",
" ",
"import",
" ",
"fail",
"ed",
" ",
"in",
" ",
"theano",
".",
"misc",
".",
"pyc",
"uda",
"\\u",
"init",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"pyc",
"uda",
"_",
"._",
"\\u",
"driver_",
"._",
"Logi",
"c",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"theano_",
"._",
"config_",
"._",
"force",
"\\u",
"device_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"\"",
"CU",
"DA",
"\\u",
"DEV",
"ICE",
"\"_",
"in_",
"os_",
"._",
"environ_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"del_",
"os_",
"._",
"environ_",
"[_",
"\"",
"CU",
"DA",
"\\u",
"DEV",
"ICE",
"\"_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"import_",
"pyc",
"uda",
"_",
"._",
"autoi",
"nit_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pyc",
"uda",
"\\u",
"available_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"pyc",
"uda",
"_",
"._",
"driver_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pyc",
"uda",
"\\u",
"available_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Import",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"pyc",
"uda",
"\\u",
"available_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"hasattr_",
"(_",
"pyc",
"uda",
"_",
"._",
"driver_",
"._",
"Context_",
",_",
"\"",
"attach",
"\"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pyc",
"uda",
"_",
"._",
"driver_",
"._",
"Context_",
"._",
"attach_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"atexit_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"atexit_",
"._",
"register_",
"(_",
"pyc",
"uda",
"_",
"._",
"driver_",
"._",
"Context_",
"._",
"pop_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"No",
"w",
" ",
"we",
" ",
"alw",
"ay",
"s",
" ",
"import",
" ",
"this",
" ",
"file",
" ",
"whe",
"n",
" ",
"we",
" ",
"call_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"theano",
".",
"sand",
"box",
".",
"cud",
"a",
".",
"use",
".",
" ",
"So",
" ",
"this",
" ",
"shou",
"ld",
" ",
"not",
" ",
"happ",
"en_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"normal",
"ly",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"TOD",
"O",
":",
" ",
"make",
" ",
"this",
" ",
"an",
" ",
"error",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"warnings_",
"._",
"warn_",
"(_",
"\"",
"For",
" ",
"some",
" ",
"unk",
"now",
" ",
"reason",
",",
" ",
"theano",
".",
"misc",
".",
"pyc",
"uda",
"\\u",
"init",
" ",
"was",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
" ",
"not",
" ",
"import",
"ed",
" ",
"bef",
"ore",
" ",
"The",
"ano",
" ",
"initialize",
"d",
" ",
"the",
" ",
"GPU",
" ",
"and",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
" ",
"your",
" ",
"Py",
"CU",
"DA",
" ",
"version",
" ",
"is",
" ",
"2011",
".2",
".2",
" ",
"or",
" ",
"ear",
"lie",
"r",
".\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
" ",
"To",
" ",
"fix",
" ",
"the",
" ",
"problem",
",",
" ",
"import",
" ",
"theano",
".",
"misc",
".",
"pyc",
"uda",
"\\u",
"init",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
" ",
"manu",
"ally",
" ",
"bef",
"ore",
" ",
"usi",
"ng",
"/",
"initiali",
"zin",
"g",
" ",
"the",
" ",
"GPU",
",",
" ",
"use",
" ",
"the",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
" ",
"The",
"ano",
" ",
"flag",
" ",
"pyc",
"uda",
".",
"init",
"=",
"Tru",
"e",
" ",
"or",
" ",
"use",
" ",
"a",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
" ",
"more",
" ",
"recent",
" ",
"version",
" ",
"of",
" ",
"Py",
"CU",
"DA",
".\"_",
")_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"set\\u",
"gpu",
"\\u",
"from",
"\\u",
"theano_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"set",
" ",
"the",
" ",
"GPU",
" ",
"used",
" ",
"by",
" ",
"Py",
"CU",
"DA",
" ",
"to",
" ",
"the",
" ",
"same",
" ",
"as",
" ",
"the",
" ",
"one",
" ",
"used",
" ",
"by",
" ",
"The",
"ano",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Transfer",
" ",
"the",
" ",
"theano",
" ",
"gpu",
" ",
"bindi",
"ng",
" ",
"to",
" ",
"pyc",
"uda",
",",
" ",
"for",
" ",
"consiste",
"ncy_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"config_",
"._",
"device_",
"._",
"startswith_",
"(_",
"\"",
"gpu",
"\"_",
")_",
"and_",
"len_",
"(_",
"config_",
"._",
"device_",
")_",
">_",
"3_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"os_",
"._",
"environ_",
"[_",
"\"",
"CU",
"DA",
"\\u",
"DEV",
"ICE",
"\"_",
"]_",
"=_",
"theano_",
"._",
"config_",
"._",
"device_",
"[_",
"3_",
":_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"(_",
"config_",
"._",
"init",
"\\u",
"gpu",
"\\u",
"device_",
"._",
"startswith_",
"(_",
"\"",
"gpu",
"\"_",
")_",
"and_",
"\\u\\u\\uNL\\u\\u\\u_",
"len_",
"(_",
"config_",
"._",
"init",
"\\u",
"gpu",
"\\u",
"device_",
")_",
">_",
"3_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"os_",
"._",
"environ_",
"[_",
"\"",
"CU",
"D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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Comparison of constants | Ron89/thesaurus_query.vim/autoload/thesaurus_query/thesaurus_query.py | [
{
"content": " def query(self, word):\n if word in self.word_list: # search word_list first to save query time\n return self.word_list[word]\n\n error_encountered = 0\n good_backends=[]\n faulty_backends=[]\n for query_backend_curr in self.query_backend_priority: # query each of the backend list till found\n specified_language = get_variable(\"tq_language\")\n if specified_language!=\"All\":\n if specified_language==-1:\n if self.query_backends[query_backend_curr].language!='en':\n continue\n elif self.query_backends[query_backend_curr].language not in specified_language:\n continue\n [state, synonym_list]=self.query_backends[query_backend_curr].query(word)\n if state == -1:\n error_encountered = 1\n faulty_backends.append(self.query_backends[query_backend_curr].identifier)\n continue\n if state == 0:\n good_backends.append(self.query_backends[query_backend_curr].identifier)\n break\n for faulty in faulty_backends:\n self.query_backend_priority.remove(faulty)\n self.query_backend_priority+=faulty_backends\n if int(vim.eval(\"g:tq_raise_backend_priority_if_synonym_found\")) == 1:\n for good in good_backends:\n self.query_backend_priority.remove(good)\n self.query_backend_priority=good_backends+self.query_backend_priority\n if error_encountered == 1:\n vim.command('echohl WarningMSG | echon \"WARNING: \" | echohl None | echon \"one or more query backends report error. Please check on thesaurus source(s).\\n\"')\n if 'state' not in locals():\n vim.command('echohl WarningMSG | echon \"WARNING: \" | echohl None | echon \"No thesaurus source is used. Please check on your configuration on g:thesaurus_query#enabled_backends and g:tq_language or b:tq_language.\\n\"')\n return []\n if state == 0: # save to word_list buffer only when synonym is found\n self.word_list[word]=synonym_list\n self.word_list_keys.append(word)\n if len(self.word_list_keys) > self.wordlist_size_max:\n del self.word_list[self.word_list_keys.pop(0)]\n return synonym_list",
"metadata": "root.Thesaurus_Query_Handler.query",
"header": "['class', 'Thesaurus_Query_Handler', ':', '___EOS___']",
"index": 40
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Compari",
"son_",
"of_",
"constants_",
"[SEP]_",
"class_",
"The",
"sau",
"rus",
"\\u",
"Query",
"\\u",
"Handler_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"query_",
"(_",
"self_",
",_",
"word_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"word_",
"in_",
"self_",
"._",
"word",
"\\u",
"list_",
":_",
"#",
" ",
"search",
" ",
"word",
"\\u",
"list",
" ",
"first",
" ",
"to",
" ",
"save",
" ",
"query",
" ",
"time_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"word",
"\\u",
"list_",
"[_",
"word_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"error",
"\\u",
"encounter",
"ed_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"good",
"\\u",
"backends_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"fault",
"y",
"\\u",
"backends_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"query",
"\\u",
"back",
"end",
"\\u",
"curr_",
"in_",
"self_",
"._",
"query",
"\\u",
"back",
"end",
"\\u",
"priority_",
":_",
"#",
" ",
"query",
" ",
"each",
" ",
"of",
" ",
"the",
" ",
"back",
"end",
" ",
"list",
" ",
"till",
" ",
"found_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"specified",
"\\u",
"language_",
"=_",
"get",
"\\u",
"variable_",
"(_",
"\"",
"tq",
"\\u",
"language",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"specified",
"\\u",
"language_",
"!=_",
"\"",
"All",
"\"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"specified",
"\\u",
"language_",
"==_",
"-_",
"1_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"if_",
"self_",
"._",
"query",
"\\u",
"backends_",
"[_",
"query",
"\\u",
"back",
"end",
"\\u",
"curr_",
"]_",
"._",
"language_",
"!=_",
"'",
"en",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
" _",
"continue_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"self_",
"._",
"query",
"\\u",
"backends_",
"[_",
"query",
"\\u",
"back",
"end",
"\\u",
"curr_",
"]_",
"._",
"language_",
"not_",
"in_",
"specified",
"\\u",
"language_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" ",
"_",
"continue_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[_",
"state_",
",_",
"synonym",
"\\u",
"list_",
"]_",
"=_",
"self_",
"._",
"query",
"\\u",
"backends_",
"[_",
"query",
"\\u",
"back",
"end",
"\\u",
"curr_",
"]_",
"._",
"query_",
"(_",
"word_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"state_",
"==_",
"-_",
"1_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"error",
"\\u",
"encounter",
"ed_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"fault",
"y",
"\\u",
"backends_",
"._",
"append_",
"(_",
"self_",
"._",
"query",
"\\u",
"backends_",
"[_",
"query",
"\\u",
"back",
"end",
"\\u",
"curr_",
"]_",
"._",
"identifier_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"continue_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"state_",
"==_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"good",
"\\u",
"backends_",
"._",
"append_",
"(_",
"self_",
"._",
"query",
"\\u",
"backends_",
"[_",
"query",
"\\u",
"back",
"end",
"\\u",
"curr_",
"]_",
"._",
"identifier_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"fault",
"y_",
"in_",
"fault",
"y",
"\\u",
"backends_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"query",
"\\u",
"back",
"end",
"\\u",
"priority_",
"._",
"remove_",
"(_",
"fault",
"y_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"query",
"\\u",
"back",
"end",
"\\u",
"priority_",
"+=_",
"fault",
"y",
"\\u",
"backends_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"int_",
"(_",
"vim_",
"._",
"eval_",
"(_",
"\"",
"g",
":",
"tq",
"\\u",
"raise",
"\\u",
"back",
"end",
"\\u",
"priorit",
"y",
"\\u",
"if",
"\\u",
"synonym",
"\\u",
"found",
"\"_",
")_",
")_",
"==_",
"1_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"good_",
"in_",
"good",
"\\u",
"backends_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"query",
"\\u",
"back",
"end",
"\\u",
"priority_",
"._",
"remove_",
"(_",
"good_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"query",
"\\u",
"back",
"end",
"\\u",
"priority_",
"=_",
"good",
"\\u",
"backends_",
"+_",
"self_",
"._",
"query",
"\\u",
"back",
"end",
"\\u",
"priority_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"error",
"\\u",
"encounter",
"ed_",
"==_",
"1_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"vim_",
"._",
"command_",
"(_",
"'",
"echo",
"hl",
" ",
"Warn",
"ing",
"MS",
"G",
" ",
"|",
" ",
"echo",
"n",
" ",
"\"",
"WARN",
"ING",
":",
" ",
"\"",
" ",
"|",
" ",
"echo",
"hl",
" ",
"Non",
"e",
" ",
"|",
" ",
"echo",
"n",
" ",
"\"",
"one",
" ",
"or",
" ",
"more",
" ",
"query",
" ",
"back",
"ends",
" ",
"report",
" ",
"error",
".",
" ",
"Ple",
"ase",
" ",
"check",
" ",
"on",
" ",
"thes",
"aur",
"us",
" ",
"source",
"(",
"s",
").",
"\\\\",
"n",
"\"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"'",
"state",
"'_",
"not_",
"in_",
"locals_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"vim_",
"._",
"command_",
"(_",
"'",
"echo",
"hl",
" ",
"Warn",
"ing",
"MS",
"G",
" ",
"|",
" ",
"echo",
"n",
" ",
"\"",
"WARN",
"ING",
":",
" ",
"\"",
" ",
"|",
" ",
"echo",
"hl",
" ",
"Non",
"e",
" ",
"|",
" ",
"echo",
"n",
" ",
"\"",
"No",
" ",
"thes",
"aur",
"us",
" ",
"source",
" ",
"is",
" ",
"used",
".",
" ",
"Ple",
"ase",
" ",
"check",
" ",
"on",
" ",
"your",
" ",
"configura",
"tion",
" ",
"on",
" ",
"g",
":",
"thes",
"aur",
"us",
"\\u",
"query",
"#",
"enable",
"d\\u",
"back",
"ends",
" ",
"and",
" ",
"g",
":",
"tq",
"\\u",
"language",
" ",
"or",
" ",
"b",
":",
"tq",
"\\u",
"language",
".\\\\",
"n",
"\"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"state_",
"==_",
"0_",
":_",
"#",
" ",
"save",
" ",
"to",
" ",
"word",
"\\u",
"list",
" ",
"buffer",
" ",
"only",
" ",
"whe",
"n",
" ",
"synonym",
" ",
"is",
" ",
"found_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"word",
"\\u",
"list_",
"[_",
"word_",
"]_",
"=_",
"synonym",
"\\u",
"list_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"word",
"\\u",
"list",
"\\u",
"keys_",
"._",
"append_",
"(_",
"word_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"len_",
"(_",
"self_",
"._",
"word",
"\\u",
"list",
"\\u",
"keys_",
")_",
">_",
"self_",
"._",
"wordlist",
"\\u",
"size",
"\\u",
"max_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"del_",
"self_",
"._",
"word",
"\\u",
"list_",
"[_",
"self_",
"._",
"word",
"\\u",
"list",
"\\u",
"keys_",
"._",
"pop_",
"(_",
"0_",
")_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"synonym",
"\\u",
"list_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | pydata/pandas/pandas/computation/ops.py | [
{
"content": "\"\"\"Operator classes for eval.\n\"\"\"\n\nimport operator as op\nfrom functools import partial\nfrom datetime import datetime\n\nimport numpy as np\n\nimport pandas as pd\nfrom pandas.compat import PY3, string_types, text_type\nimport pandas.core.common as com\nfrom pandas.formats.printing import pprint_thing, pprint_thing_encoded\nimport pandas.lib as lib\nfrom pandas.core.base import StringMixin\nfrom pandas.computation.common import _ensure_decoded, _result_type_many\nfrom pandas.computation.scope import _DEFAULT_GLOBALS\n\n\n_reductions = 'sum', 'prod'\n\n_unary_math_ops = ('sin', 'cos', 'exp', 'log', 'expm1', 'log1p',\n 'sqrt', 'sinh', 'cosh', 'tanh', 'arcsin', 'arccos',\n 'arctan', 'arccosh', 'arcsinh', 'arctanh', 'abs')\n_binary_math_ops = ('arctan2',)\n_mathops = _unary_math_ops + _binary_math_ops\n\n\n_LOCAL_TAG = '__pd_eval_local_'\n\n\n\n\n\n\n\n\n_bool_op_map = {'not': '~', 'and': '&', 'or': '|'}\n\n\n\n\n\n\n\n\n_cmp_ops_syms = '>', '<', '>=', '<=', '==', '!=', 'in', 'not in'\n_cmp_ops_funcs = op.gt, op.lt, op.ge, op.le, op.eq, op.ne, _in, _not_in\n_cmp_ops_dict = dict(zip(_cmp_ops_syms, _cmp_ops_funcs))\n\n_bool_ops_syms = '&', '|', 'and', 'or'\n_bool_ops_funcs = op.and_, op.or_, op.and_, op.or_\n_bool_ops_dict = dict(zip(_bool_ops_syms, _bool_ops_funcs))\n\n_arith_ops_syms = '+', '-', '*', '/', '**', '//', '%'\n_arith_ops_funcs = (op.add, op.sub, op.mul, op.truediv if PY3 else op.div,\n op.pow, op.floordiv, op.mod)\n_arith_ops_dict = dict(zip(_arith_ops_syms, _arith_ops_funcs))\n\n_special_case_arith_ops_syms = '**', '//', '%'\n_special_case_arith_ops_funcs = op.pow, op.floordiv, op.mod\n_special_case_arith_ops_dict = dict(zip(_special_case_arith_ops_syms,\n _special_case_arith_ops_funcs))\n\n_binary_ops_dict = {}\n\nfor d in (_cmp_ops_dict, _bool_ops_dict, _arith_ops_dict):\n _binary_ops_dict.update(d)\n\n\n\n\n\n\n\n\n\n\n\n\n_unary_ops_syms = '+', '-', '~', 'not'\n_unary_ops_funcs = op.pos, op.neg, op.invert, op.invert\n_unary_ops_dict = dict(zip(_unary_ops_syms, _unary_ops_funcs))\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class UndefinedVariableError(NameError):\n\n \"\"\"NameError subclass for local variables.\"\"\"\n",
"metadata": "root.UndefinedVariableError",
"header": "['module', '___EOS___']",
"index": 31
},
{
"content": " def __init__(self, name, is_local):\n if is_local:\n msg = 'local variable {0!r} is not defined'\n else:\n msg = 'name {0!r} is not defined'\n super(UndefinedVariableError, self).__init__(msg.format(name))",
"metadata": "root.UndefinedVariableError.__init__",
"header": "['class', 'UndefinedVariableError', '(', 'NameError', ')', ':', '___EOS___']",
"index": 35
},
{
"content": "class Term(StringMixin):\n\n\n\n\n\n\n\n\n\n\n\n return_type = type\n\n\n\n\n\n\n",
"metadata": "root.Term",
"header": "['module', '___EOS___']",
"index": 43
},
{
"content": " def __new__(cls, name, env, side=None, encoding=None):\n klass = Constant if not isinstance(name, string_types) else cls\n supr_new = super(Term, klass).__new__\n return supr_new(klass)",
"metadata": "root.Term.__new__",
"header": "['class', 'Term', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 45
},
{
"content": " def __init__(self, name, env, side=None, encoding=None):\n self._name = name\n self.env = env\n self.side = side\n tname = text_type(name)\n self.is_local = (tname.startswith(_LOCAL_TAG) or\n tname in _DEFAULT_GLOBALS)\n self._value = self._resolve_name()\n self.encoding = encoding",
"metadata": "root.Term.__init__",
"header": "['class', 'Term', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 50
},
{
"content": " @property\n def local_name(self):\n return self.name.replace(_LOCAL_TAG, '')",
"metadata": "root.Term.local_name",
"header": "['class', 'Term', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 60
},
{
"content": " def __unicode__(self):\n return pprint_thing(self.name)",
"metadata": "root.Term.__unicode__",
"header": "['class', 'Term', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 64
},
{
"content": " def __call__(self, *args, **kwargs):\n return self.value",
"metadata": "root.Term.__call__",
"header": "['class', 'Term', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 67
},
{
"content": " def evaluate(self, *args, **kwargs):\n return self",
"metadata": "root.Term.evaluate",
"header": "['class', 'Term', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 70
},
{
"content": " def _resolve_name(self):\n res = self.env.resolve(self.local_name, is_local=self.is_local)\n self.update(res)\n\n if hasattr(res, 'ndim') and res.ndim > 2:\n raise NotImplementedError(\"N-dimensional objects, where N > 2,\"\n \" are not supported with eval\")\n return res",
"metadata": "root.Term._resolve_name",
"header": "['class', 'Term', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 73
},
{
"content": " def update(self, value):\n \"\"\"\n search order for local (i.e., @variable) variables:\n\n scope, key_variable\n [('locals', 'local_name'),\n ('globals', 'local_name'),\n ('locals', 'key'),\n ('globals', 'key')]\n \"\"\"\n key = self.name\n\n # if it's a variable name (otherwise a constant)\n if isinstance(key, string_types):\n self.env.swapkey(self.local_name, key, new_value=value)\n\n self.value = value",
"metadata": "root.Term.update",
"header": "['class', 'Term', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 82
},
{
"content": " @property\n def isscalar(self):\n return lib.isscalar(self._value)",
"metadata": "root.Term.isscalar",
"header": "['class', 'Term', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 100
},
{
"content": " @property\n def type(self):\n try:\n # potentially very slow for large, mixed dtype frames\n return self._value.values.dtype\n except AttributeError:\n try:\n # ndarray\n return self._value.dtype\n except AttributeError:\n # scalar\n return type(self._value)",
"metadata": "root.Term.type",
"header": "['class', 'Term', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 104
},
{
"content": " @property\n def raw(self):\n return pprint_thing('{0}(name={1!r}, type={2})'\n ''.format(self.__class__.__name__, self.name,\n self.type))",
"metadata": "root.Term.raw",
"header": "['class', 'Term', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 119
},
{
"content": " @property\n def is_datetime(self):\n try:\n t = self.type.type\n except AttributeError:\n t = self.type\n\n return issubclass(t, (datetime, np.datetime64))",
"metadata": "root.Term.is_datetime",
"header": "['class', 'Term', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 125
},
{
"content": " @property\n def value(self):\n return self._value",
"metadata": "root.Term.value",
"header": "['class', 'Term', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 134
},
{
"content": " @value.setter\n def value(self, new_value):\n self._value = new_value",
"metadata": "root.Term.value",
"header": "['class', 'Term', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 138
},
{
"content": " @property\n def name(self):\n return self._name",
"metadata": "root.Term.name",
"header": "['class', 'Term', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 142
},
{
"content": " @name.setter\n def name(self, new_name):\n self._name = new_name",
"metadata": "root.Term.name",
"header": "['class', 'Term', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 146
},
{
"content": " @property\n def ndim(self):\n return self._value.ndim",
"metadata": "root.Term.ndim",
"header": "['class', 'Term', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 150
},
{
"content": "class Constant(Term):\n\n\n",
"metadata": "root.Constant",
"header": "['module', '___EOS___']",
"index": 155
},
{
"content": " def __init__(self, value, env, side=None, encoding=None):\n super(Constant, self).__init__(value, env, side=side,\n encoding=encoding)",
"metadata": "root.Constant.__init__",
"header": "['class', 'Constant', '(', 'Term', ')', ':', '___EOS___']",
"index": 157
},
{
"content": " def _resolve_name(self):\n return self._name",
"metadata": "root.Constant._resolve_name",
"header": "['class', 'Constant', '(', 'Term', ')', ':', '___EOS___']",
"index": 161
},
{
"content": " @property\n def name(self):\n return self.value",
"metadata": "root.Constant.name",
"header": "['class', 'Constant', '(', 'Term', ')', ':', '___EOS___']",
"index": 164
},
{
"content": "class Op(StringMixin):\n\n \"\"\"Hold an operator of arbitrary arity\n \"\"\"\n\n\n\n\n\n\n\n",
"metadata": "root.Op",
"header": "['module', '___EOS___']",
"index": 172
},
{
"content": " def __init__(self, op, operands, *args, **kwargs):\n self.op = _bool_op_map.get(op, op)\n self.operands = operands\n self.encoding = kwargs.get('encoding', None)",
"metadata": "root.Op.__init__",
"header": "['class', 'Op', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 177
},
{
"content": " def __iter__(self):\n return iter(self.operands)",
"metadata": "root.Op.__iter__",
"header": "['class', 'Op', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 182
},
{
"content": " def __unicode__(self):\n \"\"\"Print a generic n-ary operator and its operands using infix\n notation\"\"\"\n # recurse over the operands\n parened = ('({0})'.format(pprint_thing(opr))\n for opr in self.operands)\n return pprint_thing(' {0} '.format(self.op).join(parened))",
"metadata": "root.Op.__unicode__",
"header": "['class', 'Op', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 185
},
{
"content": " @property\n def return_type(self):\n # clobber types to bool if the op is a boolean operator\n if self.op in (_cmp_ops_syms + _bool_ops_syms):\n return np.bool_\n return _result_type_many(*(term.type for term in com.flatten(self)))",
"metadata": "root.Op.return_type",
"header": "['class', 'Op', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 193
},
{
"content": " @property\n def has_invalid_return_type(self):\n types = self.operand_types\n obj_dtype_set = frozenset([np.dtype('object')])\n return self.return_type == object and types - obj_dtype_set",
"metadata": "root.Op.has_invalid_return_type",
"header": "['class', 'Op', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 200
},
{
"content": " @property\n def operand_types(self):\n return frozenset(term.type for term in com.flatten(self))",
"metadata": "root.Op.operand_types",
"header": "['class', 'Op', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 206
},
{
"content": " @property\n def isscalar(self):\n return all(operand.isscalar for operand in self.operands)",
"metadata": "root.Op.isscalar",
"header": "['class', 'Op', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 210
},
{
"content": " @property\n def is_datetime(self):\n try:\n t = self.return_type.type\n except AttributeError:\n t = self.return_type\n\n return issubclass(t, (datetime, np.datetime64))",
"metadata": "root.Op.is_datetime",
"header": "['class', 'Op', '(', 'StringMixin', ')', ':', '___EOS___']",
"index": 214
},
{
"content": "def _in(x, y):\n \"\"\"Compute the vectorized membership of ``x in y`` if possible, otherwise\n use Python.\n \"\"\"\n try:\n return x.isin(y)\n except AttributeError:\n if com.is_list_like(x):\n try:\n return y.isin(x)\n except AttributeError:\n pass\n return x in y",
"metadata": "root._in",
"header": "['module', '___EOS___']",
"index": 224
},
{
"content": "def _not_in(x, y):\n \"\"\"Compute the vectorized membership of ``x not in y`` if possible,\n otherwise use Python.\n \"\"\"\n try:\n return ~x.isin(y)\n except AttributeError:\n if com.is_list_like(x):\n try:\n return ~y.isin(x)\n except AttributeError:\n pass\n return x not in y",
"metadata": "root._not_in",
"header": "['module', '___EOS___']",
"index": 239
},
{
"content": "def _cast_inplace(terms, dtype):\n \"\"\"Cast an expression inplace.\n\n Parameters\n ----------\n terms : Op\n The expression that should cast.\n dtype : str or numpy.dtype\n The dtype to cast to.\n \"\"\"\n dt = np.dtype(dtype)\n for term in terms:\n try:\n new_value = term.value.astype(dt)\n except AttributeError:\n new_value = dt.type(term.value)\n term.update(new_value)",
"metadata": "root._cast_inplace",
"header": "['module', '___EOS___']",
"index": 278
},
{
"content": "def is_term(obj):\n return isinstance(obj, Term)",
"metadata": "root.is_term",
"header": "['module', '___EOS___']",
"index": 297
},
{
"content": "class BinOp(Op):\n\n \"\"\"Hold a binary operator and its operands\n\n Parameters\n ----------\n op : str\n left : Term or Op\n right : Term or Op\n \"\"\"\n\n\n\n\n",
"metadata": "root.BinOp",
"header": "['module', '___EOS___']",
"index": 301
},
{
"content": " def __init__(self, op, lhs, rhs, **kwargs):\n super(BinOp, self).__init__(op, (lhs, rhs))\n self.lhs = lhs\n self.rhs = rhs\n\n self._disallow_scalar_only_bool_ops()\n\n self.convert_values()\n\n try:\n self.func = _binary_ops_dict[op]\n except KeyError:\n # has to be made a list for python3\n keys = list(_binary_ops_dict.keys())\n raise ValueError('Invalid binary operator {0!r}, valid'\n ' operators are {1}'.format(op, keys))",
"metadata": "root.BinOp.__init__",
"header": "['class', 'BinOp', '(', 'Op', ')', ':', '___EOS___']",
"index": 312
},
{
"content": " def __call__(self, env):\n \"\"\"Recursively evaluate an expression in Python space.\n\n Parameters\n ----------\n env : Scope\n\n Returns\n -------\n object\n The result of an evaluated expression.\n \"\"\"\n # handle truediv\n if self.op == '/' and env.scope['truediv']:\n self.func = op.truediv\n\n # recurse over the left/right nodes\n left = self.lhs(env)\n right = self.rhs(env)\n\n return self.func(left, right)",
"metadata": "root.BinOp.__call__",
"header": "['class', 'BinOp', '(', 'Op', ')', ':', '___EOS___']",
"index": 329
},
{
"content": " def evaluate(self, env, engine, parser, term_type, eval_in_python):\n \"\"\"Evaluate a binary operation *before* being passed to the engine.\n\n Parameters\n ----------\n env : Scope\n engine : str\n parser : str\n term_type : type\n eval_in_python : list\n\n Returns\n -------\n term_type\n The \"pre-evaluated\" expression as an instance of ``term_type``\n \"\"\"\n if engine == 'python':\n res = self(env)\n else:\n # recurse over the left/right nodes\n left = self.lhs.evaluate(env, engine=engine, parser=parser,\n term_type=term_type,\n eval_in_python=eval_in_python)\n right = self.rhs.evaluate(env, engine=engine, parser=parser,\n term_type=term_type,\n eval_in_python=eval_in_python)\n\n # base cases\n if self.op in eval_in_python:\n res = self.func(left.value, right.value)\n else:\n res = pd.eval(self, local_dict=env, engine=engine,\n parser=parser)\n\n name = env.add_tmp(res)\n return term_type(name, env=env)",
"metadata": "root.BinOp.evaluate",
"header": "['class', 'BinOp', '(', 'Op', ')', ':', '___EOS___']",
"index": 351
},
{
"content": " def convert_values(self):\n \"\"\"Convert datetimes to a comparable value in an expression.\n \"\"\"\n def stringify(value):\n if self.encoding is not None:\n encoder = partial(pprint_thing_encoded,\n encoding=self.encoding)\n else:\n encoder = pprint_thing\n return encoder(value)\n\n lhs, rhs = self.lhs, self.rhs\n\n if is_term(lhs) and lhs.is_datetime and is_term(rhs) and rhs.isscalar:\n v = rhs.value\n if isinstance(v, (int, float)):\n v = stringify(v)\n v = pd.Timestamp(_ensure_decoded(v))\n if v.tz is not None:\n v = v.tz_convert('UTC')\n self.rhs.update(v)\n\n if is_term(rhs) and rhs.is_datetime and is_term(lhs) and lhs.isscalar:\n v = lhs.value\n if isinstance(v, (int, float)):\n v = stringify(v)\n v = pd.Timestamp(_ensure_decoded(v))\n if v.tz is not None:\n v = v.tz_convert('UTC')\n self.lhs.update(v)",
"metadata": "root.BinOp.convert_values",
"header": "['class', 'BinOp', '(', 'Op', ')', ':', '___EOS___']",
"index": 388
},
{
"content": " def _disallow_scalar_only_bool_ops(self):\n if ((self.lhs.isscalar or self.rhs.isscalar) and\n self.op in _bool_ops_dict and\n (not (issubclass(self.rhs.return_type, (bool, np.bool_)) and\n issubclass(self.lhs.return_type, (bool, np.bool_))))):\n raise NotImplementedError(\"cannot evaluate scalar only bool ops\")",
"metadata": "root.BinOp._disallow_scalar_only_bool_ops",
"header": "['class', 'BinOp', '(', 'Op', ')', ':', '___EOS___']",
"index": 419
},
{
"content": "def isnumeric(dtype):\n return issubclass(np.dtype(dtype).type, np.number)",
"metadata": "root.isnumeric",
"header": "['module', '___EOS___']",
"index": 427
},
{
"content": "class Div(BinOp):\n\n \"\"\"Div operator to special case casting.\n\n Parameters\n ----------\n lhs, rhs : Term or Op\n The Terms or Ops in the ``/`` expression.\n truediv : bool\n Whether or not to use true division. With Python 3 this happens\n regardless of the value of ``truediv``.\n \"\"\"\n",
"metadata": "root.Div",
"header": "['module', '___EOS___']",
"index": 431
},
{
"content": " def __init__(self, lhs, rhs, truediv, *args, **kwargs):\n super(Div, self).__init__('/', lhs, rhs, *args, **kwargs)\n\n if not isnumeric(lhs.return_type) or not isnumeric(rhs.return_type):\n raise TypeError(\"unsupported operand type(s) for {0}:\"\n \" '{1}' and '{2}'\".format(self.op,\n lhs.return_type,\n rhs.return_type))\n\n if truediv or PY3:\n _cast_inplace(com.flatten(self), np.float_)",
"metadata": "root.Div.__init__",
"header": "['class', 'Div', '(', 'BinOp', ')', ':', '___EOS___']",
"index": 444
},
{
"content": "class UnaryOp(Op):\n\n \"\"\"Hold a unary operator and its operands\n\n Parameters\n ----------\n op : str\n The token used to represent the operator.\n operand : Term or Op\n The Term or Op operand to the operator.\n\n Raises\n ------\n ValueError\n * If no function associated with the passed operator token is found.\n \"\"\"\n\n\n\n",
"metadata": "root.UnaryOp",
"header": "['module', '___EOS___']",
"index": 462
},
{
"content": " def __init__(self, op, operand):\n super(UnaryOp, self).__init__(op, (operand,))\n self.operand = operand\n\n try:\n self.func = _unary_ops_dict[op]\n except KeyError:\n raise ValueError('Invalid unary operator {0!r}, valid operators '\n 'are {1}'.format(op, _unary_ops_syms))",
"metadata": "root.UnaryOp.__init__",
"header": "['class', 'UnaryOp', '(', 'Op', ')', ':', '___EOS___']",
"index": 479
},
{
"content": " def __call__(self, env):\n operand = self.operand(env)\n return self.func(operand)",
"metadata": "root.UnaryOp.__call__",
"header": "['class', 'UnaryOp', '(', 'Op', ')', ':', '___EOS___']",
"index": 489
},
{
"content": " def __unicode__(self):\n return pprint_thing('{0}({1})'.format(self.op, self.operand))",
"metadata": "root.UnaryOp.__unicode__",
"header": "['class', 'UnaryOp', '(', 'Op', ')', ':', '___EOS___']",
"index": 493
},
{
"content": " @property\n def return_type(self):\n operand = self.operand\n if operand.return_type == np.dtype('bool'):\n return np.dtype('bool')\n if (isinstance(operand, Op) and\n (operand.op in _cmp_ops_dict or operand.op in _bool_ops_dict)):\n return np.dtype('bool')\n return np.dtype('int')",
"metadata": "root.UnaryOp.return_type",
"header": "['class', 'UnaryOp', '(', 'Op', ')', ':', '___EOS___']",
"index": 496
},
{
"content": "class MathCall(Op):\n\n\n",
"metadata": "root.MathCall",
"header": "['module', '___EOS___']",
"index": 507
},
{
"content": " def __init__(self, func, args):\n super(MathCall, self).__init__(func.name, args)\n self.func = func",
"metadata": "root.MathCall.__init__",
"header": "['class', 'MathCall', '(', 'Op', ')', ':', '___EOS___']",
"index": 509
},
{
"content": " def __call__(self, env):\n operands = [op(env) for op in self.operands]\n return self.func.func(*operands)",
"metadata": "root.MathCall.__call__",
"header": "['class', 'MathCall', '(', 'Op', ')', ':', '___EOS___']",
"index": 513
},
{
"content": " def __unicode__(self):\n operands = map(str, self.operands)\n return pprint_thing('{0}({1})'.format(self.op, ','.join(operands)))",
"metadata": "root.MathCall.__unicode__",
"header": "['class', 'MathCall', '(', 'Op', ')', ':', '___EOS___']",
"index": 517
},
{
"content": "class FuncNode(object):\n\n",
"metadata": "root.FuncNode",
"header": "['module', '___EOS___']",
"index": 522
},
{
"content": " def __init__(self, name):\n if name not in _mathops:\n raise ValueError(\n \"\\\"{0}\\\" is not a supported function\".format(name))\n self.name = name\n self.func = getattr(np, name)",
"metadata": "root.FuncNode.__init__",
"header": "['class', 'FuncNode', '(', 'object', ')', ':', '___EOS___']",
"index": 524
},
{
"content": " def __call__(self, *args):\n return MathCall(self, args)",
"metadata": "root.FuncNode.__call__",
"header": "['class', 'FuncNode', '(', 'object', ')', ':', '___EOS___']",
"index": 531
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\"\"\"",
"Opera",
"tor",
" ",
"classe",
"s",
" ",
"for",
" ",
"eval",
".",
"\\",
"10",
";\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"operator_",
"as_",
"op_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"functools_",
"import_",
"partial_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"datetime_",
"import_",
"datetime_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"numpy_",
"as_",
"np_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"pandas_",
"as_",
"pd_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"pandas_",
"._",
"compat_",
"import_",
"PY",
"3_",
",_",
"string",
"\\u",
"types_",
",_",
"text",
"\\u",
"type_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"pandas_",
"._",
"core_",
"._",
"common_",
"as_",
"com_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"pandas_",
"._",
"formats_",
"._",
"printin",
"g_",
"import_",
"ppr",
"int\\u",
"thing_",
",_",
"ppr",
"int\\u",
"thing",
"\\u",
"encoded_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"pandas_",
"._",
"lib_",
"as_",
"lib_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"pandas_",
"._",
"core_",
"._",
"base_",
"import_",
"String",
"Mixin_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"pandas_",
"._",
"computation",
"_",
"._",
"common_",
"import_",
"\\u",
"ensure",
"\\u",
"decoded_",
",_",
"\\u",
"result",
"\\u",
"type",
"\\u",
"many_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"pandas_",
"._",
"computation",
"_",
"._",
"scope_",
"import_",
"\\u",
"DEF",
"AUL",
"T",
"\\u",
"GLOB",
"ALS",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"reduc",
"tions_",
"=_",
"'",
"sum",
"'_",
",_",
"'",
"prod",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"una",
"ry",
"\\u",
"math",
"\\u",
"ops_",
"=_",
"(_",
"'",
"sin",
"'_",
",_",
"'",
"cos",
"'_",
",_",
"'",
"exp",
"'_",
",_",
"'",
"log",
"'_",
",_",
"'",
"exp",
"m1",
"'_",
",_",
"'",
"log",
"1p",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"sqrt",
"'_",
",_",
"'",
"sinh",
"'_",
",_",
"'",
"cos",
"h",
"'_",
",_",
"'",
"tan",
"h",
"'_",
",_",
"'",
"arcs",
"in",
"'_",
",_",
"'",
"arcc",
"os",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"arctan",
"'_",
",_",
"'",
"arcc",
"osh",
"'_",
",_",
"'",
"arcs",
"inh",
"'_",
",_",
"'",
"arctan",
"h",
"'_",
",_",
"'",
"abs",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"binar",
"y",
"\\u",
"math",
"\\u",
"ops_",
"=_",
"(_",
"'",
"arctan",
"2",
"'_",
",_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"math",
"ops_",
"=_",
"\\u",
"una",
"ry",
"\\u",
"math",
"\\u",
"ops_",
"+_",
"\\u",
"binar",
"y",
"\\u",
"math",
"\\u",
"ops_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"LOCAL",
"\\u",
"TAG_",
"=_",
"'\\u",
"\\u",
"pd",
"\\u",
"eval",
"\\u",
"local",
"\\u'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u",
"bool\\u",
"op",
"\\u",
"map_",
"=_",
"{_",
"'",
"not",
"'_",
":_",
"'~'_",
",_",
"'",
"and",
"'_",
":_",
"'&'_",
",_",
"'",
"or",
"'_",
":_",
"'|'_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u",
"cmp",
"\\u",
"ops",
"\\u",
"syms_",
"=_",
"'>'_",
",_",
"'<'_",
",_",
"'>='_",
",_",
"'<='_",
",_",
"'=='_",
",_",
"'!='_",
",_",
"'",
"in",
"'_",
",_",
"'",
"not",
" ",
"in",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"cmp",
"\\u",
"ops",
"\\u",
"funcs_",
"=_",
"op_",
"._",
"gt_",
",_",
"op_",
"._",
"lt_",
",_",
"op_",
"._",
"ge_",
",_",
"op_",
"._",
"le_",
",_",
"op_",
"._",
"eq_",
",_",
"op_",
"._",
"ne_",
",_",
"\\u",
"in_",
",_",
"\\u",
"not",
"\\u",
"in_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"cmp",
"\\u",
"ops",
"\\u",
"dict_",
"=_",
"dict_",
"(_",
"zip_",
"(_",
"\\u",
"cmp",
"\\u",
"ops",
"\\u",
"syms_",
",_",
"\\u",
"cmp",
"\\u",
"ops",
"\\u",
"funcs_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"bool\\u",
"ops",
"\\u",
"syms_",
"=_",
"'&'_",
",_",
"'|'_",
",_",
"'",
"and",
"'_",
",_",
"'",
"or",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"bool\\u",
"ops",
"\\u",
"funcs_",
"=_",
"op_",
"._",
"and\\u_",
",_",
"op_",
"._",
"or\\u_",
",_",
"op_",
"._",
"and\\u_",
",_",
"op_",
"._",
"or\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"bool\\u",
"ops",
"\\u",
"dict_",
"=_",
"dict_",
"(_",
"zip_",
"(_",
"\\u",
"bool\\u",
"ops",
"\\u",
"syms_",
",_",
"\\u",
"bool\\u",
"ops",
"\\u",
"funcs_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"arith",
"\\u",
"ops",
"\\u",
"syms_",
"=_",
"'+'_",
",_",
"'-'_",
",_",
"'*'_",
",_",
"'/'_",
",_",
"'**",
"'_",
",_",
"'//'_",
",_",
"'%'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"arith",
"\\u",
"ops",
"\\u",
"funcs_",
"=_",
"(_",
"op_",
"._",
"add_",
",_",
"op_",
"._",
"sub_",
",_",
"op_",
"._",
"mul_",
",_",
"op_",
"._",
"true",
"div_",
"if_",
"PY",
"3_",
"else_",
"op_",
"._",
"div_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"op_",
"._",
"pow_",
",_",
"op_",
"._",
"floor",
"div_",
",_",
"op_",
"._",
"mod_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"arith",
"\\u",
"ops",
"\\u",
"dict_",
"=_",
"dict_",
"(_",
"zip_",
"(_",
"\\u",
"arith",
"\\u",
"ops",
"\\u",
"syms_",
",_",
"\\u",
"arith",
"\\u",
"ops",
"\\u",
"funcs_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"special",
"\\u",
"case",
"\\u",
"arith",
"\\u",
"ops",
"\\u",
"syms_",
"=_",
"'**",
"'_",
",_",
"'//'_",
",_",
"'%'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"special",
"\\u",
"case",
"\\u",
"arith",
"\\u",
"ops",
"\\u",
"funcs_",
"=_",
"op_",
"._",
"pow_",
",_",
"op_",
"._",
"floor",
"div_",
",_",
"op_",
"._",
"mod_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"special",
"\\u",
"case",
"\\u",
"arith",
"\\u",
"ops",
"\\u",
"dict_",
"=_",
"dict_",
"(_",
"zip_",
"(_",
"\\u",
"special",
"\\u",
"case",
"\\u",
"arith",
"\\u",
"ops",
"\\u",
"syms_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"special",
"\\u",
"case",
"\\u",
"arith",
"\\u",
"ops",
"\\u",
"funcs_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"binar",
"y",
"\\u",
"ops",
"\\u",
"dict_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"d_",
"in_",
"(_",
"\\u",
"cmp",
"\\u",
"ops",
"\\u",
"dict_",
",_",
"\\u",
"bool\\u",
"ops",
"\\u",
"dict_",
",_",
"\\u",
"arith",
"\\u",
"ops",
"\\u",
"dict_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\\u",
"binar",
"y",
"\\u",
"ops",
"\\u",
"dict_",
"._",
"update_",
"(_",
"d_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u",
"una",
"ry",
"\\u",
"ops",
"\\u",
"syms_",
"=_",
"'+'_",
",_",
"'-'_",
",_",
"'~'_",
",_",
"'",
"not",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"una",
"ry",
"\\u",
"ops",
"\\u",
"funcs_",
"=_",
"op_",
"._",
"pos_",
",_",
"op_",
"._",
"neg_",
",_",
"op_",
"._",
"invert_",
",_",
"op_",
"._",
"invert_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u",
"una",
"ry",
"\\u",
"ops",
"\\u",
"dict_",
"=_",
"dict_",
"(_",
"zip_",
"(_",
"\\u",
"una",
"ry",
"\\u",
"ops",
"\\u",
"syms_",
",_",
"\\u",
"una",
"ry",
"\\u",
"ops",
"\\u",
"funcs_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Unde",
"fined",
"Varia",
"ble",
"Error_",
"(_",
"Name",
"Error_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Name",
"Error",
" ",
"subclass",
" ",
"for",
" ",
"local",
" ",
"variab",
"les",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Unde",
"fined",
"Varia",
"ble",
"Error_",
"(_",
"Name",
"Error_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"name_",
",_",
"is",
"\\u",
"local_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"is",
"\\u",
"local_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"msg_",
"=_",
"'",
"local",
" ",
"variab",
"le",
" ",
"{",
"0",
"!",
"r",
"}",
" ",
"is",
" ",
"not",
" ",
"defin",
"ed",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"msg_",
"=_",
"'",
"name",
" ",
"{",
"0",
"!",
"r",
"}",
" ",
"is",
" ",
"not",
" ",
"defin",
"ed",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"super_",
"(_",
"Unde",
"fined",
"Varia",
"ble",
"Error_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"msg_",
"._",
"format_",
"(_",
"name_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return",
"\\u",
"type_",
"=_",
"type_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"\\u\\u",
"new\\u\\u_",
"(_",
"cls_",
",_",
"name_",
",_",
"env_",
",_",
"side_",
"=_",
"None_",
",_",
"encoding_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"klass_",
"=_",
"Constant_",
"if_",
"not_",
"isinstance_",
"(_",
"name_",
",_",
"string",
"\\u",
"types_",
")_",
"else_",
"cls_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"sup",
"r",
"\\u",
"new_",
"=_",
"super_",
"(_",
"Term_",
",_",
"klass_",
")_",
"._",
"\\u\\u",
"new\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"sup",
"r",
"\\u",
"new_",
"(_",
"klass_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"name_",
",_",
"env_",
",_",
"side_",
"=_",
"None_",
",_",
"encoding_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"name_",
"=_",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"env_",
"=_",
"env_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"side_",
"=_",
"side_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"tname_",
"=_",
"text",
"\\u",
"type_",
"(_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"is",
"\\u",
"local_",
"=_",
"(_",
"tname_",
"._",
"startswith_",
"(_",
"\\u",
"LOCAL",
"\\u",
"TAG_",
")_",
"or_",
"\\u\\u\\uNL\\u\\u\\u_",
"tname_",
"in_",
"\\u",
"DEF",
"AUL",
"T",
"\\u",
"GLOB",
"ALS",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"value_",
"=_",
"self_",
"._",
"\\u",
"resolve",
"\\u",
"name_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"encoding_",
"=_",
"encoding_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"local",
"\\u",
"name_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"name_",
"._",
"replace_",
"(_",
"\\u",
"LOCAL",
"\\u",
"TAG_",
",_",
"''_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"unicode\\u\\u_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"ppr",
"int\\u",
"thing_",
"(_",
"self_",
"._",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"call\\u\\u_",
"(_",
"self_",
",_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"evaluate_",
"(_",
"self_",
",_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"resolve",
"\\u",
"name_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"res_",
"=_",
"self_",
"._",
"env_",
"._",
"resolve_",
"(_",
"self_",
"._",
"local",
"\\u",
"name_",
",_",
"is",
"\\u",
"local_",
"=_",
"self_",
"._",
"is",
"\\u",
"local_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"update_",
"(_",
"res_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"hasattr_",
"(_",
"res_",
",_",
"'",
"ndim",
"'_",
")_",
"and_",
"res_",
"._",
"ndim_",
">_",
"2_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Not",
"Impl",
"ement",
"ed",
"Error_",
"(_",
"\"",
"N",
"-",
"dimension",
"al",
" ",
"object",
"s",
",",
" ",
"where",
" ",
"N",
" ",
">",
" ",
"2",
",\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
" ",
"are",
" ",
"not",
" ",
"support",
"ed",
" ",
"with",
" ",
"eval",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"res_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"update_",
"(_",
"self_",
",_",
"value_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"search",
" ",
"order",
" ",
"for",
" ",
"local",
" ",
"(",
"i",
".",
"e",
".,",
" ",
"@",
"variab",
"le",
")",
" ",
"variab",
"les",
":",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"scope",
",",
" ",
"key",
"\\u",
"variab",
"le",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"[(",
"'",
"locals",
"',",
" ",
"'",
"local",
"\\u",
"name",
"')",
",",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
" ",
"('",
"globals",
"',",
" ",
"'",
"local",
"\\u",
"name",
"')",
",",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
" ",
"('",
"locals",
"',",
" ",
"'",
"key",
"')",
",",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
" ",
"('",
"globals",
"',",
" ",
"'",
"key",
"')]",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"key_",
"=_",
"self_",
"._",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"if",
" ",
"it",
"'",
"s",
" ",
"a",
" ",
"variab",
"le",
" ",
"name",
" ",
"(",
"other",
"wis",
"e",
" ",
"a",
" ",
"constant",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"isinstance_",
"(_",
"key_",
",_",
"string",
"\\u",
"types_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"env_",
"._",
"swap",
"key_",
"(_",
"self_",
"._",
"local",
"\\u",
"name_",
",_",
"key_",
",_",
"new",
"\\u",
"value_",
"=_",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"value_",
"=_",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"iss",
"cala",
"r_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"lib_",
"._",
"iss",
"cala",
"r_",
"(_",
"self_",
"._",
"\\u",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"type_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"potenti",
"ally",
" ",
"very",
" ",
"slow",
" ",
"for",
" ",
"large",
",",
" ",
"mixed",
" ",
"dt",
"ype",
" ",
"frames_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"\\u",
"value_",
"._",
"values_",
"._",
"dtype_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Attribute",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"ndarray_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"\\u",
"value_",
"._",
"dtype_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Attribute",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"scalar_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"type_",
"(_",
"self_",
"._",
"\\u",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"raw_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"ppr",
"int\\u",
"thing_",
"(_",
"'{",
"0",
"}(",
"name",
"={",
"1",
"!",
"r",
"},",
" ",
"type",
"={",
"2",
"})'_",
"\\u\\u\\uNL\\u\\u\\u_",
"''_",
"._",
"format_",
"(_",
"self_",
"._",
"\\u\\u",
"class\\u\\u_",
"._",
"\\u\\u",
"name\\u\\u_",
",_",
"self_",
"._",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"type_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"is",
"\\u",
"datetime_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"t_",
"=_",
"self_",
"._",
"type_",
"._",
"type_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Attribute",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"t_",
"=_",
"self_",
"._",
"type_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"issubclass_",
"(_",
"t_",
",_",
"(_",
"datetime_",
",_",
"np_",
"._",
"datetime",
"64_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"value_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"\\u",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"value_",
"._",
"setter_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"value_",
"(_",
"self_",
",_",
"new",
"\\u",
"value_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"value_",
"=_",
"new",
"\\u",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"name_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"\\u",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"name_",
"._",
"setter_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"name_",
"(_",
"self_",
",_",
"new",
"\\u",
"name_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"name_",
"=_",
"new",
"\\u",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Term_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"ndim_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"\\u",
"value_",
"._",
"ndim_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Constant_",
"(_",
"Term_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Constant_",
"(_",
"Term_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"value_",
",_",
"env_",
",_",
"side_",
"=_",
"None_",
",_",
"encoding_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"super_",
"(_",
"Constant_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"value_",
",_",
"env_",
",_",
"side_",
"=_",
"side_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"encoding_",
"=_",
"encoding_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Constant_",
"(_",
"Term_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"resolve",
"\\u",
"name_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"\\u",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Constant_",
"(_",
"Term_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"name_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Op_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Hold",
" ",
"an",
" ",
"opera",
"tor",
" ",
"of",
" ",
"arbitra",
"ry",
" ",
"arit",
"y",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Op_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"op_",
",_",
"operands_",
",_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"op_",
"=_",
"\\u",
"bool\\u",
"op",
"\\u",
"map_",
"._",
"get_",
"(_",
"op_",
",_",
"op_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"operands_",
"=_",
"operands_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"encoding_",
"=_",
"kwargs_",
"._",
"get_",
"(_",
"'",
"encoding",
"'_",
",_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Op_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"iter\\u\\u_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"iter_",
"(_",
"self_",
"._",
"operands_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Op_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"unicode\\u\\u_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Print",
" ",
"a",
" ",
"gener",
"ic",
" ",
"n",
"-",
"ary",
" ",
"opera",
"tor",
" ",
"and",
" ",
"its",
" ",
"operand",
"s",
" ",
"usi",
"ng",
" ",
"infix",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"notation",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"recurse",
" ",
"over",
" ",
"the",
" ",
"operands_",
"\\u\\u\\uNL\\u\\u\\u_",
"paren",
"ed_",
"=_",
"(_",
"'(",
"{",
"0",
"})'_",
"._",
"format_",
"(_",
"ppr",
"int\\u",
"thing_",
"(_",
"opr",
"_",
")_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"opr",
"_",
"in_",
"self_",
"._",
"operands_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"ppr",
"int\\u",
"thing_",
"(_",
"'",
" ",
"{",
"0",
"}",
" ",
"'_",
"._",
"format_",
"(_",
"self_",
"._",
"op_",
")_",
"._",
"join_",
"(_",
"paren",
"ed_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Op_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"return",
"\\u",
"type_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"clobber",
" ",
"types",
" ",
"to",
" ",
"bool",
" ",
"if",
" ",
"the",
" ",
"op",
" ",
"is",
" ",
"a",
" ",
"boolean",
" ",
"operator_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"op_",
"in_",
"(_",
"\\u",
"cmp",
"\\u",
"ops",
"\\u",
"syms_",
"+_",
"\\u",
"bool\\u",
"ops",
"\\u",
"syms_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"np_",
"._",
"bool\\u",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"\\u",
"result",
"\\u",
"type",
"\\u",
"many_",
"(_",
"*_",
"(_",
"term_",
"._",
"type_",
"for_",
"term_",
"in_",
"com_",
"._",
"flatten_",
"(_",
"self_",
")_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Op_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"has",
"\\u",
"invalid",
"\\u",
"return",
"\\u",
"type_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"types_",
"=_",
"self_",
"._",
"operand",
"\\u",
"types_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"obj",
"\\u",
"dt",
"ype",
"\\u",
"set_",
"=_",
"frozenset_",
"(_",
"[_",
"np_",
"._",
"dtype_",
"(_",
"'",
"object",
"'_",
")_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"return",
"\\u",
"type_",
"==_",
"object_",
"and_",
"types_",
"-_",
"obj",
"\\u",
"dt",
"ype",
"\\u",
"set_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Op_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"operand",
"\\u",
"types_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"frozenset_",
"(_",
"term_",
"._",
"type_",
"for_",
"term_",
"in_",
"com_",
"._",
"flatten_",
"(_",
"self_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Op_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"iss",
"cala",
"r_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"all_",
"(_",
"operand_",
"._",
"iss",
"cala",
"r_",
"for_",
"operand_",
"in_",
"self_",
"._",
"operands_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Op_",
"(_",
"String",
"Mixin_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"is",
"\\u",
"datetime_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"t_",
"=_",
"self_",
"._",
"return",
"\\u",
"type_",
"._",
"type_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Attribute",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"t_",
"=_",
"self_",
"._",
"return",
"\\u",
"type_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"issubclass_",
"(_",
"t_",
",_",
"(_",
"datetime_",
",_",
"np_",
"._",
"datetime",
"64_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"in_",
"(_",
"x_",
",_",
"y_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Compute",
" ",
"the",
" ",
"vectorize",
"d",
" ",
"member",
"ship",
" ",
"of",
" ",
"``",
"x",
" ",
"in",
" ",
"y",
"``",
" ",
"if",
" ",
"possib",
"le",
",",
" ",
"other",
"wis",
"e",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"use",
" ",
"Pyth",
"on",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"x_",
"._",
"isin_",
"(_",
"y_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Attribute",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"com_",
"._",
"is",
"\\u",
"list",
"\\u",
"like_",
"(_",
"x_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"y_",
"._",
"isin_",
"(_",
"x_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Attribute",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"x_",
"in_",
"y_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"not",
"\\u",
"in_",
"(_",
"x_",
",_",
"y_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Compute",
" ",
"the",
" ",
"vectorize",
"d",
" ",
"member",
"ship",
" ",
"of",
" ",
"``",
"x",
" ",
"not",
" ",
"in",
" ",
"y",
"``",
" ",
"if",
" ",
"possib",
"le",
",",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"other",
"wis",
"e",
" ",
"use",
" ",
"Pyth",
"on",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"~_",
"x_",
"._",
"isin_",
"(_",
"y_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Attribute",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"com_",
"._",
"is",
"\\u",
"list",
"\\u",
"like_",
"(_",
"x_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"~_",
"y_",
"._",
"isin_",
"(_",
"x_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Attribute",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"x_",
"not_",
"in_",
"y_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"cast",
"\\u",
"inplace_",
"(_",
"terms_",
",_",
"dtype_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Cast",
" ",
"an",
" ",
"express",
"ion",
" ",
"inpla",
"ce",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"term",
"s",
" ",
":",
" ",
"Op",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"express",
"ion",
" ",
"tha",
"t",
" ",
"shou",
"ld",
" ",
"cast",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"dt",
"ype",
" ",
":",
" ",
"str",
" ",
"or",
" ",
"nump",
"y",
".",
"dt",
"ype",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"dt",
"ype",
" ",
"to",
" ",
"cast",
" ",
"to",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"dt_",
"=_",
"np_",
"._",
"dtype_",
"(_",
"dtype_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"term_",
"in_",
"terms_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"new",
"\\u",
"value_",
"=_",
"term_",
"._",
"value_",
"._",
"astype_",
"(_",
"dt_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Attribute",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"new",
"\\u",
"value_",
"=_",
"dt_",
"._",
"type_",
"(_",
"term_",
"._",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"term_",
"._",
"update_",
"(_",
"new",
"\\u",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"is",
"\\u",
"term_",
"(_",
"obj_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"isinstance_",
"(_",
"obj_",
",_",
"Term_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Bin",
"Op_",
"(_",
"Op_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Hold",
" ",
"a",
" ",
"binar",
"y",
" ",
"opera",
"tor",
" ",
"and",
" ",
"its",
" ",
"operand",
"s",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"op",
" ",
":",
" ",
"str",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"left",
" ",
":",
" ",
"Term",
" ",
"or",
" ",
"Op",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"right",
" ",
":",
" ",
"Term",
" ",
"or",
" ",
"Op",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Bin",
"Op_",
"(_",
"Op_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"op_",
",_",
"lhs_",
",_",
"rhs_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"super_",
"(_",
"Bin",
"Op_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"op_",
",_",
"(_",
"lhs_",
",_",
"rhs_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"lhs_",
"=_",
"lhs_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"rhs_",
"=_",
"rhs_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"disallow",
"\\u",
"scala",
"r",
"\\u",
"only",
"\\u",
"bool\\u",
"ops_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"convert",
"\\u",
"values_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"func_",
"=_",
"\\u",
"binar",
"y",
"\\u",
"ops",
"\\u",
"dict_",
"[_",
"op_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Key",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"has",
" ",
"to",
" ",
"be",
" ",
"made",
" ",
"a",
" ",
"list",
" ",
"for",
" ",
"python",
"3_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"keys_",
"=_",
"list_",
"(_",
"\\u",
"binar",
"y",
"\\u",
"ops",
"\\u",
"dict_",
"._",
"keys_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Value",
"Error_",
"(_",
"'",
"Inva",
"lid",
" ",
"binar",
"y",
" ",
"opera",
"tor",
" ",
"{",
"0",
"!",
"r",
"},",
" ",
"valid",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
" ",
"opera",
"tors",
" ",
"are",
" ",
"{",
"1",
"}'_",
"._",
"format_",
"(_",
"op_",
",_",
"keys_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Bin",
"Op_",
"(_",
"Op_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"call\\u\\u_",
"(_",
"self_",
",_",
"env_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Recursive",
"ly",
" ",
"evaluate",
" ",
"an",
" ",
"express",
"ion",
" ",
"in",
" ",
"Pyth",
"on",
" ",
"space",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"env",
" ",
":",
" ",
"Sco",
"pe",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"object",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"result",
" ",
"of",
" ",
"an",
" ",
"evaluate",
"d",
" ",
"express",
"ion",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"handle",
" ",
"true",
"div_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"self_",
"._",
"op_",
"==_",
"'/'_",
"and_",
"env_",
"._",
"scope_",
"[_",
"'",
"true",
"div",
"'_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"func_",
"=_",
"op_",
"._",
"true",
"div_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"recurse",
" ",
"over",
" ",
"the",
" ",
"left",
"/",
"right",
" ",
"nodes_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"left_",
"=_",
"self_",
"._",
"lhs_",
"(_",
"env_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"right_",
"=_",
"self_",
"._",
"rhs_",
"(_",
"env_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"self_",
"._",
"func_",
"(_",
"left_",
",_",
"right_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Bin",
"Op_",
"(_",
"Op_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"evaluate_",
"(_",
"self_",
",_",
"env_",
",_",
"engine_",
",_",
"parser_",
",_",
"term",
"\\u",
"type_",
",_",
"eval",
"\\u",
"in",
"\\u",
"python_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Evaluate",
" ",
"a",
" ",
"binar",
"y",
" ",
"operati",
"on",
" ",
"*",
"bef",
"ore",
"*",
" ",
"bei",
"ng",
" ",
"pass",
"ed",
" ",
"to",
" ",
"the",
" ",
"eng",
"ine",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"env",
" ",
":",
" ",
"Sco",
"pe",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"eng",
"ine",
" ",
":",
" ",
"str",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"parser",
" ",
":",
" ",
"str",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"term",
"\\u",
"type",
" ",
":",
" ",
"type",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"eval",
"\\u",
"in",
"\\u",
"python",
" ",
":",
" ",
"list",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"-------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"term",
"\\u",
"type",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"\"",
"pre",
"-",
"evaluate",
"d",
"\"",
" ",
"express",
"ion",
" ",
"as",
" ",
"an",
" ",
"instance",
" ",
"of",
" ",
"``",
"term",
"\\u",
"type",
"``",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"engine_",
"==_",
"'",
"python",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"res_",
"=_",
"self_",
"(_",
"env_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"recurse",
" ",
"over",
" ",
"the",
" ",
"left",
"/",
"right",
" ",
"nodes_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"left_",
"=_",
"self_",
"._",
"lhs_",
"._",
"evaluate_",
"(_",
"env_",
",_",
"engine_",
"=_",
"engine_",
",_",
"parser_",
"=_",
"parser_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"term",
"\\u",
"type_",
"=_",
"term",
"\\u",
"type_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"eval",
"\\u",
"in",
"\\u",
"python_",
"=_",
"eval",
"\\u",
"in",
"\\u",
"python_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"right_",
"=_",
"self_",
"._",
"rhs_",
"._",
"evaluate_",
"(_",
"env_",
",_",
"engine_",
"=_",
"engine_",
",_",
"parser_",
"=_",
"parser_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"term",
"\\u",
"type_",
"=_",
"term",
"\\u",
"type_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"eval",
"\\u",
"in",
"\\u",
"python_",
"=_",
"eval",
"\\u",
"in",
"\\u",
"python_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"base",
" ",
"cases_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"self_",
"._",
"op_",
"in_",
"eval",
"\\u",
"in",
"\\u",
"python_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"res_",
"=_",
"self_",
"._",
"func_",
"(_",
"left_",
"._",
"value_",
",_",
"right_",
"._",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"res_",
"=_",
"pd_",
"._",
"eval_",
"(_",
"self_",
",_",
"local",
"\\u",
"dict_",
"=_",
"env_",
",_",
"engine_",
"=_",
"engine_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"parser_",
"=_",
"parser_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"name_",
"=_",
"env_",
"._",
"add",
"\\u",
"tmp_",
"(_",
"res_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"term",
"\\u",
"type_",
"(_",
"name_",
",_",
"env_",
"=_",
"env_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Bin",
"Op_",
"(_",
"Op_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"convert",
"\\u",
"values_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Convert",
" ",
"datetimes",
" ",
"to",
" ",
"a",
" ",
"compara",
"ble",
" ",
"value",
" ",
"in",
" ",
"an",
" ",
"express",
"ion",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"stringify",
"_",
"(_",
"value_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"encoding_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"encoder_",
"=_",
"partial_",
"(_",
"ppr",
"int\\u",
"thing",
"\\u",
"encoded_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"encoding_",
"=_",
"self_",
"._",
"encoding_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"encoder_",
"=_",
"ppr",
"int\\u",
"thing_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"encoder_",
"(_",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"lhs_",
",_",
"rhs_",
"=_",
"self_",
"._",
"lhs_",
",_",
"self_",
"._",
"rhs_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"is",
"\\u",
"term_",
"(_",
"lhs_",
")_",
"and_",
"lhs_",
"._",
"is",
"\\u",
"datetime_",
"and_",
"is",
"\\u",
"term_",
"(_",
"rhs_",
")_",
"and_",
"rhs_",
"._",
"iss",
"cala",
"r_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"v_",
"=_",
"rhs_",
"._",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"isinstance_",
"(_",
"v_",
",_",
"(_",
"int_",
",_",
"float_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"v_",
"=_",
"stringify",
"_",
"(_",
"v_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"v_",
"=_",
"pd_",
"._",
"Timestamp_",
"(_",
"\\u",
"ensure",
"\\u",
"decoded_",
"(_",
"v_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"v_",
"._",
"tz_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"v_",
"=_",
"v_",
"._",
"tz",
"\\u",
"convert_",
"(_",
"'",
"UT",
"C",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"rhs_",
"._",
"update_",
"(_",
"v_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"is",
"\\u",
"term_",
"(_",
"rhs_",
")_",
"and_",
"rhs_",
"._",
"is",
"\\u",
"datetime_",
"and_",
"is",
"\\u",
"term_",
"(_",
"lhs_",
")_",
"and_",
"lhs_",
"._",
"iss",
"cala",
"r_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"v_",
"=_",
"lhs_",
"._",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"isinstance_",
"(_",
"v_",
",_",
"(_",
"int_",
",_",
"float_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"v_",
"=_",
"stringify",
"_",
"(_",
"v_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"v_",
"=_",
"pd_",
"._",
"Timestamp_",
"(_",
"\\u",
"ensure",
"\\u",
"decoded_",
"(_",
"v_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"v_",
"._",
"tz_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"v_",
"=_",
"v_",
"._",
"tz",
"\\u",
"convert_",
"(_",
"'",
"UT",
"C",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"lhs_",
"._",
"update_",
"(_",
"v_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Bin",
"Op_",
"(_",
"Op_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"disallow",
"\\u",
"scala",
"r",
"\\u",
"only",
"\\u",
"bool\\u",
"ops_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"(_",
"(_",
"self_",
"._",
"lhs_",
"._",
"iss",
"cala",
"r_",
"or_",
"self_",
"._",
"rhs_",
"._",
"iss",
"cala",
"r_",
")_",
"and_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"op_",
"in_",
"\\u",
"bool\\u",
"ops",
"\\u",
"dict_",
"and_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"not_",
"(_",
"issubclass_",
"(_",
"self_",
"._",
"rhs_",
"._",
"return",
"\\u",
"type_",
",_",
"(_",
"bool_",
",_",
"np_",
"._",
"bool\\u",
"_",
")_",
")_",
"and_",
"\\u\\u\\uNL\\u\\u\\u_",
"issubclass_",
"(_",
"self_",
"._",
"lhs_",
"._",
"return",
"\\u",
"type_",
",_",
"(_",
"bool_",
",_",
"np_",
"._",
"bool\\u",
"_",
")_",
")_",
")_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Not",
"Impl",
"ement",
"ed",
"Error_",
"(_",
"\"",
"cann",
"ot",
" ",
"evaluate",
" ",
"scala",
"r",
" ",
"only",
" ",
"bool",
" ",
"ops",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"isn",
"ume",
"ric",
"_",
"(_",
"dtype_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"issubclass_",
"(_",
"np_",
"._",
"dtype_",
"(_",
"dtype_",
")_",
"._",
"type_",
",_",
"np_",
"._",
"number_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Div_",
"(_",
"Bin",
"Op_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Di",
"v",
" ",
"opera",
"tor",
" ",
"to",
" ",
"special",
" ",
"case",
" ",
"casting",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"lh",
"s",
",",
" ",
"rhs",
" ",
":",
" ",
"Term",
" ",
"or",
" ",
"Op",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"Term",
"s",
" ",
"or",
" ",
"Op",
"s",
" ",
"in",
" ",
"the",
" ",
"``",
"/",
"``",
" ",
"express",
"ion",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"true",
"div",
" ",
":",
" ",
"bool",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Whe",
"ther",
" ",
"or",
" ",
"not",
" ",
"to",
" ",
"use",
" ",
"true",
" ",
"divisi",
"on",
".",
" ",
"With",
" ",
"Pyth",
"on",
" ",
"3",
" ",
"this",
" ",
"happ",
"ens",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"rega",
"rd",
"less",
" ",
"of",
" ",
"the",
" ",
"value",
" ",
"of",
" ",
"``",
"true",
"div",
"``.",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Div_",
"(_",
"Bin",
"Op_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"lhs_",
",_",
"rhs_",
",_",
"true",
"div_",
",_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"super_",
"(_",
"Div_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"'/'_",
",_",
"lhs_",
",_",
"rhs_",
",_",
"*_",
"args_",
",_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"not_",
"isn",
"ume",
"ric",
"_",
"(_",
"lhs_",
"._",
"return",
"\\u",
"type_",
")_",
"or_",
"not_",
"isn",
"ume",
"ric",
"_",
"(_",
"rhs_",
"._",
"return",
"\\u",
"type_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Type",
"Error_",
"(_",
"\"",
"unsup",
"porte",
"d",
" ",
"operand",
" ",
"type",
"(",
"s",
")",
" ",
"for",
" ",
"{",
"0",
"}:",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
" ",
"'{",
"1",
"}'",
" ",
"and",
" ",
"'{",
"2",
"}'\"_",
"._",
"format_",
"(_",
"self_",
"._",
"op_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"lhs_",
"._",
"return",
"\\u",
"type_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"rhs_",
"._",
"return",
"\\u",
"type_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"true",
"div_",
"or_",
"PY",
"3_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\\u",
"cast",
"\\u",
"inplace_",
"(_",
"com_",
"._",
"flatten_",
"(_",
"self_",
")_",
",_",
"np_",
"._",
"float",
"\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Una",
"ry",
"Op_",
"(_",
"Op_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Hold",
" ",
"a",
" ",
"una",
"ry",
" ",
"opera",
"tor",
" ",
"and",
" ",
"its",
" ",
"operand",
"s",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Parameter",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"----------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"op",
" ",
":",
" ",
"str",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"token",
" ",
"used",
" ",
"to",
" ",
"represent",
" ",
"the",
" ",
"opera",
"tor",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"operand",
" ",
":",
" ",
"Term",
" ",
"or",
" ",
"Op",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
" ",
"Term",
" ",
"or",
" ",
"Op",
" ",
"operand",
" ",
"to",
" ",
"the",
" ",
"opera",
"tor",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Rai",
"ses",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Value",
"Error",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"*",
" ",
"If",
" ",
"no",
" ",
"function",
" ",
"associate",
"d",
" ",
"with",
" ",
"the",
" ",
"pass",
"ed",
" ",
"opera",
"tor",
" ",
"token",
" ",
"is",
" ",
"found",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Una",
"ry",
"Op_",
"(_",
"Op_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"op_",
",_",
"operand_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"super_",
"(_",
"Una",
"ry",
"Op_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"op_",
",_",
"(_",
"operand_",
",_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"operand_",
"=_",
"operand_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"func_",
"=_",
"\\u",
"una",
"ry",
"\\u",
"ops",
"\\u",
"dict_",
"[_",
"op_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Key",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Value",
"Error_",
"(_",
"'",
"Inva",
"lid",
" ",
"una",
"ry",
" ",
"opera",
"tor",
" ",
"{",
"0",
"!",
"r",
"},",
" ",
"valid",
" ",
"opera",
"tors",
" ",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"are",
" ",
"{",
"1",
"}'_",
"._",
"format_",
"(_",
"op_",
",_",
"\\u",
"una",
"ry",
"\\u",
"ops",
"\\u",
"syms_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Una",
"ry",
"Op_",
"(_",
"Op_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"call\\u\\u_",
"(_",
"self_",
",_",
"env_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"operand_",
"=_",
"self_",
"._",
"operand_",
"(_",
"env_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"func_",
"(_",
"operand_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Una",
"ry",
"Op_",
"(_",
"Op_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"unicode\\u\\u_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"ppr",
"int\\u",
"thing_",
"(_",
"'{",
"0",
"}(",
"{",
"1",
"})'_",
"._",
"format_",
"(_",
"self_",
"._",
"op_",
",_",
"self_",
"._",
"operand_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Una",
"ry",
"Op_",
"(_",
"Op_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"property_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"return",
"\\u",
"type_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"operand_",
"=_",
"self_",
"._",
"operand_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"operand_",
"._",
"return",
"\\u",
"type_",
"==_",
"np_",
"._",
"dtype_",
"(_",
"'",
"bool",
"'_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"np_",
"._",
"dtype_",
"(_",
"'",
"bool",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"(_",
"isinstance_",
"(_",
"operand_",
",_",
"Op_",
")_",
"and_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"operand_",
"._",
"op_",
"in_",
"\\u",
"cmp",
"\\u",
"ops",
"\\u",
"dict_",
"or_",
"operand_",
"._",
"op_",
"in_",
"\\u",
"bool\\u",
"ops",
"\\u",
"dict_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"np_",
"._",
"dtype_",
"(_",
"'",
"bool",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"np_",
"._",
"dtype_",
"(_",
"'",
"int",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Math",
"Call_",
"(_",
"Op_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Math",
"Call_",
"(_",
"Op_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"func_",
",_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"super_",
"(_",
"Math",
"Call_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"func_",
"._",
"name_",
",_",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"func_",
"=_",
"func_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Math",
"Call_",
"(_",
"Op_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"call\\u\\u_",
"(_",
"self_",
",_",
"env_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"operands_",
"=_",
"[_",
"op_",
"(_",
"env_",
")_",
"for_",
"op_",
"in_",
"self_",
"._",
"operands_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"func_",
"._",
"func_",
"(_",
"*_",
"operands_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Math",
"Call_",
"(_",
"Op_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"unicode\\u\\u_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"operands_",
"=_",
"map_",
"(_",
"str_",
",_",
"self_",
"._",
"operands_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"ppr",
"int\\u",
"thing_",
"(_",
"'{",
"0",
"}(",
"{",
"1",
"})'_",
"._",
"format_",
"(_",
"self_",
"._",
"op_",
",_",
"','_",
"._",
"join_",
"(_",
"operands_",
")_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Func",
"Node_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Func",
"Node_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"name_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"name_",
"not_",
"in_",
"\\u",
"math",
"ops_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Value",
"Error_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"\\\\\"",
"{",
"0",
"}\\\\\"",
" ",
"is",
" ",
"not",
" ",
"a",
" ",
"support",
"ed",
" ",
"function",
"\"_",
"._",
"format_",
"(_",
"name_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"name_",
"=_",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"func_",
"=_",
"getattr_",
"(_",
"np_",
",_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Func",
"Node_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"call\\u\\u_",
"(_",
"self_",
",_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"Math",
"Call_",
"(_",
"self_",
",_",
"args_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Except block handles 'BaseException' | grantjenks/python-diskcache/tests/utils.py | [
{
"content": "def retry(sql, query):\n pause = 0.001\n error = sqlite3.OperationalError\n\n for _ in range(int(LIMITS[u'timeout'] / pause)):\n try:\n sql(query).fetchone()\n except sqlite3.OperationalError as exc:\n error = exc\n time.sleep(pause)\n else:\n break\n else:\n raise error\n\n del error",
"metadata": "root.retry",
"header": "['module', '___EOS___']",
"index": 62
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Except",
"_",
"block_",
"handles_",
"'",
"Base",
"Except",
"ion",
"'_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"retry_",
"(_",
"sql_",
",_",
"query_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pause_",
"=_",
"0.001_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"error_",
"=_",
"sqlite3_",
"._",
"Opera",
"tion",
"al",
"Error_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"\\u_",
"in_",
"range_",
"(_",
"int_",
"(_",
"LIMIT",
"S_",
"[_",
"u",
"'",
"timeo",
"ut",
"'_",
"]_",
"/_",
"pause_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"sql_",
"(_",
"query_",
")_",
"._",
"fetchone_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"sqlite3_",
"._",
"Opera",
"tion",
"al",
"Error_",
"as_",
"exc_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"error_",
"=_",
"exc_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"time_",
"._",
"sleep_",
"(_",
"pause_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"break_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"error_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"del_",
"error_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | openstack/rally/tests/unit/plugins/openstack/context/neutron/test_lbaas.py | [
{
"content": "# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n# License for the specific language governing permissions and limitations\n# under the License.\n\nimport mock\n\nfrom rally.plugins.openstack.context.neutron import lbaas as lbaas_context\nfrom tests.unit import test\n\nNET = \"rally.plugins.openstack.wrappers.network.\"\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class LbaasTestCase(test.TestCase):\n\n\n\n\n\n\n",
"metadata": "root.LbaasTestCase",
"header": "['module', '___EOS___']",
"index": 20
},
{
"content": " def get_context(self, **kwargs):\n foo_tenant = {\"networks\": [{\"id\": \"foo_net\",\n \"tenant_id\": \"foo_tenant\",\n \"subnets\": [\"foo_subnet\"]}]}\n bar_tenant = {\"networks\": [{\"id\": \"bar_net\",\n \"tenant_id\": \"bar_tenant\",\n \"subnets\": [\"bar_subnet\"]}]}\n return {\"task\": {\"uuid\": \"foo_task\"},\n \"admin\": {\"credential\": \"foo_admin\"},\n \"users\": [{\"id\": \"foo_user\", \"tenant_id\": \"foo_tenant\"},\n {\"id\": \"bar_user\", \"tenant_id\": \"bar_tenant\"}],\n \"config\": {\"lbaas\": kwargs},\n \"tenants\": {\"foo_tenant\": foo_tenant,\n \"bar_tenant\": bar_tenant}}",
"metadata": "root.LbaasTestCase.get_context",
"header": "['class', 'LbaasTestCase', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 21
},
{
"content": " @mock.patch(\"rally.osclients.Clients\")\n @mock.patch(NET + \"wrap\", return_value=\"foo_service\")\n def test__init__default(self, mock_wrap, mock_clients):\n context = lbaas_context.Lbaas(self.get_context())\n self.assertEqual(\n context.config[\"pool\"][\"lb_method\"],\n lbaas_context.Lbaas.DEFAULT_CONFIG[\"pool\"][\"lb_method\"])\n self.assertEqual(\n context.config[\"pool\"][\"protocol\"],\n lbaas_context.Lbaas.DEFAULT_CONFIG[\"pool\"][\"protocol\"])\n self.assertEqual(\n context.config[\"lbaas_version\"],\n lbaas_context.Lbaas.DEFAULT_CONFIG[\"lbaas_version\"])",
"metadata": "root.LbaasTestCase.test__init__default",
"header": "['class', 'LbaasTestCase', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 36
},
{
"content": " @mock.patch(\"rally.osclients.Clients\")\n @mock.patch(NET + \"wrap\", return_value=\"foo_service\")\n def test__init__explicit(self, mock_wrap, mock_clients):\n context = lbaas_context.Lbaas(\n self.get_context(pool={\"lb_method\": \"LEAST_CONNECTIONS\"}))\n self.assertEqual(context.config[\"pool\"][\"lb_method\"],\n \"LEAST_CONNECTIONS\")",
"metadata": "root.LbaasTestCase.test__init__explicit",
"header": "['class', 'LbaasTestCase', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 50
},
{
"content": " @mock.patch(NET + \"wrap\")\n @mock.patch(\"rally.plugins.openstack.context.neutron.lbaas.utils\")\n @mock.patch(\"rally.osclients.Clients\")\n def test_setup_with_lbaas(self, mock_clients, mock_utils, mock_wrap):\n mock_utils.iterate_per_tenants.return_value = [\n (\"foo_user\", \"foo_tenant\"),\n (\"bar_user\", \"bar_tenant\")]\n foo_net = {\"id\": \"foo_net\",\n \"tenant_id\": \"foo_tenant\",\n \"subnets\": [\"foo_subnet\"],\n \"lb_pools\": [{\"pool\": {\"id\": \"foo_pool\",\n \"tenant_id\": \"foo_tenant\"}}]}\n bar_net = {\"id\": \"bar_net\",\n \"tenant_id\": \"bar_tenant\",\n \"subnets\": [\"bar_subnet\"],\n \"lb_pools\": [{\"pool\": {\"id\": \"bar_pool\",\n \"tenant_id\": \"bar_tenant\"}}]}\n expected_net = [bar_net, foo_net]\n mock_create = mock.Mock(\n side_effect=lambda t, s,\n **kw: {\"pool\": {\"id\": str(t.split(\"_\")[0]) + \"_pool\",\n \"tenant_id\": t}})\n actual_net = []\n mock_wrap.return_value = mock.Mock(create_v1_pool=mock_create)\n net_wrapper = mock_wrap(mock_clients.return_value)\n net_wrapper.supports_extension.return_value = (True, None)\n fake_args = {\"lbaas_version\": 1}\n lb_context = lbaas_context.Lbaas(self.get_context(**fake_args))\n lb_context.setup()\n mock_utils.iterate_per_tenants.assert_called_once_with(\n lb_context.context[\"users\"])\n net_wrapper.supports_extension.assert_called_once_with(\"lbaas\")\n for tenant_id, tenant_ctx in (\n sorted(lb_context.context[\"tenants\"].items())):\n for network in tenant_ctx[\"networks\"]:\n actual_net.append(network)\n self.assertEqual(expected_net, actual_net)",
"metadata": "root.LbaasTestCase.test_setup_with_lbaas",
"header": "['class', 'LbaasTestCase', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 58
},
{
"content": " @mock.patch(NET + \"wrap\")\n @mock.patch(\"rally.plugins.openstack.context.neutron.lbaas.utils\")\n @mock.patch(\"rally.osclients.Clients\")\n def test_setup_with_no_lbaas(self, mock_clients, mock_utils, mock_wrap):\n mock_utils.iterate_per_tenants.return_value = [\n (\"bar_user\", \"bar_tenant\")]\n mock_create = mock.Mock(side_effect=lambda t, **kw: t + \"-net\")\n mock_wrap.return_value = mock.Mock(create_v1_pool=mock_create)\n fake_args = {\"lbaas_version\": 1}\n lb_context = lbaas_context.Lbaas(self.get_context(**fake_args))\n net_wrapper = mock_wrap(mock_clients.return_value)\n net_wrapper.supports_extension.return_value = (False, None)\n lb_context.setup()\n mock_utils.iterate_per_tenants.assert_not_called()\n net_wrapper.supports_extension.assert_called_once_with(\"lbaas\")\n assert not net_wrapper.create_v1_pool.called",
"metadata": "root.LbaasTestCase.test_setup_with_no_lbaas",
"header": "['class', 'LbaasTestCase', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 96
},
{
"content": " @mock.patch(NET + \"wrap\")\n @mock.patch(\"rally.plugins.openstack.context.neutron.lbaas.utils\")\n @mock.patch(\"rally.osclients.Clients\")\n def test_setup_with_lbaas_version_not_one(self, mock_clients,\n mock_utils, mock_wrap):\n mock_utils.iterate_per_tenants.return_value = [\n (\"bar_user\", \"bar_tenant\")]\n mock_create = mock.Mock(side_effect=lambda t, **kw: t + \"-net\")\n mock_wrap.return_value = mock.Mock(create_v1_pool=mock_create)\n fake_args = {\"lbaas_version\": 2}\n lb_context = lbaas_context.Lbaas(self.get_context(**fake_args))\n net_wrapper = mock_wrap(mock_clients.return_value)\n net_wrapper.supports_extension.return_value = (True, None)\n self.assertRaises(NotImplementedError, lb_context.setup)",
"metadata": "root.LbaasTestCase.test_setup_with_lbaas_version_not_one",
"header": "['class', 'LbaasTestCase', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 113
},
{
"content": " @mock.patch(\"rally.osclients.Clients\")\n @mock.patch(NET + \"wrap\")\n def test_cleanup(self, mock_wrap, mock_clients):\n net_wrapper = mock_wrap(mock_clients.return_value)\n lb_context = lbaas_context.Lbaas(self.get_context())\n expected_pools = []\n for tenant_id, tenant_ctx in lb_context.context[\"tenants\"].items():\n resultant_pool = {\"pool\": {\n \"id\": str(tenant_id.split(\"_\")[0]) + \"_pool\"}}\n expected_pools.append(resultant_pool)\n for network in (\n lb_context.context[\"tenants\"][tenant_id][\"networks\"]):\n network.setdefault(\"lb_pools\", []).append(resultant_pool)\n lb_context.cleanup()\n net_wrapper.delete_v1_pool.assert_has_calls(\n [mock.call(pool[\"pool\"][\"id\"]) for pool in expected_pools])",
"metadata": "root.LbaasTestCase.test_cleanup",
"header": "['class', 'LbaasTestCase', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 128
},
{
"content": " @mock.patch(\"rally.osclients.Clients\")\n @mock.patch(NET + \"wrap\")\n def test_cleanup_lbaas_version_not_one(self, mock_wrap, mock_clients):\n fakeargs = {\"lbaas_version\": 2}\n net_wrapper = mock_wrap(mock_clients.return_value)\n lb_context = lbaas_context.Lbaas(self.get_context(**fakeargs))\n for tenant_id, tenant_ctx in lb_context.context[\"tenants\"].items():\n resultant_pool = {\"pool\": {\n \"id\": str(tenant_id.split(\"_\")[0]) + \"_pool\"}}\n for network in (\n lb_context.context[\"tenants\"][tenant_id][\"networks\"]):\n network.setdefault(\"lb_pools\", []).append(resultant_pool)\n lb_context.cleanup()\n assert not net_wrapper.delete_v1_pool.called",
"metadata": "root.LbaasTestCase.test_cleanup_lbaas_version_not_one",
"header": "['class', 'LbaasTestCase', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']",
"index": 145
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"License",
"d",
" ",
"under",
" ",
"the",
" ",
"Ap",
"ache",
" ",
"License",
",",
" ",
"Version",
" ",
"2.0",
" ",
"(",
"the",
" ",
"\"",
"License",
"\");",
" ",
"you",
" ",
"may",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"not",
" ",
"use",
" ",
"this",
" ",
"file",
" ",
"except",
" ",
"in",
" ",
"compli",
"anc",
"e",
" ",
"with",
" ",
"the",
" ",
"License",
".",
" ",
"You",
" ",
"may",
" ",
"obtain",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"a",
" ",
"copy",
" ",
"of",
" ",
"the",
" ",
"License",
" ",
"at_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
" ",
"http",
"://",
"www",
".",
"apa",
"che",
".",
"org",
"/",
"license",
"s",
"/",
"LICENSE",
"-",
"2.0_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"Un",
"less",
" ",
"require",
"d",
" ",
"by",
" ",
"applica",
"ble",
" ",
"law",
" ",
"or",
" ",
"agree",
"d",
" ",
"to",
" ",
"in",
" ",
"writ",
"ing",
",",
" ",
"software",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"distributed",
" ",
"under",
" ",
"the",
" ",
"License",
" ",
"is",
" ",
"distributed",
" ",
"on",
" ",
"an",
" ",
"\"",
"AS",
" ",
"IS",
"\"",
" ",
"BAS",
"IS",
",",
" ",
"WITH",
"OUT_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"WAR",
"RAN",
"TIES",
" ",
"OR",
" ",
"CONDITION",
"S",
" ",
"OF",
" ",
"ANY",
" ",
"KIND",
",",
" ",
"eit",
"her",
" ",
"express",
" ",
"or",
" ",
"impli",
"ed",
".",
" ",
"See",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"License",
" ",
"for",
" ",
"the",
" ",
"specific",
" ",
"language",
" ",
"govern",
"ing",
" ",
"permissi",
"ons",
" ",
"and",
" ",
"limit",
"ations_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"under",
" ",
"the",
" ",
"License",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"mock_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"rally",
"_",
"._",
"plugins_",
"._",
"openstack_",
"._",
"context_",
"._",
"neutron_",
"import_",
"lba",
"as_",
"as_",
"lba",
"as",
"\\u",
"context_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"tests_",
"._",
"unit_",
"import_",
"test_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"NET",
"_",
"=_",
"\"",
"rally",
".",
"plugin",
"s",
".",
"openst",
"ack",
".",
"wrapp",
"ers",
".",
"network",
".\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Lb",
"aas",
"Test",
"Case_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Lb",
"aas",
"Test",
"Case_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"get",
"\\u",
"context_",
"(_",
"self_",
",_",
"**_",
"kwargs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"foo",
"\\u",
"tenant_",
"=_",
"{_",
"\"",
"network",
"s",
"\"_",
":_",
"[_",
"{_",
"\"",
"id",
"\"_",
":_",
"\"",
"foo",
"\\u",
"net",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"tenan",
"t",
"\\u",
"id",
"\"_",
":_",
"\"",
"foo",
"\\u",
"tenan",
"t",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"subnet",
"s",
"\"_",
":_",
"[_",
"\"",
"foo",
"\\u",
"subnet",
"\"_",
"]_",
"}_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"\\u",
"tenant_",
"=_",
"{_",
"\"",
"network",
"s",
"\"_",
":_",
"[_",
"{_",
"\"",
"id",
"\"_",
":_",
"\"",
"bar",
"\\u",
"net",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"tenan",
"t",
"\\u",
"id",
"\"_",
":_",
"\"",
"bar",
"\\u",
"tenan",
"t",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"subnet",
"s",
"\"_",
":_",
"[_",
"\"",
"bar",
"\\u",
"subnet",
"\"_",
"]_",
"}_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"{_",
"\"",
"task",
"\"_",
":_",
"{_",
"\"",
"uuid",
"\"_",
":_",
"\"",
"foo",
"\\u",
"task",
"\"_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"admin",
"\"_",
":_",
"{_",
"\"",
"cred",
"ential",
"\"_",
":_",
"\"",
"foo",
"\\u",
"admin",
"\"_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"users",
"\"_",
":_",
"[_",
"{_",
"\"",
"id",
"\"_",
":_",
"\"",
"foo",
"\\u",
"user",
"\"_",
",_",
"\"",
"tenan",
"t",
"\\u",
"id",
"\"_",
":_",
"\"",
"foo",
"\\u",
"tenan",
"t",
"\"_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"{_",
"\"",
"id",
"\"_",
":_",
"\"",
"bar",
"\\u",
"user",
"\"_",
",_",
"\"",
"tenan",
"t",
"\\u",
"id",
"\"_",
":_",
"\"",
"bar",
"\\u",
"tenan",
"t",
"\"_",
"}_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"config",
"\"_",
":_",
"{_",
"\"",
"lba",
"as",
"\"_",
":_",
"kwargs_",
"}_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"tenan",
"ts",
"\"_",
":_",
"{_",
"\"",
"foo",
"\\u",
"tenan",
"t",
"\"_",
":_",
"foo",
"\\u",
"tenant_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"bar",
"\\u",
"tenan",
"t",
"\"_",
":_",
"bar",
"\\u",
"tenant_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Lb",
"aas",
"Test",
"Case_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"(_",
"\"",
"rally",
".",
"osc",
"lien",
"ts",
".",
"Client",
"s",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"(_",
"NET",
"_",
"+_",
"\"",
"wrap",
"\"_",
",_",
"return",
"\\u",
"value_",
"=_",
"\"",
"foo",
"\\u",
"service",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"test\\u",
"\\u",
"init",
"\\u\\u",
"default_",
"(_",
"self_",
",_",
"mock",
"\\u",
"wrap_",
",_",
"mock",
"\\u",
"clients_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"context_",
"=_",
"lba",
"as",
"\\u",
"context_",
"._",
"Lb",
"aas",
"_",
"(_",
"self_",
"._",
"get",
"\\u",
"context_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"context_",
"._",
"config_",
"[_",
"\"",
"pool",
"\"_",
"]_",
"[_",
"\"",
"lb",
"\\u",
"method",
"\"_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"lba",
"as",
"\\u",
"context_",
"._",
"Lb",
"aas",
"_",
"._",
"DEF",
"AUL",
"T",
"\\u",
"CONFIG_",
"[_",
"\"",
"pool",
"\"_",
"]_",
"[_",
"\"",
"lb",
"\\u",
"method",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"context_",
"._",
"config_",
"[_",
"\"",
"pool",
"\"_",
"]_",
"[_",
"\"",
"protoc",
"ol",
"\"_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"lba",
"as",
"\\u",
"context_",
"._",
"Lb",
"aas",
"_",
"._",
"DEF",
"AUL",
"T",
"\\u",
"CONFIG_",
"[_",
"\"",
"pool",
"\"_",
"]_",
"[_",
"\"",
"protoc",
"ol",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"context_",
"._",
"config_",
"[_",
"\"",
"lba",
"as",
"\\u",
"version",
"\"_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"lba",
"as",
"\\u",
"context_",
"._",
"Lb",
"aas",
"_",
"._",
"DEF",
"AUL",
"T",
"\\u",
"CONFIG_",
"[_",
"\"",
"lba",
"as",
"\\u",
"version",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Lb",
"aas",
"Test",
"Case_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"(_",
"\"",
"rally",
".",
"osc",
"lien",
"ts",
".",
"Client",
"s",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"(_",
"NET",
"_",
"+_",
"\"",
"wrap",
"\"_",
",_",
"return",
"\\u",
"value_",
"=_",
"\"",
"foo",
"\\u",
"service",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"test\\u",
"\\u",
"init",
"\\u\\u",
"explicit",
"_",
"(_",
"self_",
",_",
"mock",
"\\u",
"wrap_",
",_",
"mock",
"\\u",
"clients_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"context_",
"=_",
"lba",
"as",
"\\u",
"context_",
"._",
"Lb",
"aas",
"_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"get",
"\\u",
"context_",
"(_",
"pool_",
"=_",
"{_",
"\"",
"lb",
"\\u",
"method",
"\"_",
":_",
"\"",
"LEA",
"ST",
"\\u",
"CONNECTION",
"S",
"\"_",
"}_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"context_",
"._",
"config_",
"[_",
"\"",
"pool",
"\"_",
"]_",
"[_",
"\"",
"lb",
"\\u",
"method",
"\"_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"LEA",
"ST",
"\\u",
"CONNECTION",
"S",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Lb",
"aas",
"Test",
"Case_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"(_",
"NET",
"_",
"+_",
"\"",
"wrap",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"(_",
"\"",
"rally",
".",
"plugin",
"s",
".",
"openst",
"ack",
".",
"context",
".",
"neut",
"ron",
".",
"lba",
"as",
".",
"util",
"s",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"(_",
"\"",
"rally",
".",
"osc",
"lien",
"ts",
".",
"Client",
"s",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"test\\u",
"setup",
"\\u",
"with",
"\\u",
"lba",
"as_",
"(_",
"self_",
",_",
"mock",
"\\u",
"clients_",
",_",
"mock",
"\\u",
"utils_",
",_",
"mock",
"\\u",
"wrap_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mock",
"\\u",
"utils_",
"._",
"iterate",
"\\u",
"per",
"\\u",
"tenants_",
"._",
"return",
"\\u",
"value_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"\"",
"foo",
"\\u",
"user",
"\"_",
",_",
"\"",
"foo",
"\\u",
"tenan",
"t",
"\"_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"\"",
"bar",
"\\u",
"user",
"\"_",
",_",
"\"",
"bar",
"\\u",
"tenan",
"t",
"\"_",
")_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"foo",
"\\u",
"net_",
"=_",
"{_",
"\"",
"id",
"\"_",
":_",
"\"",
"foo",
"\\u",
"net",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"tenan",
"t",
"\\u",
"id",
"\"_",
":_",
"\"",
"foo",
"\\u",
"tenan",
"t",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"subnet",
"s",
"\"_",
":_",
"[_",
"\"",
"foo",
"\\u",
"subnet",
"\"_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"lb",
"\\u",
"pools",
"\"_",
":_",
"[_",
"{_",
"\"",
"pool",
"\"_",
":_",
"{_",
"\"",
"id",
"\"_",
":_",
"\"",
"foo",
"\\u",
"pool",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"tenan",
"t",
"\\u",
"id",
"\"_",
":_",
"\"",
"foo",
"\\u",
"tenan",
"t",
"\"_",
"}_",
"}_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bar",
"\\u",
"net_",
"=_",
"{_",
"\"",
"id",
"\"_",
":_",
"\"",
"bar",
"\\u",
"net",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"tenan",
"t",
"\\u",
"id",
"\"_",
":_",
"\"",
"bar",
"\\u",
"tenan",
"t",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"subnet",
"s",
"\"_",
":_",
"[_",
"\"",
"bar",
"\\u",
"subnet",
"\"_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"lb",
"\\u",
"pools",
"\"_",
":_",
"[_",
"{_",
"\"",
"pool",
"\"_",
":_",
"{_",
"\"",
"id",
"\"_",
":_",
"\"",
"bar",
"\\u",
"pool",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"tenan",
"t",
"\\u",
"id",
"\"_",
":_",
"\"",
"bar",
"\\u",
"tenan",
"t",
"\"_",
"}_",
"}_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected",
"\\u",
"net_",
"=_",
"[_",
"bar",
"\\u",
"net_",
",_",
"foo",
"\\u",
"net_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mock",
"\\u",
"create_",
"=_",
"mock_",
"._",
"Mock_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"side",
"\\u",
"effect_",
"=_",
"lambda_",
"t_",
",_",
"s_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"**_",
"kw_",
":_",
"{_",
"\"",
"pool",
"\"_",
":_",
"{_",
"\"",
"id",
"\"_",
":_",
"str_",
"(_",
"t_",
"._",
"split_",
"(_",
"\"\\u\"_",
")_",
"[_",
"0_",
"]_",
")_",
"+_",
"\"\\u",
"pool",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"tenan",
"t",
"\\u",
"id",
"\"_",
":_",
"t_",
"}_",
"}_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"actual",
"\\u",
"net_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mock",
"\\u",
"wrap_",
"._",
"return",
"\\u",
"value_",
"=_",
"mock_",
"._",
"Mock_",
"(_",
"create",
"\\u",
"v1",
"\\u",
"pool_",
"=_",
"mock",
"\\u",
"create_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"net",
"\\u",
"wrapper_",
"=_",
"mock",
"\\u",
"wrap_",
"(_",
"mock",
"\\u",
"clients_",
"._",
"return",
"\\u",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"net",
"\\u",
"wrapper_",
"._",
"support",
"s",
"\\u",
"extension_",
"._",
"return",
"\\u",
"value_",
"=_",
"(_",
"True_",
",_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"fake",
"\\u",
"args_",
"=_",
"{_",
"\"",
"lba",
"as",
"\\u",
"version",
"\"_",
":_",
"1_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"lb",
"\\u",
"context_",
"=_",
"lba",
"as",
"\\u",
"context_",
"._",
"Lb",
"aas",
"_",
"(_",
"self_",
"._",
"get",
"\\u",
"context_",
"(_",
"**_",
"fake",
"\\u",
"args_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"lb",
"\\u",
"context_",
"._",
"setup_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mock",
"\\u",
"utils_",
"._",
"iterate",
"\\u",
"per",
"\\u",
"tenants_",
"._",
"assert",
"\\u",
"call",
"ed",
"\\u",
"onc",
"e\\u",
"with_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"lb",
"\\u",
"context_",
"._",
"context_",
"[_",
"\"",
"users",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"net",
"\\u",
"wrapper_",
"._",
"support",
"s",
"\\u",
"extension_",
"._",
"assert",
"\\u",
"call",
"ed",
"\\u",
"onc",
"e\\u",
"with_",
"(_",
"\"",
"lba",
"as",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"tenan",
"t",
"\\u",
"id_",
",_",
"tenan",
"t",
"\\u",
"ctx_",
"in_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"sorted_",
"(_",
"lb",
"\\u",
"context_",
"._",
"context_",
"[_",
"\"",
"tenan",
"ts",
"\"_",
"]_",
"._",
"items_",
"(_",
")_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"network_",
"in_",
"tenan",
"t",
"\\u",
"ctx_",
"[_",
"\"",
"network",
"s",
"\"_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"actual",
"\\u",
"net_",
"._",
"append_",
"(_",
"network_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"expected",
"\\u",
"net_",
",_",
"actual",
"\\u",
"net_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Lb",
"aas",
"Test",
"Case_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"(_",
"NET",
"_",
"+_",
"\"",
"wrap",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"(_",
"\"",
"rally",
".",
"plugin",
"s",
".",
"openst",
"ack",
".",
"context",
".",
"neut",
"ron",
".",
"lba",
"as",
".",
"util",
"s",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"(_",
"\"",
"rally",
".",
"osc",
"lien",
"ts",
".",
"Client",
"s",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"test\\u",
"setup",
"\\u",
"with",
"\\u",
"no",
"\\u",
"lba",
"as_",
"(_",
"self_",
",_",
"mock",
"\\u",
"clients_",
",_",
"mock",
"\\u",
"utils_",
",_",
"mock",
"\\u",
"wrap_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mock",
"\\u",
"utils_",
"._",
"iterate",
"\\u",
"per",
"\\u",
"tenants_",
"._",
"return",
"\\u",
"value_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"\"",
"bar",
"\\u",
"user",
"\"_",
",_",
"\"",
"bar",
"\\u",
"tenan",
"t",
"\"_",
")_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mock",
"\\u",
"create_",
"=_",
"mock_",
"._",
"Mock_",
"(_",
"side",
"\\u",
"effect_",
"=_",
"lambda_",
"t_",
",_",
"**_",
"kw_",
":_",
"t_",
"+_",
"\"-",
"net",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mock",
"\\u",
"wrap_",
"._",
"return",
"\\u",
"value_",
"=_",
"mock_",
"._",
"Mock_",
"(_",
"create",
"\\u",
"v1",
"\\u",
"pool_",
"=_",
"mock",
"\\u",
"create_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"fake",
"\\u",
"args_",
"=_",
"{_",
"\"",
"lba",
"as",
"\\u",
"version",
"\"_",
":_",
"1_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"lb",
"\\u",
"context_",
"=_",
"lba",
"as",
"\\u",
"context_",
"._",
"Lb",
"aas",
"_",
"(_",
"self_",
"._",
"get",
"\\u",
"context_",
"(_",
"**_",
"fake",
"\\u",
"args_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"net",
"\\u",
"wrapper_",
"=_",
"mock",
"\\u",
"wrap_",
"(_",
"mock",
"\\u",
"clients_",
"._",
"return",
"\\u",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"net",
"\\u",
"wrapper_",
"._",
"support",
"s",
"\\u",
"extension_",
"._",
"return",
"\\u",
"value_",
"=_",
"(_",
"False_",
",_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"lb",
"\\u",
"context_",
"._",
"setup_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mock",
"\\u",
"utils_",
"._",
"iterate",
"\\u",
"per",
"\\u",
"tenants_",
"._",
"assert",
"\\u",
"not",
"\\u",
"called_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"net",
"\\u",
"wrapper_",
"._",
"support",
"s",
"\\u",
"extension_",
"._",
"assert",
"\\u",
"call",
"ed",
"\\u",
"onc",
"e\\u",
"with_",
"(_",
"\"",
"lba",
"as",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"not_",
"net",
"\\u",
"wrapper_",
"._",
"create",
"\\u",
"v1",
"\\u",
"pool_",
"._",
"called_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Lb",
"aas",
"Test",
"Case_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"(_",
"NET",
"_",
"+_",
"\"",
"wrap",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"(_",
"\"",
"rally",
".",
"plugin",
"s",
".",
"openst",
"ack",
".",
"context",
".",
"neut",
"ron",
".",
"lba",
"as",
".",
"util",
"s",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"(_",
"\"",
"rally",
".",
"osc",
"lien",
"ts",
".",
"Client",
"s",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"test\\u",
"setup",
"\\u",
"with",
"\\u",
"lba",
"as",
"\\u",
"version",
"\\u",
"not",
"\\u",
"one_",
"(_",
"self_",
",_",
"mock",
"\\u",
"clients_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"mock",
"\\u",
"utils_",
",_",
"mock",
"\\u",
"wrap_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mock",
"\\u",
"utils_",
"._",
"iterate",
"\\u",
"per",
"\\u",
"tenants_",
"._",
"return",
"\\u",
"value_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"\"",
"bar",
"\\u",
"user",
"\"_",
",_",
"\"",
"bar",
"\\u",
"tenan",
"t",
"\"_",
")_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mock",
"\\u",
"create_",
"=_",
"mock_",
"._",
"Mock_",
"(_",
"side",
"\\u",
"effect_",
"=_",
"lambda_",
"t_",
",_",
"**_",
"kw_",
":_",
"t_",
"+_",
"\"-",
"net",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mock",
"\\u",
"wrap_",
"._",
"return",
"\\u",
"value_",
"=_",
"mock_",
"._",
"Mock_",
"(_",
"create",
"\\u",
"v1",
"\\u",
"pool_",
"=_",
"mock",
"\\u",
"create_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"fake",
"\\u",
"args_",
"=_",
"{_",
"\"",
"lba",
"as",
"\\u",
"version",
"\"_",
":_",
"2_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"lb",
"\\u",
"context_",
"=_",
"lba",
"as",
"\\u",
"context_",
"._",
"Lb",
"aas",
"_",
"(_",
"self_",
"._",
"get",
"\\u",
"context_",
"(_",
"**_",
"fake",
"\\u",
"args_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"net",
"\\u",
"wrapper_",
"=_",
"mock",
"\\u",
"wrap_",
"(_",
"mock",
"\\u",
"clients_",
"._",
"return",
"\\u",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"net",
"\\u",
"wrapper_",
"._",
"support",
"s",
"\\u",
"extension_",
"._",
"return",
"\\u",
"value_",
"=_",
"(_",
"True_",
",_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"Not",
"Impl",
"ement",
"ed",
"Error_",
",_",
"lb",
"\\u",
"context_",
"._",
"setup_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Lb",
"aas",
"Test",
"Case_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"(_",
"\"",
"rally",
".",
"osc",
"lien",
"ts",
".",
"Client",
"s",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"(_",
"NET",
"_",
"+_",
"\"",
"wrap",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"test\\u",
"cleanup_",
"(_",
"self_",
",_",
"mock",
"\\u",
"wrap_",
",_",
"mock",
"\\u",
"clients_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"net",
"\\u",
"wrapper_",
"=_",
"mock",
"\\u",
"wrap_",
"(_",
"mock",
"\\u",
"clients_",
"._",
"return",
"\\u",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"lb",
"\\u",
"context_",
"=_",
"lba",
"as",
"\\u",
"context_",
"._",
"Lb",
"aas",
"_",
"(_",
"self_",
"._",
"get",
"\\u",
"context_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected",
"\\u",
"pools_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"tenan",
"t",
"\\u",
"id_",
",_",
"tenan",
"t",
"\\u",
"ctx_",
"in_",
"lb",
"\\u",
"context_",
"._",
"context_",
"[_",
"\"",
"tenan",
"ts",
"\"_",
"]_",
"._",
"items_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"result",
"ant",
"\\u",
"pool_",
"=_",
"{_",
"\"",
"pool",
"\"_",
":_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"id",
"\"_",
":_",
"str_",
"(_",
"tenan",
"t",
"\\u",
"id_",
"._",
"split_",
"(_",
"\"\\u\"_",
")_",
"[_",
"0_",
"]_",
")_",
"+_",
"\"\\u",
"pool",
"\"_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected",
"\\u",
"pools_",
"._",
"append_",
"(_",
"result",
"ant",
"\\u",
"pool_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"network_",
"in_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"lb",
"\\u",
"context_",
"._",
"context_",
"[_",
"\"",
"tenan",
"ts",
"\"_",
"]_",
"[_",
"tenan",
"t",
"\\u",
"id_",
"]_",
"[_",
"\"",
"network",
"s",
"\"_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"network_",
"._",
"setdefault_",
"(_",
"\"",
"lb",
"\\u",
"pools",
"\"_",
",_",
"[_",
"]_",
")_",
"._",
"append_",
"(_",
"result",
"ant",
"\\u",
"pool_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"lb",
"\\u",
"context_",
"._",
"cleanup_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"net",
"\\u",
"wrapper_",
"._",
"delete",
"\\u",
"v1",
"\\u",
"pool_",
"._",
"assert",
"\\u",
"has",
"\\u",
"calls_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"[_",
"mock_",
"._",
"call_",
"(_",
"pool_",
"[_",
"\"",
"pool",
"\"_",
"]_",
"[_",
"\"",
"id",
"\"_",
"]_",
")_",
"for_",
"pool_",
"in_",
"expected",
"\\u",
"pools_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Lb",
"aas",
"Test",
"Case_",
"(_",
"test_",
"._",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"(_",
"\"",
"rally",
".",
"osc",
"lien",
"ts",
".",
"Client",
"s",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"@_",
"mock_",
"._",
"patch_",
"(_",
"NET",
"_",
"+_",
"\"",
"wrap",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"test\\u",
"clean",
"up",
"\\u",
"lba",
"as",
"\\u",
"version",
"\\u",
"not",
"\\u",
"one_",
"(_",
"self_",
",_",
"mock",
"\\u",
"wrap_",
",_",
"mock",
"\\u",
"clients_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"fake",
"args_",
"=_",
"{_",
"\"",
"lba",
"as",
"\\u",
"version",
"\"_",
":_",
"2_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"net",
"\\u",
"wrapper_",
"=_",
"mock",
"\\u",
"wrap_",
"(_",
"mock",
"\\u",
"clients_",
"._",
"return",
"\\u",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"lb",
"\\u",
"context_",
"=_",
"lba",
"as",
"\\u",
"context_",
"._",
"Lb",
"aas",
"_",
"(_",
"self_",
"._",
"get",
"\\u",
"context_",
"(_",
"**_",
"fake",
"args_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"tenan",
"t",
"\\u",
"id_",
",_",
"tenan",
"t",
"\\u",
"ctx_",
"in_",
"lb",
"\\u",
"context_",
"._",
"context_",
"[_",
"\"",
"tenan",
"ts",
"\"_",
"]_",
"._",
"items_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"result",
"ant",
"\\u",
"pool_",
"=_",
"{_",
"\"",
"pool",
"\"_",
":_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"id",
"\"_",
":_",
"str_",
"(_",
"tenan",
"t",
"\\u",
"id_",
"._",
"split_",
"(_",
"\"\\u\"_",
")_",
"[_",
"0_",
"]_",
")_",
"+_",
"\"\\u",
"pool",
"\"_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"network_",
"in_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"lb",
"\\u",
"context_",
"._",
"context_",
"[_",
"\"",
"tenan",
"ts",
"\"_",
"]_",
"[_",
"tenan",
"t",
"\\u",
"id_",
"]_",
"[_",
"\"",
"network",
"s",
"\"_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"network_",
"._",
"setdefault_",
"(_",
"\"",
"lb",
"\\u",
"pools",
"\"_",
",_",
"[_",
"]_",
")_",
"._",
"append_",
"(_",
"result",
"ant",
"\\u",
"pool_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"lb",
"\\u",
"context_",
"._",
"cleanup_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"not_",
"net",
"\\u",
"wrapper_",
"._",
"delete",
"\\u",
"v1",
"\\u",
"pool_",
"._",
"called_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | agiliq/merchant/billing/models/authorize_models.py | [
{
"content": "class AuthorizeAIMResponse(models.Model):\n RESPONSE_CODES = [\n (1, 'Approved'),\n (2, 'Declined'),\n (3, 'Error'),\n (4, 'Held for Review'),\n ]\n ADDRESS_VERIFICATION_RESPONSE = [\n ('A', 'Address(Street) matches,ZIP does not'),\n ('B', 'Address information not provided for AVS check'),\n ('E', 'AVS error'),\n ('G', 'Non-U.S. Card Issuing Bank'),\n ('N', 'No match on Address(Street) or ZIP'),\n ('P', 'AVS not applicable for this transactions'),\n ('R', 'Retry-System unavailable or timed out'),\n ('S', 'Service not supported by issuer'),\n ('U', 'Address information is unavailable'),\n ('W', 'Nine digit Zip matches, Address(Street) does not'),\n ('X', 'Address(Street) and nine digit ZIP match'),\n ('Y', 'Address(Street) and five digit ZIP match'),\n ('Z', 'Five digit Zip matches, Address(Street) does not'),\n ]\n CARD_CODE_RESPONSES = [\n ('', ''),\n ('M', 'Match'),\n ('N', 'No Match'),\n ('P', 'Not Processed'),\n ('S', 'Should have been present'),\n ('U', 'Issuer unable to process request'),\n ]\n response_code = models.IntegerField(choices=RESPONSE_CODES)\n response_reason_code = models.IntegerField(blank=True)\n response_reason_text = models.TextField(blank=True)\n authorization_code = models.CharField(max_length=8)\n address_verification_response = models.CharField(max_length='8', choices=ADDRESS_VERIFICATION_RESPONSE)\n transaction_id = models.CharField(max_length=64)\n invoice_number = models.CharField(max_length=64, blank=True)\n description = models.CharField(max_length=255, blank=True)\n amount = models.DecimalField(max_digits=16, decimal_places=2)\n method = models.CharField(max_length=255, blank=True)\n transaction_type = models.CharField(max_length=255, blank=True)\n customer_id = models.CharField(max_length=64, blank=True)\n\n first_name = models.CharField(max_length=64, blank=True)\n last_name = models.CharField(max_length=64, blank=True)\n company = models.CharField(max_length=64, blank=True)\n address = models.CharField(max_length=64, blank=True)\n city = models.CharField(max_length=64, blank=True)\n state = models.CharField(max_length=64, blank=True)\n zip_code = models.CharField(max_length=64, blank=True)\n country = models.CharField(max_length=64, blank=True)\n phone = models.CharField(max_length=64, blank=True)\n fax = models.CharField(max_length=64, blank=True)\n email = models.EmailField()\n\n shipping_first_name = models.CharField(max_length=64, blank=True)\n shipping_last_name = models.CharField(max_length=64, blank=True)\n shipping_company = models.CharField(max_length=64, blank=True)\n shipping_address = models.CharField(max_length=64, blank=True)\n shipping_city = models.CharField(max_length=64, blank=True)\n shipping_state = models.CharField(max_length=64, blank=True)\n shipping_zip_code = models.CharField(max_length=64, blank=True)\n shipping_country = models.CharField(max_length=64, blank=True)\n\n card_code_response = models.CharField(max_length='8', choices=CARD_CODE_RESPONSES, help_text=u'Card Code Verification response')\n\n class Meta:\n app_label = __name__.split(\".\")[0]\n",
"metadata": "root.AuthorizeAIMResponse",
"header": "['module', '___EOS___']",
"index": 6
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Authoriz",
"e",
"AI",
"MR",
"esp",
"ons",
"e_",
"(_",
"models_",
"._",
"Model_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"RESPONSE",
"\\u",
"CODES_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"1_",
",_",
"'",
"Appro",
"ved",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"2_",
",_",
"'",
"Decl",
"ine",
"d",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"3_",
",_",
"'",
"Error",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"4_",
",_",
"'",
"Hel",
"d",
" ",
"for",
" ",
"Review",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"ADDR",
"ESS",
"\\u",
"VERI",
"FICATION",
"\\u",
"RESPONSE_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"A",
"'_",
",_",
"'",
"Address",
"(",
"Stre",
"et",
")",
" ",
"matche",
"s",
",",
"ZI",
"P",
" ",
"doe",
"s",
" ",
"not",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"B",
"'_",
",_",
"'",
"Address",
" ",
"informati",
"on",
" ",
"not",
" ",
"provided",
" ",
"for",
" ",
"AV",
"S",
" ",
"check",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"E",
"'_",
",_",
"'",
"AV",
"S",
" ",
"error",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"G",
"'_",
",_",
"'",
"Non",
"-",
"U",
".",
"S",
".",
" ",
"Card",
" ",
"Is",
"sui",
"ng",
" ",
"Bank",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"N",
"'_",
",_",
"'",
"No",
" ",
"match",
" ",
"on",
" ",
"Address",
"(",
"Stre",
"et",
")",
" ",
"or",
" ",
"ZI",
"P",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"P",
"'_",
",_",
"'",
"AV",
"S",
" ",
"not",
" ",
"applica",
"ble",
" ",
"for",
" ",
"this",
" ",
"transaction",
"s",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"R",
"'_",
",_",
"'",
"Retr",
"y",
"-",
"System",
" ",
"unava",
"ilab",
"le",
" ",
"or",
" ",
"timed",
" ",
"out",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"S",
"'_",
",_",
"'",
"Service",
" ",
"not",
" ",
"support",
"ed",
" ",
"by",
" ",
"issue",
"r",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"U",
"'_",
",_",
"'",
"Address",
" ",
"informati",
"on",
" ",
"is",
" ",
"unava",
"ilab",
"le",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"W",
"'_",
",_",
"'",
"Nin",
"e",
" ",
"digit",
" ",
"Zip",
" ",
"matche",
"s",
",",
" ",
"Address",
"(",
"Stre",
"et",
")",
" ",
"doe",
"s",
" ",
"not",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"X",
"'_",
",_",
"'",
"Address",
"(",
"Stre",
"et",
")",
" ",
"and",
" ",
"nine",
" ",
"digit",
" ",
"ZI",
"P",
" ",
"match",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"Y",
"'_",
",_",
"'",
"Address",
"(",
"Stre",
"et",
")",
" ",
"and",
" ",
"five",
" ",
"digit",
" ",
"ZI",
"P",
" ",
"match",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"Z",
"'_",
",_",
"'",
"Fiv",
"e",
" ",
"digit",
" ",
"Zip",
" ",
"matche",
"s",
",",
" ",
"Address",
"(",
"Stre",
"et",
")",
" ",
"doe",
"s",
" ",
"not",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"CARD",
"\\u",
"CODE",
"\\u",
"RESPONSE",
"S_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"''_",
",_",
"''_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"M",
"'_",
",_",
"'",
"Match",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"N",
"'_",
",_",
"'",
"No",
" ",
"Match",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"P",
"'_",
",_",
"'",
"Not",
" ",
"Processe",
"d",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"S",
"'_",
",_",
"'",
"Sho",
"ul",
"d",
" ",
"have",
" ",
"bee",
"n",
" ",
"presen",
"t",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"'",
"U",
"'_",
",_",
"'",
"Issue",
"r",
" ",
"una",
"ble",
" ",
"to",
" ",
"process",
" ",
"request",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"response",
"\\u",
"code_",
"=_",
"models_",
"._",
"Integer",
"Field_",
"(_",
"choices_",
"=_",
"RESPONSE",
"\\u",
"CODES_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"response",
"\\u",
"reason",
"\\u",
"code_",
"=_",
"models_",
"._",
"Integer",
"Field_",
"(_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"response",
"\\u",
"reason",
"\\u",
"text_",
"=_",
"models_",
"._",
"Text",
"Field_",
"(_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"authoriz",
"ation",
"\\u",
"code_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"8_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"address",
"\\u",
"verification",
"\\u",
"response_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"'",
"8",
"'_",
",_",
"choices_",
"=_",
"ADDR",
"ESS",
"\\u",
"VERI",
"FICATION",
"\\u",
"RESPONSE_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"transaction",
"\\u",
"id_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"invoic",
"e\\u",
"number_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"description_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"255_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"amount_",
"=_",
"models_",
"._",
"Deci",
"mal",
"Field_",
"(_",
"max",
"\\u",
"digits_",
"=_",
"16_",
",_",
"decima",
"l\\u",
"places_",
"=_",
"2_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"method_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"255_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"transaction",
"\\u",
"type_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"255_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"customer",
"\\u",
"id_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"first",
"\\u",
"name_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"last",
"\\u",
"name_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"company_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"address_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"city_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"state_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"zip",
"\\u",
"code_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"country_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"phone_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"fax",
"_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"email_",
"=_",
"models_",
"._",
"Ema",
"il",
"Field_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"shipping",
"\\u",
"first",
"\\u",
"name_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"shipping",
"\\u",
"last",
"\\u",
"name_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"shipping",
"\\u",
"company_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"shipping",
"\\u",
"address_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"shipping",
"\\u",
"city_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"shipping",
"\\u",
"state_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"shipping",
"\\u",
"zip",
"\\u",
"code_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"shipping",
"\\u",
"country_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"64_",
",_",
"blank_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"card",
"\\u",
"code",
"\\u",
"response_",
"=_",
"models_",
"._",
"Char",
"Field_",
"(_",
"max",
"\\u",
"length_",
"=_",
"'",
"8",
"'_",
",_",
"choices_",
"=_",
"CARD",
"\\u",
"CODE",
"\\u",
"RESPONSE",
"S_",
",_",
"help",
"\\u",
"text_",
"=_",
"u",
"'",
"Card",
" ",
"Code",
" ",
"Veri",
"fication",
" ",
"response",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Meta_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"app",
"\\u",
"label_",
"=_",
"\\u\\u",
"name\\u\\u_",
"._",
"split_",
"(_",
"\".\"_",
")_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,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] |
`__init__` method calls overridden method | sdispater/orator/orator/orm/utils.py | [
{
"content": "class relation(object):\n \"\"\"\n Base relation decorator\n \"\"\"\n\n relation_class = None\n\n\n\n\n\n",
"metadata": "root.relation",
"header": "['module', '___EOS___']",
"index": 143
},
{
"content": " def __init__(self, func=None, relation=None):\n self._relation = relation\n self._related = None\n self._conditions = None\n\n self.set_func(func)",
"metadata": "root.relation.__init__",
"header": "['class', 'relation', '(', 'object', ')', ':', '___EOS___']",
"index": 150
},
{
"content": " def set_func(self, func):\n self.func = func\n\n if self._relation is None:\n if isinstance(func, property):\n self._relation = func.fget.__name__ if func else None\n else:\n self._relation = func.__name__ if func else None\n\n self.expr = func\n if func is not None:\n update_wrapper(self, func)",
"metadata": "root.relation.set_func",
"header": "['class', 'relation', '(', 'object', ')', ':', '___EOS___']",
"index": 157
},
{
"content": " def __get__(self, instance, owner):\n if instance is None:\n return self.expr\n\n if self._relation in instance._relations:\n return instance._relations[self._relation]\n\n self._related = self.func(instance)\n if isinstance(self._related, (Builder, QueryBuilder)):\n # Extra conditions on relation\n self._conditions = self._related\n self._related = self._related.get_model().__class__\n\n relation = self._get(instance)\n\n if self._conditions:\n # Setting extra conditions\n self._set_conditions(relation)\n\n relation = Wrapper(relation)\n\n instance._relations[self._relation] = relation\n\n return relation",
"metadata": "root.relation.__get__",
"header": "['class', 'relation', '(', 'object', ')', ':', '___EOS___']",
"index": 170
},
{
"content": " def _get(self, instance):\n raise NotImplementedError()",
"metadata": "root.relation._get",
"header": "['class', 'relation', '(', 'object', ')', ':', '___EOS___']",
"index": 195
},
{
"content": " def _set_conditions(self, relation):\n relation.merge_query(self._conditions)\n relation.set_extra_query(self._conditions)",
"metadata": "root.relation._set_conditions",
"header": "['class', 'relation', '(', 'object', ')', ':', '___EOS___']",
"index": 198
},
{
"content": " def __call__(self, func):\n self.set_func(func)\n\n return self",
"metadata": "root.relation.__call__",
"header": "['class', 'relation', '(', 'object', ')', ':', '___EOS___']",
"index": 202
},
{
"content": "class has_one(relation):\n \"\"\"\n Has One relationship decorator\n \"\"\"\n\n relation_class = HasOne\n\n",
"metadata": "root.has_one",
"header": "['module', '___EOS___']",
"index": 208
},
{
"content": " def __init__(self, foreign_key=None, local_key=None, relation=None):\n if isinstance(foreign_key, (types.FunctionType, types.MethodType)):\n func = foreign_key\n foreign_key = None\n else:\n func = None\n\n self._foreign_key = foreign_key\n self._local_key = local_key\n\n super(has_one, self).__init__(func, relation)",
"metadata": "root.has_one.__init__",
"header": "['class', 'has_one', '(', 'relation', ')', ':', '___EOS___']",
"index": 215
},
{
"content": " def _get(self, instance):\n return instance.has_one(\n self._related,\n self._foreign_key,\n self._local_key,\n self._relation,\n _wrapped=False\n )",
"metadata": "root.has_one._get",
"header": "['class', 'has_one', '(', 'relation', ')', ':', '___EOS___']",
"index": 227
},
{
"content": "class morph_one(relation):\n \"\"\"\n Morph One relationship decorator\n \"\"\"\n\n relation_class = MorphOne\n\n",
"metadata": "root.morph_one",
"header": "['module', '___EOS___']",
"index": 237
},
{
"content": " def __init__(self, name, type_column=None, id_column=None, local_key=None, relation=None):\n if isinstance(name, (types.FunctionType, types.MethodType)):\n raise RuntimeError('morph_one relation requires a name')\n\n self._name = name\n self._type_column = type_column\n self._id_column = id_column\n self._local_key = local_key\n\n super(morph_one, self).__init__(relation=relation)",
"metadata": "root.morph_one.__init__",
"header": "['class', 'morph_one', '(', 'relation', ')', ':', '___EOS___']",
"index": 244
},
{
"content": " def _get(self, instance):\n return instance.morph_one(\n self._related, self._name,\n self._type_column, self._id_column,\n self._local_key, self._relation,\n _wrapped=False\n )",
"metadata": "root.morph_one._get",
"header": "['class', 'morph_one', '(', 'relation', ')', ':', '___EOS___']",
"index": 255
},
{
"content": "class belongs_to(relation):\n \"\"\"\n Belongs to relationship decorator\n \"\"\"\n\n relation_class = BelongsTo\n\n\n",
"metadata": "root.belongs_to",
"header": "['module', '___EOS___']",
"index": 264
},
{
"content": " def __init__(self, foreign_key=None, other_key=None, relation=None):\n if isinstance(foreign_key, (types.FunctionType, types.MethodType)):\n func = foreign_key\n foreign_key = None\n else:\n func = None\n\n self._foreign_key = foreign_key\n self._other_key = other_key\n\n super(belongs_to, self).__init__(func, relation)",
"metadata": "root.belongs_to.__init__",
"header": "['class', 'belongs_to', '(', 'relation', ')', ':', '___EOS___']",
"index": 271
},
{
"content": " def _get(self, instance):\n return instance.belongs_to(\n self._related,\n self._foreign_key,\n self._other_key,\n self._relation,\n _wrapped=False\n )",
"metadata": "root.belongs_to._get",
"header": "['class', 'belongs_to', '(', 'relation', ')', ':', '___EOS___']",
"index": 283
},
{
"content": " def _set(self, relation):\n relation._foreign_key = self._foreign_key\n relation._other_key = self._other_key\n relation._relation = self._relation",
"metadata": "root.belongs_to._set",
"header": "['class', 'belongs_to', '(', 'relation', ')', ':', '___EOS___']",
"index": 292
},
{
"content": "class morph_to(relation):\n \"\"\"\n Morph To relationship decorator\n \"\"\"\n\n relation_class = MorphTo\n\n",
"metadata": "root.morph_to",
"header": "['module', '___EOS___']",
"index": 298
},
{
"content": " def __init__(self, name=None, type_column=None, id_column=None):\n if isinstance(name, (types.FunctionType, types.MethodType)):\n func = name\n name = None\n else:\n func = None\n\n self._name = name\n self._type_column = type_column\n self._id_column = id_column\n\n super(morph_to, self).__init__(func, name)",
"metadata": "root.morph_to.__init__",
"header": "['class', 'morph_to', '(', 'relation', ')', ':', '___EOS___']",
"index": 305
},
{
"content": " def _get(self, instance):\n return instance.morph_to(\n self._relation,\n self._type_column, self._id_column,\n _wrapped=False\n )",
"metadata": "root.morph_to._get",
"header": "['class', 'morph_to', '(', 'relation', ')', ':', '___EOS___']",
"index": 318
},
{
"content": "class has_many(relation):\n \"\"\"\n Has Many relationship decorator\n \"\"\"\n\n relation_class = HasMany\n\n",
"metadata": "root.has_many",
"header": "['module', '___EOS___']",
"index": 326
},
{
"content": " def __init__(self, foreign_key=None, local_key=None, relation=None):\n if isinstance(foreign_key, (types.FunctionType, types.MethodType)):\n func = foreign_key\n foreign_key = None\n else:\n func = None\n\n self._foreign_key = foreign_key\n self._local_key = local_key\n\n super(has_many, self).__init__(func, relation)",
"metadata": "root.has_many.__init__",
"header": "['class', 'has_many', '(', 'relation', ')', ':', '___EOS___']",
"index": 333
},
{
"content": " def _get(self, instance):\n return instance.has_many(\n self._related,\n self._foreign_key,\n self._local_key,\n self._relation,\n _wrapped=False\n )",
"metadata": "root.has_many._get",
"header": "['class', 'has_many', '(', 'relation', ')', ':', '___EOS___']",
"index": 345
},
{
"content": "class has_many_through(relation):\n \"\"\"\n Has Many Through relationship decorator\n \"\"\"\n\n relation_class = HasManyThrough\n\n",
"metadata": "root.has_many_through",
"header": "['module', '___EOS___']",
"index": 355
},
{
"content": " def __init__(self, through, first_key=None, second_key=None, relation=None):\n if isinstance(through, (types.FunctionType, types.MethodType)):\n raise RuntimeError('has_many_through relation requires the through parameter')\n\n self._through = through\n self._first_key = first_key\n self._second_key = second_key\n\n super(has_many_through, self).__init__(relation=relation)",
"metadata": "root.has_many_through.__init__",
"header": "['class', 'has_many_through', '(', 'relation', ')', ':', '___EOS___']",
"index": 362
},
{
"content": " def _get(self, instance):\n return instance.has_many_through(\n self._related,\n self._through,\n self._first_key,\n self._second_key,\n self._relation,\n _wrapped=False\n )",
"metadata": "root.has_many_through._get",
"header": "['class', 'has_many_through', '(', 'relation', ')', ':', '___EOS___']",
"index": 372
},
{
"content": "class morph_many(relation):\n \"\"\"\n Morph Many relationship decorator\n \"\"\"\n\n relation_class = MorphMany\n\n",
"metadata": "root.morph_many",
"header": "['module', '___EOS___']",
"index": 383
},
{
"content": " def __init__(self, name, type_column=None, id_column=None, local_key=None, relation=None):\n if isinstance(name, (types.FunctionType, types.MethodType)):\n raise RuntimeError('morph_many relation requires a name')\n\n self._name = name\n self._type_column = type_column\n self._id_column = id_column\n self._local_key = local_key\n\n super(morph_many, self).__init__(relation=relation)",
"metadata": "root.morph_many.__init__",
"header": "['class', 'morph_many', '(', 'relation', ')', ':', '___EOS___']",
"index": 390
},
{
"content": " def _get(self, instance):\n return instance.morph_many(\n self._related, self._name,\n self._type_column, self._id_column,\n self._local_key, self._relation,\n _wrapped=False\n )",
"metadata": "root.morph_many._get",
"header": "['class', 'morph_many', '(', 'relation', ')', ':', '___EOS___']",
"index": 401
},
{
"content": "class belongs_to_many(relation):\n \"\"\"\n Belongs To Many relationship decorator\n \"\"\"\n\n relation_class = BelongsToMany\n\n",
"metadata": "root.belongs_to_many",
"header": "['module', '___EOS___']",
"index": 410
},
{
"content": " def __init__(self, table=None, foreign_key=None, other_key=None,\n relation=None, with_timestamps=False, with_pivot=None):\n if isinstance(table, (types.FunctionType, types.MethodType)):\n func = table\n table = None\n else:\n func = None\n\n self._table = table\n self._foreign_key = foreign_key\n self._other_key = other_key\n\n self._timestamps = with_timestamps\n self._pivot = with_pivot\n\n super(belongs_to_many, self).__init__(func, relation)",
"metadata": "root.belongs_to_many.__init__",
"header": "['class', 'belongs_to_many', '(', 'relation', ')', ':', '___EOS___']",
"index": 417
},
{
"content": " def _get(self, instance):\n r = instance.belongs_to_many(\n self._related,\n self._table,\n self._foreign_key,\n self._other_key,\n self._relation,\n _wrapped=False\n )\n\n if self._timestamps:\n r = r.with_timestamps()\n\n if self._pivot:\n r = r.with_pivot(*self._pivot)\n\n return r",
"metadata": "root.belongs_to_many._get",
"header": "['class', 'belongs_to_many', '(', 'relation', ')', ':', '___EOS___']",
"index": 434
},
{
"content": "class morph_to_many(relation):\n \"\"\"\n Morph To Many relationship decorator\n \"\"\"\n\n relation_class = MorphToMany\n\n",
"metadata": "root.morph_to_many",
"header": "['module', '___EOS___']",
"index": 453
},
{
"content": " def __init__(self, name, table=None, foreign_key=None, other_key=None, relation=None):\n if isinstance(name, (types.FunctionType, types.MethodType)):\n raise RuntimeError('morph_to_many relation required a name')\n\n self._name = name\n self._table = table\n self._foreign_key = foreign_key\n self._other_key = other_key\n\n super(morph_to_many, self).__init__(relation=relation)",
"metadata": "root.morph_to_many.__init__",
"header": "['class', 'morph_to_many', '(', 'relation', ')', ':', '___EOS___']",
"index": 460
},
{
"content": " def _get(self, instance):\n return instance.morph_to_many(\n self._related,\n self._name,\n self._table,\n self._foreign_key,\n self._other_key,\n relation=self._relation,\n _wrapped=False\n )",
"metadata": "root.morph_to_many._get",
"header": "['class', 'morph_to_many', '(', 'relation', ')', ':', '___EOS___']",
"index": 471
},
{
"content": "class morphed_by_many(relation):\n \"\"\"\n Morphed By Many relationship decorator\n \"\"\"\n\n relation_class = MorphToMany\n\n",
"metadata": "root.morphed_by_many",
"header": "['module', '___EOS___']",
"index": 483
},
{
"content": " def __init__(self, name, table=None, foreign_key=None, other_key=None, relation=None):\n if isinstance(foreign_key, (types.FunctionType, types.MethodType)):\n raise RuntimeError('morphed_by_many relation requires a name')\n\n self._name = name\n self._table = table\n self._foreign_key = foreign_key\n self._other_key = other_key\n\n super(morphed_by_many, self).__init__(relation=relation)",
"metadata": "root.morphed_by_many.__init__",
"header": "['class', 'morphed_by_many', '(', 'relation', ')', ':', '___EOS___']",
"index": 490
},
{
"content": " def _get(self, instance):\n return instance.morphed_by_many(\n self._related,\n self._name,\n self._table,\n self._foreign_key,\n self._other_key,\n self._relation,\n _wrapped=False\n )",
"metadata": "root.morphed_by_many._get",
"header": "['class', 'morphed_by_many', '(', 'relation', ')', ':', '___EOS___']",
"index": 501
}
] | [] | [] | 0 | false | [
"[CLS]_",
"`_",
"\\u\\u",
"init\\u\\u_",
"`_",
"method_",
"calls_",
"overrid",
"den_",
"method_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"relation_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Base",
" ",
"relation",
" ",
"decorat",
"or",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"relation",
"\\u",
"class_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"relation_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"func_",
"=_",
"None_",
",_",
"relation_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"relation_",
"=_",
"relation_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"related_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"conditions_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"set\\u",
"func_",
"(_",
"func_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"relation_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"set\\u",
"func_",
"(_",
"self_",
",_",
"func_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"func_",
"=_",
"func_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"self_",
"._",
"\\u",
"relation_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"func_",
",_",
"property_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"relation_",
"=_",
"func_",
"._",
"fget_",
"._",
"\\u\\u",
"name\\u\\u_",
"if_",
"func_",
"else_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"relation_",
"=_",
"func_",
"._",
"\\u\\u",
"name\\u\\u_",
"if_",
"func_",
"else_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"expr_",
"=_",
"func_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"func_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"update",
"\\u",
"wrapper_",
"(_",
"self_",
",_",
"func_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"relation_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"get\\u\\u_",
"(_",
"self_",
",_",
"instance_",
",_",
"owner_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"instance_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"expr_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"self_",
"._",
"\\u",
"relation_",
"in_",
"instance_",
"._",
"\\u",
"relations_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"instance_",
"._",
"\\u",
"relations_",
"[_",
"self_",
"._",
"\\u",
"relation_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"related_",
"=_",
"self_",
"._",
"func_",
"(_",
"instance_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"isinstance_",
"(_",
"self_",
"._",
"\\u",
"related_",
",_",
"(_",
"Builder_",
",_",
"Query",
"Builder_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Extra",
" ",
"condition",
"s",
" ",
"on",
" ",
"relation_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"conditions_",
"=_",
"self_",
"._",
"\\u",
"related_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"related_",
"=_",
"self_",
"._",
"\\u",
"related_",
"._",
"get",
"\\u",
"model_",
"(_",
")_",
"._",
"\\u\\u",
"class\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"relation_",
"=_",
"self_",
"._",
"\\u",
"get_",
"(_",
"instance_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"self_",
"._",
"\\u",
"conditions_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Sett",
"ing",
" ",
"extra",
" ",
"conditions_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"set\\u",
"conditions_",
"(_",
"relation_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"relation_",
"=_",
"Wrapper_",
"(_",
"relation_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"instance_",
"._",
"\\u",
"relations_",
"[_",
"self_",
"._",
"\\u",
"relation_",
"]_",
"=_",
"relation_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"relation_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"relation_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get_",
"(_",
"self_",
",_",
"instance_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Not",
"Impl",
"ement",
"ed",
"Error_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"relation_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"set\\u",
"conditions_",
"(_",
"self_",
",_",
"relation_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"relation_",
"._",
"merge",
"\\u",
"query_",
"(_",
"self_",
"._",
"\\u",
"conditions_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"relation_",
"._",
"set\\u",
"extra",
"\\u",
"query_",
"(_",
"self_",
"._",
"\\u",
"conditions_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"relation_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"call\\u\\u_",
"(_",
"self_",
",_",
"func_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"set\\u",
"func_",
"(_",
"func_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"return_",
"self_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"has",
"\\u",
"one_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Has",
" ",
"One",
" ",
"relation",
"ship",
" ",
"decorat",
"or",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"relation",
"\\u",
"class_",
"=_",
"Has",
"One_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"has",
"\\u",
"one_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"foreign",
"\\u",
"key_",
"=_",
"None_",
",_",
"local",
"\\u",
"key_",
"=_",
"None_",
",_",
"relation_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"foreign",
"\\u",
"key_",
",_",
"(_",
"types_",
"._",
"Function",
"Type_",
",_",
"types_",
"._",
"Meth",
"od",
"Type_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"func_",
"=_",
"foreign",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"foreign",
"\\u",
"key_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"func_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"foreign",
"\\u",
"key_",
"=_",
"foreign",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"local",
"\\u",
"key_",
"=_",
"local",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"super_",
"(_",
"has",
"\\u",
"one_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"func_",
",_",
"relation_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"has",
"\\u",
"one_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get_",
"(_",
"self_",
",_",
"instance_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"instance_",
"._",
"has",
"\\u",
"one_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"related_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"foreign",
"\\u",
"key_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"local",
"\\u",
"key_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"relation_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"wrapped_",
"=_",
"False_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"morph",
"\\u",
"one_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Morph",
" ",
"One",
" ",
"relation",
"ship",
" ",
"decorat",
"or",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"relation",
"\\u",
"class_",
"=_",
"Morph",
"One_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"morph",
"\\u",
"one_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"name_",
",_",
"type",
"\\u",
"column_",
"=_",
"None_",
",_",
"id",
"\\u",
"column_",
"=_",
"None_",
",_",
"local",
"\\u",
"key_",
"=_",
"None_",
",_",
"relation_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"name_",
",_",
"(_",
"types_",
"._",
"Function",
"Type_",
",_",
"types_",
"._",
"Meth",
"od",
"Type_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Run",
"time",
"Error_",
"(_",
"'",
"morph",
"\\u",
"one",
" ",
"relation",
" ",
"require",
"s",
" ",
"a",
" ",
"name",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"name_",
"=_",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"type",
"\\u",
"column_",
"=_",
"type",
"\\u",
"column_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"id",
"\\u",
"column_",
"=_",
"id",
"\\u",
"column_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"local",
"\\u",
"key_",
"=_",
"local",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"super_",
"(_",
"morph",
"\\u",
"one_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"relation_",
"=_",
"relation_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"morph",
"\\u",
"one_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get_",
"(_",
"self_",
",_",
"instance_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"instance_",
"._",
"morph",
"\\u",
"one_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"related_",
",_",
"self_",
"._",
"\\u",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"type",
"\\u",
"column_",
",_",
"self_",
"._",
"\\u",
"id",
"\\u",
"column_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"local",
"\\u",
"key_",
",_",
"self_",
"._",
"\\u",
"relation_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"wrapped_",
"=_",
"False_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"belo",
"ngs",
"\\u",
"to_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Bel",
"ong",
"s",
" ",
"to",
" ",
"relation",
"ship",
" ",
"decorat",
"or",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"relation",
"\\u",
"class_",
"=_",
"Bel",
"ong",
"s",
"To_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"belo",
"ngs",
"\\u",
"to_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"foreign",
"\\u",
"key_",
"=_",
"None_",
",_",
"other",
"\\u",
"key_",
"=_",
"None_",
",_",
"relation_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"foreign",
"\\u",
"key_",
",_",
"(_",
"types_",
"._",
"Function",
"Type_",
",_",
"types_",
"._",
"Meth",
"od",
"Type_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"func_",
"=_",
"foreign",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"foreign",
"\\u",
"key_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"func_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"foreign",
"\\u",
"key_",
"=_",
"foreign",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"other",
"\\u",
"key_",
"=_",
"other",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"super_",
"(_",
"belo",
"ngs",
"\\u",
"to_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"func_",
",_",
"relation_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"belo",
"ngs",
"\\u",
"to_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get_",
"(_",
"self_",
",_",
"instance_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"instance_",
"._",
"belo",
"ngs",
"\\u",
"to_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"related_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"foreign",
"\\u",
"key_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"other",
"\\u",
"key_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"relation_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"wrapped_",
"=_",
"False_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"belo",
"ngs",
"\\u",
"to_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"set_",
"(_",
"self_",
",_",
"relation_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"relation_",
"._",
"\\u",
"foreign",
"\\u",
"key_",
"=_",
"self_",
"._",
"\\u",
"foreign",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"relation_",
"._",
"\\u",
"other",
"\\u",
"key_",
"=_",
"self_",
"._",
"\\u",
"other",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"relation_",
"._",
"\\u",
"relation_",
"=_",
"self_",
"._",
"\\u",
"relation_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"morph",
"\\u",
"to_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Morph",
" ",
"To",
" ",
"relation",
"ship",
" ",
"decorat",
"or",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"relation",
"\\u",
"class_",
"=_",
"Morph",
"To_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"morph",
"\\u",
"to_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"name_",
"=_",
"None_",
",_",
"type",
"\\u",
"column_",
"=_",
"None_",
",_",
"id",
"\\u",
"column_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"name_",
",_",
"(_",
"types_",
"._",
"Function",
"Type_",
",_",
"types_",
"._",
"Meth",
"od",
"Type_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"func_",
"=_",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"name_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"func_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"name_",
"=_",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"type",
"\\u",
"column_",
"=_",
"type",
"\\u",
"column_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"id",
"\\u",
"column_",
"=_",
"id",
"\\u",
"column_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"super_",
"(_",
"morph",
"\\u",
"to_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"func_",
",_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"morph",
"\\u",
"to_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get_",
"(_",
"self_",
",_",
"instance_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"instance_",
"._",
"morph",
"\\u",
"to_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"relation_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"type",
"\\u",
"column_",
",_",
"self_",
"._",
"\\u",
"id",
"\\u",
"column_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"wrapped_",
"=_",
"False_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"has",
"\\u",
"many_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Has",
" ",
"Many",
" ",
"relation",
"ship",
" ",
"decorat",
"or",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"relation",
"\\u",
"class_",
"=_",
"Has",
"Many",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"has",
"\\u",
"many_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"foreign",
"\\u",
"key_",
"=_",
"None_",
",_",
"local",
"\\u",
"key_",
"=_",
"None_",
",_",
"relation_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"foreign",
"\\u",
"key_",
",_",
"(_",
"types_",
"._",
"Function",
"Type_",
",_",
"types_",
"._",
"Meth",
"od",
"Type_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"func_",
"=_",
"foreign",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"foreign",
"\\u",
"key_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"func_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"foreign",
"\\u",
"key_",
"=_",
"foreign",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"local",
"\\u",
"key_",
"=_",
"local",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"super_",
"(_",
"has",
"\\u",
"many_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"func_",
",_",
"relation_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"has",
"\\u",
"many_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get_",
"(_",
"self_",
",_",
"instance_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"instance_",
"._",
"has",
"\\u",
"many_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"related_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"foreign",
"\\u",
"key_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"local",
"\\u",
"key_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"relation_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"wrapped_",
"=_",
"False_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"has",
"\\u",
"many",
"\\u",
"through_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Has",
" ",
"Many",
" ",
"Through",
" ",
"relation",
"ship",
" ",
"decorat",
"or",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"relation",
"\\u",
"class_",
"=_",
"Has",
"Many",
"Through",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"has",
"\\u",
"many",
"\\u",
"through_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"through_",
",_",
"first",
"\\u",
"key_",
"=_",
"None_",
",_",
"second",
"\\u",
"key_",
"=_",
"None_",
",_",
"relation_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"through_",
",_",
"(_",
"types_",
"._",
"Function",
"Type_",
",_",
"types_",
"._",
"Meth",
"od",
"Type_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Run",
"time",
"Error_",
"(_",
"'",
"has",
"\\u",
"many",
"\\u",
"through",
" ",
"relation",
" ",
"require",
"s",
" ",
"the",
" ",
"through",
" ",
"parameter",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"through_",
"=_",
"through_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"first",
"\\u",
"key_",
"=_",
"first",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"second",
"\\u",
"key_",
"=_",
"second",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"super_",
"(_",
"has",
"\\u",
"many",
"\\u",
"through_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"relation_",
"=_",
"relation_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"has",
"\\u",
"many",
"\\u",
"through_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get_",
"(_",
"self_",
",_",
"instance_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"instance_",
"._",
"has",
"\\u",
"many",
"\\u",
"through_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"related_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"through_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"first",
"\\u",
"key_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"second",
"\\u",
"key_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"relation_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"wrapped_",
"=_",
"False_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"morph",
"\\u",
"many_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Morph",
" ",
"Many",
" ",
"relation",
"ship",
" ",
"decorat",
"or",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"relation",
"\\u",
"class_",
"=_",
"Morph",
"Many",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"morph",
"\\u",
"many_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"name_",
",_",
"type",
"\\u",
"column_",
"=_",
"None_",
",_",
"id",
"\\u",
"column_",
"=_",
"None_",
",_",
"local",
"\\u",
"key_",
"=_",
"None_",
",_",
"relation_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"name_",
",_",
"(_",
"types_",
"._",
"Function",
"Type_",
",_",
"types_",
"._",
"Meth",
"od",
"Type_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Run",
"time",
"Error_",
"(_",
"'",
"morph",
"\\u",
"many",
" ",
"relation",
" ",
"require",
"s",
" ",
"a",
" ",
"name",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"name_",
"=_",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"type",
"\\u",
"column_",
"=_",
"type",
"\\u",
"column_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"id",
"\\u",
"column_",
"=_",
"id",
"\\u",
"column_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"local",
"\\u",
"key_",
"=_",
"local",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"super_",
"(_",
"morph",
"\\u",
"many_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"relation_",
"=_",
"relation_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"morph",
"\\u",
"many_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get_",
"(_",
"self_",
",_",
"instance_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"instance_",
"._",
"morph",
"\\u",
"many_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"related_",
",_",
"self_",
"._",
"\\u",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"type",
"\\u",
"column_",
",_",
"self_",
"._",
"\\u",
"id",
"\\u",
"column_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"local",
"\\u",
"key_",
",_",
"self_",
"._",
"\\u",
"relation_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"wrapped_",
"=_",
"False_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"belo",
"ngs",
"\\u",
"to",
"\\u",
"many_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Bel",
"ong",
"s",
" ",
"To",
" ",
"Many",
" ",
"relation",
"ship",
" ",
"decorat",
"or",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"relation",
"\\u",
"class_",
"=_",
"Bel",
"ong",
"s",
"To",
"Many",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"belo",
"ngs",
"\\u",
"to",
"\\u",
"many_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"table_",
"=_",
"None_",
",_",
"foreign",
"\\u",
"key_",
"=_",
"None_",
",_",
"other",
"\\u",
"key_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"relation_",
"=_",
"None_",
",_",
"with",
"\\u",
"timestamps_",
"=_",
"False_",
",_",
"with",
"\\u",
"pivot_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"table_",
",_",
"(_",
"types_",
"._",
"Function",
"Type_",
",_",
"types_",
"._",
"Meth",
"od",
"Type_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"func_",
"=_",
"table_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"table_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"func_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"table_",
"=_",
"table_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"foreign",
"\\u",
"key_",
"=_",
"foreign",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"other",
"\\u",
"key_",
"=_",
"other",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"timestamps_",
"=_",
"with",
"\\u",
"timestamps_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"pivot_",
"=_",
"with",
"\\u",
"pivot_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"super_",
"(_",
"belo",
"ngs",
"\\u",
"to",
"\\u",
"many_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"func_",
",_",
"relation_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"belo",
"ngs",
"\\u",
"to",
"\\u",
"many_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get_",
"(_",
"self_",
",_",
"instance_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"r_",
"=_",
"instance_",
"._",
"belo",
"ngs",
"\\u",
"to",
"\\u",
"many_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"related_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"table_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"foreign",
"\\u",
"key_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"other",
"\\u",
"key_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"relation_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"wrapped_",
"=_",
"False_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"self_",
"._",
"\\u",
"timestamps_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"r_",
"=_",
"r_",
"._",
"with",
"\\u",
"timestamps_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"self_",
"._",
"\\u",
"pivot_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"r_",
"=_",
"r_",
"._",
"with",
"\\u",
"pivot_",
"(_",
"*_",
"self_",
"._",
"\\u",
"pivot_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"r_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"morph",
"\\u",
"to",
"\\u",
"many_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Morph",
" ",
"To",
" ",
"Many",
" ",
"relation",
"ship",
" ",
"decorat",
"or",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"relation",
"\\u",
"class_",
"=_",
"Morph",
"To",
"Many",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"morph",
"\\u",
"to",
"\\u",
"many_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"name_",
",_",
"table_",
"=_",
"None_",
",_",
"foreign",
"\\u",
"key_",
"=_",
"None_",
",_",
"other",
"\\u",
"key_",
"=_",
"None_",
",_",
"relation_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"name_",
",_",
"(_",
"types_",
"._",
"Function",
"Type_",
",_",
"types_",
"._",
"Meth",
"od",
"Type_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Run",
"time",
"Error_",
"(_",
"'",
"morph",
"\\u",
"to",
"\\u",
"many",
" ",
"relation",
" ",
"require",
"d",
" ",
"a",
" ",
"name",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"name_",
"=_",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"table_",
"=_",
"table_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"foreign",
"\\u",
"key_",
"=_",
"foreign",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"other",
"\\u",
"key_",
"=_",
"other",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"super_",
"(_",
"morph",
"\\u",
"to",
"\\u",
"many_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"relation_",
"=_",
"relation_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"morph",
"\\u",
"to",
"\\u",
"many_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get_",
"(_",
"self_",
",_",
"instance_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"instance_",
"._",
"morph",
"\\u",
"to",
"\\u",
"many_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"related_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"table_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"foreign",
"\\u",
"key_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"other",
"\\u",
"key_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"relation_",
"=_",
"self_",
"._",
"\\u",
"relation_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"wrapped_",
"=_",
"False_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"morph",
"ed",
"\\u",
"by",
"\\u",
"many_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Morph",
"ed",
" ",
"By",
" ",
"Many",
" ",
"relation",
"ship",
" ",
"decorat",
"or",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"relation",
"\\u",
"class_",
"=_",
"Morph",
"To",
"Many",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"morph",
"ed",
"\\u",
"by",
"\\u",
"many_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"name_",
",_",
"table_",
"=_",
"None_",
",_",
"foreign",
"\\u",
"key_",
"=_",
"None_",
",_",
"other",
"\\u",
"key_",
"=_",
"None_",
",_",
"relation_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"isinstance_",
"(_",
"foreign",
"\\u",
"key_",
",_",
"(_",
"types_",
"._",
"Function",
"Type_",
",_",
"types_",
"._",
"Meth",
"od",
"Type_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Run",
"time",
"Error_",
"(_",
"'",
"morph",
"ed",
"\\u",
"by",
"\\u",
"many",
" ",
"relation",
" ",
"require",
"s",
" ",
"a",
" ",
"name",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"name_",
"=_",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"table_",
"=_",
"table_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"foreign",
"\\u",
"key_",
"=_",
"foreign",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"other",
"\\u",
"key_",
"=_",
"other",
"\\u",
"key_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"super_",
"(_",
"morph",
"ed",
"\\u",
"by",
"\\u",
"many_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"relation_",
"=_",
"relation_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"morph",
"ed",
"\\u",
"by",
"\\u",
"many_",
"(_",
"relation_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"get_",
"(_",
"self_",
",_",
"instance_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"instance_",
"._",
"morph",
"ed",
"\\u",
"by",
"\\u",
"many_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"related_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"table_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"foreign",
"\\u",
"key_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"other",
"\\u",
"key_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"relation_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"wrapped_",
"=_",
"False_",
"\\u\\u\\uNL\\u\\u\\u_",
")_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Except block handles 'BaseException' | bfontaine/term2048/tests/test_board.py | [
{
"content": "# -*- coding: UTF-8 -*-\n\nimport platform\n\nif platform.python_version() < '2.7':\n import unittest2 as unittest\nelse:\n import unittest\n\nif platform.python_version() < '3.0':\n import __builtin__\nelse:\n import builtins as __builtin__\n\nimport helpers\nfrom term2048 import board\nBoard = board.Board\n\n# PY3 compat\ntry:\n xrange\nexcept NameError:\n xrange = range\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Except",
"_",
"block_",
"handles_",
"'",
"Base",
"Except",
"ion",
"'_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#",
" ",
"-*-",
" ",
"codi",
"ng",
":",
" ",
"UT",
"F",
"-",
"8",
" ",
"-*-",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"platform_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"platform_",
"._",
"python",
"\\u",
"version_",
"(_",
")_",
"<_",
"'",
"2.7",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"unittest2_",
"as_",
"unittest_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"unittest_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"platform_",
"._",
"python",
"\\u",
"version_",
"(_",
")_",
"<_",
"'",
"3.0",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"\\u\\u",
"builtin\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"builtins_",
"as_",
"\\u\\u",
"builtin\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"import_",
"helpers_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"term",
"2048_",
"import_",
"board_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Board_",
"=_",
"board_",
"._",
"Board_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"PY",
"3",
" ",
"compat_",
"\\u\\u\\uNL\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"xrange_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Name",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"xrange_",
"=_",
"range_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Comparison of constants | pydata/pandas/pandas/io/sql.py | [
{
"content": " def read(self, coerce_float=True, parse_dates=None, columns=None,\n chunksize=None):\n\n if columns is not None and len(columns) > 0:\n from sqlalchemy import select\n cols = [self.table.c[n] for n in columns]\n if self.index is not None:\n [cols.insert(0, self.table.c[idx]) for idx in self.index[::-1]]\n sql_select = select(cols)\n else:\n sql_select = self.table.select()\n\n result = self.pd_sql.execute(sql_select)\n column_names = result.keys()\n\n if chunksize is not None:\n return self._query_iterator(result, chunksize, column_names,\n coerce_float=coerce_float,\n parse_dates=parse_dates)\n else:\n data = result.fetchall()\n self.frame = DataFrame.from_records(\n data, columns=column_names, coerce_float=coerce_float)\n\n self._harmonize_columns(parse_dates=parse_dates)\n\n if self.index is not None:\n self.frame.set_index(self.index, inplace=True)\n\n return self.frame",
"metadata": "root.SQLTable.read",
"header": "['class', 'SQLTable', '(', 'PandasObject', ')', ':', '___EOS___']",
"index": 790
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Compari",
"son_",
"of_",
"constants_",
"[SEP]_",
"class_",
"SQL",
"Table_",
"(_",
"Pan",
"das",
"Object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"read_",
"(_",
"self_",
",_",
"coerce",
"\\u",
"float_",
"=_",
"True_",
",_",
"parse",
"\\u",
"dates_",
"=_",
"None_",
",_",
"columns_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"chunksize_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"columns_",
"is_",
"not_",
"None_",
"and_",
"len_",
"(_",
"columns_",
")_",
">_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"sqlalchemy_",
"import_",
"select_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"cols_",
"=_",
"[_",
"self_",
"._",
"table_",
"._",
"c_",
"[_",
"n_",
"]_",
"for_",
"n_",
"in_",
"columns_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"self_",
"._",
"index_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"[_",
"cols_",
"._",
"insert_",
"(_",
"0_",
",_",
"self_",
"._",
"table_",
"._",
"c_",
"[_",
"idx_",
"]_",
")_",
"for_",
"idx_",
"in_",
"self_",
"._",
"index_",
"[_",
":_",
":_",
"-_",
"1_",
"]_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"sql",
"\\u",
"select_",
"=_",
"select_",
"(_",
"cols_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"sql",
"\\u",
"select_",
"=_",
"self_",
"._",
"table_",
"._",
"select_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"result_",
"=_",
"self_",
"._",
"pd",
"\\u",
"sql_",
"._",
"execute_",
"(_",
"sql",
"\\u",
"select_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"column",
"\\u",
"names_",
"=_",
"result_",
"._",
"keys_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"chunksize_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"\\u",
"query",
"\\u",
"iterator_",
"(_",
"result_",
",_",
"chunksize_",
",_",
"column",
"\\u",
"names_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"coerce",
"\\u",
"float_",
"=_",
"coerce",
"\\u",
"float_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"parse",
"\\u",
"dates_",
"=_",
"parse",
"\\u",
"dates_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"=_",
"result_",
"._",
"fetchall_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"frame_",
"=_",
"Data",
"Frame_",
"._",
"from",
"\\u",
"records_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"data_",
",_",
"columns_",
"=_",
"column",
"\\u",
"names_",
",_",
"coerce",
"\\u",
"float_",
"=_",
"coerce",
"\\u",
"float_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"harm",
"oni",
"ze",
"\\u",
"columns_",
"(_",
"parse",
"\\u",
"dates_",
"=_",
"parse",
"\\u",
"dates_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"self_",
"._",
"index_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"frame_",
"._",
"set\\u",
"index_",
"(_",
"self_",
"._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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | lepture/flask-wtf/tests/base.py | [
{
"content": " def create_app(self):\n app = Flask(__name__)\n app.secret_key = \"secret\"\n\n @app.route(\"/\", methods=(\"GET\", \"POST\"))\n def index():\n\n form = MyForm()\n if form.validate_on_submit():\n name = form.name.data.upper()\n else:\n name = ''\n\n return render_template(\"index.html\",\n form=form,\n name=name)\n\n @app.route(\"/simple/\", methods=(\"POST\",))\n def simple():\n form = SimpleForm()\n form.validate()\n assert form.csrf_enabled\n assert not form.validate()\n return \"OK\"\n\n @app.route(\"/two_forms/\", methods=(\"POST\",))\n def two_forms():\n form = SimpleForm()\n assert form.csrf_enabled\n assert form.validate()\n assert form.validate()\n form2 = SimpleForm()\n assert form2.csrf_enabled\n assert form2.validate()\n return \"OK\"\n\n @app.route(\"/hidden/\")\n def hidden():\n\n form = HiddenFieldsForm()\n return render_template(\"hidden.html\", form=form)\n\n @app.route(\"/ajax/\", methods=(\"POST\",))\n def ajax_submit():\n form = MyForm()\n if form.validate_on_submit():\n return jsonify(name=form.name.data,\n success=True,\n errors=None)\n\n return jsonify(name=None,\n #errors=form.errors,\n success=False)\n\n return app",
"metadata": "root.TestCase.create_app",
"header": "['class', 'TestCase', '(', 'object', ')', ':', '___EOS___']",
"index": 44
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Test",
"Case_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"create",
"\\u",
"app_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"app_",
"=_",
"Flask_",
"(_",
"\\u\\u",
"name\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"app_",
"._",
"secret",
"\\u",
"key_",
"=_",
"\"",
"secret",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"@_",
"app_",
"._",
"route_",
"(_",
"\"/\"_",
",_",
"methods_",
"=_",
"(_",
"\"",
"GET",
"\"_",
",_",
"\"",
"POST",
"\"_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"index_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"form_",
"=_",
"My",
"Form_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"form_",
"._",
"validat",
"e\\u",
"on",
"\\u",
"submit_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"name_",
"=_",
"form_",
"._",
"name_",
"._",
"data_",
"._",
"upper_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"name_",
"=_",
"''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"render",
"\\u",
"template_",
"(_",
"\"",
"index",
".",
"html",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"form_",
"=_",
"form_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"name_",
"=_",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"app_",
"._",
"route_",
"(_",
"\"/",
"simple",
"/\"_",
",_",
"methods_",
"=_",
"(_",
"\"",
"POST",
"\"_",
",_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"simple_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"form_",
"=_",
"Simple",
"Form_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"form_",
"._",
"validate_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"form_",
"._",
"csr",
"f",
"\\u",
"enabled_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"not_",
"form_",
"._",
"validate_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"\"",
"OK",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"app_",
"._",
"route_",
"(_",
"\"/",
"two",
"\\u",
"forms",
"/\"_",
",_",
"methods_",
"=_",
"(_",
"\"",
"POST",
"\"_",
",_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"two",
"\\u",
"forms_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"form_",
"=_",
"Simple",
"Form_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"form_",
"._",
"csr",
"f",
"\\u",
"enabled_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"form_",
"._",
"validate_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"form_",
"._",
"validate_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"form",
"2_",
"=_",
"Simple",
"Form_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"form",
"2_",
"._",
"csr",
"f",
"\\u",
"enabled_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"form",
"2_",
"._",
"validate_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"\"",
"OK",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"app_",
"._",
"route_",
"(_",
"\"/",
"hidden",
"/\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"hidden_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"form_",
"=_",
"Hi",
"dde",
"n",
"Field",
"s",
"Form_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"render",
"\\u",
"template_",
"(_",
"\"",
"hidden",
".",
"html",
"\"_",
",_",
"form_",
"=_",
"form_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"app_",
"._",
"route_",
"(_",
"\"/",
"aja",
"x",
"/\"_",
",_",
"methods_",
"=_",
"(_",
"\"",
"POST",
"\"_",
",_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"aja",
"x",
"\\u",
"submit_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"form_",
"=_",
"My",
"Form_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"form_",
"._",
"validat",
"e\\u",
"on",
"\\u",
"submit_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"jsonify_",
"(_",
"name_",
"=_",
"form_",
"._",
"name_",
"._",
"data_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"success_",
"=_",
"True_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"errors_",
"=_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"jsonify_",
"(_",
"name_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"error",
"s",
"=",
"form",
".",
"error",
"s",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"success_",
"=_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"app_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | steveniemitz/scales/scales/loadbalancer/aperture.py | [
{
"content": " def _ScheduleNextJitter(self):\n \"\"\"Schedule the aperture to jitter in a random amount of time between\n _jitter_min and _jitter_max.\n \"\"\"\n next_jitter = random.randint(self._jitter_min, self._jitter_max)\n now = LOW_RESOLUTION_TIME_SOURCE.now\n self._next_jitter = LOW_RESOLUTION_TIMER_QUEUE.Schedule(\n now + next_jitter, self._Jitter)",
"metadata": "root.ApertureBalancerSink._ScheduleNextJitter",
"header": "['class', 'ApertureBalancerSink', '(', 'HeapBalancerSink', ')', ':', '___EOS___']",
"index": 183
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Ape",
"rtu",
"re",
"Balance",
"r",
"Sink_",
"(_",
"Hea",
"p",
"Balance",
"r",
"Sink_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"Schedule",
"Ne",
"xt",
"Ji",
"tter_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Schedule",
" ",
"the",
" ",
"aperture",
" ",
"to",
" ",
"jitter",
" ",
"in",
" ",
"a",
" ",
"random",
" ",
"amo",
"unt",
" ",
"of",
" ",
"time",
" ",
"bet",
"ween",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\\u",
"jitter",
"\\u",
"min",
" ",
"and",
" ",
"\\u",
"jitter",
"\\u",
"max",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"next",
"\\u",
"jitter_",
"=_",
"random_",
"._",
"randint_",
"(_",
"self_",
"._",
"\\u",
"jitter",
"\\u",
"min_",
",_",
"self_",
"._",
"\\u",
"jitter",
"\\u",
"max_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"now_",
"=_",
"LOW",
"\\u",
"RESOL",
"UTION",
"\\u",
"TIME",
"\\u",
"SOURCE_",
"._",
"now_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"next",
"\\u",
"jitter_",
"=_",
"LOW",
"\\u",
"RESOL",
"UTION",
"\\u",
"TIMER",
"\\u",
"QUEUE",
"_",
"._",
"Schedule_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"now_",
"+_",
"next",
"\\u",
"jitter_",
",_",
"self_",
"._",
"\\u",
"Ji",
"tter_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Implicit string concatenation in a list | bt3gl/Neat-Problems-in-Python-and-Flask/USEFUL/snippets_and_examples_Flask/example_SQLAlchemy/app.py | [
{
"content": "@app.route('/', methods=['GET', 'POST'])\ndef index():\n form = NameForm()\n if form.validate_on_submit():\n user = User.query.filter_by(username=form.name.data).first()\n if user is None:\n user = User(username=form.name.data)\n db.session.add(user)\n session['known'] = False\n else:\n session['known'] = True\n session['name'] = form.name.data\n return redirect(url_for('index'))\n return render_template('index.html', form=form, name=session.get('name'),\n known=session.get('known', False))",
"metadata": "root.index",
"header": "['module', '___EOS___']",
"index": 59
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Implicit",
"_",
"string_",
"concate",
"nation_",
"in_",
"a_",
"list_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"app_",
"._",
"route_",
"(_",
"'/'_",
",_",
"methods_",
"=_",
"[_",
"'",
"GET",
"'_",
",_",
"'",
"POST",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"index_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"form_",
"=_",
"Name",
"Form_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"form_",
"._",
"validat",
"e\\u",
"on",
"\\u",
"submit_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"user_",
"=_",
"User_",
"._",
"query_",
"._",
"filter",
"\\u",
"by_",
"(_",
"username_",
"=_",
"form_",
"._",
"name_",
"._",
"data_",
")_",
"._",
"first_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"user_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"user_",
"=_",
"User_",
"(_",
"username_",
"=_",
"form_",
"._",
"name_",
"._",
"data_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"db_",
"._",
"session_",
"._",
"add_",
"(_",
"user_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"session_",
"[_",
"'",
"know",
"n",
"'_",
"]_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"session_",
"[_",
"'",
"know",
"n",
"'_",
"]_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"session_",
"[_",
"'",
"name",
"'_",
"]_",
"=_",
"form_",
"._",
"name_",
"._",
"data_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"redirect_",
"(_",
"url",
"\\u",
"for_",
"(_",
"'",
"index",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"render",
"\\u",
"template_",
"(_",
"'",
"index",
".",
"html",
"'_",
",_",
"form_",
"=_",
"form_",
",_",
"name_",
"=_",
"session_",
"._",
"get_",
"(_",
"'",
"name",
"'_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"known_",
"=_",
"session_",
"._",
"get_",
"(_",
"'",
"know",
"n",
"'_",
",_",
"False_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | juliarizza/web2courses/models/00_db.py | [
{
"content": "# -*- coding: utf-8 -*-\n\n#########################################################################\n## This scaffolding model makes your app work on Google App Engine too\n## File is released under public domain and you can use without limitations\n#########################################################################\n\n## if SSL/HTTPS is properly configured and you want all HTTP requests to\n## be redirected to HTTPS, uncomment the line below:\n# request.requires_https()\n\n## app configuration made easy. Look inside private/appconfig.ini\nfrom gluon.contrib.appconfig import AppConfig\n## once in production, remove reload=True to gain full speed\nmyconf = AppConfig(reload=True)\n\nresponse.formstyle = 'bootstrap3inline'\n\nif not request.env.web2py_runtime_gae:\n ## if NOT running on Google App Engine use SQLite or other DB\n db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size', cast=int), check_reserved=['all'])\nelse:\n ## connect to Google BigTable (optional 'google:datastore://namespace')\n db = DAL('google:datastore+ndb')\n ## store sessions and tickets there\n session.connect(request, response, db=db)\n ## or store session in Memcache, Redis, etc.\n ## from gluon.contrib.memdb import MEMDB\n ## from google.appengine.api.memcache import Client\n ## session.connect(request, response, db = MEMDB(Client()))\n\n## by default give a view/generic.extension to all actions from localhost\n## none otherwise. a pattern can be 'controller/function.extension'\nresponse.generic_patterns = ['*'] if request.is_local else []\n## choose a style for forms\nresponse.formstyle = myconf.take('forms.formstyle') # or 'bootstrap3_stacked' or 'bootstrap2' or other\nresponse.form_label_separator = myconf.take('forms.separator')\n\n## CKEditor for text fields! yay!\nfrom plugin_ckeditor import CKEditor\n\nckeditor = CKEditor(db)\nckeditor.define_tables()\n\n## (optional) optimize handling of static files\n# response.optimize_css = 'concat,minify,inline'\n# response.optimize_js = 'concat,minify,inline'\n## (optional) static assets folder versioning\n# response.static_version = '0.0.0'\n#########################################################################\n## Here is sample code if you need for\n## - email capabilities\n## - authentication (registration, login, logout, ... )\n## - authorization (role based authorization)\n## - services (xml, csv, json, xmlrpc, jsonrpc, amf, rss)\n## - old style crud actions\n## (more options discussed in gluon/tools.py)\n#########################################################################\n\nfrom gluon.tools import Auth, Service, PluginManager, Crud\n\nauth = Auth(db)\nservice = Service()\nplugins = PluginManager()\ncrud = Crud(db)\n\n## create all tables needed by auth if not custom tables\nauth.settings.extra_fields['auth_user'] = [\n Field('avatar', 'upload', requires=IS_EMPTY_OR(IS_IMAGE())),\n Field('bio', 'text')\n ]\nauth.define_tables(username=False, signature=False)\n\nimport logging\nlogger = logging.getLogger(\"web2py.app.%s\" % request.application)\nlogger.setLevel(logging.DEBUG)\n\n## configure email\nmail = auth.settings.mailer\nmail.settings.server = 'logging' if request.is_local else myconf.take('smtp.server')\nmail.settings.sender = myconf.take('smtp.sender')\nmail.settings.login = myconf.take('smtp.login')\n\n## configure auth policy\nauth.settings.registration_requires_verification = False\nauth.settings.registration_requires_approval = False\nauth.settings.reset_password_requires_verification = True\nauth.settings.create_user_groups = False\n\n#########################################################################\n## Define your tables below (or better in another model file) for example\n##\n## >>> db.define_table('mytable',Field('myfield','string'))\n##\n## Fields can be 'string','text','password','integer','double','boolean'\n## 'date','time','datetime','blob','upload', 'reference TABLENAME'\n## There is an implicit 'id integer autoincrement' field\n## Consult manual for more options, validators, etc.\n##\n## More API examples for controllers:\n##\n## >>> db.mytable.insert(myfield='value')\n## >>> rows=db(db.mytable.myfield=='value').select(db.mytable.ALL)\n## >>> for row in rows: print row.id, row.myfield\n#########################################################################\n\n## after defining tables, uncomment below to enable auditing\n# auth.enable_record_versioning(db)\n\n#groups\nif db(db.auth_group).count() == 0:\n db.auth_group.insert(role=\"Student\", description=\"Students group.\")\n db.auth_group.insert(role=\"Teacher\", description=\"Teachers group.\")\n db.auth_group.insert(role=\"Admin\", description=\"Admins group.\")\n db.commit()\nauth.settings.everybody_group_id = 1",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#",
" ",
"-*-",
" ",
"codi",
"ng",
":",
" ",
"utf",
"-",
"8",
" ",
"-*-",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"######",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"Thi",
"s",
" ",
"scaffold",
"ing",
" ",
"model",
" ",
"make",
"s",
" ",
"your",
" ",
"app",
" ",
"work",
" ",
"on",
" ",
"Goo",
"gle",
" ",
"App",
" ",
"Engine",
" ",
"too",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"File",
" ",
"is",
" ",
"released",
" ",
"under",
" ",
"public",
" ",
"domain",
" ",
"and",
" ",
"you",
" ",
"can",
" ",
"use",
" ",
"with",
"out",
" ",
"limit",
"ations_",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"######",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"if",
" ",
"SS",
"L",
"/",
"HTTP",
"S",
" ",
"is",
" ",
"proper",
"ly",
" ",
"configur",
"ed",
" ",
"and",
" ",
"you",
" ",
"want",
" ",
"all",
" ",
"HTTP",
" ",
"request",
"s",
" ",
"to_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"be",
" ",
"redirected",
" ",
"to",
" ",
"HTTP",
"S",
",",
" ",
"uncomm",
"ent",
" ",
"the",
" ",
"line",
" ",
"belo",
"w",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"request",
".",
"require",
"s",
"\\u",
"https",
"()",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"app",
" ",
"configura",
"tion",
" ",
"made",
" ",
"easy",
".",
" ",
"Look",
" ",
"insi",
"de",
" ",
"private",
"/",
"appc",
"onfi",
"g",
".",
"ini_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"gluon_",
"._",
"contrib_",
"._",
"appc",
"onfig_",
"import_",
"App",
"Config_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"##",
" ",
"onc",
"e",
" ",
"in",
" ",
"producti",
"on",
",",
" ",
"remove",
" ",
"relo",
"ad",
"=",
"Tru",
"e",
" ",
"to",
" ",
"gain",
" ",
"full",
" ",
"speed_",
"\\u\\u\\uNL\\u\\u\\u_",
"myco",
"nf_",
"=_",
"App",
"Config_",
"(_",
"reload_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"response_",
"._",
"forms",
"tyle_",
"=_",
"'",
"boots",
"trap",
"3",
"inline",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"not_",
"request_",
"._",
"env_",
"._",
"web",
"2py",
"\\u",
"runt",
"ime",
"\\u",
"gae",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"##",
" ",
"if",
" ",
"NOT",
" ",
"runn",
"ing",
" ",
"on",
" ",
"Goo",
"gle",
" ",
"App",
" ",
"Engine",
" ",
"use",
" ",
"SQL",
"ite",
" ",
"or",
" ",
"other",
" ",
"DB_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"db_",
"=_",
"DA",
"L_",
"(_",
"myco",
"nf_",
"._",
"take_",
"(_",
"'",
"db",
".",
"uri",
"'_",
")_",
",_",
"pool",
"\\u",
"size_",
"=_",
"myco",
"nf_",
"._",
"take_",
"(_",
"'",
"db",
".",
"pool",
"\\u",
"size",
"'_",
",_",
"cast_",
"=_",
"int_",
")_",
",_",
"check",
"\\u",
"reserved_",
"=_",
"[_",
"'",
"all",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"##",
" ",
"connect",
" ",
"to",
" ",
"Goo",
"gle",
" ",
"Big",
"Table",
" ",
"(",
"option",
"al",
" ",
"'",
"google",
":",
"datast",
"ore",
"://",
"namespace",
"')",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"db_",
"=_",
"DA",
"L_",
"(_",
"'",
"google",
":",
"datast",
"ore",
"+",
"ndb",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"##",
" ",
"store",
" ",
"session",
"s",
" ",
"and",
" ",
"tick",
"ets",
" ",
"there",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"session_",
"._",
"connect_",
"(_",
"request_",
",_",
"response_",
",_",
"db_",
"=_",
"db_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"##",
" ",
"or",
" ",
"store",
" ",
"session",
" ",
"in",
" ",
"Memcache",
",",
" ",
"Red",
"is",
",",
" ",
"etc",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"from",
" ",
"glu",
"on",
".",
"contrib",
".",
"mem",
"db",
" ",
"import",
" ",
"MEM",
"DB_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"from",
" ",
"google",
".",
"appengine",
".",
"api",
".",
"memc",
"ache",
" ",
"import",
" ",
"Client_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"session",
".",
"connect",
"(",
"request",
",",
" ",
"response",
",",
" ",
"db",
" ",
"=",
" ",
"MEM",
"DB",
"(",
"Client",
"())",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"by",
" ",
"default",
" ",
"give",
" ",
"a",
" ",
"view",
"/",
"gener",
"ic",
".",
"extensi",
"on",
" ",
"to",
" ",
"all",
" ",
"action",
"s",
" ",
"from",
" ",
"local",
"host_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"none",
" ",
"other",
"wis",
"e",
".",
" ",
"a",
" ",
"pattern",
" ",
"can",
" ",
"be",
" ",
"'",
"controlle",
"r",
"/",
"function",
".",
"extensi",
"on",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"response_",
"._",
"gener",
"ic",
"\\u",
"patterns_",
"=_",
"[_",
"'*'_",
"]_",
"if_",
"request_",
"._",
"is",
"\\u",
"local_",
"else_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"##",
" ",
"choose",
" ",
"a",
" ",
"style",
" ",
"for",
" ",
"forms_",
"\\u\\u\\uNL\\u\\u\\u_",
"response_",
"._",
"forms",
"tyle_",
"=_",
"myco",
"nf_",
"._",
"take_",
"(_",
"'",
"forms",
".",
"forms",
"tyl",
"e",
"'_",
")_",
"#",
" ",
"or",
" ",
"'",
"boots",
"trap",
"3",
"\\u",
"stacked",
"'",
" ",
"or",
" ",
"'",
"boots",
"trap",
"2",
"'",
" ",
"or",
" ",
"other_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"response_",
"._",
"form",
"\\u",
"label",
"\\u",
"separator_",
"=_",
"myco",
"nf_",
"._",
"take_",
"(_",
"'",
"forms",
".",
"separator",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"CK",
"Edit",
"or",
" ",
"for",
" ",
"text",
" ",
"fields",
"!",
" ",
"ya",
"y",
"!",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"plugin",
"\\u",
"cked",
"itor",
"_",
"import_",
"CK",
"Editor_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"cked",
"itor",
"_",
"=_",
"CK",
"Editor_",
"(_",
"db_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"cked",
"itor",
"_",
"._",
"defin",
"e\\u",
"tables_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"(",
"option",
"al",
")",
" ",
"optimize",
" ",
"handling",
" ",
"of",
" ",
"static",
" ",
"files_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"response",
".",
"optimize",
"\\u",
"css",
" ",
"=",
" ",
"'",
"conc",
"at",
",",
"minif",
"y",
",",
"inline",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"response",
".",
"optimize",
"\\u",
"js",
" ",
"=",
" ",
"'",
"conc",
"at",
",",
"minif",
"y",
",",
"inline",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"(",
"option",
"al",
")",
" ",
"static",
" ",
"asset",
"s",
" ",
"folder",
" ",
"versioning",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"response",
".",
"static",
"\\u",
"version",
" ",
"=",
" ",
"'",
"0.",
"0.",
"0",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"######",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"Her",
"e",
" ",
"is",
" ",
"sample",
" ",
"code",
" ",
"if",
" ",
"you",
" ",
"need",
" ",
"for_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"-",
" ",
"email",
" ",
"capabilities_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"-",
" ",
"authenticat",
"ion",
" ",
"(",
"registration",
",",
" ",
"login",
",",
" ",
"logo",
"ut",
",",
" ",
"...",
" ",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"-",
" ",
"authoriz",
"ation",
" ",
"(",
"role",
" ",
"based",
" ",
"authoriz",
"ation",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"-",
" ",
"service",
"s",
" ",
"(",
"xml",
",",
" ",
"csv",
",",
" ",
"json",
",",
" ",
"xmlrpc",
",",
" ",
"jsonrpc",
",",
" ",
"am",
"f",
",",
" ",
"rs",
"s",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"-",
" ",
"old",
" ",
"style",
" ",
"crud",
" ",
"actions_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"(",
"more",
" ",
"options",
" ",
"discuss",
"ed",
" ",
"in",
" ",
"glu",
"on",
"/",
"tool",
"s",
".",
"py",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"######",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"gluon_",
"._",
"tools_",
"import_",
"Auth_",
",_",
"Service_",
",_",
"Plug",
"in",
"Manager_",
",_",
"Cru",
"d_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"auth_",
"=_",
"Auth_",
"(_",
"db_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"service_",
"=_",
"Service_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"plugins_",
"=_",
"Plug",
"in",
"Manager_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"crud",
"_",
"=_",
"Cru",
"d_",
"(_",
"db_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"create",
" ",
"all",
" ",
"tables",
" ",
"need",
"ed",
" ",
"by",
" ",
"auth",
" ",
"if",
" ",
"not",
" ",
"custom",
" ",
"tables_",
"\\u\\u\\uNL\\u\\u\\u_",
"auth_",
"._",
"settings_",
"._",
"extra",
"\\u",
"fields_",
"[_",
"'",
"auth",
"\\u",
"user",
"'_",
"]_",
"=_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"Field_",
"(_",
"'",
"avat",
"ar",
"'_",
",_",
"'",
"upload",
"'_",
",_",
"requires_",
"=_",
"IS",
"\\u",
"EMP",
"TY",
"\\u",
"OR_",
"(_",
"IS",
"\\u",
"IMAGE_",
"(_",
")_",
")_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Field_",
"(_",
"'",
"bio",
"'_",
",_",
"'",
"text",
"'_",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"auth_",
"._",
"defin",
"e\\u",
"tables_",
"(_",
"username_",
"=_",
"False_",
",_",
"signature_",
"=_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"logging_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"logger_",
"=_",
"logging_",
"._",
"get",
"Logger_",
"(_",
"\"",
"web",
"2py",
".",
"app",
".",
"%",
"s",
"\"_",
"%_",
"request_",
"._",
"application_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"logger_",
"._",
"set",
"Level_",
"(_",
"logging_",
"._",
"DEBUG_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"configur",
"e",
" ",
"email_",
"\\u\\u\\uNL\\u\\u\\u_",
"mail_",
"=_",
"auth_",
"._",
"settings_",
"._",
"mailer",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mail_",
"._",
"settings_",
"._",
"server_",
"=_",
"'",
"logg",
"ing",
"'_",
"if_",
"request_",
"._",
"is",
"\\u",
"local_",
"else_",
"myco",
"nf_",
"._",
"take_",
"(_",
"'",
"smt",
"p",
".",
"server",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mail_",
"._",
"settings_",
"._",
"sender_",
"=_",
"myco",
"nf_",
"._",
"take_",
"(_",
"'",
"smt",
"p",
".",
"sender",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"mail_",
"._",
"settings_",
"._",
"login_",
"=_",
"myco",
"nf_",
"._",
"take_",
"(_",
"'",
"smt",
"p",
".",
"login",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"configur",
"e",
" ",
"auth",
" ",
"policy_",
"\\u\\u\\uNL\\u\\u\\u_",
"auth_",
"._",
"settings_",
"._",
"registration",
"\\u",
"require",
"s",
"\\u",
"verification",
"_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"auth_",
"._",
"settings_",
"._",
"registration",
"\\u",
"require",
"s",
"\\u",
"approval",
"_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"auth_",
"._",
"settings_",
"._",
"reset",
"\\u",
"password",
"\\u",
"require",
"s",
"\\u",
"verification",
"_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"auth_",
"._",
"settings_",
"._",
"create",
"\\u",
"user",
"\\u",
"groups_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"######",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"Define",
" ",
"your",
" ",
"tables",
" ",
"belo",
"w",
" ",
"(",
"or",
" ",
"bett",
"er",
" ",
"in",
" ",
"anot",
"her",
" ",
"model",
" ",
"file",
")",
" ",
"for",
" ",
"example_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
">>>",
" ",
"db",
".",
"defin",
"e\\u",
"table",
"('",
"myt",
"able",
"',",
"Field",
"('",
"myfi",
"eld",
"','",
"string",
"'))",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"Field",
"s",
" ",
"can",
" ",
"be",
" ",
"'",
"string",
"','",
"text",
"','",
"password",
"','",
"integ",
"er",
"','",
"double",
"','",
"boolean",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
" ",
" ",
"'",
"date",
"','",
"time",
"','",
"datetime",
"','",
"blob",
"','",
"upload",
"',",
" ",
"'",
"reference",
" ",
"TAB",
"LEN",
"AME",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"There",
" ",
"is",
" ",
"an",
" ",
"implicit",
" ",
"'",
"id",
" ",
"integ",
"er",
" ",
"autoi",
"ncr",
"ement",
"'",
" ",
"field_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"Consult",
" ",
"manu",
"al",
" ",
"for",
" ",
"more",
" ",
"options",
",",
" ",
"validator",
"s",
",",
" ",
"etc",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"Mor",
"e",
" ",
"API",
" ",
"example",
"s",
" ",
"for",
" ",
"controlle",
"rs",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
">>>",
" ",
"db",
".",
"myt",
"able",
".",
"insert",
"(",
"myfi",
"eld",
"='",
"value",
"')",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
">>>",
" ",
"rows",
"=",
"db",
"(",
"db",
".",
"myt",
"able",
".",
"myfi",
"eld",
"=='",
"value",
"')",
".",
"select",
"(",
"db",
".",
"myt",
"able",
".",
"ALL",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
">>>",
" ",
"for",
" ",
"row",
" ",
"in",
" ",
"rows",
":",
" ",
"print",
" ",
"row",
".",
"id",
",",
" ",
"row",
".",
"myfi",
"eld_",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"######",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"##",
" ",
"after",
" ",
"defini",
"ng",
" ",
"tables",
",",
" ",
"uncomm",
"ent",
" ",
"belo",
"w",
" ",
"to",
" ",
"enable",
" ",
"audit",
"ing_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"auth",
".",
"enable",
"\\u",
"record",
"\\u",
"versioning",
"(",
"db",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"groups_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"db_",
"(_",
"db_",
"._",
"auth",
"\\u",
"group_",
")_",
"._",
"count_",
"(_",
")_",
"==_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"db_",
"._",
"auth",
"\\u",
"group_",
"._",
"insert_",
"(_",
"role_",
"=_",
"\"",
"Stud",
"ent",
"\"_",
",_",
"description_",
"=_",
"\"",
"Stud",
"ents",
" ",
"group",
".\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"db_",
"._",
"auth",
"\\u",
"group_",
"._",
"insert_",
"(_",
"role_",
"=_",
"\"",
"Teacher",
"\"_",
",_",
"description_",
"=_",
"\"",
"Teacher",
"s",
" ",
"group",
".\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"db_",
"._",
"auth",
"\\u",
"group_",
"._",
"insert_",
"(_",
"role_",
"=_",
"\"",
"Admi",
"n",
"\"_",
",_",
"description_",
"=_",
"\"",
"Admi",
"ns",
" ",
"group",
".\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"db_",
"._",
"commit_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"auth_",
"._",
"settings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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | weecology/retriever/test/test_integration.py | [
{
"content": "\"\"\"Integrations tests for EcoData Retriever\"\"\"\n\nimport imp\nimport os\nimport shutil\nfrom retriever.lib.compile import compile_script\nfrom retriever import HOME_DIR, ENGINE_LIST\n\nsimple_csv = {'name': 'simple_csv',\n 'raw_data': \"a,b,c\\n1,2,3\\n4,5,6\\n\",\n 'script': \"shortname: simple_csv\\ntable: simple_csv, http://example.com/simple_csv.txt\",\n 'expect_out': '\"record_id\",\"a\",\"b\",\"c\"\\n1,1,2,3\\n2,4,5,6'}\n\ncrosstab = {'name': 'crosstab',\n 'raw_data': \"a,b,c1,c2\\n1,1,1.1,1.2\\n1,2,2.1,2.2\",\n 'script': \"shortname: crosstab\\ntable: crosstab, http://example.com/crosstab.txt\\n*column: record_id, pk-auto\\n*column: a, int\\n*column: b, int\\n*ct_column: c\\n*column: val, ct-double\\n*ct_names: c1,c2\",\n 'expect_out': '\"record_id\",\"a\",\"b\",\"c\",\"val\"\\n3,1,1,\"c1\",1.1\\n4,1,1,\"c2\",1.2\\n5,1,2,\"c1\",2.1\\n6,1,2,\"c2\",2.2'}\n\ntests = [simple_csv, crosstab]\n\n\n\n\nmysql_engine, postgres_engine, sqlite_engine, msaccess_engine, csv_engine, download_engine, json_engine, xml_engine = ENGINE_LIST()\ncsv_engine.opts = {'engine': 'csv', 'table_name': './{db}_{table}.txt'}\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "def setup_module():\n \"\"\"Put raw data and scripts in appropriate .retriever directories\"\"\"\n for test in tests:\n if not os.path.exists(os.path.join(HOME_DIR, \"raw_data\", test['name'])):\n os.makedirs(os.path.join(HOME_DIR, \"raw_data\", test['name']))\n with open(os.path.join(HOME_DIR, \"raw_data\", test['name'], test['name'] + '.txt'), 'w') as data_file:\n data_file.write(test['raw_data'])\n with open(os.path.join(HOME_DIR, \"scripts\", test['name'] + '.script'), 'w') as script_file:\n script_file.write(test['script'])\n compile_script(os.path.join(HOME_DIR, \"scripts\", test['name']))",
"metadata": "root.setup_module",
"header": "['module', '___EOS___']",
"index": 20
},
{
"content": "def teardown_module():\n \"\"\"Remove test data and scripts from .retriever directories\"\"\"\n for test in tests:\n shutil.rmtree(os.path.join(HOME_DIR, \"raw_data\", test['name']))\n os.remove(os.path.join(HOME_DIR, \"scripts\", test['name'] + '.script'))",
"metadata": "root.teardown_module",
"header": "['module', '___EOS___']",
"index": 31
},
{
"content": "def get_script_module(script_name):\n \"\"\"Load a script module\"\"\"\n file, pathname, desc = imp.find_module(script_name, [os.path.join(HOME_DIR, \"scripts\")])\n return imp.load_module(script_name, file, pathname, desc)",
"metadata": "root.get_script_module",
"header": "['module', '___EOS___']",
"index": 37
},
{
"content": "def test_csv_from_csv():\n simple_csv_module = get_script_module('simple_csv')\n simple_csv_module.SCRIPT.download(csv_engine)\n simple_csv_module.SCRIPT.engine.disconnect()\n with open(\"simple_csv_simple_csv.txt\", 'r') as obs_out_file:\n obs_out = obs_out_file.read()\n print len(obs_out)\n assert obs_out == simple_csv['expect_out']",
"metadata": "root.test_csv_from_csv",
"header": "['module', '___EOS___']",
"index": 45
},
{
"content": "def test_crosstab_from_csv():\n crosstab_module = get_script_module('crosstab')\n crosstab_module.SCRIPT.download(csv_engine)\n crosstab_module.SCRIPT.engine.disconnect()\n with open(\"crosstab_crosstab.txt\", 'r') as obs_out_file:\n obs_out = obs_out_file.read()\n print len(obs_out)\n assert obs_out == crosstab['expect_out']",
"metadata": "root.test_crosstab_from_csv",
"header": "['module', '___EOS___']",
"index": 54
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\"\"\"",
"Integrati",
"ons",
" ",
"tests",
" ",
"for",
" ",
"Eco",
"Data",
" ",
"Retrieve",
"r",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"imp_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"os_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"shutil_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"retrieve",
"r_",
"._",
"lib_",
"._",
"compile_",
"import_",
"compile",
"\\u",
"script_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"retrieve",
"r_",
"import_",
"HOM",
"E",
"\\u",
"DIR_",
",_",
"ENGINE",
"\\u",
"LIST_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"simple",
"\\u",
"csv_",
"=_",
"{_",
"'",
"name",
"'_",
":_",
"'",
"simple",
"\\u",
"csv",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"raw",
"\\u",
"data",
"'_",
":_",
"\"",
"a",
",",
"b",
",",
"c",
"\\\\",
"n1",
",",
"2",
",",
"3",
"\\\\",
"n4",
",",
"5",
",",
"6",
"\\\\",
"n",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"script",
"'_",
":_",
"\"",
"short",
"name",
":",
" ",
"simple",
"\\u",
"csv",
"\\\\",
"nta",
"ble",
":",
" ",
"simple",
"\\u",
"csv",
",",
" ",
"http",
"://",
"example",
".",
"com",
"/",
"simple",
"\\u",
"csv",
".",
"txt",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"expect",
"\\u",
"out",
"'_",
":_",
"'\"",
"record",
"\\u",
"id",
"\",\"",
"a",
"\",\"",
"b",
"\",\"",
"c",
"\"\\\\",
"n1",
",",
"1",
",",
"2",
",",
"3",
"\\\\",
"n2",
",",
"4",
",",
"5",
",",
"6",
"'_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"cross",
"tab_",
"=_",
"{_",
"'",
"name",
"'_",
":_",
"'",
"cross",
"tab",
"'_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"raw",
"\\u",
"data",
"'_",
":_",
"\"",
"a",
",",
"b",
",",
"c1",
",",
"c2",
"\\\\",
"n1",
",",
"1",
",",
"1.1",
",",
"1.2",
"\\\\",
"n1",
",",
"2",
",",
"2.1",
",",
"2.2",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"script",
"'_",
":_",
"\"",
"short",
"name",
":",
" ",
"cross",
"tab",
"\\\\",
"nta",
"ble",
":",
" ",
"cross",
"tab",
",",
" ",
"http",
"://",
"example",
".",
"com",
"/",
"cross",
"tab",
".",
"txt",
"\\\\",
"n",
"*",
"column",
":",
" ",
"record",
"\\u",
"id",
",",
" ",
"pk",
"-",
"auto",
"\\\\",
"n",
"*",
"column",
":",
" ",
"a",
",",
" ",
"int",
"\\\\",
"n",
"*",
"column",
":",
" ",
"b",
",",
" ",
"int",
"\\\\",
"n",
"*",
"ct",
"\\u",
"column",
":",
" ",
"c",
"\\\\",
"n",
"*",
"column",
":",
" ",
"val",
",",
" ",
"ct",
"-",
"double",
"\\\\",
"n",
"*",
"ct",
"\\u",
"names",
":",
" ",
"c1",
",",
"c2",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"'",
"expect",
"\\u",
"out",
"'_",
":_",
"'\"",
"record",
"\\u",
"id",
"\",\"",
"a",
"\",\"",
"b",
"\",\"",
"c",
"\",\"",
"val",
"\"\\\\",
"n",
"3",
",",
"1",
",",
"1",
",\"",
"c1",
"\",",
"1.1",
"\\\\",
"n4",
",",
"1",
",",
"1",
",\"",
"c2",
"\",",
"1.2",
"\\\\",
"n",
"5",
",",
"1",
",",
"2",
",\"",
"c1",
"\",",
"2.1",
"\\\\",
"n",
"6",
",",
"1",
",",
"2",
",\"",
"c2",
"\",",
"2.2",
"'_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"tests_",
"=_",
"[_",
"simple",
"\\u",
"csv_",
",_",
"cross",
"tab_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"mysql",
"\\u",
"engine_",
",_",
"postgres",
"\\u",
"engine_",
",_",
"sql",
"ite",
"\\u",
"engine_",
",_",
"msa",
"ccess",
"\\u",
"engine_",
",_",
"csv",
"\\u",
"engine_",
",_",
"download",
"\\u",
"engine_",
",_",
"json",
"\\u",
"engine_",
",_",
"xml",
"\\u",
"engine_",
"=_",
"ENGINE",
"\\u",
"LIST_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"csv",
"\\u",
"engine_",
"._",
"opts_",
"=_",
"{_",
"'",
"eng",
"ine",
"'_",
":_",
"'",
"csv",
"'_",
",_",
"'",
"table",
"\\u",
"name",
"'_",
":_",
"'./",
"{",
"db",
"}\\u",
"{",
"table",
"}.",
"txt",
"'_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"setup",
"\\u",
"module_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Put",
" ",
"raw",
" ",
"data",
" ",
"and",
" ",
"scripts",
" ",
"in",
" ",
"appropr",
"iate",
" ",
".",
"retrieve",
"r",
" ",
"director",
"ies",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"test_",
"in_",
"tests_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"os_",
"._",
"path_",
"._",
"exists_",
"(_",
"os_",
"._",
"path_",
"._",
"join_",
"(_",
"HOM",
"E",
"\\u",
"DIR_",
",_",
"\"",
"raw",
"\\u",
"data",
"\"_",
",_",
"test_",
"[_",
"'",
"name",
"'_",
"]_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"os_",
"._",
"makedirs_",
"(_",
"os_",
"._",
"path_",
"._",
"join_",
"(_",
"HOM",
"E",
"\\u",
"DIR_",
",_",
"\"",
"raw",
"\\u",
"data",
"\"_",
",_",
"test_",
"[_",
"'",
"name",
"'_",
"]_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"open_",
"(_",
"os_",
"._",
"path_",
"._",
"join_",
"(_",
"HOM",
"E",
"\\u",
"DIR_",
",_",
"\"",
"raw",
"\\u",
"data",
"\"_",
",_",
"test_",
"[_",
"'",
"name",
"'_",
"]_",
",_",
"test_",
"[_",
"'",
"name",
"'_",
"]_",
"+_",
"'.",
"txt",
"'_",
")_",
",_",
"'",
"w",
"'_",
")_",
"as_",
"data\\u",
"file_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data\\u",
"file_",
"._",
"write_",
"(_",
"test_",
"[_",
"'",
"raw",
"\\u",
"data",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"open_",
"(_",
"os_",
"._",
"path_",
"._",
"join_",
"(_",
"HOM",
"E",
"\\u",
"DIR_",
",_",
"\"",
"scripts",
"\"_",
",_",
"test_",
"[_",
"'",
"name",
"'_",
"]_",
"+_",
"'.",
"script",
"'_",
")_",
",_",
"'",
"w",
"'_",
")_",
"as_",
"script",
"\\u",
"file_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"script",
"\\u",
"file_",
"._",
"write_",
"(_",
"test_",
"[_",
"'",
"script",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"compile",
"\\u",
"script_",
"(_",
"os_",
"._",
"path_",
"._",
"join_",
"(_",
"HOM",
"E",
"\\u",
"DIR_",
",_",
"\"",
"scripts",
"\"_",
",_",
"test_",
"[_",
"'",
"name",
"'_",
"]_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"tear",
"down",
"\\u",
"module_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Remove",
" ",
"test",
" ",
"data",
" ",
"and",
" ",
"scripts",
" ",
"from",
" ",
".",
"retrieve",
"r",
" ",
"director",
"ies",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"test_",
"in_",
"tests_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"shutil_",
"._",
"rmtree_",
"(_",
"os_",
"._",
"path_",
"._",
"join_",
"(_",
"HOM",
"E",
"\\u",
"DIR_",
",_",
"\"",
"raw",
"\\u",
"data",
"\"_",
",_",
"test_",
"[_",
"'",
"name",
"'_",
"]_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"os_",
"._",
"remove_",
"(_",
"os_",
"._",
"path_",
"._",
"join_",
"(_",
"HOM",
"E",
"\\u",
"DIR_",
",_",
"\"",
"scripts",
"\"_",
",_",
"test_",
"[_",
"'",
"name",
"'_",
"]_",
"+_",
"'.",
"script",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"script",
"\\u",
"module_",
"(_",
"script",
"\\u",
"name_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Load",
" ",
"a",
" ",
"script",
" ",
"module",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"file_",
",_",
"pathname_",
",_",
"desc_",
"=_",
"imp_",
"._",
"find",
"\\u",
"module_",
"(_",
"script",
"\\u",
"name_",
",_",
"[_",
"os_",
"._",
"path_",
"._",
"join_",
"(_",
"HOM",
"E",
"\\u",
"DIR_",
",_",
"\"",
"scripts",
"\"_",
")_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"imp_",
"._",
"load",
"\\u",
"module_",
"(_",
"script",
"\\u",
"name_",
",_",
"file_",
",_",
"pathname_",
",_",
"desc_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"test\\u",
"csv",
"\\u",
"from",
"\\u",
"csv_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"simple",
"\\u",
"csv",
"\\u",
"module_",
"=_",
"get",
"\\u",
"script",
"\\u",
"module_",
"(_",
"'",
"simple",
"\\u",
"csv",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"simple",
"\\u",
"csv",
"\\u",
"module_",
"._",
"SCRIPT_",
"._",
"download_",
"(_",
"csv",
"\\u",
"engine_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"simple",
"\\u",
"csv",
"\\u",
"module_",
"._",
"SCRIPT_",
"._",
"engine_",
"._",
"disconnect_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"open_",
"(_",
"\"",
"simple",
"\\u",
"csv",
"\\u",
"simple",
"\\u",
"csv",
".",
"txt",
"\"_",
",_",
"'",
"r",
"'_",
")_",
"as_",
"obs",
"\\u",
"out",
"\\u",
"file_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"obs",
"\\u",
"out_",
"=_",
"obs",
"\\u",
"out",
"\\u",
"file_",
"._",
"read_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"print_",
"len_",
"(_",
"obs",
"\\u",
"out_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"obs",
"\\u",
"out_",
"==_",
"simple",
"\\u",
"csv_",
"[_",
"'",
"expect",
"\\u",
"out",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"cross",
"tab",
"\\u",
"from",
"\\u",
"csv_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"cross",
"tab",
"\\u",
"module_",
"=_",
"get",
"\\u",
"script",
"\\u",
"module_",
"(_",
"'",
"cross",
"tab",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"cross",
"tab",
"\\u",
"module_",
"._",
"SCRIPT_",
"._",
"download_",
"(_",
"csv",
"\\u",
"engine_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"cross",
"tab",
"\\u",
"module_",
"._",
"SCRIPT_",
"._",
"engine_",
"._",
"disconnect_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"open_",
"(_",
"\"",
"cross",
"tab",
"\\u",
"cross",
"tab",
".",
"txt",
"\"_",
",_",
"'",
"r",
"'_",
")_",
"as_",
"obs",
"\\u",
"out",
"\\u",
"file_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"obs",
"\\u",
"out_",
"=_",
"obs",
"\\u",
"out",
"\\u",
"file_",
"._",
"read_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"print_",
"len_",
"(_",
"obs",
"\\u",
"out_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"assert_",
"obs",
"\\u",
"out_",
"==_",
"cross",
"tab_",
"[_",
"'",
"expect",
"\\u",
"out",
"'_",
"]_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2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,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | ga4gh/server/tests/datadriven/test_sequenceAnnotations.py | [
{
"content": "\"\"\"\nData-driven tests for sequence annotation Features.\n\"\"\"\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport ga4gh.datarepo as datarepo\nimport ga4gh.datamodel as datamodel\nimport ga4gh.datamodel.datasets as datasets\nimport ga4gh.datamodel.sequenceAnnotations as sequenceAnnotations\nimport ga4gh.protocol as protocol\nimport tests.datadriven as datadriven\n\n_datasetName = \"ds\"\n\n_discontinuousTestData = {\n \"featureSetName\": \"discontinuous\",\n \"referenceName\": \"apidb|Pf3D7_13\",\n \"totalFeatures\": 30,\n \"sampleFeatureId\": 4409955920,\n \"sampleParentId\": 4409956112,\n \"sampleStart\": 820942,\n \"sampleEnd\": 821379,\n \"sampleStrand\": protocol.Strand.POS_STRAND,\n \"sampleSiblings\": 2,\n \"region\": [0, 2**32],\n \"ontologyRestriction\": [\"gene\", ],\n \"featuresWithOntology\": 3\n}\n\n_gencodeV21Set1TestData = {\n \"featureSetName\": \"gencodeV21Set1\",\n \"referenceName\": \"chr1\",\n \"totalFeatures\": 543,\n \"sampleFeatureId\": 4397111632,\n \"sampleParentId\": 4397111312,\n \"sampleStart\": 804776,\n \"sampleEnd\": 804832,\n \"sampleStrand\": protocol.Strand.POS_STRAND,\n \"sampleSiblings\": 5,\n \"region\": [0, 2**32],\n \"ontologyRestriction\": [\"gene\", ],\n \"featuresWithOntology\": 58\n}\n\n_sacCerTestTestData = {\n \"featureSetName\": \"sacCerTest\",\n \"referenceName\": \"chrI\",\n \"totalFeatures\": 33,\n \"sampleFeatureId\": 4324354512,\n \"sampleParentId\": None,\n \"sampleStart\": 337,\n \"sampleEnd\": 801,\n \"sampleStrand\": protocol.Strand.NEG_STRAND,\n \"sampleSiblings\": 20,\n \"region\": [0, 2**32],\n \"ontologyRestriction\": [\"gene\", ],\n \"featuresWithOntology\": 11\n}\n\n_specialCasesTestTestData = {\n \"featureSetName\": \"specialCasesTest\",\n \"referenceName\": \"2L\",\n \"totalFeatures\": 4,\n \"sampleFeatureId\": 4554844304,\n \"sampleParentId\": None,\n \"sampleStart\": 22229583,\n \"sampleEnd\": 22229699,\n \"sampleStrand\": protocol.Strand.NEG_STRAND,\n \"sampleSiblings\": 2,\n \"region\": [0, 2**32],\n \"ontologyRestriction\": [\"gene\", ],\n \"featuresWithOntology\": 0\n}\n\n_testDataForFeatureSetName = {\n \"discontinuous\": _discontinuousTestData,\n \"gencodeV21Set1\": _gencodeV21Set1TestData,\n \"sacCerTest\": _sacCerTestTestData,\n \"specialCasesTest\": _specialCasesTestTestData\n}\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "def _getFeatureCompoundId(dataSetName, featureSetName, featureId):\n splits = [dataSetName, featureSetName, str(featureId)]\n joined = datamodel.CompoundId.join(splits)\n obfuscated = datamodel.CompoundId.obfuscate(joined)\n return obfuscated",
"metadata": "root._getFeatureCompoundId",
"header": "['module', '___EOS___']",
"index": 84
},
{
"content": "def testFeatureSets():\n testDataDir = \"tests/data/datasets/dataset1/sequenceAnnotations\"\n for test in datadriven.makeTests(testDataDir, FeatureSetTests, \"*.db\"):\n yield test",
"metadata": "root.testFeatureSets",
"header": "['module', '___EOS___']",
"index": 91
},
{
"content": "class FeatureSetTests(datadriven.DataDrivenTest):\n \"\"\"\n Re-parses source GFF3 files, compares the results with the contents\n of corresponding sequenceAnnotations.Feature objects.\n \"\"\"\n\n\n\n\n\n",
"metadata": "root.FeatureSetTests",
"header": "['module', '___EOS___']",
"index": 97
},
{
"content": " def __init__(self, featureSetLocalName, dataPath):\n \"\"\"\n :param localId: Name of the GFF3 resource corresponding to a pair\n of files, .db and .gff3\n :param dataPath: string representing full path to the .db file\n :return:\n \"\"\"\n self._dataset = datasets.AbstractDataset(_datasetName)\n self._datarepo = datarepo.FileSystemDataRepository(\"tests/data\")\n featureSetLocalName = featureSetLocalName[:-3] # remove '.db'\n self._testData = _testDataForFeatureSetName[featureSetLocalName]\n super(FeatureSetTests, self).__init__(featureSetLocalName, dataPath)",
"metadata": "root.FeatureSetTests.__init__",
"header": "['class', 'FeatureSetTests', '(', 'datadriven', '.', 'DataDrivenTest', ')', ':', '___EOS___']",
"index": 102
},
{
"content": " def getProtocolClass(self):\n return protocol.FeatureSet",
"metadata": "root.FeatureSetTests.getProtocolClass",
"header": "['class', 'FeatureSetTests', '(', 'datadriven', '.', 'DataDrivenTest', ')', ':', '___EOS___']",
"index": 115
},
{
"content": " def getDataModelInstance(self, localId, dataPath):\n return sequenceAnnotations.Gff3DbFeatureSet(\n self._dataset, localId, dataPath, self._datarepo)",
"metadata": "root.FeatureSetTests.getDataModelInstance",
"header": "['class', 'FeatureSetTests', '(', 'datadriven', '.', 'DataDrivenTest', ')', ':', '___EOS___']",
"index": 118
},
{
"content": " def testGetFeatureById(self):\n idString = _getFeatureCompoundId(\n _datasetName,\n self._testData[\"featureSetName\"],\n self._testData[\"sampleFeatureId\"])\n compoundId = datamodel.FeatureCompoundId.parse(idString)\n feature = self._gaObject.getFeature(compoundId)\n self.assertIsNotNone(feature)\n self.assertEqual(feature.id, idString)\n if self._testData[\"sampleParentId\"] is not None:\n self.assertEqual(\n datamodel.FeatureCompoundId.parse(\n feature.parentId).featureId,\n str(self._testData[\"sampleParentId\"]))\n else:\n self.assertEqual(feature.parentId, '')\n self.assertEqual(\n feature.referenceName,\n self._testData[\"referenceName\"])\n self.assertEqual(\n feature.start,\n self._testData[\"sampleStart\"])\n self.assertEqual(\n feature.end,\n self._testData[\"sampleEnd\"])\n self.assertEqual(\n feature.strand,\n self._testData[\"sampleStrand\"])",
"metadata": "root.FeatureSetTests.testGetFeatureById",
"header": "['class', 'FeatureSetTests', '(', 'datadriven', '.', 'DataDrivenTest', ')', ':', '___EOS___']",
"index": 122
},
{
"content": " def testFetchAllFeaturesInRegion(self):\n features = []\n nextPageTokens = []\n for (feature, nextPageToken) in self._gaObject.getFeatures(\n self._testData[\"referenceName\"],\n self._testData[\"region\"][0],\n self._testData[\"region\"][1],\n None, 1000):\n features.append(feature)\n nextPageTokens.append(nextPageToken)\n self.assertEqual(len(features), self._testData[\"totalFeatures\"])\n self.assertIsNone(nextPageTokens[-1])",
"metadata": "root.FeatureSetTests.testFetchAllFeaturesInRegion",
"header": "['class', 'FeatureSetTests', '(', 'datadriven', '.', 'DataDrivenTest', ')', ':', '___EOS___']",
"index": 151
},
{
"content": " def testFetchFeaturesRestrictedByOntology(self):\n features = []\n for (feature, _) in self._gaObject.getFeatures(\n self._testData[\"referenceName\"],\n self._testData[\"region\"][0],\n self._testData[\"region\"][1],\n None, 1000,\n featureTypes=self._testData[\"ontologyRestriction\"]):\n features.append(feature)\n self.assertEqual(len(features),\n self._testData[\"featuresWithOntology\"])",
"metadata": "root.FeatureSetTests.testFetchFeaturesRestrictedByOntology",
"header": "['class', 'FeatureSetTests', '(', 'datadriven', '.', 'DataDrivenTest', ')', ':', '___EOS___']",
"index": 164
},
{
"content": " def testFetchFeaturesRestrictedByParent(self):\n parentId = \"\"\n if self._testData[\"sampleParentId\"] is not None:\n parentIdString = _getFeatureCompoundId(\n _datasetName,\n self._testData[\"featureSetName\"],\n self._testData[\"sampleParentId\"])\n parentId = datamodel.FeatureCompoundId.parse(\n parentIdString).featureId\n features = []\n for (feature, _) in self._gaObject.getFeatures(\n self._testData[\"referenceName\"],\n self._testData[\"region\"][0],\n self._testData[\"region\"][1],\n None, 1000,\n parentId=parentId):\n features.append(feature)\n self.assertEqual(len(features),\n self._testData[\"sampleSiblings\"])",
"metadata": "root.FeatureSetTests.testFetchFeaturesRestrictedByParent",
"header": "['class', 'FeatureSetTests', '(', 'datadriven', '.', 'DataDrivenTest', ')', ':', '___EOS___']",
"index": 176
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\"\"\"",
"\\",
"10",
";",
"Data",
"-",
"drive",
"n",
" ",
"tests",
" ",
"for",
" ",
"sequence",
" ",
"annot",
"ation",
" ",
"Feature",
"s",
".",
"\\",
"10",
";\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"\\u\\u",
"future\\u\\u_",
"import_",
"division_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"\\u\\u",
"future\\u\\u_",
"import_",
"print",
"\\u",
"function_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"\\u\\u",
"future\\u\\u_",
"import_",
"unicode",
"\\u",
"literals_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"ga",
"4",
"gh_",
"._",
"datar",
"epo",
"_",
"as_",
"datar",
"epo",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"ga",
"4",
"gh_",
"._",
"datamo",
"del_",
"as_",
"datamo",
"del_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"ga",
"4",
"gh_",
"._",
"datamo",
"del_",
"._",
"datasets_",
"as_",
"datasets_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"ga",
"4",
"gh_",
"._",
"datamo",
"del_",
"._",
"sequence",
"Annotations",
"_",
"as_",
"sequence",
"Annotations",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"ga",
"4",
"gh_",
"._",
"protocol_",
"as_",
"protocol_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"tests_",
"._",
"datad",
"rive",
"n_",
"as_",
"datad",
"rive",
"n_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"dataset",
"Name_",
"=_",
"\"",
"ds",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"discon",
"tin",
"uo",
"us",
"Test",
"Data_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"feature",
"Set",
"Name",
"\"_",
":_",
"\"",
"discon",
"tin",
"uo",
"us",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"reference",
"Name",
"\"_",
":_",
"\"",
"apid",
"b",
"|",
"Pf",
"3",
"D7",
"\\u",
"13",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"total",
"Feature",
"s",
"\"_",
":_",
"30_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Feature",
"Id",
"\"_",
":_",
"440",
"995",
"592",
"0_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Parent",
"Id",
"\"_",
":_",
"440",
"995",
"611",
"2_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Start",
"\"_",
":_",
"820",
"942",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"End",
"\"_",
":_",
"821",
"379",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Strand",
"\"_",
":_",
"protocol_",
"._",
"Strand",
"_",
"._",
"POS",
"\\u",
"STRA",
"ND_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Sibling",
"s",
"\"_",
":_",
"2_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"region",
"\"_",
":_",
"[_",
"0_",
",_",
"2_",
"**_",
"32_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"ontology",
"Restriction",
"\"_",
":_",
"[_",
"\"",
"gene",
"\"_",
",_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"features",
"With",
"Ont",
"olog",
"y",
"\"_",
":_",
"3_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"genc",
"ode",
"V2",
"1",
"Set",
"1",
"Test",
"Data_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"feature",
"Set",
"Name",
"\"_",
":_",
"\"",
"genc",
"ode",
"V2",
"1",
"Set",
"1",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"reference",
"Name",
"\"_",
":_",
"\"",
"chr",
"1",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"total",
"Feature",
"s",
"\"_",
":_",
"543",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Feature",
"Id",
"\"_",
":_",
"439",
"711",
"163",
"2_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Parent",
"Id",
"\"_",
":_",
"439",
"711",
"131",
"2_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Start",
"\"_",
":_",
"804",
"776",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"End",
"\"_",
":_",
"804",
"832",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Strand",
"\"_",
":_",
"protocol_",
"._",
"Strand",
"_",
"._",
"POS",
"\\u",
"STRA",
"ND_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Sibling",
"s",
"\"_",
":_",
"5_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"region",
"\"_",
":_",
"[_",
"0_",
",_",
"2_",
"**_",
"32_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"ontology",
"Restriction",
"\"_",
":_",
"[_",
"\"",
"gene",
"\"_",
",_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"features",
"With",
"Ont",
"olog",
"y",
"\"_",
":_",
"58_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"sac",
"Ce",
"r",
"Test",
"Test",
"Data_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"feature",
"Set",
"Name",
"\"_",
":_",
"\"",
"sac",
"Ce",
"r",
"Test",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"reference",
"Name",
"\"_",
":_",
"\"",
"chr",
"I",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"total",
"Feature",
"s",
"\"_",
":_",
"33_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Feature",
"Id",
"\"_",
":_",
"432",
"435",
"451",
"2_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Parent",
"Id",
"\"_",
":_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Start",
"\"_",
":_",
"337",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"End",
"\"_",
":_",
"801",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Strand",
"\"_",
":_",
"protocol_",
"._",
"Strand",
"_",
"._",
"NEG",
"\\u",
"STRA",
"ND_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Sibling",
"s",
"\"_",
":_",
"20_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"region",
"\"_",
":_",
"[_",
"0_",
",_",
"2_",
"**_",
"32_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"ontology",
"Restriction",
"\"_",
":_",
"[_",
"\"",
"gene",
"\"_",
",_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"features",
"With",
"Ont",
"olog",
"y",
"\"_",
":_",
"11_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"special",
"Case",
"s",
"Test",
"Test",
"Data_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"feature",
"Set",
"Name",
"\"_",
":_",
"\"",
"special",
"Case",
"s",
"Test",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"reference",
"Name",
"\"_",
":_",
"\"",
"2",
"L",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"total",
"Feature",
"s",
"\"_",
":_",
"4_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Feature",
"Id",
"\"_",
":_",
"455",
"484",
"430",
"4_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Parent",
"Id",
"\"_",
":_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Start",
"\"_",
":_",
"2222",
"958",
"3_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"End",
"\"_",
":_",
"2222",
"969",
"9_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Strand",
"\"_",
":_",
"protocol_",
"._",
"Strand",
"_",
"._",
"NEG",
"\\u",
"STRA",
"ND_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sample",
"Sibling",
"s",
"\"_",
":_",
"2_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"region",
"\"_",
":_",
"[_",
"0_",
",_",
"2_",
"**_",
"32_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"ontology",
"Restriction",
"\"_",
":_",
"[_",
"\"",
"gene",
"\"_",
",_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"features",
"With",
"Ont",
"olog",
"y",
"\"_",
":_",
"0_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"test",
"Data",
"For",
"Feature",
"Set",
"Name_",
"=_",
"{_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"discon",
"tin",
"uo",
"us",
"\"_",
":_",
"\\u",
"discon",
"tin",
"uo",
"us",
"Test",
"Data_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"genc",
"ode",
"V2",
"1",
"Set",
"1",
"\"_",
":_",
"\\u",
"genc",
"ode",
"V2",
"1",
"Set",
"1",
"Test",
"Data_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"sac",
"Ce",
"r",
"Test",
"\"_",
":_",
"\\u",
"sac",
"Ce",
"r",
"Test",
"Test",
"Data_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"",
"special",
"Case",
"s",
"Test",
"\"_",
":_",
"\\u",
"special",
"Case",
"s",
"Test",
"Test",
"Data_",
"\\u\\u\\uNL\\u\\u\\u_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u",
"get",
"Feature",
"Compo",
"und",
"Id_",
"(_",
"data",
"Set",
"Name_",
",_",
"feature",
"Set",
"Name_",
",_",
"feature",
"Id_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"splits_",
"=_",
"[_",
"data",
"Set",
"Name_",
",_",
"feature",
"Set",
"Name_",
",_",
"str_",
"(_",
"feature",
"Id_",
")_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"joined_",
"=_",
"datamo",
"del_",
"._",
"Compo",
"und",
"Id_",
"._",
"join_",
"(_",
"splits_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"obf",
"usc",
"ated",
"_",
"=_",
"datamo",
"del_",
"._",
"Compo",
"und",
"Id_",
"._",
"obf",
"usc",
"ate_",
"(_",
"joined_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"obf",
"usc",
"ated",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Feature",
"Sets_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"test",
"Data",
"Dir_",
"=_",
"\"",
"tests",
"/",
"data",
"/",
"dataset",
"s",
"/",
"dataset",
"1",
"/",
"sequence",
"Annotations",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"test_",
"in_",
"datad",
"rive",
"n_",
"._",
"make",
"Tests_",
"(_",
"test",
"Data",
"Dir_",
",_",
"Feature",
"Set",
"Tests_",
",_",
"\"*",
".",
"db",
"\"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"yield_",
"test_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Feature",
"Set",
"Tests_",
"(_",
"datad",
"rive",
"n_",
"._",
"Data",
"Drive",
"n",
"Test_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Re",
"-",
"parse",
"s",
" ",
"source",
" ",
"GF",
"F3",
" ",
"files",
",",
" ",
"compare",
"s",
" ",
"the",
" ",
"results",
" ",
"with",
" ",
"the",
" ",
"content",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"of",
" ",
"correspond",
"ing",
" ",
"sequence",
"Annotations",
".",
"Feature",
" ",
"object",
"s",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Feature",
"Set",
"Tests_",
"(_",
"datad",
"rive",
"n_",
"._",
"Data",
"Drive",
"n",
"Test_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"feature",
"Set",
"Local",
"Name_",
",_",
"data",
"Path_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"local",
"Id",
":",
" ",
"Name",
" ",
"of",
" ",
"the",
" ",
"GF",
"F3",
" ",
"resource",
" ",
"correspond",
"ing",
" ",
"to",
" ",
"a",
" ",
"pair",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"of",
" ",
"files",
",",
" ",
".",
"db",
" ",
"and",
" ",
".",
"gff",
"3",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"param",
" ",
"data",
"Path",
":",
" ",
"string",
" ",
"represent",
"ing",
" ",
"full",
" ",
"path",
" ",
"to",
" ",
"the",
" ",
".",
"db",
" ",
"file",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
":",
"return",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"dataset_",
"=_",
"datasets_",
"._",
"Abstract",
"Dataset_",
"(_",
"\\u",
"dataset",
"Name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"datar",
"epo",
"_",
"=_",
"datar",
"epo",
"_",
"._",
"File",
"System",
"Data",
"Repository_",
"(_",
"\"",
"tests",
"/",
"data",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"feature",
"Set",
"Local",
"Name_",
"=_",
"feature",
"Set",
"Local",
"Name_",
"[_",
":_",
"-_",
"3_",
"]_",
"#",
" ",
"remove",
" ",
"'.",
"db",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"=_",
"\\u",
"test",
"Data",
"For",
"Feature",
"Set",
"Name_",
"[_",
"feature",
"Set",
"Local",
"Name_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"super_",
"(_",
"Feature",
"Set",
"Tests_",
",_",
"self_",
")_",
"._",
"\\u\\u",
"init\\u\\u_",
"(_",
"feature",
"Set",
"Local",
"Name_",
",_",
"data",
"Path_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Feature",
"Set",
"Tests_",
"(_",
"datad",
"rive",
"n_",
"._",
"Data",
"Drive",
"n",
"Test_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"Proto",
"col",
"Class_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"protocol_",
"._",
"Feature",
"Set_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Feature",
"Set",
"Tests_",
"(_",
"datad",
"rive",
"n_",
"._",
"Data",
"Drive",
"n",
"Test_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"Data",
"Model",
"Instance_",
"(_",
"self_",
",_",
"local",
"Id_",
",_",
"data",
"Path_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"sequence",
"Annotations",
"_",
"._",
"Gf",
"f3",
"Db",
"Feature",
"Set_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"dataset_",
",_",
"local",
"Id_",
",_",
"data",
"Path_",
",_",
"self_",
"._",
"\\u",
"datar",
"epo",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Feature",
"Set",
"Tests_",
"(_",
"datad",
"rive",
"n_",
"._",
"Data",
"Drive",
"n",
"Test_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Get",
"Feature",
"By",
"Id_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"id",
"String_",
"=_",
"\\u",
"get",
"Feature",
"Compo",
"und",
"Id_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"dataset",
"Name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"feature",
"Set",
"Name",
"\"_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"sample",
"Feature",
"Id",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"compo",
"und",
"Id_",
"=_",
"datamo",
"del_",
"._",
"Feature",
"Compo",
"und",
"Id_",
"._",
"parse_",
"(_",
"id",
"String_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"feature_",
"=_",
"self_",
"._",
"\\u",
"ga",
"Object_",
"._",
"get",
"Feature_",
"(_",
"compo",
"und",
"Id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Is",
"Not",
"None_",
"(_",
"feature_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"feature_",
"._",
"id_",
",_",
"id",
"String_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"sample",
"Parent",
"Id",
"\"_",
"]_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"assert",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"datamo",
"del_",
"._",
"Feature",
"Compo",
"und",
"Id_",
"._",
"parse_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"feature_",
"._",
"parent",
"Id_",
")_",
"._",
"feature",
"Id_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"str_",
"(_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"sample",
"Parent",
"Id",
"\"_",
"]_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"assert",
"Equal_",
"(_",
"feature_",
"._",
"parent",
"Id_",
",_",
"''_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"feature_",
"._",
"reference",
"Name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"reference",
"Name",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"feature_",
"._",
"start_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"sample",
"Start",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"feature_",
"._",
"end_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"sample",
"End",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"feature_",
"._",
"strand_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"sample",
"Strand",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Feature",
"Set",
"Tests_",
"(_",
"datad",
"rive",
"n_",
"._",
"Data",
"Drive",
"n",
"Test_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Fe",
"tch",
"All",
"Feature",
"s",
"In",
"Region_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"features_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"next",
"Page",
"Tokens_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"(_",
"feature_",
",_",
"next",
"Page",
"Token_",
")_",
"in_",
"self_",
"._",
"\\u",
"ga",
"Object_",
"._",
"get",
"Features_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"reference",
"Name",
"\"_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"region",
"\"_",
"]_",
"[_",
"0_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"region",
"\"_",
"]_",
"[_",
"1_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"None_",
",_",
"1000_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"features_",
"._",
"append_",
"(_",
"feature_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"next",
"Page",
"Tokens_",
"._",
"append_",
"(_",
"next",
"Page",
"Token_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"len_",
"(_",
"features_",
")_",
",_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"total",
"Feature",
"s",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Is",
"None_",
"(_",
"next",
"Page",
"Tokens_",
"[_",
"-_",
"1_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Feature",
"Set",
"Tests_",
"(_",
"datad",
"rive",
"n_",
"._",
"Data",
"Drive",
"n",
"Test_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Fe",
"tch",
"Feature",
"s",
"Restrict",
"ed",
"By",
"Ont",
"olog",
"y_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"features_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"(_",
"feature_",
",_",
"\\u_",
")_",
"in_",
"self_",
"._",
"\\u",
"ga",
"Object_",
"._",
"get",
"Features_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"reference",
"Name",
"\"_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"region",
"\"_",
"]_",
"[_",
"0_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"region",
"\"_",
"]_",
"[_",
"1_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"None_",
",_",
"1000_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"feature",
"Types_",
"=_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"ontology",
"Restriction",
"\"_",
"]_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"features_",
"._",
"append_",
"(_",
"feature_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"len_",
"(_",
"features_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"features",
"With",
"Ont",
"olog",
"y",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Feature",
"Set",
"Tests_",
"(_",
"datad",
"rive",
"n_",
"._",
"Data",
"Drive",
"n",
"Test_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test",
"Fe",
"tch",
"Feature",
"s",
"Restrict",
"ed",
"By",
"Parent_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"parent",
"Id_",
"=_",
"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"sample",
"Parent",
"Id",
"\"_",
"]_",
"is_",
"not_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"parent",
"Id",
"String_",
"=_",
"\\u",
"get",
"Feature",
"Compo",
"und",
"Id_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u",
"dataset",
"Name_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"feature",
"Set",
"Name",
"\"_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"sample",
"Parent",
"Id",
"\"_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"parent",
"Id_",
"=_",
"datamo",
"del_",
"._",
"Feature",
"Compo",
"und",
"Id_",
"._",
"parse_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"parent",
"Id",
"String_",
")_",
"._",
"feature",
"Id_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"features_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"(_",
"feature_",
",_",
"\\u_",
")_",
"in_",
"self_",
"._",
"\\u",
"ga",
"Object_",
"._",
"get",
"Features_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"reference",
"Name",
"\"_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"region",
"\"_",
"]_",
"[_",
"0_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"region",
"\"_",
"]_",
"[_",
"1_",
"]_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"None_",
",_",
"1000_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"parent",
"Id_",
"=_",
"parent",
"Id_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"features_",
"._",
"append_",
"(_",
"feature_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"len_",
"(_",
"features_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test",
"Data_",
"[_",
"\"",
"sample",
"Sibling",
"s",
"\"_",
"]_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,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
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
'import *' may pollute namespace | coleifer/peewee/playhouse/tests/test_compound_queries.py | [
{
"content": "import itertools\nimport operator\nimport sys\nif sys.version_info[0] != 3:\n from functools import reduce\nfrom functools import wraps\n\nfrom peewee import *\nfrom playhouse.tests.base import compiler\nfrom playhouse.tests.base import database_initializer\nfrom playhouse.tests.base import log_console\nfrom playhouse.tests.base import ModelTestCase\nfrom playhouse.tests.base import PeeweeTestCase\nfrom playhouse.tests.base import skip_unless\nfrom playhouse.tests.base import test_db\nfrom playhouse.tests.models import *\n\ncompound_db = database_initializer.get_in_memory_database()\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | true | [
"[CLS]_",
"'",
"import",
" ",
"*'_",
"may",
"_",
"poll",
"ute",
"_",
"namespace_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"import_",
"itertools_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"operator_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"sys_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"sys_",
"._",
"version",
"\\u",
"info_",
"[_",
"0_",
"]_",
"!=_",
"3_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"functools_",
"import_",
"reduce_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"from_",
"functools_",
"import_",
"wraps_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"peewee",
"_",
"import_",
"*_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"play",
"house_",
"._",
"tests_",
"._",
"base_",
"import_",
"compiler_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"play",
"house_",
"._",
"tests_",
"._",
"base_",
"import_",
"databa",
"se",
"\\u",
"initializer_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"play",
"house_",
"._",
"tests_",
"._",
"base_",
"import_",
"log",
"\\u",
"console_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"play",
"house_",
"._",
"tests_",
"._",
"base_",
"import_",
"Model",
"Test",
"Case_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"play",
"house_",
"._",
"tests_",
"._",
"base_",
"import_",
"Pe",
"ew",
"ee",
"Test",
"Case_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"play",
"house_",
"._",
"tests_",
"._",
"base_",
"import_",
"skip",
"\\u",
"unl",
"ess_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"play",
"house_",
"._",
"tests_",
"._",
"base_",
"import_",
"test\\u",
"db_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"play",
"house_",
"._",
"tests_",
"._",
"models_",
"import_",
"*_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"compo",
"und",
"\\u",
"db_",
"=_",
"databa",
"se",
"\\u",
"initializer_",
"._",
"get",
"\\u",
"in",
"\\u",
"memory",
"\\u",
"database_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | OpenKMIP/PyKMIP/kmip/tests/unit/core/messages/payloads/test_discover_versions.py | [
{
"content": "# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n# License for the specific language governing permissions and limitations\n# under the License.\n\nfrom six.moves import xrange\n\nfrom testtools import TestCase\n\nfrom kmip.core import utils\n\nfrom kmip.core.messages.contents import ProtocolVersion\nfrom kmip.core.messages.payloads import discover_versions\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class TestDiscoverVersionsRequestPayload(TestCase):\n\n\n\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root.TestDiscoverVersionsRequestPayload",
"header": "['module', '___EOS___']",
"index": 25
},
{
"content": " def setUp(self):\n super(TestDiscoverVersionsRequestPayload, self).setUp()\n\n self.protocol_versions_empty = list()\n self.protocol_versions_one = list()\n self.protocol_versions_one.append(ProtocolVersion.create(1, 0))\n self.protocol_versions_two = list()\n self.protocol_versions_two.append(ProtocolVersion.create(1, 1))\n self.protocol_versions_two.append(ProtocolVersion.create(1, 0))\n\n self.encoding_empty = utils.BytearrayStream((\n b'\\x42\\x00\\x79\\x01\\x00\\x00\\x00\\x00'))\n self.encoding_one = utils.BytearrayStream((\n b'\\x42\\x00\\x79\\x01\\x00\\x00\\x00\\x28\\x42\\x00\\x69\\x01\\x00\\x00\\x00\\x20'\n b'\\x42\\x00\\x6A\\x02\\x00\\x00\\x00\\x04\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00'\n b'\\x42\\x00\\x6B\\x02\\x00\\x00\\x00\\x04\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\n b'\\x00'))\n self.encoding_two = utils.BytearrayStream((\n b'\\x42\\x00\\x79\\x01\\x00\\x00\\x00\\x50\\x42\\x00\\x69\\x01\\x00\\x00\\x00\\x20'\n b'\\x42\\x00\\x6A\\x02\\x00\\x00\\x00\\x04\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00'\n b'\\x42\\x00\\x6B\\x02\\x00\\x00\\x00\\x04\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00'\n b'\\x42\\x00\\x69\\x01\\x00\\x00\\x00\\x20\\x42\\x00\\x6A\\x02\\x00\\x00\\x00\\x04'\n b'\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x42\\x00\\x6B\\x02\\x00\\x00\\x00\\x04'\n b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'))",
"metadata": "root.TestDiscoverVersionsRequestPayload.setUp",
"header": "['class', 'TestDiscoverVersionsRequestPayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 27
},
{
"content": " def tearDown(self):\n super(TestDiscoverVersionsRequestPayload, self).tearDown()",
"metadata": "root.TestDiscoverVersionsRequestPayload.tearDown",
"header": "['class', 'TestDiscoverVersionsRequestPayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 52
},
{
"content": " def test_init_with_none(self):\n discover_versions.DiscoverVersionsRequestPayload()",
"metadata": "root.TestDiscoverVersionsRequestPayload.test_init_with_none",
"header": "['class', 'TestDiscoverVersionsRequestPayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 55
},
{
"content": " def test_init_with_args(self):\n discover_versions.DiscoverVersionsRequestPayload(\n self.protocol_versions_empty)",
"metadata": "root.TestDiscoverVersionsRequestPayload.test_init_with_args",
"header": "['class', 'TestDiscoverVersionsRequestPayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 58
},
{
"content": " def test_validate_with_invalid_protocol_versions(self):\n kwargs = {'protocol_versions': 'invalid'}\n self.assertRaisesRegexp(\n TypeError, \"invalid protocol versions list\",\n discover_versions.DiscoverVersionsRequestPayload, **kwargs)",
"metadata": "root.TestDiscoverVersionsRequestPayload.test_validate_with_invalid_protocol_versions",
"header": "['class', 'TestDiscoverVersionsRequestPayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 62
},
{
"content": " def test_validate_with_invalid_protocol_version(self):\n kwargs = {'protocol_versions': ['invalid']}\n self.assertRaisesRegexp(\n TypeError, \"invalid protocol version\",\n discover_versions.DiscoverVersionsRequestPayload, **kwargs)",
"metadata": "root.TestDiscoverVersionsRequestPayload.test_validate_with_invalid_protocol_version",
"header": "['class', 'TestDiscoverVersionsRequestPayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 68
},
{
"content": " def _test_read(self, stream, payload, protocol_versions):\n payload.read(stream)\n expected = len(protocol_versions)\n observed = len(payload.protocol_versions)\n\n msg = \"protocol versions list decoding mismatch\"\n msg += \"; expected {0} results, received {1}\".format(\n expected, observed)\n self.assertEqual(expected, observed, msg)\n\n for i in xrange(len(protocol_versions)):\n expected = protocol_versions[i]\n observed = payload.protocol_versions[i]\n\n msg = \"protocol version decoding mismatch\"\n msg += \"; expected {0}, received {1}\".format(expected, observed)\n self.assertEqual(expected, observed, msg)",
"metadata": "root.TestDiscoverVersionsRequestPayload._test_read",
"header": "['class', 'TestDiscoverVersionsRequestPayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 74
},
{
"content": " def test_read_with_empty_protocol_list(self):\n stream = self.encoding_empty\n payload = discover_versions.DiscoverVersionsRequestPayload()\n protocol_versions = self.protocol_versions_empty\n\n self._test_read(stream, payload, protocol_versions)",
"metadata": "root.TestDiscoverVersionsRequestPayload.test_read_with_empty_protocol_list",
"header": "['class', 'TestDiscoverVersionsRequestPayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 92
},
{
"content": " def test_read_with_one_protocol_version(self):\n stream = self.encoding_one\n payload = discover_versions.DiscoverVersionsRequestPayload()\n protocol_versions = self.protocol_versions_one\n\n self._test_read(stream, payload, protocol_versions)",
"metadata": "root.TestDiscoverVersionsRequestPayload.test_read_with_one_protocol_version",
"header": "['class', 'TestDiscoverVersionsRequestPayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 99
},
{
"content": " def test_read_with_two_protocol_versions(self):\n stream = self.encoding_two\n payload = discover_versions.DiscoverVersionsRequestPayload()\n protocol_versions = self.protocol_versions_two\n\n self._test_read(stream, payload, protocol_versions)",
"metadata": "root.TestDiscoverVersionsRequestPayload.test_read_with_two_protocol_versions",
"header": "['class', 'TestDiscoverVersionsRequestPayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 106
},
{
"content": " def _test_write(self, payload, expected):\n stream = utils.BytearrayStream()\n payload.write(stream)\n\n length_expected = len(expected)\n length_received = len(stream)\n\n msg = \"encoding lengths not equal\"\n msg += \"; expected {0}, received {1}\".format(\n length_expected, length_received)\n self.assertEqual(length_expected, length_received, msg)\n\n msg = \"encoding mismatch\"\n msg += \";\\nexpected:\\n{0}\\nreceived:\\n{1}\".format(expected, stream)\n\n self.assertEqual(expected, stream, msg)",
"metadata": "root.TestDiscoverVersionsRequestPayload._test_write",
"header": "['class', 'TestDiscoverVersionsRequestPayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 113
},
{
"content": " def test_write_with_empty_protocol_list(self):\n payload = discover_versions.DiscoverVersionsRequestPayload(\n self.protocol_versions_empty)\n expected = self.encoding_empty\n\n self._test_write(payload, expected)",
"metadata": "root.TestDiscoverVersionsRequestPayload.test_write_with_empty_protocol_list",
"header": "['class', 'TestDiscoverVersionsRequestPayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 130
},
{
"content": " def test_write_with_one_protocol_version(self):\n payload = discover_versions.DiscoverVersionsRequestPayload(\n self.protocol_versions_one)\n expected = self.encoding_one\n\n self._test_write(payload, expected)",
"metadata": "root.TestDiscoverVersionsRequestPayload.test_write_with_one_protocol_version",
"header": "['class', 'TestDiscoverVersionsRequestPayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 137
},
{
"content": " def test_write_with_two_protocol_versions(self):\n payload = discover_versions.DiscoverVersionsRequestPayload(\n self.protocol_versions_two)\n expected = self.encoding_two\n\n self._test_write(payload, expected)",
"metadata": "root.TestDiscoverVersionsRequestPayload.test_write_with_two_protocol_versions",
"header": "['class', 'TestDiscoverVersionsRequestPayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 144
},
{
"content": "class TestDiscoverVersionsResponsePayload(TestCase):\n\n\n\n\n\n\n\n\n\n\n\n\n\n",
"metadata": "root.TestDiscoverVersionsResponsePayload",
"header": "['module', '___EOS___']",
"index": 152
},
{
"content": " def setUp(self):\n super(TestDiscoverVersionsResponsePayload, self).setUp()\n\n self.protocol_versions_empty = list()\n self.protocol_versions_one = list()\n self.protocol_versions_one.append(ProtocolVersion.create(1, 0))\n self.protocol_versions_two = list()\n self.protocol_versions_two.append(ProtocolVersion.create(1, 1))\n self.protocol_versions_two.append(ProtocolVersion.create(1, 0))\n\n self.encoding_empty = utils.BytearrayStream((\n b'\\x42\\x00\\x7C\\x01\\x00\\x00\\x00\\x00'))\n self.encoding_one = utils.BytearrayStream((\n b'\\x42\\x00\\x7C\\x01\\x00\\x00\\x00\\x28\\x42\\x00\\x69\\x01\\x00\\x00\\x00\\x20'\n b'\\x42\\x00\\x6A\\x02\\x00\\x00\\x00\\x04\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00'\n b'\\x42\\x00\\x6B\\x02\\x00\\x00\\x00\\x04\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\n b'\\x00'))\n self.encoding_two = utils.BytearrayStream((\n b'\\x42\\x00\\x7C\\x01\\x00\\x00\\x00\\x50\\x42\\x00\\x69\\x01\\x00\\x00\\x00\\x20'\n b'\\x42\\x00\\x6A\\x02\\x00\\x00\\x00\\x04\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00'\n b'\\x42\\x00\\x6B\\x02\\x00\\x00\\x00\\x04\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00'\n b'\\x42\\x00\\x69\\x01\\x00\\x00\\x00\\x20\\x42\\x00\\x6A\\x02\\x00\\x00\\x00\\x04'\n b'\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x42\\x00\\x6B\\x02\\x00\\x00\\x00\\x04'\n b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'))",
"metadata": "root.TestDiscoverVersionsResponsePayload.setUp",
"header": "['class', 'TestDiscoverVersionsResponsePayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 154
},
{
"content": " def tearDown(self):\n super(TestDiscoverVersionsResponsePayload, self).tearDown()",
"metadata": "root.TestDiscoverVersionsResponsePayload.tearDown",
"header": "['class', 'TestDiscoverVersionsResponsePayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 179
},
{
"content": " def test_init_with_none(self):\n discover_versions.DiscoverVersionsResponsePayload()",
"metadata": "root.TestDiscoverVersionsResponsePayload.test_init_with_none",
"header": "['class', 'TestDiscoverVersionsResponsePayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 182
},
{
"content": " def test_init_with_args(self):\n discover_versions.DiscoverVersionsResponsePayload(\n self.protocol_versions_empty)",
"metadata": "root.TestDiscoverVersionsResponsePayload.test_init_with_args",
"header": "['class', 'TestDiscoverVersionsResponsePayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 185
},
{
"content": " def test_validate_with_invalid_protocol_versions(self):\n kwargs = {'protocol_versions': 'invalid'}\n self.assertRaisesRegexp(\n TypeError, \"invalid protocol versions list\",\n discover_versions.DiscoverVersionsResponsePayload, **kwargs)",
"metadata": "root.TestDiscoverVersionsResponsePayload.test_validate_with_invalid_protocol_versions",
"header": "['class', 'TestDiscoverVersionsResponsePayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 189
},
{
"content": " def test_validate_with_invalid_protocol_version(self):\n kwargs = {'protocol_versions': ['invalid']}\n self.assertRaisesRegexp(\n TypeError, \"invalid protocol version\",\n discover_versions.DiscoverVersionsResponsePayload, **kwargs)",
"metadata": "root.TestDiscoverVersionsResponsePayload.test_validate_with_invalid_protocol_version",
"header": "['class', 'TestDiscoverVersionsResponsePayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 195
},
{
"content": " def _test_read(self, stream, payload, protocol_versions):\n payload.read(stream)\n expected = len(protocol_versions)\n observed = len(payload.protocol_versions)\n\n msg = \"protocol versions list decoding mismatch\"\n msg += \"; expected {0} results, received {1}\".format(\n expected, observed)\n self.assertEqual(expected, observed, msg)\n\n for i in xrange(len(protocol_versions)):\n expected = protocol_versions[i]\n observed = payload.protocol_versions[i]\n\n msg = \"protocol version decoding mismatch\"\n msg += \"; expected {0}, received {1}\".format(expected, observed)\n self.assertEqual(expected, observed, msg)",
"metadata": "root.TestDiscoverVersionsResponsePayload._test_read",
"header": "['class', 'TestDiscoverVersionsResponsePayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 201
},
{
"content": " def test_read_with_empty_protocol_list(self):\n stream = self.encoding_empty\n payload = discover_versions.DiscoverVersionsResponsePayload()\n protocol_versions = self.protocol_versions_empty\n\n self._test_read(stream, payload, protocol_versions)",
"metadata": "root.TestDiscoverVersionsResponsePayload.test_read_with_empty_protocol_list",
"header": "['class', 'TestDiscoverVersionsResponsePayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 219
},
{
"content": " def test_read_with_one_protocol_version(self):\n stream = self.encoding_one\n payload = discover_versions.DiscoverVersionsResponsePayload()\n protocol_versions = self.protocol_versions_one\n\n self._test_read(stream, payload, protocol_versions)",
"metadata": "root.TestDiscoverVersionsResponsePayload.test_read_with_one_protocol_version",
"header": "['class', 'TestDiscoverVersionsResponsePayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 226
},
{
"content": " def test_read_with_two_protocol_versions(self):\n stream = self.encoding_two\n payload = discover_versions.DiscoverVersionsResponsePayload()\n protocol_versions = self.protocol_versions_two\n\n self._test_read(stream, payload, protocol_versions)",
"metadata": "root.TestDiscoverVersionsResponsePayload.test_read_with_two_protocol_versions",
"header": "['class', 'TestDiscoverVersionsResponsePayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 233
},
{
"content": " def _test_write(self, payload, expected):\n stream = utils.BytearrayStream()\n payload.write(stream)\n\n length_expected = len(expected)\n length_received = len(stream)\n\n msg = \"encoding lengths not equal\"\n msg += \"; expected {0}, received {1}\".format(\n length_expected, length_received)\n self.assertEqual(length_expected, length_received, msg)\n\n msg = \"encoding mismatch\"\n msg += \";\\nexpected:\\n{0}\\nreceived:\\n{1}\".format(expected, stream)\n\n self.assertEqual(expected, stream, msg)",
"metadata": "root.TestDiscoverVersionsResponsePayload._test_write",
"header": "['class', 'TestDiscoverVersionsResponsePayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 240
},
{
"content": " def test_write_with_empty_protocol_list(self):\n payload = discover_versions.DiscoverVersionsResponsePayload(\n self.protocol_versions_empty)\n expected = self.encoding_empty\n\n self._test_write(payload, expected)",
"metadata": "root.TestDiscoverVersionsResponsePayload.test_write_with_empty_protocol_list",
"header": "['class', 'TestDiscoverVersionsResponsePayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 257
},
{
"content": " def test_write_with_one_protocol_version(self):\n payload = discover_versions.DiscoverVersionsResponsePayload(\n self.protocol_versions_one)\n expected = self.encoding_one\n\n self._test_write(payload, expected)",
"metadata": "root.TestDiscoverVersionsResponsePayload.test_write_with_one_protocol_version",
"header": "['class', 'TestDiscoverVersionsResponsePayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 264
},
{
"content": " def test_write_with_two_protocol_versions(self):\n payload = discover_versions.DiscoverVersionsResponsePayload(\n self.protocol_versions_two)\n expected = self.encoding_two\n\n self._test_write(payload, expected)",
"metadata": "root.TestDiscoverVersionsResponsePayload.test_write_with_two_protocol_versions",
"header": "['class', 'TestDiscoverVersionsResponsePayload', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 271
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#",
" ",
"Copy",
"right",
" ",
"(",
"c",
")",
" ",
"2014",
" ",
"The",
" ",
"Joh",
"ns",
" ",
"Hop",
"kins",
" ",
"Univers",
"it",
"y",
"/",
"Appl",
"ied",
" ",
"Phys",
"ics",
" ",
"Labo",
"rator",
"y_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"All",
" ",
"Rig",
"hts",
" ",
"Reserve",
"d",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"License",
"d",
" ",
"under",
" ",
"the",
" ",
"Ap",
"ache",
" ",
"License",
",",
" ",
"Version",
" ",
"2.0",
" ",
"(",
"the",
" ",
"\"",
"License",
"\");",
" ",
"you",
" ",
"may",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"not",
" ",
"use",
" ",
"this",
" ",
"file",
" ",
"except",
" ",
"in",
" ",
"compli",
"anc",
"e",
" ",
"with",
" ",
"the",
" ",
"License",
".",
" ",
"You",
" ",
"may",
" ",
"obtain",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"a",
" ",
"copy",
" ",
"of",
" ",
"the",
" ",
"License",
" ",
"at_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"http",
"://",
"www",
".",
"apa",
"che",
".",
"org",
"/",
"license",
"s",
"/",
"LICENSE",
"-",
"2.0_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Un",
"less",
" ",
"require",
"d",
" ",
"by",
" ",
"applica",
"ble",
" ",
"law",
" ",
"or",
" ",
"agree",
"d",
" ",
"to",
" ",
"in",
" ",
"writ",
"ing",
",",
" ",
"software",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"distributed",
" ",
"under",
" ",
"the",
" ",
"License",
" ",
"is",
" ",
"distributed",
" ",
"on",
" ",
"an",
" ",
"\"",
"AS",
" ",
"IS",
"\"",
" ",
"BAS",
"IS",
",",
" ",
"WITH",
"OUT_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"WAR",
"RAN",
"TIES",
" ",
"OR",
" ",
"CONDITION",
"S",
" ",
"OF",
" ",
"ANY",
" ",
"KIND",
",",
" ",
"eit",
"her",
" ",
"express",
" ",
"or",
" ",
"impli",
"ed",
".",
" ",
"See",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"License",
" ",
"for",
" ",
"the",
" ",
"specific",
" ",
"language",
" ",
"govern",
"ing",
" ",
"permissi",
"ons",
" ",
"and",
" ",
"limit",
"ations_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"under",
" ",
"the",
" ",
"License",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"six_",
"._",
"moves_",
"import_",
"xrange_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"testtools_",
"import_",
"Test",
"Case_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"kmi",
"p_",
"._",
"core_",
"import_",
"utils_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"kmi",
"p_",
"._",
"core_",
"._",
"messages_",
"._",
"contents_",
"import_",
"Proto",
"col",
"Version_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"kmi",
"p_",
"._",
"core_",
"._",
"messages_",
"._",
"payloads_",
"import_",
"discove",
"r",
"\\u",
"versions_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"set",
"Up_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"super_",
"(_",
"Test",
"Discover",
"Version",
"s",
"Request",
"Payload_",
",_",
"self_",
")_",
"._",
"set",
"Up_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"empty_",
"=_",
"list_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"one_",
"=_",
"list_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"one_",
"._",
"append_",
"(_",
"Proto",
"col",
"Version_",
"._",
"create_",
"(_",
"1_",
",_",
"0_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"two_",
"=_",
"list_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"two_",
"._",
"append_",
"(_",
"Proto",
"col",
"Version_",
"._",
"create_",
"(_",
"1_",
",_",
"1_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"two_",
"._",
"append_",
"(_",
"Proto",
"col",
"Version_",
"._",
"create_",
"(_",
"1_",
",_",
"0_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"encoding",
"\\u",
"empty_",
"=_",
"utils_",
"._",
"Byte",
"array",
"Stream_",
"(_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x",
"7",
"9",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"encoding",
"\\u",
"one_",
"=_",
"utils_",
"._",
"Byte",
"array",
"Stream_",
"(_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x",
"7",
"9",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x2",
"8",
"\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"9",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x2",
"0",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"A",
"\\\\",
"x0",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"4",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"B",
"\\\\",
"x0",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"4",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x0",
"0",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"encoding",
"\\u",
"two_",
"=_",
"utils_",
"._",
"Byte",
"array",
"Stream_",
"(_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x",
"7",
"9",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x5",
"0",
"\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"9",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x2",
"0",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"A",
"\\\\",
"x0",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"4",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"B",
"\\\\",
"x0",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"4",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"9",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x2",
"0",
"\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"A",
"\\\\",
"x0",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"4",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"B",
"\\\\",
"x0",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"4",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"tear",
"Down_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"super_",
"(_",
"Test",
"Discover",
"Version",
"s",
"Request",
"Payload_",
",_",
"self_",
")_",
"._",
"tear",
"Down_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"init",
"\\u",
"with",
"\\u",
"none_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"init",
"\\u",
"with",
"\\u",
"args_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"empty_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"validat",
"e\\u",
"with",
"\\u",
"invalid",
"\\u",
"protoc",
"ol",
"\\u",
"versions_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"kwargs_",
"=_",
"{_",
"'",
"protoc",
"ol",
"\\u",
"version",
"s",
"'_",
":_",
"'",
"invalid",
"'_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Rai",
"ses",
"Regexp_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"Type",
"Error_",
",_",
"\"",
"invalid",
" ",
"protoc",
"ol",
" ",
"version",
"s",
" ",
"list",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Request",
"Payload_",
",_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"validat",
"e\\u",
"with",
"\\u",
"invalid",
"\\u",
"protoc",
"ol",
"\\u",
"version_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"kwargs_",
"=_",
"{_",
"'",
"protoc",
"ol",
"\\u",
"version",
"s",
"'_",
":_",
"[_",
"'",
"invalid",
"'_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Rai",
"ses",
"Regexp_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"Type",
"Error_",
",_",
"\"",
"invalid",
" ",
"protoc",
"ol",
" ",
"version",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Request",
"Payload_",
",_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"test\\u",
"read_",
"(_",
"self_",
",_",
"stream_",
",_",
"payload_",
",_",
"protoc",
"ol",
"\\u",
"versions_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"payload_",
"._",
"read_",
"(_",
"stream_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"len_",
"(_",
"protoc",
"ol",
"\\u",
"versions_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"observed_",
"=_",
"len_",
"(_",
"payload_",
"._",
"protoc",
"ol",
"\\u",
"versions_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"msg_",
"=_",
"\"",
"protoc",
"ol",
" ",
"version",
"s",
" ",
"list",
" ",
"deco",
"ding",
" ",
"mism",
"atch",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"msg_",
"+=_",
"\";",
" ",
"expected",
" ",
"{",
"0",
"}",
" ",
"results",
",",
" ",
"receive",
"d",
" ",
"{",
"1",
"}\"_",
"._",
"format_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"expected_",
",_",
"observed_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"expected_",
",_",
"observed_",
",_",
"msg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"i_",
"in_",
"xrange_",
"(_",
"len_",
"(_",
"protoc",
"ol",
"\\u",
"versions_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"expected_",
"=_",
"protoc",
"ol",
"\\u",
"versions_",
"[_",
"i_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"observed_",
"=_",
"payload_",
"._",
"protoc",
"ol",
"\\u",
"versions_",
"[_",
"i_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"msg_",
"=_",
"\"",
"protoc",
"ol",
" ",
"version",
" ",
"deco",
"ding",
" ",
"mism",
"atch",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"msg_",
"+=_",
"\";",
" ",
"expected",
" ",
"{",
"0",
"},",
" ",
"receive",
"d",
" ",
"{",
"1",
"}\"_",
"._",
"format_",
"(_",
"expected_",
",_",
"observed_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"expected_",
",_",
"observed_",
",_",
"msg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"read",
"\\u",
"with",
"\\u",
"empty",
"\\u",
"protoc",
"ol",
"\\u",
"list_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"stream_",
"=_",
"self_",
"._",
"encoding",
"\\u",
"empty_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"payload_",
"=_",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"protoc",
"ol",
"\\u",
"versions_",
"=_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"empty_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test\\u",
"read_",
"(_",
"stream_",
",_",
"payload_",
",_",
"protoc",
"ol",
"\\u",
"versions_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"read",
"\\u",
"with",
"\\u",
"one",
"\\u",
"protoc",
"ol",
"\\u",
"version_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"stream_",
"=_",
"self_",
"._",
"encoding",
"\\u",
"one_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"payload_",
"=_",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"protoc",
"ol",
"\\u",
"versions_",
"=_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"one_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test\\u",
"read_",
"(_",
"stream_",
",_",
"payload_",
",_",
"protoc",
"ol",
"\\u",
"versions_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"read",
"\\u",
"with",
"\\u",
"two",
"\\u",
"protoc",
"ol",
"\\u",
"versions_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"stream_",
"=_",
"self_",
"._",
"encoding",
"\\u",
"two_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"payload_",
"=_",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"protoc",
"ol",
"\\u",
"versions_",
"=_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"two_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test\\u",
"read_",
"(_",
"stream_",
",_",
"payload_",
",_",
"protoc",
"ol",
"\\u",
"versions_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"test\\u",
"write_",
"(_",
"self_",
",_",
"payload_",
",_",
"expected_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"stream_",
"=_",
"utils_",
"._",
"Byte",
"array",
"Stream_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"payload_",
"._",
"write_",
"(_",
"stream_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"length",
"\\u",
"expected_",
"=_",
"len_",
"(_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"length",
"\\u",
"received_",
"=_",
"len_",
"(_",
"stream_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"msg_",
"=_",
"\"",
"encoding",
" ",
"length",
"s",
" ",
"not",
" ",
"equal",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"msg_",
"+=_",
"\";",
" ",
"expected",
" ",
"{",
"0",
"},",
" ",
"receive",
"d",
" ",
"{",
"1",
"}\"_",
"._",
"format_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"length",
"\\u",
"expected_",
",_",
"length",
"\\u",
"received_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"length",
"\\u",
"expected_",
",_",
"length",
"\\u",
"received_",
",_",
"msg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"msg_",
"=_",
"\"",
"encoding",
" ",
"mism",
"atch",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"msg_",
"+=_",
"\";",
"\\\\",
"nex",
"pect",
"ed",
":\\\\",
"n",
"{",
"0",
"}\\\\",
"nre",
"ce",
"ive",
"d",
":\\\\",
"n",
"{",
"1",
"}\"_",
"._",
"format_",
"(_",
"expected_",
",_",
"stream_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"expected_",
",_",
"stream_",
",_",
"msg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"write",
"\\u",
"with",
"\\u",
"empty",
"\\u",
"protoc",
"ol",
"\\u",
"list_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"payload_",
"=_",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"empty_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"self_",
"._",
"encoding",
"\\u",
"empty_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test\\u",
"write_",
"(_",
"payload_",
",_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"write",
"\\u",
"with",
"\\u",
"one",
"\\u",
"protoc",
"ol",
"\\u",
"version_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"payload_",
"=_",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"one_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"self_",
"._",
"encoding",
"\\u",
"one_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test\\u",
"write_",
"(_",
"payload_",
",_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"write",
"\\u",
"with",
"\\u",
"two",
"\\u",
"protoc",
"ol",
"\\u",
"versions_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"payload_",
"=_",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Request",
"Payload_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"two_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"self_",
"._",
"encoding",
"\\u",
"two_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test\\u",
"write_",
"(_",
"payload_",
",_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"set",
"Up_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"super_",
"(_",
"Test",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
",_",
"self_",
")_",
"._",
"set",
"Up_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"empty_",
"=_",
"list_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"one_",
"=_",
"list_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"one_",
"._",
"append_",
"(_",
"Proto",
"col",
"Version_",
"._",
"create_",
"(_",
"1_",
",_",
"0_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"two_",
"=_",
"list_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"two_",
"._",
"append_",
"(_",
"Proto",
"col",
"Version_",
"._",
"create_",
"(_",
"1_",
",_",
"1_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"two_",
"._",
"append_",
"(_",
"Proto",
"col",
"Version_",
"._",
"create_",
"(_",
"1_",
",_",
"0_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"encoding",
"\\u",
"empty_",
"=_",
"utils_",
"._",
"Byte",
"array",
"Stream_",
"(_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x",
"7",
"C",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"encoding",
"\\u",
"one_",
"=_",
"utils_",
"._",
"Byte",
"array",
"Stream_",
"(_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x",
"7",
"C",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x2",
"8",
"\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"9",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x2",
"0",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"A",
"\\\\",
"x0",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"4",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"B",
"\\\\",
"x0",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"4",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x0",
"0",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"encoding",
"\\u",
"two_",
"=_",
"utils_",
"._",
"Byte",
"array",
"Stream_",
"(_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x",
"7",
"C",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x5",
"0",
"\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"9",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x2",
"0",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"A",
"\\\\",
"x0",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"4",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"B",
"\\\\",
"x0",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"4",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"9",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x2",
"0",
"\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"A",
"\\\\",
"x0",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"4",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"1",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x4",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x6",
"B",
"\\\\",
"x0",
"2",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"4",
"'_",
"\\u\\u\\uNL\\u\\u\\u_",
"b",
"'\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"\\\\",
"x0",
"0",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"tear",
"Down_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"super_",
"(_",
"Test",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
",_",
"self_",
")_",
"._",
"tear",
"Down_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"init",
"\\u",
"with",
"\\u",
"none_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"init",
"\\u",
"with",
"\\u",
"args_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"empty_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"validat",
"e\\u",
"with",
"\\u",
"invalid",
"\\u",
"protoc",
"ol",
"\\u",
"versions_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"kwargs_",
"=_",
"{_",
"'",
"protoc",
"ol",
"\\u",
"version",
"s",
"'_",
":_",
"'",
"invalid",
"'_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Rai",
"ses",
"Regexp_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"Type",
"Error_",
",_",
"\"",
"invalid",
" ",
"protoc",
"ol",
" ",
"version",
"s",
" ",
"list",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
",_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"validat",
"e\\u",
"with",
"\\u",
"invalid",
"\\u",
"protoc",
"ol",
"\\u",
"version_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"kwargs_",
"=_",
"{_",
"'",
"protoc",
"ol",
"\\u",
"version",
"s",
"'_",
":_",
"[_",
"'",
"invalid",
"'_",
"]_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Rai",
"ses",
"Regexp_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"Type",
"Error_",
",_",
"\"",
"invalid",
" ",
"protoc",
"ol",
" ",
"version",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
",_",
"**_",
"kwargs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"test\\u",
"read_",
"(_",
"self_",
",_",
"stream_",
",_",
"payload_",
",_",
"protoc",
"ol",
"\\u",
"versions_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"payload_",
"._",
"read_",
"(_",
"stream_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"len_",
"(_",
"protoc",
"ol",
"\\u",
"versions_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"observed_",
"=_",
"len_",
"(_",
"payload_",
"._",
"protoc",
"ol",
"\\u",
"versions_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"msg_",
"=_",
"\"",
"protoc",
"ol",
" ",
"version",
"s",
" ",
"list",
" ",
"deco",
"ding",
" ",
"mism",
"atch",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"msg_",
"+=_",
"\";",
" ",
"expected",
" ",
"{",
"0",
"}",
" ",
"results",
",",
" ",
"receive",
"d",
" ",
"{",
"1",
"}\"_",
"._",
"format_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"expected_",
",_",
"observed_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"expected_",
",_",
"observed_",
",_",
"msg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"for_",
"i_",
"in_",
"xrange_",
"(_",
"len_",
"(_",
"protoc",
"ol",
"\\u",
"versions_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"expected_",
"=_",
"protoc",
"ol",
"\\u",
"versions_",
"[_",
"i_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"observed_",
"=_",
"payload_",
"._",
"protoc",
"ol",
"\\u",
"versions_",
"[_",
"i_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"msg_",
"=_",
"\"",
"protoc",
"ol",
" ",
"version",
" ",
"deco",
"ding",
" ",
"mism",
"atch",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"msg_",
"+=_",
"\";",
" ",
"expected",
" ",
"{",
"0",
"},",
" ",
"receive",
"d",
" ",
"{",
"1",
"}\"_",
"._",
"format_",
"(_",
"expected_",
",_",
"observed_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"expected_",
",_",
"observed_",
",_",
"msg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"read",
"\\u",
"with",
"\\u",
"empty",
"\\u",
"protoc",
"ol",
"\\u",
"list_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"stream_",
"=_",
"self_",
"._",
"encoding",
"\\u",
"empty_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"payload_",
"=_",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"protoc",
"ol",
"\\u",
"versions_",
"=_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"empty_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test\\u",
"read_",
"(_",
"stream_",
",_",
"payload_",
",_",
"protoc",
"ol",
"\\u",
"versions_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"read",
"\\u",
"with",
"\\u",
"one",
"\\u",
"protoc",
"ol",
"\\u",
"version_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"stream_",
"=_",
"self_",
"._",
"encoding",
"\\u",
"one_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"payload_",
"=_",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"protoc",
"ol",
"\\u",
"versions_",
"=_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"one_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test\\u",
"read_",
"(_",
"stream_",
",_",
"payload_",
",_",
"protoc",
"ol",
"\\u",
"versions_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"read",
"\\u",
"with",
"\\u",
"two",
"\\u",
"protoc",
"ol",
"\\u",
"versions_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"stream_",
"=_",
"self_",
"._",
"encoding",
"\\u",
"two_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"payload_",
"=_",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"protoc",
"ol",
"\\u",
"versions_",
"=_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"two_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test\\u",
"read_",
"(_",
"stream_",
",_",
"payload_",
",_",
"protoc",
"ol",
"\\u",
"versions_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"test\\u",
"write_",
"(_",
"self_",
",_",
"payload_",
",_",
"expected_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"stream_",
"=_",
"utils_",
"._",
"Byte",
"array",
"Stream_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"payload_",
"._",
"write_",
"(_",
"stream_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"length",
"\\u",
"expected_",
"=_",
"len_",
"(_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"length",
"\\u",
"received_",
"=_",
"len_",
"(_",
"stream_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"msg_",
"=_",
"\"",
"encoding",
" ",
"length",
"s",
" ",
"not",
" ",
"equal",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"msg_",
"+=_",
"\";",
" ",
"expected",
" ",
"{",
"0",
"},",
" ",
"receive",
"d",
" ",
"{",
"1",
"}\"_",
"._",
"format_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"length",
"\\u",
"expected_",
",_",
"length",
"\\u",
"received_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"length",
"\\u",
"expected_",
",_",
"length",
"\\u",
"received_",
",_",
"msg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"msg_",
"=_",
"\"",
"encoding",
" ",
"mism",
"atch",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"msg_",
"+=_",
"\";",
"\\\\",
"nex",
"pect",
"ed",
":\\\\",
"n",
"{",
"0",
"}\\\\",
"nre",
"ce",
"ive",
"d",
":\\\\",
"n",
"{",
"1",
"}\"_",
"._",
"format_",
"(_",
"expected_",
",_",
"stream_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"expected_",
",_",
"stream_",
",_",
"msg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"write",
"\\u",
"with",
"\\u",
"empty",
"\\u",
"protoc",
"ol",
"\\u",
"list_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"payload_",
"=_",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"empty_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"self_",
"._",
"encoding",
"\\u",
"empty_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test\\u",
"write_",
"(_",
"payload_",
",_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"write",
"\\u",
"with",
"\\u",
"one",
"\\u",
"protoc",
"ol",
"\\u",
"version_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"payload_",
"=_",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"one_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"self_",
"._",
"encoding",
"\\u",
"one_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test\\u",
"write_",
"(_",
"payload_",
",_",
"expected_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Test",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"write",
"\\u",
"with",
"\\u",
"two",
"\\u",
"protoc",
"ol",
"\\u",
"versions_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"payload_",
"=_",
"discove",
"r",
"\\u",
"versions_",
"._",
"Discover",
"Version",
"s",
"Respons",
"e",
"Payload_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"protoc",
"ol",
"\\u",
"version",
"s",
"\\u",
"two_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"expected_",
"=_",
"self_",
"._",
"encoding",
"\\u",
"two_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"test\\u",
"write_",
"(_",
"payload_",
",_",
"expected_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unnecessary pass | datastax/python-driver/cassandra/protocol.py | [
{
"content": "class RequestValidationException(ErrorMessageSub):\n pass",
"metadata": "root.RequestValidationException",
"header": "['module', '___EOS___']",
"index": 167
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"necessar",
"y_",
"pass_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Request",
"Validat",
"ion",
"Exception_",
"(_",
"Error",
"Messag",
"e",
"Sub_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Except block handles 'BaseException' | datamade/dedupe/dedupe/core.py | [
{
"content": "def peek(records) :\n try :\n record = next(records)\n except TypeError as e:\n if \"not an iterator\" not in str(e) :\n raise\n try :\n records = iter(records)\n record = next(records)\n except StopIteration :\n return None, records\n except StopIteration :\n return None, records\n \n\n\n return record, itertools.chain([record], records)",
"metadata": "root.peek",
"header": "['module', '___EOS___']",
"index": 290
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Except",
"_",
"block_",
"handles_",
"'",
"Base",
"Except",
"ion",
"'_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"peek_",
"(_",
"records_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"record_",
"=_",
"next_",
"(_",
"records_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Type",
"Error_",
"as_",
"e_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"\"",
"not",
" ",
"an",
" ",
"iter",
"ator",
"\"_",
"not_",
"in_",
"str_",
"(_",
"e_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"records_",
"=_",
"iter_",
"(_",
"records_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"record_",
"=_",
"next_",
"(_",
"records_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Sto",
"p",
"Iteration_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"None_",
",_",
"records_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Sto",
"p",
"Iteration_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"None_",
",_",
"records_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"record_",
",_",
"itertools_",
"._",
"chain_",
"(_",
"[_",
"record_",
"]_",
",_",
"records_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | django/django/tests/forms_tests/field_tests/test_typedchoicefield.py | [
{
"content": "from __future__ import unicode_literals\n\nimport decimal\n\nfrom django.forms import TypedChoiceField, ValidationError\nfrom django.test import SimpleTestCase\nfrom django.utils import six\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class TypedChoiceFieldTest(SimpleTestCase):\n\n\n\n\n\n\n\n",
"metadata": "root.TypedChoiceFieldTest",
"header": "['module', '___EOS___']",
"index": 9
},
{
"content": " def test_typedchoicefield_1(self):\n f = TypedChoiceField(choices=[(1, \"+1\"), (-1, \"-1\")], coerce=int)\n self.assertEqual(1, f.clean('1'))\n msg = \"'Select a valid choice. 2 is not one of the available choices.'\"\n with self.assertRaisesMessage(ValidationError, msg):\n f.clean('2')",
"metadata": "root.TypedChoiceFieldTest.test_typedchoicefield_1",
"header": "['class', 'TypedChoiceFieldTest', '(', 'SimpleTestCase', ')', ':', '___EOS___']",
"index": 11
},
{
"content": " def test_typedchoicefield_2(self):\n # Different coercion, same validation.\n f = TypedChoiceField(choices=[(1, \"+1\"), (-1, \"-1\")], coerce=float)\n self.assertEqual(1.0, f.clean('1'))",
"metadata": "root.TypedChoiceFieldTest.test_typedchoicefield_2",
"header": "['class', 'TypedChoiceFieldTest', '(', 'SimpleTestCase', ')', ':', '___EOS___']",
"index": 18
},
{
"content": " def test_typedchoicefield_3(self):\n # This can also cause weirdness: be careful (bool(-1) == True, remember)\n f = TypedChoiceField(choices=[(1, \"+1\"), (-1, \"-1\")], coerce=bool)\n self.assertTrue(f.clean('-1'))",
"metadata": "root.TypedChoiceFieldTest.test_typedchoicefield_3",
"header": "['class', 'TypedChoiceFieldTest', '(', 'SimpleTestCase', ')', ':', '___EOS___']",
"index": 23
},
{
"content": " def test_typedchoicefield_4(self):\n # Even more weirdness: if you have a valid choice but your coercion function\n # can't coerce, you'll still get a validation error. Don't do this!\n f = TypedChoiceField(choices=[('A', 'A'), ('B', 'B')], coerce=int)\n msg = \"'Select a valid choice. B is not one of the available choices.'\"\n with self.assertRaisesMessage(ValidationError, msg):\n f.clean('B')\n # Required fields require values\n with self.assertRaisesMessage(ValidationError, \"'This field is required.'\"):\n f.clean('')",
"metadata": "root.TypedChoiceFieldTest.test_typedchoicefield_4",
"header": "['class', 'TypedChoiceFieldTest', '(', 'SimpleTestCase', ')', ':', '___EOS___']",
"index": 28
},
{
"content": " def test_typedchoicefield_5(self):\n # Non-required fields aren't required\n f = TypedChoiceField(choices=[(1, \"+1\"), (-1, \"-1\")], coerce=int, required=False)\n self.assertEqual('', f.clean(''))\n # If you want cleaning an empty value to return a different type, tell the field",
"metadata": "root.TypedChoiceFieldTest.test_typedchoicefield_5",
"header": "['class', 'TypedChoiceFieldTest', '(', 'SimpleTestCase', ')', ':', '___EOS___']",
"index": 39
},
{
"content": " def test_typedchoicefield_6(self):\n f = TypedChoiceField(choices=[(1, \"+1\"), (-1, \"-1\")], coerce=int, required=False, empty_value=None)\n self.assertIsNone(f.clean(''))",
"metadata": "root.TypedChoiceFieldTest.test_typedchoicefield_6",
"header": "['class', 'TypedChoiceFieldTest', '(', 'SimpleTestCase', ')', ':', '___EOS___']",
"index": 45
},
{
"content": " def test_typedchoicefield_has_changed(self):\n # has_changed should not trigger required validation\n f = TypedChoiceField(choices=[(1, \"+1\"), (-1, \"-1\")], coerce=int, required=True)\n self.assertFalse(f.has_changed(None, ''))\n self.assertFalse(f.has_changed(1, '1'))\n self.assertFalse(f.has_changed('1', '1'))\n\n f = TypedChoiceField(\n choices=[('', '---------'), ('a', \"a\"), ('b', \"b\")], coerce=six.text_type,\n required=False, initial=None, empty_value=None,\n )\n self.assertFalse(f.has_changed(None, ''))\n self.assertTrue(f.has_changed('', 'a'))\n self.assertFalse(f.has_changed('a', 'a'))",
"metadata": "root.TypedChoiceFieldTest.test_typedchoicefield_has_changed",
"header": "['class', 'TypedChoiceFieldTest', '(', 'SimpleTestCase', ')', ':', '___EOS___']",
"index": 49
},
{
"content": " def test_typedchoicefield_special_coerce(self):\n \"\"\"\n A coerce function which results in a value not present in choices\n should raise an appropriate error (#21397).\n \"\"\"\n def coerce_func(val):\n return decimal.Decimal('1.%s' % val)\n\n f = TypedChoiceField(choices=[(1, \"1\"), (2, \"2\")], coerce=coerce_func, required=True)\n self.assertEqual(decimal.Decimal('1.2'), f.clean('2'))\n with self.assertRaisesMessage(ValidationError, \"'This field is required.'\"):\n f.clean('')\n msg = \"'Select a valid choice. 3 is not one of the available choices.'\"\n with self.assertRaisesMessage(ValidationError, msg):\n f.clean('3')",
"metadata": "root.TypedChoiceFieldTest.test_typedchoicefield_special_coerce",
"header": "['class', 'TypedChoiceFieldTest', '(', 'SimpleTestCase', ')', ':', '___EOS___']",
"index": 64
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"from_",
"\\u\\u",
"future\\u\\u_",
"import_",
"unicode",
"\\u",
"literals_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"decimal_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"django_",
"._",
"forms_",
"import_",
"Type",
"d",
"Choi",
"ce",
"Field_",
",_",
"Validat",
"ion",
"Error_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"test_",
"import_",
"Simple",
"Test",
"Case_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"utils_",
"import_",
"six_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Type",
"d",
"Choi",
"ce",
"Field",
"Test_",
"(_",
"Simple",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Type",
"d",
"Choi",
"ce",
"Field",
"Test_",
"(_",
"Simple",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"test\\u",
"typed",
"choice",
"field",
"\\u",
"1_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"=_",
"Type",
"d",
"Choi",
"ce",
"Field_",
"(_",
"choices_",
"=_",
"[_",
"(_",
"1_",
",_",
"\"+",
"1",
"\"_",
")_",
",_",
"(_",
"-_",
"1_",
",_",
"\"-",
"1",
"\"_",
")_",
"]_",
",_",
"coerce",
"_",
"=_",
"int_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"1_",
",_",
"f_",
"._",
"clean_",
"(_",
"'",
"1",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"msg_",
"=_",
"\"'",
"Select",
" ",
"a",
" ",
"valid",
" ",
"choice",
".",
" ",
"2",
" ",
"is",
" ",
"not",
" ",
"one",
" ",
"of",
" ",
"the",
" ",
"avail",
"able",
" ",
"choice",
"s",
".'",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"self_",
"._",
"assert",
"Rai",
"ses",
"Message_",
"(_",
"Validat",
"ion",
"Error_",
",_",
"msg_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"._",
"clean_",
"(_",
"'",
"2",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Type",
"d",
"Choi",
"ce",
"Field",
"Test_",
"(_",
"Simple",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"typed",
"choice",
"field",
"\\u",
"2_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Different",
" ",
"coe",
"rci",
"on",
",",
" ",
"same",
" ",
"validation",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"=_",
"Type",
"d",
"Choi",
"ce",
"Field_",
"(_",
"choices_",
"=_",
"[_",
"(_",
"1_",
",_",
"\"+",
"1",
"\"_",
")_",
",_",
"(_",
"-_",
"1_",
",_",
"\"-",
"1",
"\"_",
")_",
"]_",
",_",
"coerce",
"_",
"=_",
"float_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"1.0_",
",_",
"f_",
"._",
"clean_",
"(_",
"'",
"1",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Type",
"d",
"Choi",
"ce",
"Field",
"Test_",
"(_",
"Simple",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"typed",
"choice",
"field",
"\\u",
"3_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Thi",
"s",
" ",
"can",
" ",
"als",
"o",
" ",
"caus",
"e",
" ",
"weird",
"ness",
":",
" ",
"be",
" ",
"care",
"ful",
" ",
"(",
"bool",
"(-",
"1",
")",
" ",
"==",
" ",
"Tru",
"e",
",",
" ",
"remember",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"=_",
"Type",
"d",
"Choi",
"ce",
"Field_",
"(_",
"choices_",
"=_",
"[_",
"(_",
"1_",
",_",
"\"+",
"1",
"\"_",
")_",
",_",
"(_",
"-_",
"1_",
",_",
"\"-",
"1",
"\"_",
")_",
"]_",
",_",
"coerce",
"_",
"=_",
"bool_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"f_",
"._",
"clean_",
"(_",
"'-",
"1",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Type",
"d",
"Choi",
"ce",
"Field",
"Test_",
"(_",
"Simple",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"typed",
"choice",
"field",
"\\u",
"4_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Even",
" ",
"more",
" ",
"weird",
"ness",
":",
" ",
"if",
" ",
"you",
" ",
"have",
" ",
"a",
" ",
"valid",
" ",
"choice",
" ",
"but",
" ",
"your",
" ",
"coe",
"rci",
"on",
" ",
"function_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"can",
"'",
"t",
" ",
"coerce",
",",
" ",
"you",
"'",
"ll",
" ",
"still",
" ",
"get",
" ",
"a",
" ",
"validation",
" ",
"error",
".",
" ",
"Don",
"'",
"t",
" ",
"do",
" ",
"this",
"!",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"=_",
"Type",
"d",
"Choi",
"ce",
"Field_",
"(_",
"choices_",
"=_",
"[_",
"(_",
"'",
"A",
"'_",
",_",
"'",
"A",
"'_",
")_",
",_",
"(_",
"'",
"B",
"'_",
",_",
"'",
"B",
"'_",
")_",
"]_",
",_",
"coerce",
"_",
"=_",
"int_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"msg_",
"=_",
"\"'",
"Select",
" ",
"a",
" ",
"valid",
" ",
"choice",
".",
" ",
"B",
" ",
"is",
" ",
"not",
" ",
"one",
" ",
"of",
" ",
"the",
" ",
"avail",
"able",
" ",
"choice",
"s",
".'",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"self_",
"._",
"assert",
"Rai",
"ses",
"Message_",
"(_",
"Validat",
"ion",
"Error_",
",_",
"msg_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"._",
"clean_",
"(_",
"'",
"B",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Requ",
"ired",
" ",
"fields",
" ",
"require",
" ",
"values_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"with_",
"self_",
"._",
"assert",
"Rai",
"ses",
"Message_",
"(_",
"Validat",
"ion",
"Error_",
",_",
"\"'",
"Thi",
"s",
" ",
"field",
" ",
"is",
" ",
"require",
"d",
".'",
"\"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"._",
"clean_",
"(_",
"''_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Type",
"d",
"Choi",
"ce",
"Field",
"Test_",
"(_",
"Simple",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"typed",
"choice",
"field",
"\\u",
"5_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Non",
"-",
"require",
"d",
" ",
"fields",
" ",
"are",
"n",
"'",
"t",
" ",
"required_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"=_",
"Type",
"d",
"Choi",
"ce",
"Field_",
"(_",
"choices_",
"=_",
"[_",
"(_",
"1_",
",_",
"\"+",
"1",
"\"_",
")_",
",_",
"(_",
"-_",
"1_",
",_",
"\"-",
"1",
"\"_",
")_",
"]_",
",_",
"coerce",
"_",
"=_",
"int_",
",_",
"required_",
"=_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"''_",
",_",
"f_",
"._",
"clean_",
"(_",
"''_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"If",
" ",
"you",
" ",
"want",
" ",
"clean",
"ing",
" ",
"an",
" ",
"empty",
" ",
"value",
" ",
"to",
" ",
"return",
" ",
"a",
" ",
"different",
" ",
"type",
",",
" ",
"tell",
" ",
"the",
" ",
"field_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Type",
"d",
"Choi",
"ce",
"Field",
"Test_",
"(_",
"Simple",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"typed",
"choice",
"field",
"\\u",
"6_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"=_",
"Type",
"d",
"Choi",
"ce",
"Field_",
"(_",
"choices_",
"=_",
"[_",
"(_",
"1_",
",_",
"\"+",
"1",
"\"_",
")_",
",_",
"(_",
"-_",
"1_",
",_",
"\"-",
"1",
"\"_",
")_",
"]_",
",_",
"coerce",
"_",
"=_",
"int_",
",_",
"required_",
"=_",
"False_",
",_",
"empty",
"\\u",
"value_",
"=_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Is",
"None_",
"(_",
"f_",
"._",
"clean_",
"(_",
"''_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Type",
"d",
"Choi",
"ce",
"Field",
"Test_",
"(_",
"Simple",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"typed",
"choice",
"field",
"\\u",
"has",
"\\u",
"changed_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"has",
"\\u",
"change",
"d",
" ",
"shou",
"ld",
" ",
"not",
" ",
"trigger",
" ",
"require",
"d",
" ",
"validation_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"=_",
"Type",
"d",
"Choi",
"ce",
"Field_",
"(_",
"choices_",
"=_",
"[_",
"(_",
"1_",
",_",
"\"+",
"1",
"\"_",
")_",
",_",
"(_",
"-_",
"1_",
",_",
"\"-",
"1",
"\"_",
")_",
"]_",
",_",
"coerce",
"_",
"=_",
"int_",
",_",
"required_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"f_",
"._",
"has",
"\\u",
"changed_",
"(_",
"None_",
",_",
"''_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"f_",
"._",
"has",
"\\u",
"changed_",
"(_",
"1_",
",_",
"'",
"1",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"f_",
"._",
"has",
"\\u",
"changed_",
"(_",
"'",
"1",
"'_",
",_",
"'",
"1",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"f_",
"=_",
"Type",
"d",
"Choi",
"ce",
"Field_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"choices_",
"=_",
"[_",
"(_",
"''_",
",_",
"'-------",
"--'_",
")_",
",_",
"(_",
"'",
"a",
"'_",
",_",
"\"",
"a",
"\"_",
")_",
",_",
"(_",
"'",
"b",
"'_",
",_",
"\"",
"b",
"\"_",
")_",
"]_",
",_",
"coerce",
"_",
"=_",
"six_",
"._",
"text",
"\\u",
"type_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"required_",
"=_",
"False_",
",_",
"initial_",
"=_",
"None_",
",_",
"empty",
"\\u",
"value_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"f_",
"._",
"has",
"\\u",
"changed_",
"(_",
"None_",
",_",
"''_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"True_",
"(_",
"f_",
"._",
"has",
"\\u",
"changed_",
"(_",
"''_",
",_",
"'",
"a",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"False_",
"(_",
"f_",
"._",
"has",
"\\u",
"changed_",
"(_",
"'",
"a",
"'_",
",_",
"'",
"a",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Type",
"d",
"Choi",
"ce",
"Field",
"Test_",
"(_",
"Simple",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"typed",
"choice",
"field",
"\\u",
"special",
"\\u",
"coerce",
"_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"A",
" ",
"coerce",
" ",
"function",
" ",
"whi",
"ch",
" ",
"results",
" ",
"in",
" ",
"a",
" ",
"value",
" ",
"not",
" ",
"presen",
"t",
" ",
"in",
" ",
"choice",
"s",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"shou",
"ld",
" ",
"raise",
" ",
"an",
" ",
"appropr",
"iate",
" ",
"error",
" ",
"(",
"#",
"213",
"9",
"7",
").",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"coerce",
"\\u",
"func_",
"(_",
"val_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"decimal_",
"._",
"Decimal_",
"(_",
"'",
"1",
".",
"%",
"s",
"'_",
"%_",
"val_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"f_",
"=_",
"Type",
"d",
"Choi",
"ce",
"Field_",
"(_",
"choices_",
"=_",
"[_",
"(_",
"1_",
",_",
"\"",
"1",
"\"_",
")_",
",_",
"(_",
"2_",
",_",
"\"",
"2",
"\"_",
")_",
"]_",
",_",
"coerce",
"_",
"=_",
"coerce",
"\\u",
"func_",
",_",
"required_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"decimal_",
"._",
"Decimal_",
"(_",
"'",
"1.2",
"'_",
")_",
",_",
"f_",
"._",
"clean_",
"(_",
"'",
"2",
"'_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"self_",
"._",
"assert",
"Rai",
"ses",
"Message_",
"(_",
"Validat",
"ion",
"Error_",
",_",
"\"'",
"Thi",
"s",
" ",
"field",
" ",
"is",
" ",
"require",
"d",
".'",
"\"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"._",
"clean_",
"(_",
"''_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"msg_",
"=_",
"\"'",
"Select",
" ",
"a",
" ",
"valid",
" ",
"choice",
".",
" ",
"3",
" ",
"is",
" ",
"not",
" ",
"one",
" ",
"of",
" ",
"the",
" ",
"avail",
"able",
" ",
"choice",
"s",
".'",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"with_",
"self_",
"._",
"assert",
"Rai",
"ses",
"Message_",
"(_",
"Validat",
"ion",
"Error_",
",_",
"msg_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"f_",
"._",
"clean_",
"(_",
"'",
"3",
"'_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | Pylons/pyramid_mailer/pyramid_mailer/testing.py | [
{
"content": "from pyramid_mailer.interfaces import IMailer\nfrom pyramid_mailer.mailer import DummyMailer\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "def includeme(config):\n mailer = DummyMailer()\n config.registry.registerUtility(mailer, IMailer)",
"metadata": "root.includeme",
"header": "['module', '___EOS___']",
"index": 3
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"from_",
"pyram",
"id",
"\\u",
"mailer",
"_",
"._",
"interfaces_",
"import_",
"IM",
"ail",
"er_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"pyram",
"id",
"\\u",
"mailer",
"_",
"._",
"mailer",
"_",
"import_",
"Du",
"mm",
"y",
"Mail",
"er_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"include",
"me_",
"(_",
"config_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"mailer",
"_",
"=_",
"Du",
"mm",
"y",
"Mail",
"er_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"config_",
"._",
"registry_",
"._",
"register",
"Utility_",
"(_",
"mailer",
"_",
",_",
"IM",
"ail",
"er_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | mayan-edms/mayan-edms/mayan/apps/linking/views.py | [
{
"content": " def get_smart_link_queryset(self):\n return SmartLink.objects.all()",
"metadata": "root.SmartLinkListView.get_smart_link_queryset",
"header": "['class', 'SmartLinkListView', '(', 'SingleObjectListView', ')', ':', '___EOS___']",
"index": 140
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Sma",
"rt",
"Link",
"List",
"View_",
"(_",
"Sing",
"le",
"Object",
"List",
"View_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"smart",
"\\u",
"link",
"\\u",
"queryset_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"Sma",
"rt",
"Link_",
"._",
"objects_",
"._",
"all_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
First parameter of a method is not named 'self' | CollabQ/CollabQ/vendor/django/contrib/auth/models.py | [
{
"content": " def __init__(self):\n pass",
"metadata": "root.AnonymousUser.__init__",
"header": "['class', 'AnonymousUser', '(', 'object', ')', ':', '___EOS___']",
"index": 314
}
] | [] | [] | 0 | true | [
"[CLS]_",
"First_",
"parameter_",
"of_",
"a_",
"method_",
"is_",
"not_",
"named_",
"'",
"self",
"'_",
"[SEP]_",
"class_",
"Ano",
"nym",
"ous",
"User_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | maxcountryman/irctk/examples/kaa/kaa/google.py | [
{
"content": "@bot.command('g')\[email protected]\ndef google(context):\n data = search(context.args)\n\n if not data['responseData']['results']:\n return 'no results found'\n first_result = data['responseData']['results'][0]\n\n url = first_result['unescapedUrl']\n\n # special handling for Wikipedia\n wiki = re.search(wiki_re, url)\n if wiki:\n desc, url = wiki_search(wiki.groups()[-1])\n return '{0} -- {1}'.format(desc, url)\n\n # special handling for YouTube\n youtube = re.search(youtube_re, url)\n if youtube:\n vid_id = youtube.groups()[-1]\n desc = get_video_description(vid_id)\n return '{0} -- {1}'.format(desc, url)\n\n title = first_result['titleNoFormatting'].encode('utf-8', 'replace')\n title = HTMLParser.unescape.__func__(HTMLParser, title)\n\n ret = title + ' - ' + shortener(url)\n\n return ret",
"metadata": "root.google",
"header": "['module', '___EOS___']",
"index": 22
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"@_",
"bot_",
"._",
"command_",
"(_",
"'",
"g",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"@_",
"bot_",
"._",
"command_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"google_",
"(_",
"context_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"data_",
"=_",
"search_",
"(_",
"context_",
"._",
"args_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"not_",
"data_",
"[_",
"'",
"response",
"Data",
"'_",
"]_",
"[_",
"'",
"results",
"'_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"'",
"no",
" ",
"results",
" ",
"found",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"first",
"\\u",
"result_",
"=_",
"data_",
"[_",
"'",
"response",
"Data",
"'_",
"]_",
"[_",
"'",
"results",
"'_",
"]_",
"[_",
"0_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"url_",
"=_",
"first",
"\\u",
"result_",
"[_",
"'",
"unescape",
"d",
"Ur",
"l",
"'_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"special",
" ",
"handling",
" ",
"for",
" ",
"Wiki",
"pedi",
"a_",
"\\u\\u\\uNL\\u\\u\\u_",
"wiki_",
"=_",
"re_",
"._",
"search_",
"(_",
"wiki",
"\\u",
"re_",
",_",
"url_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"wiki_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"desc_",
",_",
"url_",
"=_",
"wiki",
"\\u",
"search_",
"(_",
"wiki_",
"._",
"groups_",
"(_",
")_",
"[_",
"-_",
"1_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"'{",
"0",
"}",
" ",
"--",
" ",
"{",
"1",
"}'_",
"._",
"format_",
"(_",
"desc_",
",_",
"url_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"special",
" ",
"handling",
" ",
"for",
" ",
"You",
"Tu",
"be_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"youtu",
"be_",
"=_",
"re_",
"._",
"search_",
"(_",
"youtu",
"be",
"\\u",
"re_",
",_",
"url_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"youtu",
"be_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"vid",
"\\u",
"id_",
"=_",
"youtu",
"be_",
"._",
"groups_",
"(_",
")_",
"[_",
"-_",
"1_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"desc_",
"=_",
"get",
"\\u",
"video",
"\\u",
"description_",
"(_",
"vid",
"\\u",
"id_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"'{",
"0",
"}",
" ",
"--",
" ",
"{",
"1",
"}'_",
"._",
"format_",
"(_",
"desc_",
",_",
"url_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"title_",
"=_",
"first",
"\\u",
"result_",
"[_",
"'",
"title",
"No",
"Formatt",
"ing",
"'_",
"]_",
"._",
"encode_",
"(_",
"'",
"utf",
"-",
"8",
"'_",
",_",
"'",
"replace",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"title_",
"=_",
"HTM",
"LP",
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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | holgerd77/django-dynamic-scraper/dynamic_scraper/spiders/django_base_spider.py | [
{
"content": " def _check_mandatory_vars(self):\n if self.conf['RUN_TYPE'] == 'TASK':\n if not getattr(self, 'scheduler_runtime', None):\n msg = \"You have to provide a scheduler_runtime when running with run_type TASK.\"\n logging.error(msg)\n raise CloseSpider(msg)\n msg = \"SchedulerRuntime (\" + str(self.scheduler_runtime) + \") found.\"\n self.log(msg, logging.INFO)\n \n for var in self.mandatory_vars:\n attr = getattr(self, var, None)\n if not attr:\n msg = \"Missing attribute {a} (Command: {c}).\".format(a=var, c=self.command)\n logging.error(msg)\n raise CloseSpider(msg)\n \n if self.scraper.status == 'P' or self.scraper.status == 'I':\n msg = 'Scraper status set to {s}!'.format(s=self.scraper.get_status_display())\n self.log(msg, logging.WARNING)\n raise CloseSpider(msg)",
"metadata": "root.DjangoBaseSpider._check_mandatory_vars",
"header": "['class', 'DjangoBaseSpider', '(', 'CrawlSpider', ')', ':', '___EOS___']",
"index": 118
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Dj",
"ang",
"o",
"Base",
"Spider_",
"(_",
"Crawl",
"Spider_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"check",
"\\u",
"mandat",
"ory",
"\\u",
"vars_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"conf_",
"[_",
"'",
"RUN",
"\\u",
"TYPE",
"'_",
"]_",
"==_",
"'",
"TASK",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"getattr_",
"(_",
"self_",
",_",
"'",
"schedule",
"r",
"\\u",
"runt",
"ime",
"'_",
",_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"msg_",
"=_",
"\"",
"You",
" ",
"have",
" ",
"to",
" ",
"provide",
" ",
"a",
" ",
"schedule",
"r",
"\\u",
"runt",
"ime",
" ",
"whe",
"n",
" ",
"runn",
"ing",
" ",
"with",
" ",
"run",
"\\u",
"type",
" ",
"TASK",
".\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"logging_",
"._",
"error_",
"(_",
"msg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Clos",
"e",
"Spider_",
"(_",
"msg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"msg_",
"=_",
"\"",
"Schedule",
"r",
"Run",
"time",
" ",
"(\"_",
"+_",
"str_",
"(_",
"self_",
"._",
"schedule",
"r",
"\\u",
"runtime_",
")_",
"+_",
"\")",
" ",
"found",
".\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"log_",
"(_",
"msg_",
",_",
"logging_",
"._",
"INFO_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"var_",
"in_",
"self_",
"._",
"mandat",
"ory",
"\\u",
"vars_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"attr_",
"=_",
"getattr_",
"(_",
"self_",
",_",
"var_",
",_",
"None_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"attr_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"msg_",
"=_",
"\"",
"Missing",
" ",
"attribute",
" ",
"{",
"a",
"}",
" ",
"(",
"Command",
":",
" ",
"{",
"c",
"}).",
"\"_",
"._",
"format_",
"(_",
"a_",
"=_",
"var_",
",_",
"c_",
"=_",
"self_",
"._",
"command_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"logging_",
"._",
"error_",
"(_",
"msg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Clos",
"e",
"Spider_",
"(_",
"msg_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"self_",
"._",
"scraper_",
"._",
"status_",
"==_",
"'",
"P",
"'_",
"or_",
"self_",
"._",
"scraper_",
"._",
"status_",
"==_",
"'",
"I",
"'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"msg_",
"=_",
"'",
"Scrape",
"r",
" ",
"status",
" ",
"set",
" ",
"to",
" ",
"{",
"s",
"}!",
"'_",
"._",
"format_",
"(_",
"s_",
"=_",
"self_",
"._",
"scraper_",
"._",
"get",
"\\u",
"status",
"\\u",
"display_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"log_",
"(_",
"msg_",
",_",
"logging_",
"._",
"WARNING_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"raise_",
"Clos",
"e",
"Spider_",
"(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AppServer/lib/django-1.2/tests/regressiontests/m2m_through_regress/tests.py | [
{
"content": "try:\n from cStringIO import StringIO\nexcept ImportError:\n from StringIO import StringIO\n\nfrom django.core import management\nfrom django.contrib.auth.models import User\nfrom django.test import TestCase\n\nfrom models import (Person, Group, Membership, UserMembership,\n Car, Driver, CarDriver)\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class M2MThroughTestCase(TestCase):\n\n",
"metadata": "root.M2MThroughTestCase",
"header": "['module', '___EOS___']",
"index": 13
},
{
"content": " def test_everything(self):\n bob = Person.objects.create(name=\"Bob\")\n jim = Person.objects.create(name=\"Jim\")\n\n rock = Group.objects.create(name=\"Rock\")\n roll = Group.objects.create(name=\"Roll\")\n\n frank = User.objects.create_user(\"frank\", \"[email protected]\", \"password\")\n jane = User.objects.create_user(\"jane\", \"[email protected]\", \"password\")\n\n Membership.objects.create(person=bob, group=rock)\n Membership.objects.create(person=bob, group=roll)\n Membership.objects.create(person=jim, group=rock)\n\n self.assertQuerysetEqual(\n bob.group_set.all(), [\n \"<Group: Rock>\",\n \"<Group: Roll>\",\n ]\n )\n\n self.assertQuerysetEqual(\n roll.members.all(), [\n \"<Person: Bob>\",\n ]\n )\n\n self.assertRaises(AttributeError, setattr, bob, \"group_set\", [])\n self.assertRaises(AttributeError, setattr, roll, \"members\", [])\n\n self.assertRaises(AttributeError, rock.members.create, name=\"Anne\")\n self.assertRaises(AttributeError, bob.group_set.create, name=\"Funk\")\n\n UserMembership.objects.create(user=frank, group=rock)\n UserMembership.objects.create(user=frank, group=roll)\n UserMembership.objects.create(user=jane, group=rock)\n\n self.assertQuerysetEqual(\n frank.group_set.all(), [\n \"<Group: Rock>\",\n \"<Group: Roll>\",\n ]\n )\n\n self.assertQuerysetEqual(\n roll.user_members.all(), [\n \"<User: frank>\",\n ]\n )",
"metadata": "root.M2MThroughTestCase.test_everything",
"header": "['class', 'M2MThroughTestCase', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 14
},
{
"content": " def test_serialization(self):\n \"m2m-through models aren't serialized as m2m fields. Refs #8134\"\n\n p = Person.objects.create(name=\"Bob\")\n g = Group.objects.create(name=\"Roll\")\n m = Membership.objects.create(person=p, group=g)\n\n pks = {\"p_pk\": p.pk, \"g_pk\": g.pk, \"m_pk\": m.pk}\n\n out = StringIO()\n management.call_command(\"dumpdata\", \"m2m_through_regress\", format=\"json\", stdout=out)\n self.assertEqual(out.getvalue().strip(), \"\"\"[{\"pk\": %(m_pk)s, \"model\": \"m2m_through_regress.membership\", \"fields\": {\"person\": %(p_pk)s, \"price\": 100, \"group\": %(g_pk)s}}, {\"pk\": %(p_pk)s, \"model\": \"m2m_through_regress.person\", \"fields\": {\"name\": \"Bob\"}}, {\"pk\": %(g_pk)s, \"model\": \"m2m_through_regress.group\", \"fields\": {\"name\": \"Roll\"}}]\"\"\" % pks)\n\n out = StringIO()\n management.call_command(\"dumpdata\", \"m2m_through_regress\", format=\"xml\",\n indent=2, stdout=out)\n self.assertEqual(out.getvalue().strip(), \"\"\"\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<django-objects version=\"1.0\">\n <object pk=\"%(m_pk)s\" model=\"m2m_through_regress.membership\">\n <field to=\"m2m_through_regress.person\" name=\"person\" rel=\"ManyToOneRel\">%(p_pk)s</field>\n <field to=\"m2m_through_regress.group\" name=\"group\" rel=\"ManyToOneRel\">%(g_pk)s</field>\n <field type=\"IntegerField\" name=\"price\">100</field>\n </object>\n <object pk=\"%(p_pk)s\" model=\"m2m_through_regress.person\">\n <field type=\"CharField\" name=\"name\">Bob</field>\n </object>\n <object pk=\"%(g_pk)s\" model=\"m2m_through_regress.group\">\n <field type=\"CharField\" name=\"name\">Roll</field>\n </object>\n</django-objects>\n \"\"\".strip() % pks)",
"metadata": "root.M2MThroughTestCase.test_serialization",
"header": "['class', 'M2MThroughTestCase', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 64
},
{
"content": " def test_join_trimming(self):\n \"Check that we don't involve too many copies of the intermediate table when doing a join. Refs #8046, #8254\"\n bob = Person.objects.create(name=\"Bob\")\n jim = Person.objects.create(name=\"Jim\")\n\n rock = Group.objects.create(name=\"Rock\")\n roll = Group.objects.create(name=\"Roll\")\n\n Membership.objects.create(person=bob, group=rock)\n Membership.objects.create(person=jim, group=rock, price=50)\n Membership.objects.create(person=bob, group=roll, price=50)\n\n self.assertQuerysetEqual(\n rock.members.filter(membership__price=50), [\n \"<Person: Jim>\",\n ]\n )\n\n self.assertQuerysetEqual(\n bob.group_set.filter(membership__price=50), [\n \"<Group: Roll>\",\n ]\n )",
"metadata": "root.M2MThroughTestCase.test_join_trimming",
"header": "['class', 'M2MThroughTestCase', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 97
},
{
"content": "class ToFieldThroughTests(TestCase):\n\n",
"metadata": "root.ToFieldThroughTests",
"header": "['module', '___EOS___']",
"index": 122
},
{
"content": " def setUp(self):\n self.car = Car.objects.create(make=\"Toyota\")\n self.driver = Driver.objects.create(name=\"Ryan Briscoe\")\n CarDriver.objects.create(car=self.car, driver=self.driver)",
"metadata": "root.ToFieldThroughTests.setUp",
"header": "['class', 'ToFieldThroughTests', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 123
},
{
"content": " def test_to_field(self):\n self.assertQuerysetEqual(\n self.car.drivers.all(),\n [\"<Driver: Ryan Briscoe>\"]\n )",
"metadata": "root.ToFieldThroughTests.test_to_field",
"header": "['class', 'ToFieldThroughTests', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 128
},
{
"content": " def test_to_field_reverse(self):\n self.assertQuerysetEqual(\n self.driver.car_set.all(),\n [\"<Car: Toyota>\"]\n )",
"metadata": "root.ToFieldThroughTests.test_to_field_reverse",
"header": "['class', 'ToFieldThroughTests', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 134
},
{
"content": "class ThroughLoadDataTestCase(TestCase):\n fixtures = [\"m2m_through\"]\n",
"metadata": "root.ThroughLoadDataTestCase",
"header": "['module', '___EOS___']",
"index": 140
},
{
"content": " def test_sequence_creation(self):\n \"Check that sequences on an m2m_through are created for the through model, not a phantom auto-generated m2m table. Refs #11107\"\n out = StringIO()\n management.call_command(\"dumpdata\", \"m2m_through_regress\", format=\"json\", stdout=out)\n self.assertEqual(out.getvalue().strip(), \"\"\"[{\"pk\": 1, \"model\": \"m2m_through_regress.usermembership\", \"fields\": {\"price\": 100, \"group\": 1, \"user\": 1}}, {\"pk\": 1, \"model\": \"m2m_through_regress.person\", \"fields\": {\"name\": \"Guido\"}}, {\"pk\": 1, \"model\": \"m2m_through_regress.group\", \"fields\": {\"name\": \"Python Core Group\"}}]\"\"\")",
"metadata": "root.ThroughLoadDataTestCase.test_sequence_creation",
"header": "['class', 'ThroughLoadDataTestCase', '(', 'TestCase', ')', ':', '___EOS___']",
"index": 143
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"c",
"String",
"IO_",
"import_",
"String",
"IO_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Import",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"String",
"IO_",
"import_",
"String",
"IO_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"from_",
"django_",
"._",
"core_",
"import_",
"management_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"contrib_",
"._",
"auth_",
"._",
"models_",
"import_",
"User_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"django_",
"._",
"test_",
"import_",
"Test",
"Case_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"models_",
"import_",
"(_",
"Person_",
",_",
"Group_",
",_",
"Membership",
"_",
",_",
"User",
"Membership",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"Car",
"_",
",_",
"Driver_",
",_",
"Car",
"Driver_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"M2",
"MT",
"hro",
"ugh",
"Test",
"Case_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"M2",
"MT",
"hro",
"ugh",
"Test",
"Case_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"test\\u",
"every",
"thing_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"bob_",
"=_",
"Person_",
"._",
"objects_",
"._",
"create_",
"(_",
"name_",
"=_",
"\"",
"Bob",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"jim",
"_",
"=_",
"Person_",
"._",
"objects_",
"._",
"create_",
"(_",
"name_",
"=_",
"\"",
"Ji",
"m",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"rock",
"_",
"=_",
"Group_",
"._",
"objects_",
"._",
"create_",
"(_",
"name_",
"=_",
"\"",
"Rock",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"roll_",
"=_",
"Group_",
"._",
"objects_",
"._",
"create_",
"(_",
"name_",
"=_",
"\"",
"Roll",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"fran",
"k_",
"=_",
"User_",
"._",
"objects_",
"._",
"create",
"\\u",
"user_",
"(_",
"\"",
"fran",
"k",
"\"_",
",_",
"\"",
"fran",
"k",
"@",
"example",
".",
"com",
"\"_",
",_",
"\"",
"password",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"jane",
"_",
"=_",
"User_",
"._",
"objects_",
"._",
"create",
"\\u",
"user_",
"(_",
"\"",
"jane",
"\"_",
",_",
"\"",
"jane",
"@",
"example",
".",
"com",
"\"_",
",_",
"\"",
"password",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Membership",
"_",
"._",
"objects_",
"._",
"create_",
"(_",
"person_",
"=_",
"bob_",
",_",
"group_",
"=_",
"rock",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Membership",
"_",
"._",
"objects_",
"._",
"create_",
"(_",
"person_",
"=_",
"bob_",
",_",
"group_",
"=_",
"roll_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Membership",
"_",
"._",
"objects_",
"._",
"create_",
"(_",
"person_",
"=_",
"jim",
"_",
",_",
"group_",
"=_",
"rock",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Query",
"set",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"bob_",
"._",
"group",
"\\u",
"set_",
"._",
"all_",
"(_",
")_",
",_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"<",
"Group",
":",
" ",
"Rock",
">\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"<",
"Group",
":",
" ",
"Roll",
">\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Query",
"set",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"roll_",
"._",
"members_",
"._",
"all_",
"(_",
")_",
",_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"<",
"Person",
":",
" ",
"Bob",
">\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"Attribute",
"Error_",
",_",
"setattr_",
",_",
"bob_",
",_",
"\"",
"group",
"\\u",
"set",
"\"_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"Attribute",
"Error_",
",_",
"setattr_",
",_",
"roll_",
",_",
"\"",
"member",
"s",
"\"_",
",_",
"[_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"Attribute",
"Error_",
",_",
"rock",
"_",
"._",
"members_",
"._",
"create_",
",_",
"name_",
"=_",
"\"",
"Ann",
"e",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Raises_",
"(_",
"Attribute",
"Error_",
",_",
"bob_",
"._",
"group",
"\\u",
"set_",
"._",
"create_",
",_",
"name_",
"=_",
"\"",
"Fun",
"k",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"User",
"Membership",
"_",
"._",
"objects_",
"._",
"create_",
"(_",
"user_",
"=_",
"fran",
"k_",
",_",
"group_",
"=_",
"rock",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"User",
"Membership",
"_",
"._",
"objects_",
"._",
"create_",
"(_",
"user_",
"=_",
"fran",
"k_",
",_",
"group_",
"=_",
"roll_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"User",
"Membership",
"_",
"._",
"objects_",
"._",
"create_",
"(_",
"user_",
"=_",
"jane",
"_",
",_",
"group_",
"=_",
"rock",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Query",
"set",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"fran",
"k_",
"._",
"group",
"\\u",
"set_",
"._",
"all_",
"(_",
")_",
",_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"<",
"Group",
":",
" ",
"Rock",
">\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"<",
"Group",
":",
" ",
"Roll",
">\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Query",
"set",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"roll_",
"._",
"user",
"\\u",
"members_",
"._",
"all_",
"(_",
")_",
",_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"<",
"User",
":",
" ",
"fran",
"k",
">\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"M2",
"MT",
"hro",
"ugh",
"Test",
"Case_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"serialization_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"",
"m2",
"m",
"-",
"through",
" ",
"model",
"s",
" ",
"are",
"n",
"'",
"t",
" ",
"serialize",
"d",
" ",
"as",
" ",
"m2",
"m",
" ",
"fields",
".",
" ",
"Refs",
" ",
"#",
"813",
"4",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"p_",
"=_",
"Person_",
"._",
"objects_",
"._",
"create_",
"(_",
"name_",
"=_",
"\"",
"Bob",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"g_",
"=_",
"Group_",
"._",
"objects_",
"._",
"create_",
"(_",
"name_",
"=_",
"\"",
"Roll",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"m_",
"=_",
"Membership",
"_",
"._",
"objects_",
"._",
"create_",
"(_",
"person_",
"=_",
"p_",
",_",
"group_",
"=_",
"g_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"pks",
"_",
"=_",
"{_",
"\"",
"p",
"\\u",
"pk",
"\"_",
":_",
"p_",
"._",
"pk_",
",_",
"\"",
"g",
"\\u",
"pk",
"\"_",
":_",
"g_",
"._",
"pk_",
",_",
"\"",
"m",
"\\u",
"pk",
"\"_",
":_",
"m_",
"._",
"pk_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"out_",
"=_",
"String",
"IO_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"management_",
"._",
"call",
"\\u",
"command_",
"(_",
"\"",
"dump",
"data",
"\"_",
",_",
"\"",
"m2",
"m",
"\\u",
"through",
"\\u",
"regress",
"\"_",
",_",
"format_",
"=_",
"\"",
"json",
"\"_",
",_",
"stdout_",
"=_",
"out_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"out_",
"._",
"getvalue_",
"(_",
")_",
"._",
"strip_",
"(_",
")_",
",_",
"\"\"\"[",
"{",
"\"",
"pk",
"\":",
" ",
"%",
"(",
"m",
"\\u",
"pk",
")",
"s",
",",
" ",
"\"",
"model",
"\":",
" ",
"\"",
"m2",
"m",
"\\u",
"through",
"\\u",
"regress",
".",
"member",
"ship",
"\",",
" ",
"\"",
"fields",
"\":",
" ",
"{",
"\"",
"person",
"\":",
" ",
"%",
"(",
"p",
"\\u",
"pk",
")",
"s",
",",
" ",
"\"",
"price",
"\":",
" ",
"100",
",",
" ",
"\"",
"group",
"\":",
" ",
"%",
"(",
"g",
"\\u",
"pk",
")",
"s",
"}}",
",",
" ",
"{",
"\"",
"pk",
"\":",
" ",
"%",
"(",
"p",
"\\u",
"pk",
")",
"s",
",",
" ",
"\"",
"model",
"\":",
" ",
"\"",
"m2",
"m",
"\\u",
"through",
"\\u",
"regress",
".",
"person",
"\",",
" ",
"\"",
"fields",
"\":",
" ",
"{",
"\"",
"name",
"\":",
" ",
"\"",
"Bob",
"\"}}",
",",
" ",
"{",
"\"",
"pk",
"\":",
" ",
"%",
"(",
"g",
"\\u",
"pk",
")",
"s",
",",
" ",
"\"",
"model",
"\":",
" ",
"\"",
"m2",
"m",
"\\u",
"through",
"\\u",
"regress",
".",
"group",
"\",",
" ",
"\"",
"fields",
"\":",
" ",
"{",
"\"",
"name",
"\":",
" ",
"\"",
"Roll",
"\"}}",
"]\"",
"\"\"_",
"%_",
"pks",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"out_",
"=_",
"String",
"IO_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"management_",
"._",
"call",
"\\u",
"command_",
"(_",
"\"",
"dump",
"data",
"\"_",
",_",
"\"",
"m2",
"m",
"\\u",
"through",
"\\u",
"regress",
"\"_",
",_",
"format_",
"=_",
"\"",
"xml",
"\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"indent_",
"=_",
"2_",
",_",
"stdout_",
"=_",
"out_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"out_",
"._",
"getvalue_",
"(_",
")_",
"._",
"strip_",
"(_",
")_",
",_",
"\"\"\"",
"\\",
"10",
";<",
"?",
"xml",
" ",
"version",
"=\"",
"1.0",
"\"",
" ",
"encoding",
"=\"",
"utf",
"-",
"8",
"\"?",
">",
"\\",
"10",
";<",
"django",
"-",
"object",
"s",
" ",
"version",
"=\"",
"1.0",
"\">",
"\\",
"10",
";",
" ",
" ",
"<",
"object",
" ",
"pk",
"=\"",
"%",
"(",
"m",
"\\u",
"pk",
")",
"s",
"\"",
" ",
"model",
"=\"",
"m2",
"m",
"\\u",
"through",
"\\u",
"regress",
".",
"member",
"ship",
"\">",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"<",
"field",
" ",
"to",
"=\"",
"m2",
"m",
"\\u",
"through",
"\\u",
"regress",
".",
"person",
"\"",
" ",
"name",
"=\"",
"person",
"\"",
" ",
"rel",
"=\"",
"Many",
"To",
"One",
"Rel",
"\">",
"%",
"(",
"p",
"\\u",
"pk",
")",
"s",
"</",
"field",
">",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"<",
"field",
" ",
"to",
"=\"",
"m2",
"m",
"\\u",
"through",
"\\u",
"regress",
".",
"group",
"\"",
" ",
"name",
"=\"",
"group",
"\"",
" ",
"rel",
"=\"",
"Many",
"To",
"One",
"Rel",
"\">",
"%",
"(",
"g",
"\\u",
"pk",
")",
"s",
"</",
"field",
">",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"<",
"field",
" ",
"type",
"=\"",
"Integer",
"Field",
"\"",
" ",
"name",
"=\"",
"price",
"\">",
"100",
"</",
"field",
">",
"\\",
"10",
";",
" ",
" ",
"</",
"object",
">",
"\\",
"10",
";",
" ",
" ",
"<",
"object",
" ",
"pk",
"=\"",
"%",
"(",
"p",
"\\u",
"pk",
")",
"s",
"\"",
" ",
"model",
"=\"",
"m2",
"m",
"\\u",
"through",
"\\u",
"regress",
".",
"person",
"\">",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"<",
"field",
" ",
"type",
"=\"",
"Char",
"Field",
"\"",
" ",
"name",
"=\"",
"name",
"\">",
"Bob",
"</",
"field",
">",
"\\",
"10",
";",
" ",
" ",
"</",
"object",
">",
"\\",
"10",
";",
" ",
" ",
"<",
"object",
" ",
"pk",
"=\"",
"%",
"(",
"g",
"\\u",
"pk",
")",
"s",
"\"",
" ",
"model",
"=\"",
"m2",
"m",
"\\u",
"through",
"\\u",
"regress",
".",
"group",
"\">",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"<",
"field",
" ",
"type",
"=\"",
"Char",
"Field",
"\"",
" ",
"name",
"=\"",
"name",
"\">",
"Roll",
"</",
"field",
">",
"\\",
"10",
";",
" ",
" ",
"</",
"object",
">",
"\\",
"10",
";<",
"/",
"django",
"-",
"object",
"s",
">",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"._",
"strip_",
"(_",
")_",
"%_",
"pks",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"M2",
"MT",
"hro",
"ugh",
"Test",
"Case_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"join",
"\\u",
"trim",
"ming",
"_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"",
"Check",
" ",
"tha",
"t",
" ",
"we",
" ",
"don",
"'",
"t",
" ",
"involv",
"e",
" ",
"too",
" ",
"many",
" ",
"copie",
"s",
" ",
"of",
" ",
"the",
" ",
"intermediate",
" ",
"table",
" ",
"whe",
"n",
" ",
"doi",
"ng",
" ",
"a",
" ",
"join",
".",
" ",
"Refs",
" ",
"#",
"804",
"6",
",",
" ",
"#",
"825",
"4",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"bob_",
"=_",
"Person_",
"._",
"objects_",
"._",
"create_",
"(_",
"name_",
"=_",
"\"",
"Bob",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"jim",
"_",
"=_",
"Person_",
"._",
"objects_",
"._",
"create_",
"(_",
"name_",
"=_",
"\"",
"Ji",
"m",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"rock",
"_",
"=_",
"Group_",
"._",
"objects_",
"._",
"create_",
"(_",
"name_",
"=_",
"\"",
"Rock",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"roll_",
"=_",
"Group_",
"._",
"objects_",
"._",
"create_",
"(_",
"name_",
"=_",
"\"",
"Roll",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"Membership",
"_",
"._",
"objects_",
"._",
"create_",
"(_",
"person_",
"=_",
"bob_",
",_",
"group_",
"=_",
"rock",
"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Membership",
"_",
"._",
"objects_",
"._",
"create_",
"(_",
"person_",
"=_",
"jim",
"_",
",_",
"group_",
"=_",
"rock",
"_",
",_",
"price_",
"=_",
"50_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Membership",
"_",
"._",
"objects_",
"._",
"create_",
"(_",
"person_",
"=_",
"bob_",
",_",
"group_",
"=_",
"roll_",
",_",
"price_",
"=_",
"50_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Query",
"set",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"rock",
"_",
"._",
"members_",
"._",
"filter_",
"(_",
"member",
"ship",
"\\u\\u",
"price_",
"=_",
"50_",
")_",
",_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"<",
"Person",
":",
" ",
"Ji",
"m",
">\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"assert",
"Query",
"set",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"bob_",
"._",
"group",
"\\u",
"set_",
"._",
"filter_",
"(_",
"member",
"ship",
"\\u\\u",
"price_",
"=_",
"50_",
")_",
",_",
"[_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"<",
"Group",
":",
" ",
"Roll",
">\"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"To",
"Field",
"Through",
"Tests_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"To",
"Field",
"Through",
"Tests_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"def_",
"set",
"Up_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"car_",
"=_",
"Car",
"_",
"._",
"objects_",
"._",
"create_",
"(_",
"make_",
"=_",
"\"",
"To",
"yo",
"ta",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"driver_",
"=_",
"Driver_",
"._",
"objects_",
"._",
"create_",
"(_",
"name_",
"=_",
"\"",
"Ry",
"an",
" ",
"Bri",
"sco",
"e",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Car",
"Driver_",
"._",
"objects_",
"._",
"create_",
"(_",
"car_",
"=_",
"self_",
"._",
"car_",
",_",
"driver_",
"=_",
"self_",
"._",
"driver_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"To",
"Field",
"Through",
"Tests_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"to",
"\\u",
"field_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"assert",
"Query",
"set",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"car_",
"._",
"drivers_",
"._",
"all_",
"(_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"[_",
"\"<",
"Drive",
"r",
":",
" ",
"Ry",
"an",
" ",
"Bri",
"sco",
"e",
">\"_",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"To",
"Field",
"Through",
"Tests_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"test\\u",
"to",
"\\u",
"field",
"\\u",
"reverse_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"assert",
"Query",
"set",
"Equal_",
"(_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"driver_",
"._",
"car",
"\\u",
"set_",
"._",
"all_",
"(_",
")_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"[_",
"\"<",
"Car",
":",
" ",
"To",
"yo",
"ta",
">\"_",
"]_",
"\\u\\u\\uNL\\u\\u\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Through",
"Load",
"Data",
"Test",
"Case_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"fixtures_",
"=_",
"[_",
"\"",
"m2",
"m",
"\\u",
"through",
"\"_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Through",
"Load",
"Data",
"Test",
"Case_",
"(_",
"Test",
"Case_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"test\\u",
"sequence",
"\\u",
"creation_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"",
"Check",
" ",
"tha",
"t",
" ",
"sequence",
"s",
" ",
"on",
" ",
"an",
" ",
"m2",
"m",
"\\u",
"through",
" ",
"are",
" ",
"created",
" ",
"for",
" ",
"the",
" ",
"through",
" ",
"model",
",",
" ",
"not",
" ",
"a",
" ",
"phantom",
" ",
"auto",
"-",
"generat",
"ed",
" ",
"m2",
"m",
" ",
"table",
".",
" ",
"Refs",
" ",
"#",
"1110",
"7",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"out_",
"=_",
"String",
"IO_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"management_",
"._",
"call",
"\\u",
"command_",
"(_",
"\"",
"dump",
"data",
"\"_",
",_",
"\"",
"m2",
"m",
"\\u",
"through",
"\\u",
"regress",
"\"_",
",_",
"format_",
"=_",
"\"",
"json",
"\"_",
",_",
"stdout_",
"=_",
"out_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"assert",
"Equal_",
"(_",
"out_",
"._",
"getvalue_",
"(_",
")_",
"._",
"strip_",
"(_",
")_",
",_",
"\"\"\"[",
"{",
"\"",
"pk",
"\":",
" ",
"1",
",",
" ",
"\"",
"model",
"\":",
" ",
"\"",
"m2",
"m",
"\\u",
"through",
"\\u",
"regress",
".",
"userm",
"ember",
"ship",
"\",",
" ",
"\"",
"fields",
"\":",
" ",
"{",
"\"",
"price",
"\":",
" ",
"100",
",",
" ",
"\"",
"group",
"\":",
" ",
"1",
",",
" ",
"\"",
"user",
"\":",
" ",
"1",
"}}",
",",
" ",
"{",
"\"",
"pk",
"\":",
" ",
"1",
",",
" ",
"\"",
"model",
"\":",
" ",
"\"",
"m2",
"m",
"\\u",
"through",
"\\u",
"regress",
".",
"person",
"\",",
" ",
"\"",
"fields",
"\":",
" ",
"{",
"\"",
"name",
"\":",
" ",
"\"",
"Guid",
"o",
"\"}}",
",",
" ",
"{",
"\"",
"pk",
"\":",
" ",
"1",
",",
" ",
"\"",
"model",
"\":",
" ",
"\"",
"m2",
"m",
"\\u",
"through",
"\\u",
"regress",
".",
"group",
"\",",
" ",
"\"",
"fields",
"\":",
" ",
"{",
"\"",
"name",
"\":",
" ",
"\"",
"Pyth",
"on",
" ",
"Core",
" ",
"Group",
"\"}}",
"]\"",
"\"\"_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2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2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Testing equality to None | tomerfiliba/plumbum/plumbum/machines/session.py | [
{
"content": " def alive(self):\n \"\"\"Returns ``True`` if the underlying shell process is alive, ``False`` otherwise\"\"\"\n return self.proc and self.proc.poll() is None",
"metadata": "root.ShellSession.alive",
"header": "['class', 'ShellSession', '(', 'object', ')', ':', '___EOS___']",
"index": 182
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Test",
"ing_",
"equality",
"_",
"to_",
"None_",
"[SEP]_",
"class_",
"Shel",
"l",
"Session_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"alive_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Return",
"s",
" ",
"``",
"Tru",
"e",
"``",
" ",
"if",
" ",
"the",
" ",
"underl",
"ying",
" ",
"shell",
" ",
"process",
" ",
"is",
" ",
"alive",
",",
" ",
"``",
"Fal",
"se",
"``",
" ",
"other",
"wis",
"e",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"self_",
"._",
"proc_",
"and_",
"self_",
"._",
"proc_",
"._",
"poll_",
"(_",
")_",
"is_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused local variable | enthought/pyface/pyface/ui/qt4/python_editor.py | [
{
"content": "@provides(IPythonEditor)\nclass PythonEditor(MPythonEditor, Widget):\n \"\"\" The toolkit specific implementation of a PythonEditor. See the\n IPythonEditor interface for the API documentation.\n \"\"\"\n\n\n #### 'IPythonEditor' interface ############################################\n\n dirty = Bool(False)\n\n path = Unicode\n\n show_line_numbers = Bool(True)\n\n #### Events ####\n\n changed = Event\n\n key_pressed = Event(KeyPressedEvent)\n\n ###########################################################################\n # 'object' interface.\n ###########################################################################\n\n\n ###########################################################################\n # 'PythonEditor' interface.\n ###########################################################################\n\n\n\n\n ###########################################################################\n # Trait handlers.\n ###########################################################################\n\n\n\n ###########################################################################\n # Private interface.\n ###########################################################################\n\n\n",
"metadata": "root.PythonEditor",
"header": "['module', '___EOS___']",
"index": 29
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"@_",
"provides_",
"(_",
"IP",
"yth",
"on",
"Editor_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"class_",
"Pyth",
"on",
"Editor_",
"(_",
"MP",
"yth",
"on",
"Editor_",
",_",
"Widget_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"The",
" ",
"tool",
"kit",
" ",
"specific",
" ",
"implementation",
" ",
"of",
" ",
"a",
" ",
"Pyth",
"on",
"Edit",
"or",
".",
" ",
" ",
"See",
" ",
"the",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"IP",
"yth",
"on",
"Edit",
"or",
" ",
"interface",
" ",
"for",
" ",
"the",
" ",
"API",
" ",
"documentation",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"###",
"#",
" ",
"'",
"IP",
"yth",
"on",
"Edit",
"or",
"'",
" ",
"interface",
" ",
"###########",
"###########",
"###########",
"###########",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"dirty_",
"=_",
"Bool_",
"(_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"path_",
"=_",
"Unicode_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"show",
"\\u",
"line",
"\\u",
"numbers_",
"=_",
"Bool_",
"(_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"###",
"#",
" ",
"Event",
"s",
" ",
"###",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"changed_",
"=_",
"Event_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"key",
"\\u",
"pressed_",
"=_",
"Event_",
"(_",
"Key",
"Press",
"ed",
"Event_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"#########",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"'",
"object",
"'",
" ",
"interface",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"#########",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"#########",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"'",
"Pyth",
"on",
"Edit",
"or",
"'",
" ",
"interface",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"#########",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"#########",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Trait",
" ",
"handler",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"#########",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"#########",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Priva",
"te",
" ",
"interface",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"###########",
"###########",
"###########",
"###########",
"###########",
"###########",
"#########",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Variable defined multiple times | nucleic/enaml/enaml/qt/docking/q_dock_item.py | [
{
"content": " def mousePressEvent(self, event):\n \"\"\" Handle the mouse press event for the dock item.\n\n This handler will clear any alert level on a left click.\n\n \"\"\"\n if event.button() == Qt.LeftButton:\n self.clearAlert()\n super(QDockItem, self).mousePressEvent(event)",
"metadata": "root.QDockItem.mousePressEvent",
"header": "['class', 'QDockItem', '(', 'QFrame', ')', ':', '___EOS___']",
"index": 349
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Variable_",
"defined_",
"multiple_",
"times_",
"[SEP]_",
"class_",
"QD",
"ock",
"Item_",
"(_",
"QF",
"rame_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"mouse",
"Press",
"Event_",
"(_",
"self_",
",_",
"event_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
" ",
"Handle",
" ",
"the",
" ",
"mouse",
" ",
"press",
" ",
"event",
" ",
"for",
" ",
"the",
" ",
"dock",
" ",
"item",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Thi",
"s",
" ",
"handler",
" ",
"will",
" ",
"clear",
" ",
"any",
" ",
"alert",
" ",
"level",
" ",
"on",
" ",
"a",
" ",
"left",
" ",
"click",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"event_",
"._",
"button_",
"(_",
")_",
"==_",
"Qt_",
"._",
"Le",
"ft",
"Button_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"clear",
"Alert_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"super_",
"(_",
"QD",
"ock",
"Item_",
",_",
"self_",
")_",
"._",
"mouse",
"Press",
"Event_",
"(_",
"event_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | redhat-imaging/imagefactory/imgfac/picklingtools/xmldumper.py | [
{
"content": "#!/bin/env python\n\n# Copyright (c) 2001-2009 Rincon Research Corporation, Richard T. Saunders\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n# 1. Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above copyright\n# notice, this list of conditions and the following disclaimer in the\n# documentation and/or other materials provided with the distribution.\n# 3. The name of the author may not be used to endorse or promote products\n# derived from this software without specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n\"\"\"\n This class convert dictionaries to XML. This is usually\n an easy mapping, because key-value mappings go easily to XML\n (the other way is more problematic). A potential issue\n usually is how to handle attributes.... See the options below!\n\n Examples:\n \n { 'book' = {\n 'chapter' = [ 'text chap 1', 'text chap 2']\n '__attrs__' = { 'attr1':\"1\", 'attr2':\"2\" }\n }\n --------dumps as --------------\n <book attr1=\"1\" attr2=\"2\">\n <chapter>text chap 1</chapter>\n <chapter>text chap 2</chapter>\n </book>\n \n\n With UNFOLDING on (attributes are marked with _)\n \n { 'book' = {\n 'chapter' = [ 'text chap 1', 'text chap 2']\n '_attr1':\"1\", \n '_attr2':\"2\" \n }\n }\n ---------dumps as --------------\n <book attr1=\"1\" attr2=\"2\">\n <chapter date=\"1999\">text chap 1</chapter>\n <chapter data=\"2000\">text chap 2</chapter>\n </book>\n\"\"\"\n\nimport sys\nimport pretty\nfrom curses.ascii import isprint\n\n# Not until 2.7, keep as plain dict then\ntry :\n from collections import OrderedDict\nexcept :\n OrderedDict = dict\n\n# All the arrays we may get when iterating through: if someone gives\n# us the data structure (Numeric array or Python array), we still try\n# to dump it.\nfrom arraydisposition import *\narray_types = []\ntry :\n import Numeric\n array_types.append(type(Numeric.array([]))) # Tag doesn't effect type\nexcept :\n pass\ntry :\n import array\n array_types.append(array.array)\nexcept :\n pass\nimport simplearray\narray_types.append(simplearray.SimpleArray)\n\nimport pretty\n\n# Options for dictionaries -> XML\n# If XML attributes are being folded up, then you may\n# want to prepend a special character to distinguish attributes\n# from nested tags: an underscore is the usual default. If\n# you don't want a prepend char, use XML_DUMP_NO_PREPEND option\nXML_PREPEND_CHAR = '_'\n\n\n# When dumping, by DEFAULT the keys that start with _ become\n# attributes (this is called \"unfolding\"). You may want to keep\n# those keys as tags. Consider:\n#\n# { 'top': { '_a':'1', '_b': 2 }} \n# \n# DEFAULT behavior, this becomes:\n# <top a=\"1\" b=\"2\"></top> This moves the _names to attributes\n# \n# But, you may want all _ keys to stay as tags: that's the purpose of this opt\n# <top> <_a>1</_a> <_b>2</b> </top>\nXML_DUMP_PREPEND_KEYS_AS_TAGS = 0x100\n\n# Any value that is simple (i.e., contains no nested\n# content) will be placed in the attributes bin:\n# For examples:\n# { 'top': { 'x':'1', 'y': 2 }} -> <top x=\"1\" y=\"2\"></top>\nXML_DUMP_SIMPLE_TAGS_AS_ATTRIBUTES = 0x200\n\n# By default, everything dumps as strings (without quotes), but those things\n# that are strings lose their \"stringedness\", which means\n# they can't be \"evaled\" on the way back in. This option makes \n# Vals that are strings dump with quotes.\nXML_DUMP_STRINGS_AS_STRINGS = 0x400\n\n# Like XML_DUMP_STRINGS_AS_STRINGS, but this one ONLY\n# dumps strings with quotes if it thinks Eval will return\n# something else. For example in { 's': '123' } : '123' is \n# a STRING, not a number. When evalled with an XMLLoader\n# with XML_LOAD_EVAL_CONTENT flag, that will become a number.\nXML_DUMP_STRINGS_BEST_GUESS = 0x800\n\n# Show nesting when you dump: like \"prettyPrint\": basically, it shows\n# nesting\nXML_DUMP_PRETTY = 0x1000\n\n# Arrays of POD (plain old data: ints, real, complex, etc) can\n# dump as huge lists: By default they just dump with one tag\n# and then a list of numbers. If you set this option, they dump\n# as a true XML list (<data>1.0/<data><data>2.0</data> ...)\n# which is very expensive, but is easier to use with other\n# tools (spreadsheets that support lists, etc.).\nXML_DUMP_POD_LIST_AS_XML_LIST = 0x2000\n\n\n# When dumping an empty tag, what do you want it to be?\n# I.e., what is <empty></empty> \n# Normally (DEFAULT) this is an empty dictionary 'empty': {}\n# If you want that to be empty content, as in an empty string,\n# set this option: 'empty': \"\"\n# NOTE: You don't need this option if you are using\n# XML_DUMP_STRINGS_AS_STRINGS or XML_DUMP_STRINGS_BEST_GUESS\nXML_DUMP_PREFER_EMPTY_STRINGS = 0x4000\n\n# When dumping dictionaries in order, a dict BY DEFAULT prints\n# out the keys in sorted/alphabetic order and BY DEFAULT an OrderedDict\n# prints out in the OrderedDict order. The \"unnatural\" order\n# for a dict is to print out in \"random\" order (but probably slightly\n# faster). The \"unnatural\" order for an OrderedDict is sorted\n# (because normally we use an OrderedDict because we WANTS its\n# notion of order)\nXML_DUMP_UNNATURAL_ORDER = 0x8000\n\n# Even though illegal XML, allow element names starting with Digits:\n# when it does see a starting digit, it turns it into an _digit\n# so that it is still legal XML\nXML_TAGS_ACCEPTS_DIGITS = 0x80\n\n# When dumping XML, the default is to NOT have the XML header \n# <?xml version=\"1.0\">: Specifying this option will always make that\n# the header always precedes all content\nXML_STRICT_HDR = 0x10000\n\n\n\n\n\n\n# ############################# Global Functions\n\n\n\n\nimport cStringIO\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class XMLDumper(object) :\n \"\"\"An instance of this will help dump a Python object (made up of lists,\n dictionaries, Numeric data and all primitive types as XML\"\"\"\n\n # On error, do you want to throw exception, silently continue or warn\n # on stderr? Usually errors happens when there are multiple attributes\n # that conflict.\n SILENT_ON_ERROR = 1\n CERR_ON_ERROR = 2\n THROW_ON_ERROR = 3 \n\n\n \n\n \n \n \n\n\n\n # Handle the XML Header, if we want to dump it\n\n # Dump, but allow passage of attributes\n\n # Dump just the name and make sure it's well-formed tag name\n # (or attribute name): TODO: This may be too restrictive\n \n\n # Dump content: this means handling escape characters\n\n\n # Dump the start tag, with attention to formatting and options\n\n\n\n # Dump the end tag, with attention to output options and formatting\n\n\n # Does the tag represent a composite object: any container is\n # a composite: Tab, Arr, Tup, OTab \n # primitive data: string, complex, int, float, etc.\n\n\n # Find all key-values that could be XML attributes \n\n \n \n \n # Dump a list of binary data as a tag with one special key:\n # arraytype__ = \"<typetag>\" which is some typetag (silxfdSILXFD)\n # or, every individual element as a \"type__\" = <typetag>\"\n\n\n # Dump a table t\n\n \n # Dump a primitive type (string, number, real, complex, etc.)\n\n\n # Centralize error handling",
"metadata": "root.XMLDumper",
"header": "['module', '___EOS___']",
"index": 174
},
{
"content": " def __init__ (self, os, options=0,\n array_disposition=ARRAYDISPOSITION_AS_LIST,\n indent_increment=4,\n prepend_char=XML_PREPEND_CHAR, \n mode = 2) : # XMLDumper.CERR_ON_ERROR\n \"\"\"Create am XML dumper. Note that options are | together:\n XMLDumper xd(cout, XML_DUMP_PRETTY | XML_STRICT_HDR)\n \"\"\"\n # Handle \n if array_disposition == ARRAYDISPOSITION_AS_NUMERIC :\n import Numeric # let this throw the exception\n if array_disposition == ARRAYDISPOSITION_AS_NUMERIC_WRAPPER :\n import simplearray # let this throw the exception\n if array_disposition == ARRAYDISPOSITION_AS_PYTHON_ARRAY :\n import array # let this throw the exception\n \n self.os_ = os\n self.options_ = options\n self.arrDisp_ = array_disposition\n self.indentIncrement_ = indent_increment\n self.prependChar_ = prepend_char\n self.mode_ = mode\n self.specialCharToEscapeSeq_ = { }\n self.NULLKey_ = None # Has to be non-string meta-value so \"is\" test won't fail with \"\"\n self.EMPTYAttrs_ = { }\n self.LISTAttrs_ = { }\n self.DICTTag_ = \"dict__\"\n \n self.specialCharToEscapeSeq_['&'] = \"&\"\n self.specialCharToEscapeSeq_['<'] = \"<\"\n self.specialCharToEscapeSeq_['>'] = \">\"\n self.specialCharToEscapeSeq_['\\\"'] = \""\"\n self.specialCharToEscapeSeq_['\\''] = \"'\"\n self.LISTAttrs_[\"type__\"] = \"list\"\n\n # ostream& os_; // Stream outputting to\n # int options_; // OR ed options\n # ArrayDisposition_e arrDisp_; // How to handle POD data\n # int indentIncrement_; // How much to up the indent at each nesting level\n # char prependChar_; // '\\0' means NO prepend char\n # XMLDumpErrorMode_e mode_; // How to handle errors: silent, cerr,or throw\n # HashTableT<char, string, 8> \n # specialCharToEscapeSeq_; // Handle XML escape sequences\n # string NULLKey_; // Empty key\n # Tab EMPTYAttrs_; // Empty Attrs when dumping a primitive\n # Tab LISTAttrs_; // { \"type__\" = 'list' } \n # string DICTTag_; // \"dict__\"",
"metadata": "root.XMLDumper.__init__",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 185
},
{
"content": " def XMLDumpValue (self, value, indent=0) :\n \"Dump without a top-level container (i.e., no containing top-level tag)\"\n self.XMLDumpKeyValue(self.NULLKey_, value, indent) # handles header too",
"metadata": "root.XMLDumper.XMLDumpValue",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 234
},
{
"content": " def XMLDumpKeyValue (self, key, value, indent=0) :\n \"Dump with the given top-level key as the top-level tag.\"\n self._XMLHeader()\n\n # Top level lists suck: you can't \"really\" have a\n # list at the top level of an XML document, only\n # a table that contains a list!\n if type(value)==list :\n a = value\n p = a # DO NOT adopt, just sharing reference\n top = { }\n top[\"list__\"] = p\n self._XMLDumpKeyValue(key, top, indent)\n else :\n self._XMLDumpKeyValue(key, value, indent)",
"metadata": "root.XMLDumper.XMLDumpKeyValue",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 238
},
{
"content": " def dump (self, key, value, indent=0) :\n \"\"\"Dump *WITHOUT REGARD* to top-level container and/or XML header:\n this allows you to compose XML streams if you need to: it just\n dumps XML into the stream.\"\"\"\n self._XMLDumpKeyValue(key, value, indent)",
"metadata": "root.XMLDumper.dump",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 255
},
{
"content": " def dumpValue (self, value, indent=0) :\n \"\"\"Dump *WITHOUT REGARD* to top-level container and/or XML header:\n this allows you to compose XML streams if you need to: it just\n dumps XML (value only) into the stream.\"\"\"\n self._XMLDumpKeyValue(self.NULLKey_, value, indent)",
"metadata": "root.XMLDumper.dumpValue",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 261
},
{
"content": " def mode (self, mode) :\n \"\"\"If the table is malformed (usually attributes conflicting), throw\n a runtime error if strict. By default, outputs to cerr\"\"\"\n self.mode_ = mode ",
"metadata": "root.XMLDumper.mode",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 267
},
{
"content": " def _XMLHeader (self) :\n if self.options_ & XML_STRICT_HDR :\n self.os_.write(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" + \"\\n\")",
"metadata": "root.XMLDumper._XMLHeader",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 274
},
{
"content": " def _XMLDumpKeyValue (self, key, value, indent=0, attrs_ptr=None,\n was_array_typecode=None):\n t = type(value)\n if t==dict :\n \n if self.options_ & XML_DUMP_UNNATURAL_ORDER : # may want speed\n self._XMLDumpTable(key, value, indent, attrs_ptr, sortkeys=False)\n else : # Natural order (for predictability) \n self._XMLDumpTable(key, value, indent, attrs_ptr, sortkeys=True)\n \n elif t==OrderedDict :\n \n if self.options_ & XML_DUMP_UNNATURAL_ORDER : # may still want sorted\n self._XMLDumpTable(key, value, indent, attrs_ptr, sortkeys=True)\n else : # Natural order of an odict is the order of the odict\n self._XMLDumpTable(key, value, indent, attrs_ptr, sortkeys=False)\n \n elif t==list or t==tuple :\n self._XMLDumpList(key, value, indent, was_array_typecode)\n elif t in array_types :\n self._XMLDumpPODList(key, value, indent, -1, False)\n else :\n self._XMLDumpPrimitive(key, value, indent, attrs_ptr, was_array_typecode)",
"metadata": "root.XMLDumper._XMLDumpKeyValue",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 279
},
{
"content": " def _XMLDumpName (self, tag) :\n if len(tag)==0 :\n self._handleProblem(\"tag cannot be empty (0 length)\")\n \n t = tag\n if t[0].isdigit() :\n if self.options_ & XML_TAGS_ACCEPTS_DIGITS :\n self.os_.write('_')\n else :\n self._handleProblem(\"tag must start with alphabetic or _, not \"+t[0])\n elif not(t[0].isalpha() or t[0]=='_') :\n self._handleProblem(\"tag must start with alphabetic or _, not \"+t[0])\n \n for ii in xrange(1, len(tag)) :\n if not (t[ii].isalnum() or t[ii]=='_' or t[ii]==':') :\n self._handleProblem(\"tag must contain alphanumeric or _, not \"+t[ii])\n \n self.os_.write(tag) # All good",
"metadata": "root.XMLDumper._XMLDumpName",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 305
},
{
"content": " def _XMLContentFilter (self, content, was_array_typecode=None) :\n result = \"\" # RVO\n typecode = { float:'d', complex:'D' }\n type_content = type(content)\n if was_array_typecode != None :\n t = pretty.NumericString_(was_array_typecode, content)\n elif type_content in [float, complex] :\n t = pretty.NumericString_(typecode[type_content], content)\n elif type_content == long :\n t = repr(content)\n else : \n t = str(content)\n for ii in xrange(0,len(t)) :\n c = t[ii]\n if not isprint(c) :\n result += \"&#\"+hex(ord(c))[1:]+\";\"\n else :\n if c in self.specialCharToEscapeSeq_ :\n esc_seq = self.specialCharToEscapeSeq_[t[ii]]\n result = result + esc_seq\n else :\n result = result + t[ii]\n return result",
"metadata": "root.XMLDumper._XMLContentFilter",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 326
},
{
"content": " def _XMLDumpStartTag (self, tag, attrs, indent,\n primitive_dump=False, none_dump=False,\n was_array_typecode=None) :\n if tag is self.NULLKey_ : return\n\n if self.options_ & XML_DUMP_PRETTY :\n self.os_.write( ' '*indent )\n self.os_.write('<')\n self._XMLDumpName(tag)\n \n # Attributes key1=\"something\" key2=\"somethingelse\"\n len_attrs = len(attrs)\n if len_attrs >= 1 : self.os_.write(\" \")\n where = 0\n for key, val in sorted(attrs.iteritems()) :\n # String as is\n attr_name = str(key)\n if (len(attr_name)>0 and attr_name[0]==self.prependChar_ and\n ((self.options_ & XML_DUMP_PREPEND_KEYS_AS_TAGS)==0) ) :\n attr_name = attr_name[1:] # strip _\n \n attr_val = str(val)\n \n #os_ << attr_name << \"=\" << attr_val;\n self._XMLDumpName(attr_name)\n self.os_.write(\"=\\\"\" + self._XMLContentFilter(attr_val, was_array_typecode) + \"\\\"\") # TODO: handle '\n\n where += 1\n if (where!=len_attrs) : # last one, no extra space\n self.os_.write(\" \") \n \n if none_dump: self.os_.write(\"/\")\n self.os_.write(\">\")\n if ((self.options_ & XML_DUMP_PRETTY)!=0) and (not primitive_dump or none_dump) :\n self.os_.write(\"\\n\")",
"metadata": "root.XMLDumper._XMLDumpStartTag",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 352
},
{
"content": " def _XMLDumpEndTag (self, tag, indent, primitive_dump=False) :\n if tag is self.NULLKey_ :\n return\n if ((self.options_ & XML_DUMP_PRETTY) and not primitive_dump) :\n self.os_.write(' '*indent)\n self.os_.write(\"</\"+tag+\">\") # Note: Already checked that tag is okay! \n if (self.options_ & XML_DUMP_PRETTY) :\n self.os_.write(\"\\n\")",
"metadata": "root.XMLDumper._XMLDumpEndTag",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 391
},
{
"content": " def _IsComposite (self, v) :\n t = type(v)\n return t in [tuple, dict, list, OrderedDict] or t in array_types",
"metadata": "root.XMLDumper._IsComposite",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 404
},
{
"content": " def _FindAttributes (self, t) :\n # Collect all things that could be attributes\n attrs = { } # RVO\n if \"__attrs__\" in t : # We want to discover automatically:\n # Attributes all in special key '__attrs__'\n attrs = t[\"__attrs__\"]\n \n # Attributes may also have to be found\n sorted_keys = sorted(t.keys())\n for key in sorted_keys :\n value = t[key]\n ##for key, value in sorted(t.iteritems()) :\n if key==\"__attrs__\": continue # already processed\n if key==\"__content__\": continue # special\n\n # Special character says they *MAY* become attributes\n if (len(key)> 0 and key[0] == self.prependChar_) :\n if key in attrs :\n self._handleProblem(key+string(\" already in \")+str(t))\n\t\n key_without_underscore = key[1:]\n if (self.options_ & XML_DUMP_PREPEND_KEYS_AS_TAGS)==0 :\n attrs[key_without_underscore] = value\n continue\n\t\n # Do All simple values become attributes?\n if (self.options_ & XML_DUMP_SIMPLE_TAGS_AS_ATTRIBUTES) :\n simple = not self._IsComposite(value)\n if key in attrs :\n self._handleProblem(key+string(\" already in \")+str(t))\n\t\n if simple :\n attrs[key] = value\n continue\n # All done\n return attrs",
"metadata": "root.XMLDumper._FindAttributes",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 410
},
{
"content": " def _XMLDumpList (self, list_name, l, indent, was_array_typecode=None) :\n # This strange business is to handle lists with no names:\n # either nested within other lists or at the top-level so it will\n # still form well-formed XML: this is pretty rare, but we should\n # still do something useful.\n if list_name is self.NULLKey_ :\n tag = \"list__\"\n else :\n tag = list_name\n\n # Empty list\n if len(l)==0 : # Force list type__ so will unXMLize as an Arr()\n self._XMLDumpPrimitive(tag, None, indent, self.LISTAttrs_)\n return\n\n # Non-empty list\n for ii in xrange(0, len(l)) :\n key_to_use = self.NULLKey_ # normally NULL RARELY: empty list\n value_ptr = l[ii]\n \n # This strange bit is because a table is directly inside a \n # list, which means there IS no tag, which normally would be\n # an extra indent with an empty name: this is specifically because\n # of the dict within a list. A table inside can also mean\n # the __contents__\n table_inside_value = type(value_ptr)==dict or type(value_ptr)==OrderedDict\n indent_inc = self.indentIncrement_\n attrs = { }\n if (table_inside_value) :\n indent_inc = 0\n attrs = self._FindAttributes(value_ptr)\n # Special rare case: contents in special key\n if (\"__content__\" in value_ptr) :\n value_ptr = value_ptr[\"__content__\"]\n\n if (type(value_ptr)==dict or type(value_ptr)==OrderedDict) and len(value_ptr)==0 and len(l)==1 :\n # This RARE situation: \n # { 'top': [ {} ] } -> <top type__=\"list\"> <dict__/> </top>\n # Empty table inside a list: Ugh: hard to express in XML\n # without a new tag ... it's basically an anonymous table:\n # Normally, it's easy to detect a table, but an empty\n # dict inside a list is a special case\n indent_inc = self.indentIncrement_\n key_to_use = self.DICTTag_\n\t\n\t\n elif type(value_ptr) in array_types and \\\n self.arrDisp_ != ARRAYDISPOSITION_AS_LIST :\n\t #### Array data, well has peculilarities: let it handle it\n self._XMLDumpPODList(tag, value_ptr, indent, ii, \n (ii==0 and len(l)==1))\n continue\n \n # If list of 1, preserve listness by adding type field\n if (ii==0 and len(l)==1) :\n attrs[\"type__\"]=\"list\"\n \n primitive_type = not self._IsComposite(value_ptr)\n self._XMLDumpStartTag(tag, attrs, indent, primitive_type, False,\n was_array_typecode)\n self._XMLDumpKeyValue(key_to_use, value_ptr, indent+indent_inc, None, \n was_array_typecode)\n self._XMLDumpEndTag(tag, indent, primitive_type)",
"metadata": "root.XMLDumper._XMLDumpList",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 448
},
{
"content": " def _XMLDumpPODList (self, list_name, l, \n indent, inside_list_number, add_type):\n # tag = str(list_name)\n tag = list_name\n\n # Check to see if we want to dump this as a LIST or plain POD array\n if self.arrDisp_ == ARRAYDISPOSITION_AS_LIST :\n # This works works with array.array and Numeric.array because\n # the floating point typecodes are essentially the same,\n # and both support typecode and tolist\n was_array_typecode = l.typecode\n if callable(l.typecode) : was_array_typecode = l.typecode()\n # float types\n if not was_array_typecode in ['f','F','d','D'] : \n was_array_typecode = None\n l = l.tolist()\n # Integer types\n if was_array_typecode == None : \n l = [int(x) for x in l]\n \n self._XMLDumpList(list_name, l, indent, was_array_typecode)\n return\n\n # The attributes for an Array of POD will the Numeric type tag\n attrs = { }\n lookup_table = {'1':'s','b':'S', 's':'i','w':'I', 'i':'l','u':'L', 'l':'x', 'f':'f', 'd':'d', 'F':'F', 'D':'D' }\n bytetag = lookup_table[l.typecode()]\n if (self.options_ & XML_DUMP_POD_LIST_AS_XML_LIST) :\n attrs[\"type__\"] = bytetag\n else :\n attrs[\"arraytype__\"] = bytetag\n\n # There are two ways to dump Array data: either as one tag\n # with a list of numbers, or a tag for for every number.\n # Dumping array data with a tag for every number works better with \n # other tools (spreasheet etc.), but if you annotate EVERY ELEMENT \n # of a long list, the XML becomes much bigger and slow.\n\n # Dump array with a tag for EVERY element\n primitive_type = True\n temp = None\n inner_tag = tag\n if (self.options_ & XML_DUMP_POD_LIST_AS_XML_LIST) :\n # Rare case when POD array inside list\n if (inside_list_number!=-1) :\n inner_attrs = { }\n if inside_list_number==0 and add_type :\n inner_attrs[\"type__\"]=\"list\"\n self._XMLDumpStartTag(tag, inner_attrs, indent, False)\n inner_tag = \"list\"+str(inside_list_number)+\"__\"\n indent += self.indentIncrement_\n \n if len(l)==0 :\n # Empty list\n self._XMLDumpStartTag(inner_tag, attrs, indent, primitive_type)\n self._XMLDumpEndTag(inner_tag, indent, primitive_type)\n else :\n # Non-empty list\n for ii in xrange(0, len(l)) :\n self._XMLDumpStartTag(inner_tag, attrs, indent, primitive_type)\n temp = pretty.NumericString_(bytetag, l[ii]) #repr(l[ii]) # so prints with full precision of Val for reals, etc.\n self.os_.write(temp)\n self._XMLDumpEndTag(inner_tag, indent, primitive_type)\n \n # Rare case when POD array inside list\n if (inside_list_number!=-1) :\n indent -= self.indentIncrement_\n self._XMLDumpEndTag(tag, indent, False)\n \n # Dump as a list of numbers with just one tag: the tag, the list of data, \n # then the end tag \n else :\n if (inside_list_number==0 and add_type) : attrs[\"type__\"]=\"list\"\n self._XMLDumpStartTag(tag, attrs, indent, primitive_type)\n for ii in xrange(0, len(l)) :\n temp = pretty.NumericString_(bytetag, l[ii]) #repr(l[ii]) # so prints with full precision of Val for reals, etc. \n self.os_.write(temp)\n if (ii<len(l)-1) : self.os_.write(\",\")\n # End\n self._XMLDumpEndTag(tag, indent, primitive_type)",
"metadata": "root.XMLDumper._XMLDumpPODList",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 516
},
{
"content": " def _XMLDumpTable (self, dict_name, t, indent, attrs_ptr, sortkeys):\n # Rare case: when __content__ there\n if \"__content__\" in t :\n attrs = self._FindAttributes(t)\n self._XMLDumpKeyValue(dict_name, t[\"__content__\"], indent, attrs)\n return\n \n # Get attributes, Always dump start tag\n if attrs_ptr == None :\n attrs = self._FindAttributes(t)\n else :\n attrs = attrs_ptr\n self._XMLDumpStartTag(dict_name, attrs, indent)\n \n # Normally, just iterate over all keys for nested content\n keys = t.keys()\n if sortkeys : keys.sort()\n for key in keys :\n value = t[key]\n\n # Skip over keys that have already been put in attributes\n k = str(key)\n if key in attrs or k==\"__attrs__\" or (len(k)>0 and k[0]==self.prependChar_ and k[1:] in attrs) :\n continue # Skip in attrs\n\n self._XMLDumpKeyValue(key, value, indent+self.indentIncrement_)\n\n # Always dump end tag\n self._XMLDumpEndTag(dict_name, indent)",
"metadata": "root.XMLDumper._XMLDumpTable",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 599
},
{
"content": " def _XMLDumpPrimitive (self, key, value, indent, attrs_ptr, was_array_typecode=None) :\n if attrs_ptr is None :\n attrs = self.EMPTYAttrs_\n else :\n attrs = attrs_ptr\n\n if (self._IsComposite(value)) :\n raise Exception(\"Trying to dump a composite type as a primitive\")\n \n if value is None :\n self._XMLDumpStartTag(key, attrs, indent, True, True)\n return\n\n self._XMLDumpStartTag(key, attrs, indent, True)\n\n # Force all strings into quotes, messy but will always work\n # with XML_LOAD_EVAL_CONTENT on the way back if you have to convert\n if (self.options_ & XML_DUMP_STRINGS_AS_STRINGS) :\n if (type(value) == str) : # make sure pick up quotes \n self.os_.write(self._XMLContentFilter(repr(value), was_array_typecode))\n else :\n self.os_.write(self._XMLContentFilter(value, was_array_typecode)) # Let str pick \n\n # Most of the time, we can keep all strings as-is (and avoid\n # those nasty ''' quotes in XML around them): those\n # strings that will become something \"real values\" when Evalled \n # need to have quotes so they will come back as strings\n # when using XML_LOAD_EVAL_CONTENT. For example: '123' is a string\n # but when evaled, will become a number; We dump this as \n # \"'123'\" to preserve the numberness.\n elif (self.options_ & XML_DUMP_STRINGS_BEST_GUESS) :\n if (type(value)==str) :\n s = str(value) # no quotes on string\n if (len(s)==0 or # always dump empty strings with &apos!\n ((len(s)>0) and \n (s[0].isdigit() or s[0]=='(' or s[0]=='-' or s[0]=='+'))) :\n # If it starts with a number or a sign or '(' (for (1+2j), \n # probably a number and we WANT to stringize\n self.os_.write(self._XMLContentFilter(repr(value), was_array_typecode)) # puts quotes on str\n else :\n self.os_.write(self._XMLContentFilter(value, was_array_typecode)) # no quotes!\n else :\n self.os_.write(self._XMLContentFilter(value, was_array_typecode)) # Let str pick \n \n\n # Default, just plop content: still be careful of <empty></empty>:\n # Should that be a {}, None, [], or \"\"? With this option, makes it\n # empty string (you don't need this option if you are using\n # XML_DUMP_STRINGS_BEST_GUESS or XML_DUMP_STRINGS_AS_STRINGS\n else :\n if (self.options_ & XML_DUMP_PREFER_EMPTY_STRINGS) :\n if type(value)==str and len(value)==0 :\n value = \"''\" # Makes <empty></empty> into empty string\n\n self.os_.write(self._XMLContentFilter(value, was_array_typecode))\n \n self._XMLDumpEndTag(key, indent, True)",
"metadata": "root.XMLDumper._XMLDumpPrimitive",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 631
},
{
"content": " def _handleProblem (self, text):\n if (self.mode_==XMLDumper.SILENT_ON_ERROR) : return\n if (self.mode_==XMLDumper.THROW_ON_ERROR) :\n raise Exception, text\n sys.stderr.write(text+\"\\n\")",
"metadata": "root.XMLDumper._handleProblem",
"header": "['class', 'XMLDumper', '(', 'object', ')', ':', '___EOS___']",
"index": 691
},
{
"content": "def WriteToXMLStream (v, ofs, top_level_key = None,\n options = XML_DUMP_PRETTY | XML_STRICT_HDR | XML_DUMP_STRINGS_BEST_GUESS, # best options for invertible transforms\n arr_disp = ARRAYDISPOSITION_AS_NUMERIC_WRAPPER,\n prepend_char=XML_PREPEND_CHAR) :\n \"\"\"Write a Python object (usually a dict or list) as XML to a stream:\n throw a runtime-error if anything bad goes down.\n These default options:\n options=XML_DUMP_PRETTY | XML_STRICT_HDR | XML_DUMP_STRINGS_BEST_GUESS \n are the best options for invertible transforms.\n Array disposition: AS_LIST (0) might be better for dealing with Python,\n but you are much less likely to lose information by using the default\n AS_NUMERIC_WRAPPER\"\"\"\n indent = 2\n xd = XMLDumper(ofs, options, arr_disp, indent, prepend_char,\n XMLDumper.THROW_ON_ERROR)\n if top_level_key==None:\n xd.XMLDumpValue(v)\n else :\n xd.XMLDumpKeyValue(top_level_key, v)",
"metadata": "root.WriteToXMLStream",
"header": "['module', '___EOS___']",
"index": 702
},
{
"content": "def WriteToXMLFile (v, filename, top_level_key = None,\n options = XML_DUMP_PRETTY | XML_STRICT_HDR | XML_DUMP_STRINGS_BEST_GUESS, # best options for invertible transforms\n arr_disp = ARRAYDISPOSITION_AS_NUMERIC_WRAPPER,\n prepend_char=XML_PREPEND_CHAR) :\n \"\"\"Write a Python object (usually a dict or list) as XML to a file:\n throw a runtime-error if anything bad goes down.\n These default options:\n options=XML_DUMP_PRETTY | XML_STRICT_HDR | XML_DUMP_STRINGS_BEST_GUESS \n are the best options for invertible transforms.\n Array disposition: AS_LIST (0) might be better for dealing with Python,\n but you are much less likely to lose information by using the default\n AS_NUMERIC_WRAPPER\"\"\"\n\n try :\n ofs = open(filename, 'w')\n WriteToXMLStream(v, ofs, top_level_key, options, arr_disp, prepend_char)\n except Exception, e :\n raise Exception, e",
"metadata": "root.WriteToXMLFile",
"header": "['module', '___EOS___']",
"index": 723
},
{
"content": "def ConvertToXML (given_dict) :\n \"\"\"Convert the given Python dictionary to XML and return the XML\n (a text string). This uses the most common options that tend to\n make the conversions fully invertible.\"\"\"\n stream_thing = cStringIO.StringIO()\n WriteToXMLStream(given_dict, stream_thing, 'top')\n return stream_thing.getvalue()",
"metadata": "root.ConvertToXML",
"header": "['module', '___EOS___']",
"index": 743
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#!",
"/",
"bin",
"/",
"env",
" ",
"python_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"Copy",
"right",
" ",
"(",
"c",
")",
" ",
"200",
"1",
"-",
"200",
"9",
" ",
"Ri",
"ncon",
" ",
"Rese",
"arch",
" ",
"Cor",
"porat",
"ion",
",",
" ",
"Rich",
"ard",
" ",
"T",
".",
" ",
"Sau",
"nder",
"s_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"All",
" ",
"rights",
" ",
"reserve",
"d",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"Redistributi",
"on",
" ",
"and",
" ",
"use",
" ",
"in",
" ",
"source",
" ",
"and",
" ",
"binar",
"y",
" ",
"forms",
",",
" ",
"with",
" ",
"or",
" ",
"with",
"out_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"modification",
",",
" ",
"are",
" ",
"permit",
"ted",
" ",
"provided",
" ",
"tha",
"t",
" ",
"the",
" ",
"follow",
"ing",
" ",
"conditions_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"are",
" ",
"met",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"1",
".",
" ",
"Redistributi",
"ons",
" ",
"of",
" ",
"source",
" ",
"code",
" ",
"must",
" ",
"retain",
" ",
"the",
" ",
"above",
" ",
"copyright_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"notice",
",",
" ",
"this",
" ",
"list",
" ",
"of",
" ",
"condition",
"s",
" ",
"and",
" ",
"the",
" ",
"follow",
"ing",
" ",
"discl",
"aime",
"r",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"2",
".",
" ",
"Redistributi",
"ons",
" ",
"in",
" ",
"binar",
"y",
" ",
"form",
" ",
"must",
" ",
"reproduce",
" ",
"the",
" ",
"above",
" ",
"copyright_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"notice",
",",
" ",
"this",
" ",
"list",
" ",
"of",
" ",
"condition",
"s",
" ",
"and",
" ",
"the",
" ",
"follow",
"ing",
" ",
"discl",
"aime",
"r",
" ",
"in",
" ",
"the_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"documentation",
" ",
"and",
"/",
"or",
" ",
"other",
" ",
"material",
"s",
" ",
"provided",
" ",
"with",
" ",
"the",
" ",
"distribu",
"tion",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"3",
".",
" ",
"The",
" ",
"name",
" ",
"of",
" ",
"the",
" ",
"author",
" ",
"may",
" ",
"not",
" ",
"be",
" ",
"used",
" ",
"to",
" ",
"endo",
"rse",
" ",
"or",
" ",
"promote",
" ",
"products_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"derive",
"d",
" ",
"from",
" ",
"this",
" ",
"software",
" ",
"with",
"out",
" ",
"specific",
" ",
"prior",
" ",
"writt",
"en",
" ",
"permissi",
"on",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"THIS",
" ",
"SOFT",
"WARE",
" ",
"IS",
" ",
"PROVI",
"DED",
" ",
"BY",
" ",
"THE",
" ",
"AUTHOR",
" ",
"``",
"AS",
" ",
"IS",
"''",
" ",
"AND",
" ",
"ANY",
" ",
"EXPR",
"ESS",
" ",
"OR_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"IMPL",
"IED",
" ",
"WAR",
"RAN",
"TIES",
",",
" ",
"INC",
"LU",
"DING",
",",
" ",
"BUT",
" ",
"NOT",
" ",
"LIMIT",
"ED",
" ",
"TO",
",",
" ",
"THE",
" ",
"IMPL",
"IED",
" ",
"WAR",
"RAN",
"TIES",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"OF",
" ",
"MER",
"CHAN",
"TAB",
"ILI",
"TY",
" ",
"AND",
" ",
"FIT",
"NESS",
" ",
"FOR",
" ",
"A",
" ",
"PARTI",
"CUL",
"AR",
" ",
"PUR",
"POS",
"E",
" ",
"ARE",
" ",
"DISC",
"LAI",
"MED",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"IN",
" ",
"NO",
" ",
"EVENT",
" ",
"SHA",
"LL",
" ",
"THE",
" ",
"AUTHOR",
" ",
"BE",
" ",
"LI",
"AB",
"LE",
" ",
"FOR",
" ",
"ANY",
" ",
"DIRECT",
",",
" ",
"INDI",
"RECT",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"INC",
"IDENT",
"AL",
",",
" ",
"SPECIAL",
",",
" ",
"EXE",
"MPL",
"ARY",
",",
" ",
"OR",
" ",
"CONS",
"EQU",
"ENTI",
"AL",
" ",
"DA",
"MAGE",
"S",
" ",
"(",
"INC",
"LU",
"DING",
",",
" ",
"BUT",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"NOT",
" ",
"LIMIT",
"ED",
" ",
"TO",
",",
" ",
"PROC",
"URE",
"MENT",
" ",
"OF",
" ",
"SUBST",
"ITU",
"TE",
" ",
"GOOD",
"S",
" ",
"OR",
" ",
"SERVICES",
";",
" ",
"LOSS",
" ",
"OF",
" ",
"USE",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"DATA",
",",
" ",
"OR",
" ",
"PROF",
"IT",
"S",
";",
" ",
"OR",
" ",
"BUS",
"INE",
"SS",
" ",
"INTER",
"RU",
"PTION",
")",
" ",
"HO",
"WE",
"VER",
" ",
"CAU",
"SED",
" ",
"AND",
" ",
"ON",
" ",
"ANY_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"THE",
"ORY",
" ",
"OF",
" ",
"LI",
"ABI",
"LIT",
"Y",
",",
" ",
"WHE",
"THER",
" ",
"IN",
" ",
"CONTR",
"ACT",
",",
" ",
"STRI",
"CT",
" ",
"LI",
"ABI",
"LIT",
"Y",
",",
" ",
"OR",
" ",
"TOR",
"T_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"(",
"INC",
"LU",
"DING",
" ",
"NEG",
"LIG",
"ENCE",
" ",
"OR",
" ",
"OTHER",
"WI",
"SE",
")",
" ",
"ARI",
"SIN",
"G",
" ",
"IN",
" ",
"ANY",
" ",
"WAY",
" ",
"OUT",
" ",
"OF",
" ",
"THE",
" ",
"USE",
" ",
"OF_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"THIS",
" ",
"SOFT",
"WARE",
",",
" ",
"EVE",
"N",
" ",
"IF",
" ",
"ADV",
"ISE",
"D",
" ",
"OF",
" ",
"THE",
" ",
"POS",
"SIB",
"ILI",
"TY",
" ",
"OF",
" ",
"SUC",
"H",
" ",
"DA",
"MAGE",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
"Thi",
"s",
" ",
"class",
" ",
"convert",
" ",
"dictionar",
"ies",
" ",
"to",
" ",
"XML",
".",
" ",
" ",
"Thi",
"s",
" ",
"is",
" ",
"usual",
"ly",
"\\",
"10",
";",
" ",
" ",
" ",
"an",
" ",
"easy",
" ",
"mapping",
",",
" ",
"bec",
"aus",
"e",
" ",
"key",
"-",
"value",
" ",
"mapping",
"s",
" ",
"go",
" ",
"easi",
"ly",
" ",
"to",
" ",
"XML",
"\\",
"10",
";",
" ",
" ",
" ",
"(",
"the",
" ",
"other",
" ",
"way",
" ",
"is",
" ",
"more",
" ",
"problem",
"atic",
").",
" ",
" ",
"A",
" ",
"potenti",
"al",
" ",
"issue",
"\\",
"10",
";",
" ",
" ",
" ",
"usual",
"ly",
" ",
"is",
" ",
"how",
" ",
"to",
" ",
"handle",
" ",
"attribute",
"s",
"....",
" ",
"See",
" ",
"the",
" ",
"options",
" ",
"belo",
"w",
"!",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
"Exam",
"ples",
":",
"\\",
"10",
";",
" ",
" ",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"{",
" ",
"'",
"book",
"'",
" ",
"=",
" ",
"{",
"\\",
"10",
";",
" ",
" ",
"'",
"chap",
"ter",
"'",
" ",
"=",
" ",
"[",
" ",
"'",
"text",
" ",
"chap",
" ",
"1",
"',",
" ",
"'",
"text",
" ",
"chap",
" ",
"2",
"']",
"\\",
"10",
";",
" ",
" ",
"'\\u",
"\\u",
"attr",
"s",
"\\u\\u'",
" ",
"=",
" ",
"{",
" ",
"'",
"attr",
"1",
"':",
"\"",
"1",
"\",",
" ",
"'",
"attr",
"2",
"':",
"\"",
"2",
"\"",
" ",
"}",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"}",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"--------",
"dump",
"s",
" ",
"as",
" ",
"--------------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"<",
"book",
" ",
"attr",
"1",
"=\"",
"1",
"\"",
" ",
"attr",
"2",
"=\"",
"2",
"\">",
"\\",
"10",
";",
" ",
" ",
" ",
"<",
"chap",
"ter",
">",
"text",
" ",
"chap",
" ",
"1",
"</",
"chap",
"ter",
">",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"<",
"chap",
"ter",
">",
"text",
" ",
"chap",
" ",
"2",
"</",
"chap",
"ter",
">",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"</",
"book",
">",
"\\",
"10",
";",
" ",
" ",
" ",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
"With",
" ",
"UN",
"FOL",
"DING",
" ",
"on",
" ",
" ",
"(",
"attribute",
"s",
" ",
"are",
" ",
"marked",
" ",
"with",
" ",
"\\u)",
"\\",
"10",
";",
" ",
" ",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"{",
" ",
"'",
"book",
"'",
" ",
"=",
" ",
"{",
"\\",
"10",
";",
" ",
" ",
"'",
"chap",
"ter",
"'",
" ",
"=",
" ",
"[",
" ",
"'",
"text",
" ",
"chap",
" ",
"1",
"',",
" ",
"'",
"text",
" ",
"chap",
" ",
"2",
"']",
"\\",
"10",
";",
" ",
" ",
"'\\u",
"attr",
"1",
"':",
"\"",
"1",
"\",",
" ",
"\\",
"10",
";",
" ",
" ",
"'\\u",
"attr",
"2",
"':",
"\"",
"2",
"\"",
" ",
"\\",
"10",
";",
" ",
" ",
" ",
"}",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"}",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"---------",
"dump",
"s",
" ",
"as",
" ",
"--------------",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"<",
"book",
" ",
"attr",
"1",
"=\"",
"1",
"\"",
" ",
"attr",
"2",
"=\"",
"2",
"\">",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"<",
"chap",
"ter",
" ",
"date",
"=\"",
"1999",
"\">",
"text",
" ",
"chap",
" ",
"1",
"</",
"chap",
"ter",
">",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"<",
"chap",
"ter",
" ",
"data",
"=\"",
"2000",
"\">",
"text",
" ",
"chap",
" ",
"2",
"</",
"chap",
"ter",
">",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"</",
"book",
">",
"\\",
"10",
";\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"sys_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"pretty_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"curses_",
"._",
"ascii_",
"import_",
"isp",
"rint_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Not",
" ",
"unti",
"l",
" ",
"2.7",
",",
" ",
"keep",
" ",
"as",
" ",
"plain",
" ",
"dict",
" ",
"then_",
"\\u\\u\\uNL\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"collections_",
"import_",
"Order",
"ed",
"Dict_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"Order",
"ed",
"Dict_",
"=_",
"dict_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"All",
" ",
"the",
" ",
"arrays",
" ",
"we",
" ",
"may",
" ",
"get",
" ",
"whe",
"n",
" ",
"iterati",
"ng",
" ",
"through",
":",
" ",
"if",
" ",
"some",
"one",
" ",
"give",
"s_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"us",
" ",
"the",
" ",
"data",
" ",
"structure",
" ",
"(",
"Numer",
"ic",
" ",
"array",
" ",
"or",
" ",
"Pyth",
"on",
" ",
"array",
"),",
" ",
"we",
" ",
"still",
" ",
"try_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"to",
" ",
"dump",
" ",
"it",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"from_",
"array",
"disposition",
"_",
"import_",
"*_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"array",
"\\u",
"types_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"Numeric_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"array",
"\\u",
"types_",
"._",
"append_",
"(_",
"type_",
"(_",
"Numeric_",
"._",
"array_",
"(_",
"[_",
"]_",
")_",
")_",
")_",
"#",
" ",
"Ta",
"g",
" ",
"doe",
"sn",
"'",
"t",
" ",
"effect",
" ",
"type_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"array_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"array",
"\\u",
"types_",
"._",
"append_",
"(_",
"array_",
"._",
"array_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"import_",
"simple",
"array_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"array",
"\\u",
"types_",
"._",
"append_",
"(_",
"simple",
"array_",
"._",
"Simple",
"Array_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"pretty_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Optio",
"ns",
" ",
"for",
" ",
"dictionar",
"ies",
" ",
"->",
" ",
"XML_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"If",
" ",
"XML",
" ",
"attribute",
"s",
" ",
"are",
" ",
"bei",
"ng",
" ",
"fold",
"ed",
" ",
"up",
",",
" ",
"then",
" ",
"you",
" ",
"may",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"want",
" ",
"to",
" ",
"prepend",
" ",
"a",
" ",
"special",
" ",
"character",
" ",
"to",
" ",
"distinguish",
" ",
"attributes_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"from",
" ",
"nest",
"ed",
" ",
"tags",
":",
" ",
"an",
" ",
"underscore",
" ",
"is",
" ",
"the",
" ",
"usual",
" ",
"default",
".",
" ",
" ",
"If_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"you",
" ",
"don",
"'",
"t",
" ",
"want",
" ",
"a",
" ",
"prepend",
" ",
"char",
",",
" ",
"use",
" ",
"XML",
"\\u",
"DUMP",
"\\u",
"NO",
"\\u",
"PREP",
"END",
" ",
"option_",
"\\u\\u\\uNL\\u\\u\\u_",
"XML",
"\\u",
"PREP",
"END",
"\\u",
"CHAR_",
"=_",
"'\\u'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Whe",
"n",
" ",
"dump",
"ing",
",",
" ",
"by",
" ",
"DEF",
"AUL",
"T",
" ",
"the",
" ",
"keys",
" ",
"tha",
"t",
" ",
"start",
" ",
"with",
" ",
"\\u",
" ",
"bec",
"ome_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"attribute",
"s",
" ",
"(",
"this",
" ",
"is",
" ",
"call",
"ed",
" ",
"\"",
"unfol",
"ding",
"\")",
".",
" ",
" ",
"You",
" ",
"may",
" ",
"want",
" ",
"to",
" ",
"keep_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"tho",
"se",
" ",
"keys",
" ",
"as",
" ",
"tags",
".",
" ",
" ",
"Consider",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"{",
" ",
"'",
"top",
"':",
" ",
"{",
" ",
"'\\u",
"a",
"':",
"'",
"1",
"',",
" ",
"'\\u",
"b",
"':",
" ",
"2",
" ",
"}}",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"DEF",
"AUL",
"T",
" ",
"behavior",
",",
" ",
"this",
" ",
"bec",
"ome",
"s",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"<",
"top",
" ",
"a",
"=\"",
"1",
"\"",
" ",
"b",
"=\"",
"2",
"\">",
"</",
"top",
">",
" ",
" ",
" ",
"Thi",
"s",
" ",
"moves",
" ",
"the",
" ",
"\\u",
"names",
" ",
"to",
" ",
"attributes_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Bu",
"t",
",",
" ",
"you",
" ",
"may",
" ",
"want",
" ",
"all",
" ",
"\\u",
" ",
"keys",
" ",
"to",
" ",
"stay",
" ",
"as",
" ",
"tags",
":",
" ",
"tha",
"t",
"'",
"s",
" ",
"the",
" ",
"purpose",
" ",
"of",
" ",
"this",
" ",
"opt_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
"<",
"top",
">",
" ",
"<\\u",
"a",
">",
"1",
"</",
"\\u",
"a",
">",
" ",
"<\\u",
"b",
">",
"2",
"</",
"b",
">",
" ",
"</",
"top",
">_",
"\\u\\u\\uNL\\u\\u\\u_",
"XML",
"\\u",
"DUMP",
"\\u",
"PREP",
"END",
"\\u",
"KEYS",
"\\u",
"AS",
"\\u",
"TAGS_",
"=_",
"0x100",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Any",
" ",
"value",
" ",
"tha",
"t",
" ",
"is",
" ",
"simple",
" ",
"(",
"i",
".",
"e",
".,",
" ",
"contain",
"s",
" ",
"no",
" ",
"nested_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"content",
")",
" ",
"will",
" ",
"be",
" ",
"place",
"d",
" ",
"in",
" ",
"the",
" ",
"attribute",
"s",
" ",
"bin",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
"For",
" ",
"example",
"s",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
" ",
" ",
" ",
"{",
" ",
"'",
"top",
"':",
" ",
"{",
" ",
"'",
"x",
"':",
"'",
"1",
"',",
" ",
"'",
"y",
"':",
" ",
"2",
" ",
"}}",
" ",
"->",
" ",
" ",
"<",
"top",
" ",
"x",
"=\"",
"1",
"\"",
" ",
"y",
"=\"",
"2",
"\">",
"</",
"top",
">_",
"\\u\\u\\uNL\\u\\u\\u_",
"XML",
"\\u",
"DUMP",
"\\u",
"SIMPLE",
"\\u",
"TAG",
"S",
"\\u",
"AS",
"\\u",
"ATTRIBUTES_",
"=_",
"0x200",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"By",
" ",
"default",
",",
" ",
"every",
"thing",
" ",
"dump",
"s",
" ",
"as",
" ",
"string",
"s",
" ",
"(",
"with",
"out",
" ",
"quote",
"s",
"),",
" ",
"but",
" ",
"tho",
"se",
" ",
"things_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"tha",
"t",
" ",
"are",
" ",
"string",
"s",
" ",
"lose",
" ",
"thei",
"r",
" ",
"\"",
"string",
"edn",
"ess",
"\",",
" ",
"whi",
"ch",
" ",
"means_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"the",
"y",
" ",
"can",
"'",
"t",
" ",
"be",
" ",
"\"",
"eval",
"ed",
"\"",
" ",
"on",
" ",
"the",
" ",
"way",
" ",
"back",
" ",
"in",
".",
" ",
" ",
"Thi",
"s",
" ",
"option",
" ",
"make",
"s",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Val",
"s",
" ",
"tha",
"t",
" ",
"are",
" ",
"string",
"s",
" ",
"dump",
" ",
"with",
" ",
"quote",
"s",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"XML",
"\\u",
"DUMP",
"\\u",
"STRING",
"S",
"\\u",
"AS",
"\\u",
"STRING",
"S_",
"=_",
"0x400",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Lik",
"e",
" ",
"XML",
"\\u",
"DUMP",
"\\u",
"STRING",
"S",
"\\u",
"AS",
"\\u",
"STRING",
"S",
",",
" ",
"but",
" ",
"this",
" ",
"one",
" ",
"ONLY_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"dump",
"s",
" ",
"string",
"s",
" ",
"with",
" ",
"quote",
"s",
" ",
"if",
" ",
"it",
" ",
"think",
"s",
" ",
"Eval",
" ",
"will",
" ",
"return_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"somet",
"hing",
" ",
"else",
".",
" ",
" ",
"For",
" ",
"example",
" ",
"in",
" ",
"{",
" ",
"'",
"s",
"':",
" ",
"'",
"123",
"'",
" ",
"}",
" ",
":",
" ",
"'",
"123",
"'",
" ",
"is",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"a",
" ",
"STRING",
",",
" ",
"not",
" ",
"a",
" ",
"number",
".",
" ",
" ",
"Whe",
"n",
" ",
"eval",
"led",
" ",
"with",
" ",
"an",
" ",
"XML",
"Loader_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"with",
" ",
"XML",
"\\u",
"LOAD",
"\\u",
"EVAL",
"\\u",
"CONTE",
"NT",
" ",
"flag",
",",
" ",
"tha",
"t",
" ",
"will",
" ",
"bec",
"ome",
" ",
"a",
" ",
"number",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"XML",
"\\u",
"DUMP",
"\\u",
"STRING",
"S",
"\\u",
"BES",
"T",
"\\u",
"GUE",
"SS_",
"=_",
"0x800",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Show",
" ",
"nesting",
" ",
"whe",
"n",
" ",
"you",
" ",
"dump",
":",
" ",
"like",
" ",
"\"",
"pretty",
"Print",
"\":",
" ",
"basic",
"ally",
",",
" ",
"it",
" ",
"shows_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"nesting",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"XML",
"\\u",
"DUMP",
"\\u",
"PRE",
"TTY",
"_",
"=_",
"0x1000",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Arrays",
" ",
"of",
" ",
"PO",
"D",
" ",
"(",
"plain",
" ",
"old",
" ",
"data",
":",
" ",
"ints",
",",
" ",
"real",
",",
" ",
"complex",
",",
" ",
"etc",
")",
" ",
"can_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"dump",
" ",
"as",
" ",
"huge",
" ",
"lists",
":",
" ",
" ",
"By",
" ",
"default",
" ",
"the",
"y",
" ",
"just",
" ",
"dump",
" ",
"with",
" ",
"one",
" ",
"tag_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"and",
" ",
"then",
" ",
"a",
" ",
"list",
" ",
"of",
" ",
"numbers",
".",
" ",
" ",
"If",
" ",
"you",
" ",
"set",
" ",
"this",
" ",
"option",
",",
" ",
"the",
"y",
" ",
"dump_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"as",
" ",
"a",
" ",
"true",
" ",
"XML",
" ",
"list",
" ",
"(",
"<",
"data",
">",
"1.0",
"/",
"<",
"data",
"><",
"data",
">",
"2.0",
"</",
"data",
">",
" ",
"...)",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"whi",
"ch",
" ",
"is",
" ",
"very",
" ",
"expen",
"sive",
",",
" ",
"but",
" ",
"is",
" ",
"easi",
"er",
" ",
"to",
" ",
"use",
" ",
"with",
" ",
"other_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"tool",
"s",
" ",
"(",
"spreadsheet",
"s",
" ",
"tha",
"t",
" ",
"support",
" ",
"lists",
",",
" ",
"etc",
".)",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"XML",
"\\u",
"DUMP",
"\\u",
"PO",
"D",
"\\u",
"LIST",
"\\u",
"AS",
"\\u",
"XML",
"\\u",
"LIST_",
"=_",
"0x2000",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Whe",
"n",
" ",
"dump",
"ing",
" ",
"an",
" ",
"empty",
" ",
"tag",
",",
" ",
"what",
" ",
"do",
" ",
"you",
" ",
"want",
" ",
"it",
" ",
"to",
" ",
"be",
"?",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"I",
".",
"e",
".,",
" ",
"what",
" ",
"is",
" ",
"<",
"empty",
"><",
"/",
"empty",
">",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Normal",
"ly",
" ",
"(",
"DEF",
"AUL",
"T",
")",
" ",
"this",
" ",
"is",
" ",
"an",
" ",
"empty",
" ",
"dictionar",
"y",
" ",
"'",
"empty",
"':",
" ",
"{}",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"you",
" ",
"want",
" ",
"tha",
"t",
" ",
"to",
" ",
"be",
" ",
"empty",
" ",
"content",
",",
" ",
"as",
" ",
"in",
" ",
"an",
" ",
"empty",
" ",
"string",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"set",
" ",
"this",
" ",
"option",
":",
" ",
"'",
"empty",
"':",
" ",
"\"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"NOTE",
":",
" ",
"You",
" ",
"don",
"'",
"t",
" ",
"need",
" ",
"this",
" ",
"option",
" ",
"if",
" ",
"you",
" ",
"are",
" ",
"using_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"XML",
"\\u",
"DUMP",
"\\u",
"STRING",
"S",
"\\u",
"AS",
"\\u",
"STRING",
"S",
" ",
"or",
" ",
"XML",
"\\u",
"DUMP",
"\\u",
"STRING",
"S",
"\\u",
"BES",
"T",
"\\u",
"GUE",
"SS_",
"\\u\\u\\uNL\\u\\u\\u_",
"XML",
"\\u",
"DUMP",
"\\u",
"PREFER",
"\\u",
"EMP",
"TY",
"\\u",
"STRING",
"S_",
"=_",
"0x400",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Whe",
"n",
" ",
"dump",
"ing",
" ",
"dictionar",
"ies",
" ",
"in",
" ",
"order",
",",
" ",
"a",
" ",
"dict",
" ",
"BY",
" ",
"DEF",
"AUL",
"T",
" ",
"print",
"s_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"out",
" ",
"the",
" ",
"keys",
" ",
"in",
" ",
"sorte",
"d",
"/",
"alphabetic",
" ",
"order",
" ",
"and",
" ",
"BY",
" ",
"DEF",
"AUL",
"T",
" ",
"an",
" ",
"Order",
"ed",
"Dict_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"print",
"s",
" ",
"out",
" ",
"in",
" ",
"the",
" ",
"Order",
"ed",
"Dict",
" ",
"order",
".",
" ",
" ",
"The",
" ",
"\"",
"unn",
"atu",
"ral",
"\"",
" ",
"order_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"for",
" ",
"a",
" ",
"dict",
" ",
"is",
" ",
"to",
" ",
"print",
" ",
"out",
" ",
"in",
" ",
"\"",
"random",
"\"",
" ",
"order",
" ",
"(",
"but",
" ",
"probab",
"ly",
" ",
"slight",
"ly_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"faste",
"r",
").",
" ",
" ",
"The",
" ",
"\"",
"unn",
"atu",
"ral",
"\"",
" ",
"order",
" ",
"for",
" ",
"an",
" ",
"Order",
"ed",
"Dict",
" ",
"is",
" ",
"sorted_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"(",
"bec",
"aus",
"e",
" ",
"normal",
"ly",
" ",
"we",
" ",
"use",
" ",
"an",
" ",
"Order",
"ed",
"Dict",
" ",
"bec",
"aus",
"e",
" ",
"we",
" ",
"WAN",
"TS",
" ",
"its_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"noti",
"on",
" ",
"of",
" ",
"order",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"XML",
"\\u",
"DUMP",
"\\u",
"UN",
"NAT",
"URA",
"L",
"\\u",
"ORDER_",
"=_",
"0x800",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Even",
" ",
"tho",
"ugh",
" ",
"ille",
"gal",
" ",
"XML",
",",
" ",
"allow",
" ",
"element",
" ",
"names",
" ",
"startin",
"g",
" ",
"with",
" ",
"Digits",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"whe",
"n",
" ",
"it",
" ",
"doe",
"s",
" ",
"see",
" ",
"a",
" ",
"startin",
"g",
" ",
"digit",
",",
" ",
"it",
" ",
"turns",
" ",
"it",
" ",
"int",
"o",
" ",
"an",
" ",
"\\u",
"digit_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"so",
" ",
"tha",
"t",
" ",
"it",
" ",
"is",
" ",
"still",
" ",
"lega",
"l",
" ",
"XML_",
"\\u\\u\\uNL\\u\\u\\u_",
"XML",
"\\u",
"TAG",
"S",
"\\u",
"ACCEPT",
"S",
"\\u",
"DIGIT",
"S_",
"=_",
"0x80_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Whe",
"n",
" ",
"dump",
"ing",
" ",
"XML",
",",
" ",
"the",
" ",
"default",
" ",
"is",
" ",
"to",
" ",
"NOT",
" ",
"have",
" ",
"the",
" ",
"XML",
" ",
"header",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"<",
"?",
"xml",
" ",
"version",
"=\"",
"1.0",
"\">",
":",
" ",
" ",
"Speci",
"fy",
"ing",
" ",
"this",
" ",
"option",
" ",
"will",
" ",
"alw",
"ay",
"s",
" ",
"make",
" ",
"that_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"the",
" ",
"header",
" ",
"alw",
"ay",
"s",
" ",
"prece",
"des",
" ",
"all",
" ",
"content_",
"\\u\\u\\uNL\\u\\u\\u_",
"XML",
"\\u",
"STRI",
"CT",
"\\u",
"HDR",
"_",
"=_",
"0x10000",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"###########",
"###########",
"######",
"#",
" ",
"Global",
" ",
"Functions_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"import_",
"c",
"String",
"IO_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"An",
" ",
"instance",
" ",
"of",
" ",
"this",
" ",
"will",
" ",
"help",
" ",
"dump",
" ",
"a",
" ",
"Pyth",
"on",
" ",
"object",
" ",
"(",
"made",
" ",
"up",
" ",
"of",
" ",
"lists",
",",
"\\",
"10",
";",
" ",
"dictionar",
"ies",
",",
" ",
"Numer",
"ic",
" ",
"data",
" ",
"and",
" ",
"all",
" ",
"primi",
"tiv",
"e",
" ",
"types",
" ",
"as",
" ",
"XML",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"On",
" ",
"error",
",",
" ",
"do",
" ",
"you",
" ",
"want",
" ",
"to",
" ",
"throw",
" ",
"exception",
",",
" ",
"silently",
" ",
"continue",
" ",
"or",
" ",
"warn_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"on",
" ",
"std",
"err",
"?",
" ",
" ",
"Us",
"ual",
"ly",
" ",
"error",
"s",
" ",
"happ",
"ens",
" ",
"whe",
"n",
" ",
"there",
" ",
"are",
" ",
"multiple",
" ",
"attributes_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"tha",
"t",
" ",
"confl",
"ict",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"SIL",
"ENT",
"\\u",
"ON",
"\\u",
"ERROR_",
"=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"CE",
"RR",
"\\u",
"ON",
"\\u",
"ERROR_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"THRO",
"W",
"\\u",
"ON",
"\\u",
"ERROR_",
"=_",
"3_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Handle",
" ",
"the",
" ",
"XML",
" ",
"Head",
"er",
",",
" ",
"if",
" ",
"we",
" ",
"want",
" ",
"to",
" ",
"dump",
" ",
"it_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Dump",
",",
" ",
"but",
" ",
"allow",
" ",
"passage",
" ",
"of",
" ",
"attributes_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Dump",
" ",
"just",
" ",
"the",
" ",
"name",
" ",
"and",
" ",
"make",
" ",
"sure",
" ",
"it",
"'",
"s",
" ",
"well",
"-",
"formed",
" ",
"tag",
" ",
"name_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"(",
"or",
" ",
"attribute",
" ",
"name",
"):",
" ",
"TOD",
"O",
":",
" ",
"Thi",
"s",
" ",
"may",
" ",
"be",
" ",
"too",
" ",
"restrict",
"ive_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Dump",
" ",
"content",
":",
" ",
"this",
" ",
"means",
" ",
"handling",
" ",
"escape",
" ",
"characters_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Dump",
" ",
"the",
" ",
"start",
" ",
"tag",
",",
" ",
"with",
" ",
"atten",
"tion",
" ",
"to",
" ",
"format",
"ting",
" ",
"and",
" ",
"options_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Dump",
" ",
"the",
" ",
"end",
" ",
"tag",
",",
" ",
"with",
" ",
"atten",
"tion",
" ",
"to",
" ",
"output",
" ",
"options",
" ",
"and",
" ",
"formatting_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Do",
"es",
" ",
"the",
" ",
"tag",
" ",
"represent",
" ",
"a",
" ",
"composi",
"te",
" ",
"object",
":",
" ",
"any",
" ",
"container",
" ",
"is_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"a",
" ",
"composi",
"te",
":",
" ",
"Tab",
",",
" ",
"Arr",
",",
" ",
"Tup",
",",
" ",
"OT",
"ab",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"primi",
"tiv",
"e",
" ",
"data",
":",
" ",
"string",
",",
" ",
"complex",
",",
" ",
"int",
",",
" ",
"float",
",",
" ",
"etc",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Fin",
"d",
" ",
"all",
" ",
"key",
"-",
"values",
" ",
"tha",
"t",
" ",
"coul",
"d",
" ",
"be",
" ",
"XML",
" ",
"attribute",
"s",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Dump",
" ",
"a",
" ",
"list",
" ",
"of",
" ",
"binar",
"y",
" ",
"data",
" ",
"as",
" ",
"a",
" ",
"tag",
" ",
"with",
" ",
"one",
" ",
"special",
" ",
"key",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"array",
"type\\u\\u",
" ",
"=",
" ",
"\"<",
"type",
"tag",
">\"",
" ",
"whi",
"ch",
" ",
"is",
" ",
"some",
" ",
"type",
"tag",
" ",
"(",
"sil",
"xf",
"d",
"SIL",
"XF",
"D",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"or",
",",
" ",
"every",
" ",
"individual",
" ",
"element",
" ",
"as",
" ",
"a",
" ",
"\"",
"type\\u\\u",
"\"",
" ",
"=",
" ",
"<",
"type",
"tag",
">\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Dump",
" ",
"a",
" ",
"table",
" ",
"t_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Dump",
" ",
"a",
" ",
"primi",
"tiv",
"e",
" ",
"type",
" ",
"(",
"string",
",",
" ",
"number",
",",
" ",
"real",
",",
" ",
"complex",
",",
" ",
"etc",
".)",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Cent",
"ral",
"ize",
" ",
"error",
" ",
"handling",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"os_",
",_",
"options_",
"=_",
"0_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"array",
"\\u",
"disposition",
"_",
"=_",
"ARR",
"AY",
"DISP",
"OSI",
"TIO",
"N",
"\\u",
"AS",
"\\u",
"LIST_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"indent",
"\\u",
"increment_",
"=_",
"4_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"prepend",
"\\u",
"char_",
"=_",
"XML",
"\\u",
"PREP",
"END",
"\\u",
"CHAR_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"mode_",
"=_",
"2_",
")_",
":_",
"#",
" ",
"XML",
"Dumper",
".",
"CE",
"RR",
"\\u",
"ON",
"\\u",
"ERROR_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Creat",
"e",
" ",
"am",
" ",
"XML",
" ",
"dumper",
".",
" ",
" ",
"Not",
"e",
" ",
"tha",
"t",
" ",
"options",
" ",
"are",
" ",
"|",
" ",
"tog",
"ether",
":",
"\\",
"10",
";",
" ",
" ",
"XML",
"Dumper",
" ",
"xd",
"(",
"cout",
",",
" ",
"XML",
"\\u",
"DUMP",
"\\u",
"PRE",
"TTY",
" ",
"|",
" ",
"XML",
"\\u",
"STRI",
"CT",
"\\u",
"HDR",
")",
"\\",
"10",
";",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Handle",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"array",
"\\u",
"disposition",
"_",
"==_",
"ARR",
"AY",
"DISP",
"OSI",
"TIO",
"N",
"\\u",
"AS",
"\\u",
"NUMERIC",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"Numeric_",
"#",
" ",
"let",
" ",
"this",
" ",
"throw",
" ",
"the",
" ",
"exception_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"array",
"\\u",
"disposition",
"_",
"==_",
"ARR",
"AY",
"DISP",
"OSI",
"TIO",
"N",
"\\u",
"AS",
"\\u",
"NUMERIC",
"\\u",
"WRAP",
"PER",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"simple",
"array_",
"#",
" ",
"let",
" ",
"this",
" ",
"throw",
" ",
"the",
" ",
"exception_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"array",
"\\u",
"disposition",
"_",
"==_",
"ARR",
"AY",
"DISP",
"OSI",
"TIO",
"N",
"\\u",
"AS",
"\\u",
"PYTHON",
"\\u",
"ARRAY_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"array_",
"#",
" ",
"let",
" ",
"this",
" ",
"throw",
" ",
"the",
" ",
"exception_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"os",
"\\u_",
"=_",
"os_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"options",
"\\u_",
"=_",
"options_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"arr",
"Disp",
"\\u_",
"=_",
"array",
"\\u",
"disposition",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"indent",
"Increment",
"\\u_",
"=_",
"indent",
"\\u",
"increment_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"prepend",
"Char",
"\\u_",
"=_",
"prepend",
"\\u",
"char_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"mode",
"\\u_",
"=_",
"mode_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"special",
"Char",
"To",
"Esc",
"ape",
"Seq",
"\\u_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"NULL",
"Key",
"\\u_",
"=_",
"None_",
"#",
" ",
"Has",
" ",
"to",
" ",
"be",
" ",
"non",
"-",
"string",
" ",
"meta",
"-",
"value",
" ",
"so",
" ",
"\"",
"is",
"\"",
" ",
"test",
" ",
"won",
"'",
"t",
" ",
"fail",
" ",
"with",
" ",
"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"EMP",
"TY",
"Attr",
"s\\u_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"LIST",
"Attr",
"s\\u_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"DICT",
"Ta",
"g",
"\\u_",
"=_",
"\"",
"dict",
"\\u\\u\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"special",
"Char",
"To",
"Esc",
"ape",
"Seq",
"\\u_",
"[_",
"'&'_",
"]_",
"=_",
"\"&",
"amp",
";\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"special",
"Char",
"To",
"Esc",
"ape",
"Seq",
"\\u_",
"[_",
"'<'_",
"]_",
"=_",
"\"&",
"lt",
";\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"special",
"Char",
"To",
"Esc",
"ape",
"Seq",
"\\u_",
"[_",
"'>'_",
"]_",
"=_",
"\"&",
"gt",
";\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"special",
"Char",
"To",
"Esc",
"ape",
"Seq",
"\\u_",
"[_",
"'\\\\\"",
"'_",
"]_",
"=_",
"\"&",
"quot",
";\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"special",
"Char",
"To",
"Esc",
"ape",
"Seq",
"\\u_",
"[_",
"'\\\\''_",
"]_",
"=_",
"\"&",
"apos",
";\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"LIST",
"Attr",
"s\\u_",
"[_",
"\"",
"type\\u\\u",
"\"_",
"]_",
"=_",
"\"",
"list",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"ostr",
"eam",
"&",
" ",
"os",
"\\u",
";",
" ",
" ",
" ",
" ",
" ",
"//",
" ",
"Stream",
" ",
"output",
"ting",
" ",
"to_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"int",
" ",
"options",
"\\u",
";",
" ",
" ",
" ",
" ",
" ",
"//",
" ",
"OR",
" ",
"ed",
" ",
"options_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Array",
"Dispo",
"sition",
"\\u",
"e",
" ",
"arr",
"Disp",
"\\u",
";",
" ",
"//",
" ",
"Ho",
"w",
" ",
"to",
" ",
"handle",
" ",
"PO",
"D",
" ",
"data_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"int",
" ",
"indent",
"Increment",
"\\u",
";",
" ",
"//",
" ",
"Ho",
"w",
" ",
"muc",
"h",
" ",
"to",
" ",
"up",
" ",
"the",
" ",
"indent",
" ",
"at",
" ",
"each",
" ",
"nesting",
" ",
"level_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"char",
" ",
"prepend",
"Char",
"\\u",
";",
" ",
" ",
" ",
" ",
"//",
" ",
"'\\\\",
"0",
"'",
" ",
"means",
" ",
"NO",
" ",
"prepend",
" ",
"char_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"XML",
"Dump",
"Error",
"Mode",
"\\u",
"e",
" ",
"mode",
"\\u",
";",
" ",
"//",
" ",
"Ho",
"w",
" ",
"to",
" ",
"handle",
" ",
"error",
"s",
":",
" ",
"sile",
"nt",
",",
" ",
"cer",
"r",
",",
"or",
" ",
"throw_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Hash",
"Table",
"T",
"<",
"char",
",",
" ",
"string",
",",
" ",
"8",
">",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"special",
"Char",
"To",
"Esc",
"ape",
"Seq",
"\\u",
";",
" ",
" ",
"//",
" ",
"Handle",
" ",
"XML",
" ",
"escape",
" ",
"sequences_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"string",
" ",
"NULL",
"Key",
"\\u",
";",
" ",
" ",
"//",
" ",
"Emp",
"ty",
" ",
"key_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tab",
" ",
" ",
" ",
" ",
"EMP",
"TY",
"Attr",
"s",
"\\u",
";",
" ",
" ",
" ",
"//",
" ",
"Emp",
"ty",
" ",
"Attr",
"s",
" ",
"whe",
"n",
" ",
"dump",
"ing",
" ",
"a",
" ",
"primitive_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Tab",
" ",
" ",
" ",
" ",
"LIST",
"Attr",
"s",
"\\u",
";",
" ",
" ",
" ",
" ",
"//",
" ",
"{",
" ",
"\"",
"type\\u\\u",
"\"",
" ",
"=",
" ",
"'",
"list",
"'",
" ",
"}",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"string",
" ",
"DICT",
"Ta",
"g",
"\\u",
";",
" ",
" ",
"//",
" ",
"\"",
"dict",
"\\u\\u\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"XML",
"Dump",
"Value_",
"(_",
"self_",
",_",
"value_",
",_",
"indent_",
"=_",
"0_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"",
"Dump",
" ",
"with",
"out",
" ",
"a",
" ",
"top",
"-",
"level",
" ",
"container",
" ",
"(",
"i",
".",
"e",
".,",
" ",
"no",
" ",
"contain",
"ing",
" ",
"top",
"-",
"level",
" ",
"tag",
")\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"XML",
"Dump",
"Key",
"Value_",
"(_",
"self_",
"._",
"NULL",
"Key",
"\\u_",
",_",
"value_",
",_",
"indent_",
")_",
"#",
" ",
"handle",
"s",
" ",
"header",
" ",
"too",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"XML",
"Dump",
"Key",
"Value_",
"(_",
"self_",
",_",
"key_",
",_",
"value_",
",_",
"indent_",
"=_",
"0_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"",
"Dump",
" ",
"with",
" ",
"the",
" ",
"give",
"n",
" ",
"top",
"-",
"level",
" ",
"key",
" ",
"as",
" ",
"the",
" ",
"top",
"-",
"level",
" ",
"tag",
".\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Header_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Top",
" ",
"level",
" ",
"lists",
" ",
"suc",
"k",
":",
" ",
"you",
" ",
"can",
"'",
"t",
" ",
"\"",
"reall",
"y",
"\"",
" ",
"have",
" ",
"a_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"list",
" ",
"at",
" ",
"the",
" ",
"top",
" ",
"level",
" ",
"of",
" ",
"an",
" ",
"XML",
" ",
"document",
",",
" ",
"only_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"a",
" ",
"table",
" ",
"tha",
"t",
" ",
"contain",
"s",
" ",
"a",
" ",
"list",
"!",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"type_",
"(_",
"value_",
")_",
"==_",
"list_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"a_",
"=_",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"p_",
"=_",
"a_",
"#",
" ",
"DO",
" ",
"NOT",
" ",
"adopt",
",",
" ",
"just",
" ",
"shar",
"ing",
" ",
"reference_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"top_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"top_",
"[_",
"\"",
"list",
"\\u\\u\"_",
"]_",
"=_",
"p_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Key",
"Value_",
"(_",
"key_",
",_",
"top_",
",_",
"indent_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Key",
"Value_",
"(_",
"key_",
",_",
"value_",
",_",
"indent_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"dump_",
"(_",
"self_",
",_",
"key_",
",_",
"value_",
",_",
"indent_",
"=_",
"0_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Dump",
" ",
"*",
"WITH",
"OUT",
" ",
"REG",
"ARD",
"*",
" ",
"to",
" ",
"top",
"-",
"level",
" ",
"container",
" ",
"and",
"/",
"or",
" ",
"XML",
" ",
"header",
":",
"\\",
"10",
";",
" ",
" ",
"this",
" ",
"allow",
"s",
" ",
"you",
" ",
"to",
" ",
"compose",
" ",
"XML",
" ",
"stream",
"s",
" ",
"if",
" ",
"you",
" ",
"need",
" ",
"to",
":",
" ",
"it",
" ",
"just",
"\\",
"10",
";",
" ",
" ",
"dump",
"s",
" ",
"XML",
" ",
"int",
"o",
" ",
"the",
" ",
"stream",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Key",
"Value_",
"(_",
"key_",
",_",
"value_",
",_",
"indent_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"dump",
"Value_",
"(_",
"self_",
",_",
"value_",
",_",
"indent_",
"=_",
"0_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Dump",
" ",
"*",
"WITH",
"OUT",
" ",
"REG",
"ARD",
"*",
" ",
"to",
" ",
"top",
"-",
"level",
" ",
"container",
" ",
"and",
"/",
"or",
" ",
"XML",
" ",
"header",
":",
"\\",
"10",
";",
" ",
" ",
"this",
" ",
"allow",
"s",
" ",
"you",
" ",
"to",
" ",
"compose",
" ",
"XML",
" ",
"stream",
"s",
" ",
"if",
" ",
"you",
" ",
"need",
" ",
"to",
":",
" ",
"it",
" ",
"just",
"\\",
"10",
";",
" ",
" ",
"dump",
"s",
" ",
"XML",
" ",
"(",
"value",
" ",
"only",
")",
" ",
"int",
"o",
" ",
"the",
" ",
"stream",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Key",
"Value_",
"(_",
"self_",
"._",
"NULL",
"Key",
"\\u_",
",_",
"value_",
",_",
"indent_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"mode_",
"(_",
"self_",
",_",
"mode_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"If",
" ",
"the",
" ",
"table",
" ",
"is",
" ",
"mal",
"formed",
" ",
"(",
"usual",
"ly",
" ",
"attribute",
"s",
" ",
"conflicting",
"),",
" ",
"throw",
"\\",
"10",
";",
" ",
" ",
"a",
" ",
"runt",
"ime",
" ",
"error",
" ",
"if",
" ",
"strict",
".",
" ",
" ",
"By",
" ",
"default",
",",
" ",
"output",
"s",
" ",
"to",
" ",
"cer",
"r",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"mode",
"\\u_",
"=_",
"mode_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"XML",
"Header_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"options",
"\\u_",
"&_",
"XML",
"\\u",
"STRI",
"CT",
"\\u",
"HDR",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"\"<",
"?",
"xml",
" ",
"version",
"=\\\\\"",
"1.0",
"\\\\\"",
" ",
"encoding",
"=\\\\\"",
"UT",
"F",
"-",
"8",
"\\\\\"",
"?>",
"\"_",
"+_",
"\"\\\\",
"n",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"XML",
"Dump",
"Key",
"Value_",
"(_",
"self_",
",_",
"key_",
",_",
"value_",
",_",
"indent_",
"=_",
"0_",
",_",
"attr",
"s",
"\\u",
"ptr_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"t_",
"=_",
"type_",
"(_",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"t_",
"==_",
"dict_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"options",
"\\u_",
"&_",
"XML",
"\\u",
"DUMP",
"\\u",
"UN",
"NAT",
"URA",
"L",
"\\u",
"ORDER_",
":_",
"#",
" ",
"may",
" ",
"want",
" ",
"speed_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Table_",
"(_",
"key_",
",_",
"value_",
",_",
"indent_",
",_",
"attr",
"s",
"\\u",
"ptr_",
",_",
"sort",
"keys_",
"=_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"#",
" ",
"Nat",
"ural",
" ",
"order",
" ",
"(",
"for",
" ",
"predi",
"ctab",
"ilit",
"y",
")",
" _",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Table_",
"(_",
"key_",
",_",
"value_",
",_",
"indent_",
",_",
"attr",
"s",
"\\u",
"ptr_",
",_",
"sort",
"keys_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"t_",
"==_",
"Order",
"ed",
"Dict_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"options",
"\\u_",
"&_",
"XML",
"\\u",
"DUMP",
"\\u",
"UN",
"NAT",
"URA",
"L",
"\\u",
"ORDER_",
":_",
"#",
" ",
"may",
" ",
"still",
" ",
"want",
" ",
"sorted_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Table_",
"(_",
"key_",
",_",
"value_",
",_",
"indent_",
",_",
"attr",
"s",
"\\u",
"ptr_",
",_",
"sort",
"keys_",
"=_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"#",
" ",
"Nat",
"ural",
" ",
"order",
" ",
"of",
" ",
"an",
" ",
"odi",
"ct",
" ",
"is",
" ",
"the",
" ",
"order",
" ",
"of",
" ",
"the",
" ",
"odict_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Table_",
"(_",
"key_",
",_",
"value_",
",_",
"indent_",
",_",
"attr",
"s",
"\\u",
"ptr_",
",_",
"sort",
"keys_",
"=_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"t_",
"==_",
"list_",
"or_",
"t_",
"==_",
"tuple_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"XML",
"Dump",
"List_",
"(_",
"key_",
",_",
"value_",
",_",
"indent_",
",_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"t_",
"in_",
"array",
"\\u",
"types_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"XML",
"Dump",
"PO",
"DL",
"ist_",
"(_",
"key_",
",_",
"value_",
",_",
"indent_",
",_",
"-_",
"1_",
",_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Primitive",
"_",
"(_",
"key_",
",_",
"value_",
",_",
"indent_",
",_",
"attr",
"s",
"\\u",
"ptr_",
",_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"XML",
"Dump",
"Name_",
"(_",
"self_",
",_",
"tag_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"len_",
"(_",
"tag_",
")_",
"==_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"handle",
"Problem_",
"(_",
"\"",
"tag",
" ",
"cann",
"ot",
" ",
"be",
" ",
"empty",
" ",
"(",
"0",
" ",
"length",
")\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"t_",
"=_",
"tag_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"t_",
"[_",
"0_",
"]_",
"._",
"isdigit_",
"(_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"self_",
"._",
"options",
"\\u_",
"&_",
"XML",
"\\u",
"TAG",
"S",
"\\u",
"ACCEPT",
"S",
"\\u",
"DIGIT",
"S_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"'\\u'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"handle",
"Problem_",
"(_",
"\"",
"tag",
" ",
"must",
" ",
"start",
" ",
"with",
" ",
"alphabetic",
" ",
"or",
" ",
"\\u",
",",
" ",
"not",
" ",
"\"_",
"+_",
"t_",
"[_",
"0_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"not_",
"(_",
"t_",
"[_",
"0_",
"]_",
"._",
"isalpha_",
"(_",
")_",
"or_",
"t_",
"[_",
"0_",
"]_",
"==_",
"'\\u'_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"handle",
"Problem_",
"(_",
"\"",
"tag",
" ",
"must",
" ",
"start",
" ",
"with",
" ",
"alphabetic",
" ",
"or",
" ",
"\\u",
",",
" ",
"not",
" ",
"\"_",
"+_",
"t_",
"[_",
"0_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"ii_",
"in_",
"xrange_",
"(_",
"1_",
",_",
"len_",
"(_",
"tag_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"not_",
"(_",
"t_",
"[_",
"ii_",
"]_",
"._",
"isal",
"num_",
"(_",
")_",
"or_",
"t_",
"[_",
"ii_",
"]_",
"==_",
"'\\u'_",
"or_",
"t_",
"[_",
"ii_",
"]_",
"==_",
"':'_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"handle",
"Problem_",
"(_",
"\"",
"tag",
" ",
"must",
" ",
"contain",
" ",
"alphanumeric",
" ",
"or",
" ",
"\\u",
",",
" ",
"not",
" ",
"\"_",
"+_",
"t_",
"[_",
"ii_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"tag_",
")_",
"#",
" ",
"All",
" ",
"good_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"XML",
"Conten",
"t",
"Filter_",
"(_",
"self_",
",_",
"content_",
",_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"result_",
"=_",
"\"\"_",
"#",
" ",
"RV",
"O_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"typecode_",
"=_",
"{_",
"float_",
":_",
"'",
"d",
"'_",
",_",
"complex_",
":_",
"'",
"D",
"'_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"type",
"\\u",
"content_",
"=_",
"type_",
"(_",
"content_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
"!=_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"t_",
"=_",
"pretty_",
"._",
"Numer",
"ic",
"String",
"\\u_",
"(_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
",_",
"content_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"type",
"\\u",
"content_",
"in_",
"[_",
"float_",
",_",
"complex_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"t_",
"=_",
"pretty_",
"._",
"Numer",
"ic",
"String",
"\\u_",
"(_",
"typecode_",
"[_",
"type",
"\\u",
"content_",
"]_",
",_",
"content_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"type",
"\\u",
"content_",
"==_",
"long_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"t_",
"=_",
"repr_",
"(_",
"content_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"t_",
"=_",
"str_",
"(_",
"content_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"ii_",
"in_",
"xrange_",
"(_",
"0_",
",_",
"len_",
"(_",
"t_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"c_",
"=_",
"t_",
"[_",
"ii_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"not_",
"isp",
"rint_",
"(_",
"c_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"result_",
"+=_",
"\"&",
"#\"_",
"+_",
"hex_",
"(_",
"ord_",
"(_",
"c_",
")_",
")_",
"[_",
"1_",
":_",
"]_",
"+_",
"\";\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"c_",
"in_",
"self_",
"._",
"special",
"Char",
"To",
"Esc",
"ape",
"Seq",
"\\u_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"esc",
"\\u",
"seq_",
"=_",
"self_",
"._",
"special",
"Char",
"To",
"Esc",
"ape",
"Seq",
"\\u_",
"[_",
"t_",
"[_",
"ii_",
"]_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"result_",
"=_",
"result_",
"+_",
"esc",
"\\u",
"seq_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"result_",
"=_",
"result_",
"+_",
"t_",
"[_",
"ii_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"result_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"XML",
"Dump",
"Start",
"Tag_",
"(_",
"self_",
",_",
"tag_",
",_",
"attrs_",
",_",
"indent_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"primi",
"tiv",
"e\\u",
"dump_",
"=_",
"False_",
",_",
"none",
"\\u",
"dump_",
"=_",
"False_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"tag_",
"is_",
"self_",
"._",
"NULL",
"Key",
"\\u_",
":_",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"self_",
"._",
"options",
"\\u_",
"&_",
"XML",
"\\u",
"DUMP",
"\\u",
"PRE",
"TTY",
"_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"'",
" ",
"'_",
"*_",
"indent_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"'<'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Name_",
"(_",
"tag_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Attribute",
"s",
" ",
" ",
"key",
"1",
"=\"",
"somet",
"hing",
"\"",
" ",
"key",
"2",
"=\"",
"somet",
"hing",
"else",
"\"_",
"\\u\\u\\uNL\\u\\u\\u_",
"len",
"\\u",
"attrs_",
"=_",
"len_",
"(_",
"attrs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"len",
"\\u",
"attrs_",
">=_",
"1_",
":_",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"\"",
" ",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"where_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"key_",
",_",
"val_",
"in_",
"sorted_",
"(_",
"attrs_",
"._",
"iteritems_",
"(_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"String",
" ",
"as",
" ",
"is_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"attr",
"\\u",
"name_",
"=_",
"str_",
"(_",
"key_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"(_",
"len_",
"(_",
"attr",
"\\u",
"name_",
")_",
">_",
"0_",
"and_",
"attr",
"\\u",
"name_",
"[_",
"0_",
"]_",
"==_",
"self_",
"._",
"prepend",
"Char",
"\\u_",
"and_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"(_",
"self_",
"._",
"options",
"\\u_",
"&_",
"XML",
"\\u",
"DUMP",
"\\u",
"PREP",
"END",
"\\u",
"KEYS",
"\\u",
"AS",
"\\u",
"TAGS_",
")_",
"==_",
"0_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"attr",
"\\u",
"name_",
"=_",
"attr",
"\\u",
"name_",
"[_",
"1_",
":_",
"]_",
"#",
" ",
"strip",
" ",
"\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"attr",
"\\u",
"val_",
"=_",
"str_",
"(_",
"val_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
"os",
"\\u",
" ",
"<<",
" ",
"attr",
"\\u",
"name",
" ",
"<<",
" ",
"\"=",
"\"",
" ",
"<<",
" ",
"attr",
"\\u",
"val",
";_",
"\\u\\u\\uNL\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Name_",
"(_",
"attr",
"\\u",
"name_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"\"=",
"\\\\\"\"_",
"+_",
"self_",
"._",
"\\u",
"XML",
"Conten",
"t",
"Filter_",
"(_",
"attr",
"\\u",
"val_",
",_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
")_",
"+_",
"\"\\\\\"\"_",
")_",
"#",
" ",
"TOD",
"O",
":",
" ",
"handle",
" ",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"where_",
"+=_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"(_",
"where_",
"!=_",
"len",
"\\u",
"attrs_",
")_",
":_",
"#",
" ",
"last",
" ",
"one",
",",
" ",
"no",
" ",
"extra",
" ",
"space_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"\"",
" ",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"none",
"\\u",
"dump_",
":_",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"\"/\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"\">\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"(_",
"(_",
"self_",
"._",
"options",
"\\u_",
"&_",
"XML",
"\\u",
"DUMP",
"\\u",
"PRE",
"TTY",
"_",
")_",
"!=_",
"0_",
")_",
"and_",
"(_",
"not_",
"primi",
"tiv",
"e\\u",
"dump_",
"or_",
"none",
"\\u",
"dump_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"\"\\\\",
"n",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"XML",
"Dump",
"End",
"Tag_",
"(_",
"self_",
",_",
"tag_",
",_",
"indent_",
",_",
"primi",
"tiv",
"e\\u",
"dump_",
"=_",
"False_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"tag_",
"is_",
"self_",
"._",
"NULL",
"Key",
"\\u_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"(_",
"(_",
"self_",
"._",
"options",
"\\u_",
"&_",
"XML",
"\\u",
"DUMP",
"\\u",
"PRE",
"TTY",
"_",
")_",
"and_",
"not_",
"primi",
"tiv",
"e\\u",
"dump_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"'",
" ",
"'_",
"*_",
"indent_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"\"<",
"/\"_",
"+_",
"tag_",
"+_",
"\">\"_",
")_",
"#",
" ",
"Not",
"e",
":",
" ",
"Al",
"read",
"y",
" ",
"checke",
"d",
" ",
"tha",
"t",
" ",
"tag",
" ",
"is",
" ",
"oka",
"y",
"!",
" _",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"(_",
"self_",
"._",
"options",
"\\u_",
"&_",
"XML",
"\\u",
"DUMP",
"\\u",
"PRE",
"TTY",
"_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"\"\\\\",
"n",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"Is",
"Composit",
"e_",
"(_",
"self_",
",_",
"v_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"t_",
"=_",
"type_",
"(_",
"v_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"t_",
"in_",
"[_",
"tuple_",
",_",
"dict_",
",_",
"list_",
",_",
"Order",
"ed",
"Dict_",
"]_",
"or_",
"t_",
"in_",
"array",
"\\u",
"types_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"Fin",
"d",
"Attributes_",
"(_",
"self_",
",_",
"t_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Collect",
" ",
"all",
" ",
"thing",
"s",
" ",
"tha",
"t",
" ",
"coul",
"d",
" ",
"be",
" ",
"attributes_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"attrs_",
"=_",
"{_",
"}_",
"#",
" ",
"RV",
"O_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"\"\\u\\u",
"attr",
"s",
"\\u\\u\"_",
"in_",
"t_",
":_",
"#",
" ",
"We",
" ",
"want",
" ",
"to",
" ",
"discove",
"r",
" ",
"automati",
"call",
"y",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Attribute",
"s",
" ",
"all",
" ",
"in",
" ",
"special",
" ",
"key",
" ",
"'\\u",
"\\u",
"attr",
"s",
"\\u\\u'_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"attrs_",
"=_",
"t_",
"[_",
"\"\\u\\u",
"attr",
"s",
"\\u\\u\"_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Attribute",
"s",
" ",
"may",
" ",
"als",
"o",
" ",
"have",
" ",
"to",
" ",
"be",
" ",
"found_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"sorte",
"d\\u",
"keys_",
"=_",
"sorted_",
"(_",
"t_",
"._",
"keys_",
"(_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"key_",
"in_",
"sorte",
"d\\u",
"keys_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"value_",
"=_",
"t_",
"[_",
"key_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"##",
"for",
" ",
"key",
",",
" ",
"value",
" ",
"in",
" ",
"sorte",
"d",
"(",
"t",
".",
"iter",
"items",
"())",
" ",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"key_",
"==_",
"\"\\u\\u",
"attr",
"s",
"\\u\\u\"_",
":_",
"continue_",
"#",
" ",
"alr",
"ead",
"y",
" ",
"processed_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"key_",
"==_",
"\"\\u\\u",
"content",
"\\u\\u\"_",
":_",
"continue_",
"#",
" ",
"special_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Special",
" ",
"character",
" ",
"say",
"s",
" ",
"the",
"y",
" ",
"*",
"MA",
"Y",
"*",
" ",
"bec",
"ome",
" ",
"attributes_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"(_",
"len_",
"(_",
"key_",
")_",
">_",
"0_",
"and_",
"key_",
"[_",
"0_",
"]_",
"==_",
"self_",
"._",
"prepend",
"Char",
"\\u_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"key_",
"in_",
"attrs_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"handle",
"Problem_",
"(_",
"key_",
"+_",
"string_",
"(_",
"\"",
" ",
"alr",
"ead",
"y",
" ",
"in",
" ",
"\"_",
")_",
"+_",
"str_",
"(_",
"t_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"key",
"\\u",
"with",
"out",
"\\u",
"underscore",
"_",
"=_",
"key_",
"[_",
"1_",
":_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"(_",
"self_",
"._",
"options",
"\\u_",
"&_",
"XML",
"\\u",
"DUMP",
"\\u",
"PREP",
"END",
"\\u",
"KEYS",
"\\u",
"AS",
"\\u",
"TAGS_",
")_",
"==_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"attrs_",
"[_",
"key",
"\\u",
"with",
"out",
"\\u",
"underscore",
"_",
"]_",
"=_",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"continue_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Do",
" ",
"All",
" ",
"simple",
" ",
"values",
" ",
"bec",
"ome",
" ",
"attribute",
"s",
"?",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"(_",
"self_",
"._",
"options",
"\\u_",
"&_",
"XML",
"\\u",
"DUMP",
"\\u",
"SIMPLE",
"\\u",
"TAG",
"S",
"\\u",
"AS",
"\\u",
"ATTRIBUTES_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"simple_",
"=_",
"not_",
"self_",
"._",
"\\u",
"Is",
"Composit",
"e_",
"(_",
"value_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"key_",
"in_",
"attrs_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"handle",
"Problem_",
"(_",
"key_",
"+_",
"string_",
"(_",
"\"",
" ",
"alr",
"ead",
"y",
" ",
"in",
" ",
"\"_",
")_",
"+_",
"str_",
"(_",
"t_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"simple_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"attrs_",
"[_",
"key_",
"]_",
"=_",
"value_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"continue_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"All",
" ",
"done_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"attrs_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"XML",
"Dump",
"List_",
"(_",
"self_",
",_",
"list",
"\\u",
"name_",
",_",
"l_",
",_",
"indent_",
",_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Thi",
"s",
" ",
"stran",
"ge",
" ",
"business",
" ",
"is",
" ",
"to",
" ",
"handle",
" ",
"lists",
" ",
"with",
" ",
"no",
" ",
"names",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"eit",
"her",
" ",
"nest",
"ed",
" ",
"within",
" ",
"other",
" ",
"lists",
" ",
"or",
" ",
"at",
" ",
"the",
" ",
"top",
"-",
"level",
" ",
"so",
" ",
"it",
" ",
"will",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"still",
" ",
"form",
" ",
"well",
"-",
"formed",
" ",
"XML",
":",
" ",
"this",
" ",
"is",
" ",
"pretty",
" ",
"rare",
",",
" ",
"but",
" ",
"we",
" ",
"should_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"still",
" ",
"do",
" ",
"somet",
"hing",
" ",
"usef",
"ul",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"list",
"\\u",
"name_",
"is_",
"self_",
"._",
"NULL",
"Key",
"\\u_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"tag_",
"=_",
"\"",
"list",
"\\u\\u\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"tag_",
"=_",
"list",
"\\u",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Emp",
"ty",
" ",
"list_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"len_",
"(_",
"l_",
")_",
"==_",
"0_",
":_",
"#",
" ",
"Force",
" ",
"list",
" ",
"type\\u\\u",
" ",
"so",
" ",
"will",
" ",
"un",
"XML",
"ize",
" ",
"as",
" ",
"an",
" ",
"Arr",
"()",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Primitive",
"_",
"(_",
"tag_",
",_",
"None_",
",_",
"indent_",
",_",
"self_",
"._",
"LIST",
"Attr",
"s\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Non",
"-",
"empty",
" ",
"list_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"for_",
"ii_",
"in_",
"xrange_",
"(_",
"0_",
",_",
"len_",
"(_",
"l_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"key",
"\\u",
"to",
"\\u",
"use_",
"=_",
"self_",
"._",
"NULL",
"Key",
"\\u_",
"#",
" ",
"normal",
"ly",
" ",
"NULL",
" ",
"RAR",
"EL",
"Y",
":",
" ",
"empty",
" ",
"list_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"value",
"\\u",
"ptr_",
"=_",
"l_",
"[_",
"ii_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Thi",
"s",
" ",
"stran",
"ge",
" ",
"bit",
" ",
"is",
" ",
"bec",
"aus",
"e",
" ",
"a",
" ",
"table",
" ",
"is",
" ",
"direct",
"ly",
" ",
"insi",
"de",
" ",
"a",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"list",
",",
" ",
"whi",
"ch",
" ",
"means",
" ",
"there",
" ",
"IS",
" ",
"no",
" ",
"tag",
",",
" ",
"whi",
"ch",
" ",
"normal",
"ly",
" ",
"wou",
"ld",
" ",
"be_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"an",
" ",
"extra",
" ",
"indent",
" ",
"with",
" ",
"an",
" ",
"empty",
" ",
"name",
":",
" ",
"this",
" ",
"is",
" ",
"specifica",
"ll",
"y",
" ",
"bec",
"aus",
"e_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"of",
" ",
"the",
" ",
"dict",
" ",
"within",
" ",
"a",
" ",
"list",
".",
" ",
" ",
"A",
" ",
"table",
" ",
"insi",
"de",
" ",
"can",
" ",
"als",
"o",
" ",
"mean_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"the",
" ",
"\\u\\u",
"content",
"s\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"table",
"\\u",
"insi",
"de",
"\\u",
"value_",
"=_",
"type_",
"(_",
"value",
"\\u",
"ptr_",
")_",
"==_",
"dict_",
"or_",
"type_",
"(_",
"value",
"\\u",
"ptr_",
")_",
"==_",
"Order",
"ed",
"Dict_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"indent",
"\\u",
"inc_",
"=_",
"self_",
"._",
"indent",
"Increment",
"\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"attrs_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"(_",
"table",
"\\u",
"insi",
"de",
"\\u",
"value_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"indent",
"\\u",
"inc_",
"=_",
"0_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"attrs_",
"=_",
"self_",
"._",
"\\u",
"Fin",
"d",
"Attributes_",
"(_",
"value",
"\\u",
"ptr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Special",
" ",
"rare",
" ",
"case",
":",
" ",
"content",
"s",
" ",
"in",
" ",
"special",
" ",
"key_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"(_",
"\"\\u\\u",
"content",
"\\u\\u\"_",
"in_",
"value",
"\\u",
"ptr_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"value",
"\\u",
"ptr_",
"=_",
"value",
"\\u",
"ptr_",
"[_",
"\"\\u\\u",
"content",
"\\u\\u\"_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"(_",
"type_",
"(_",
"value",
"\\u",
"ptr_",
")_",
"==_",
"dict_",
"or_",
"type_",
"(_",
"value",
"\\u",
"ptr_",
")_",
"==_",
"Order",
"ed",
"Dict_",
")_",
"and_",
"len_",
"(_",
"value",
"\\u",
"ptr_",
")_",
"==_",
"0_",
"and_",
"len_",
"(_",
"l_",
")_",
"==_",
"1_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Thi",
"s",
" ",
"RAR",
"E",
" ",
"situation",
":",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"{",
" ",
"'",
"top",
"':",
" ",
"[",
" ",
"{}",
" ",
"]",
" ",
"}",
" ",
"->",
" ",
"<",
"top",
" ",
"type\\u\\u",
"=\"",
"list",
"\">",
" ",
"<",
"dict",
"\\u\\u",
"/>",
" ",
"</",
"top",
">_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Emp",
"ty",
" ",
"table",
" ",
"insi",
"de",
" ",
"a",
" ",
"list",
":",
" ",
"Ug",
"h",
":",
" ",
"hard",
" ",
"to",
" ",
"express",
" ",
"in",
" ",
"XML_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"with",
"out",
" ",
"a",
" ",
"new",
" ",
"tag",
" ",
"...",
" ",
"it",
"'",
"s",
" ",
"basic",
"ally",
" ",
"an",
" ",
"anonym",
"ous",
" ",
"table",
":_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Normal",
"ly",
",",
" ",
"it",
"'",
"s",
" ",
"easy",
" ",
"to",
" ",
"detect",
" ",
"a",
" ",
"table",
",",
" ",
"but",
" ",
"an",
" ",
"empty_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"dict",
" ",
"insi",
"de",
" ",
"a",
" ",
"list",
" ",
"is",
" ",
"a",
" ",
"special",
" ",
"case_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"indent",
"\\u",
"inc_",
"=_",
"self_",
"._",
"indent",
"Increment",
"\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"key",
"\\u",
"to",
"\\u",
"use_",
"=_",
"self_",
"._",
"DICT",
"Ta",
"g",
"\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"type_",
"(_",
"value",
"\\u",
"ptr_",
")_",
"in_",
"array",
"\\u",
"types_",
"and_",
"self_",
"._",
"arr",
"Disp",
"\\u_",
"!=_",
"ARR",
"AY",
"DISP",
"OSI",
"TIO",
"N",
"\\u",
"AS",
"\\u",
"LIST_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"###",
"#",
" ",
"Array",
" ",
"data",
",",
" ",
"well",
" ",
"has",
" ",
"pec",
"uli",
"lar",
"iti",
"es",
":",
" ",
"let",
" ",
"it",
" ",
"handle",
" ",
"it_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"XML",
"Dump",
"PO",
"DL",
"ist_",
"(_",
"tag_",
",_",
"value",
"\\u",
"ptr_",
",_",
"indent_",
",_",
"ii_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"ii_",
"==_",
"0_",
"and_",
"len_",
"(_",
"l_",
")_",
"==_",
"1_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"continue_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"If",
" ",
"list",
" ",
"of",
" ",
"1",
",",
" ",
"preserve",
" ",
"listn",
"ess",
" ",
"by",
" ",
"addin",
"g",
" ",
"type",
" ",
"field_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"(_",
"ii_",
"==_",
"0_",
"and_",
"len_",
"(_",
"l_",
")_",
"==_",
"1_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"attrs_",
"[_",
"\"",
"type\\u\\u",
"\"_",
"]_",
"=_",
"\"",
"list",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"primi",
"tiv",
"e\\u",
"type_",
"=_",
"not_",
"self_",
"._",
"\\u",
"Is",
"Composit",
"e_",
"(_",
"value",
"\\u",
"ptr_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Start",
"Tag_",
"(_",
"tag_",
",_",
"attrs_",
",_",
"indent_",
",_",
"primi",
"tiv",
"e\\u",
"type_",
",_",
"False_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Key",
"Value_",
"(_",
"key",
"\\u",
"to",
"\\u",
"use_",
",_",
"value",
"\\u",
"ptr_",
",_",
"indent_",
"+_",
"indent",
"\\u",
"inc_",
",_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"End",
"Tag_",
"(_",
"tag_",
",_",
"indent_",
",_",
"primi",
"tiv",
"e\\u",
"type_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"XML",
"Dump",
"PO",
"DL",
"ist_",
"(_",
"self_",
",_",
"list",
"\\u",
"name_",
",_",
"l_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"indent_",
",_",
"insi",
"de",
"\\u",
"list",
"\\u",
"number_",
",_",
"add",
"\\u",
"type_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"tag",
" ",
"=",
" ",
"str",
"(",
"list",
"\\u",
"name",
")_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"tag_",
"=_",
"list",
"\\u",
"name_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Check",
" ",
"to",
" ",
"see",
" ",
"if",
" ",
"we",
" ",
"want",
" ",
"to",
" ",
"dump",
" ",
"this",
" ",
"as",
" ",
"a",
" ",
"LIST",
" ",
"or",
" ",
"plain",
" ",
"PO",
"D",
" ",
"array_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"self_",
"._",
"arr",
"Disp",
"\\u_",
"==_",
"ARR",
"AY",
"DISP",
"OSI",
"TIO",
"N",
"\\u",
"AS",
"\\u",
"LIST_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Thi",
"s",
" ",
"works",
" ",
"works",
" ",
"with",
" ",
"array",
".",
"array",
" ",
"and",
" ",
"Numer",
"ic",
".",
"array",
" ",
"bec",
"aus",
"e_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"the",
" ",
"float",
"ing",
" ",
"point",
" ",
"typec",
"odes",
" ",
"are",
" ",
"essential",
"ly",
" ",
"the",
" ",
"same",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"and",
" ",
"bot",
"h",
" ",
"support",
" ",
"typec",
"ode",
" ",
"and",
" ",
"tolist_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"was",
"\\u",
"array",
"\\u",
"typecode_",
"=_",
"l_",
"._",
"typecode_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"callable_",
"(_",
"l_",
"._",
"typecode_",
")_",
":_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
"=_",
"l_",
"._",
"typecode_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"float",
" ",
"types_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"not_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
"in_",
"[_",
"'",
"f",
"'_",
",_",
"'",
"F",
"'_",
",_",
"'",
"d",
"'_",
",_",
"'",
"D",
"'_",
"]_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"was",
"\\u",
"array",
"\\u",
"typecode_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"l_",
"=_",
"l_",
"._",
"tolist_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Integer",
" ",
"types_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
"==_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"l_",
"=_",
"[_",
"int_",
"(_",
"x_",
")_",
"for_",
"x_",
"in_",
"l_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"List_",
"(_",
"list",
"\\u",
"name_",
",_",
"l_",
",_",
"indent_",
",_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"The",
" ",
"attribute",
"s",
" ",
"for",
" ",
"an",
" ",
"Array",
" ",
"of",
" ",
"PO",
"D",
" ",
"will",
" ",
"the",
" ",
"Numer",
"ic",
" ",
"type",
" ",
"tag_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"attrs_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"look",
"up",
"\\u",
"table_",
"=_",
"{_",
"'",
"1",
"'_",
":_",
"'",
"s",
"'_",
",_",
"'",
"b",
"'_",
":_",
"'",
"S",
"'_",
",_",
"'",
"s",
"'_",
":_",
"'",
"i",
"'_",
",_",
"'",
"w",
"'_",
":_",
"'",
"I",
"'_",
",_",
"'",
"i",
"'_",
":_",
"'",
"l",
"'_",
",_",
"'",
"u",
"'_",
":_",
"'",
"L",
"'_",
",_",
"'",
"l",
"'_",
":_",
"'",
"x",
"'_",
",_",
"'",
"f",
"'_",
":_",
"'",
"f",
"'_",
",_",
"'",
"d",
"'_",
":_",
"'",
"d",
"'_",
",_",
"'",
"F",
"'_",
":_",
"'",
"F",
"'_",
",_",
"'",
"D",
"'_",
":_",
"'",
"D",
"'_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"byte",
"tag_",
"=_",
"look",
"up",
"\\u",
"table_",
"[_",
"l_",
"._",
"typecode_",
"(_",
")_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"(_",
"self_",
"._",
"options",
"\\u_",
"&_",
"XML",
"\\u",
"DUMP",
"\\u",
"PO",
"D",
"\\u",
"LIST",
"\\u",
"AS",
"\\u",
"XML",
"\\u",
"LIST_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"attrs_",
"[_",
"\"",
"type\\u\\u",
"\"_",
"]_",
"=_",
"byte",
"tag_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"attrs_",
"[_",
"\"",
"array",
"type\\u\\u",
"\"_",
"]_",
"=_",
"byte",
"tag_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"There",
" ",
"are",
" ",
"two",
" ",
"way",
"s",
" ",
"to",
" ",
"dump",
" ",
"Array",
" ",
"data",
":",
" ",
"eit",
"her",
" ",
"as",
" ",
"one",
" ",
"tag_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"with",
" ",
"a",
" ",
"list",
" ",
"of",
" ",
"numbers",
",",
" ",
"or",
" ",
"a",
" ",
"tag",
" ",
"for",
" ",
"for",
" ",
"every",
" ",
"number",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Dump",
"ing",
" ",
"array",
" ",
"data",
" ",
"with",
" ",
"a",
" ",
"tag",
" ",
"for",
" ",
"every",
" ",
"number",
" ",
"works",
" ",
"bett",
"er",
" ",
"with",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"other",
" ",
"tool",
"s",
" ",
"(",
"spr",
"eas",
"heet",
" ",
"etc",
".)",
",",
" ",
"but",
" ",
"if",
" ",
"you",
" ",
"annot",
"ate",
" ",
"EVE",
"RY",
" ",
"ELEMENT",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"of",
" ",
"a",
" ",
"long",
" ",
"list",
",",
" ",
"the",
" ",
"XML",
" ",
"bec",
"ome",
"s",
" ",
"muc",
"h",
" ",
"bigger",
" ",
"and",
" ",
"slow",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Dump",
" ",
"array",
" ",
"with",
" ",
"a",
" ",
"tag",
" ",
"for",
" ",
"EVE",
"RY",
" ",
"element_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"primi",
"tiv",
"e\\u",
"type_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"temp_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"inner",
"\\u",
"tag_",
"=_",
"tag_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"(_",
"self_",
"._",
"options",
"\\u_",
"&_",
"XML",
"\\u",
"DUMP",
"\\u",
"PO",
"D",
"\\u",
"LIST",
"\\u",
"AS",
"\\u",
"XML",
"\\u",
"LIST_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Ra",
"re",
" ",
"case",
" ",
"whe",
"n",
" ",
"PO",
"D",
" ",
"array",
" ",
"insi",
"de",
" ",
"list_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"(_",
"insi",
"de",
"\\u",
"list",
"\\u",
"number_",
"!=_",
"-_",
"1_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"inner",
"\\u",
"attrs_",
"=_",
"{_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"insi",
"de",
"\\u",
"list",
"\\u",
"number_",
"==_",
"0_",
"and_",
"add",
"\\u",
"type_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"inner",
"\\u",
"attrs_",
"[_",
"\"",
"type\\u\\u",
"\"_",
"]_",
"=_",
"\"",
"list",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Start",
"Tag_",
"(_",
"tag_",
",_",
"inner",
"\\u",
"attrs_",
",_",
"indent_",
",_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"inner",
"\\u",
"tag_",
"=_",
"\"",
"list",
"\"_",
"+_",
"str_",
"(_",
"insi",
"de",
"\\u",
"list",
"\\u",
"number_",
")_",
"+_",
"\"\\u\\u",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"indent_",
"+=_",
"self_",
"._",
"indent",
"Increment",
"\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"len_",
"(_",
"l_",
")_",
"==_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Emp",
"ty",
" ",
"list_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Start",
"Tag_",
"(_",
"inner",
"\\u",
"tag_",
",_",
"attrs_",
",_",
"indent_",
",_",
"primi",
"tiv",
"e\\u",
"type_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"End",
"Tag_",
"(_",
"inner",
"\\u",
"tag_",
",_",
"indent_",
",_",
"primi",
"tiv",
"e\\u",
"type_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Non",
"-",
"empty",
" ",
"list_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"for_",
"ii_",
"in_",
"xrange_",
"(_",
"0_",
",_",
"len_",
"(_",
"l_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Start",
"Tag_",
"(_",
"inner",
"\\u",
"tag_",
",_",
"attrs_",
",_",
"indent_",
",_",
"primi",
"tiv",
"e\\u",
"type_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"temp_",
"=_",
"pretty_",
"._",
"Numer",
"ic",
"String",
"\\u_",
"(_",
"byte",
"tag_",
",_",
"l_",
"[_",
"ii_",
"]_",
")_",
"#",
"repr",
"(",
"l",
"[",
"ii",
"])",
" ",
" ",
"#",
" ",
"so",
" ",
"print",
"s",
" ",
"with",
" ",
"full",
" ",
"preci",
"sion",
" ",
"of",
" ",
"Val",
" ",
"for",
" ",
"real",
"s",
",",
" ",
"etc",
"._",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"temp_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"End",
"Tag_",
"(_",
"inner",
"\\u",
"tag_",
",_",
"indent_",
",_",
"primi",
"tiv",
"e\\u",
"type_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Ra",
"re",
" ",
"case",
" ",
"whe",
"n",
" ",
"PO",
"D",
" ",
"array",
" ",
"insi",
"de",
" ",
"list_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"(_",
"insi",
"de",
"\\u",
"list",
"\\u",
"number_",
"!=_",
"-_",
"1_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"indent_",
"-=_",
"self_",
"._",
"indent",
"Increment",
"\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"End",
"Tag_",
"(_",
"tag_",
",_",
"indent_",
",_",
"False_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Dump",
" ",
"as",
" ",
"a",
" ",
"list",
" ",
"of",
" ",
"numbers",
" ",
"with",
" ",
"just",
" ",
"one",
" ",
"tag",
":",
" ",
"the",
" ",
"tag",
",",
" ",
"the",
" ",
"list",
" ",
"of",
" ",
"data",
",",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"then",
" ",
"the",
" ",
"end",
" ",
"tag",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"(_",
"insi",
"de",
"\\u",
"list",
"\\u",
"number_",
"==_",
"0_",
"and_",
"add",
"\\u",
"type_",
")_",
":_",
"attrs_",
"[_",
"\"",
"type\\u\\u",
"\"_",
"]_",
"=_",
"\"",
"list",
"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Start",
"Tag_",
"(_",
"tag_",
",_",
"attrs_",
",_",
"indent_",
",_",
"primi",
"tiv",
"e\\u",
"type_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"ii_",
"in_",
"xrange_",
"(_",
"0_",
",_",
"len_",
"(_",
"l_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"temp_",
"=_",
"pretty_",
"._",
"Numer",
"ic",
"String",
"\\u_",
"(_",
"byte",
"tag_",
",_",
"l_",
"[_",
"ii_",
"]_",
")_",
"#",
"repr",
"(",
"l",
"[",
"ii",
"])",
" ",
" ",
"#",
" ",
"so",
" ",
"print",
"s",
" ",
"with",
" ",
"full",
" ",
"preci",
"sion",
" ",
"of",
" ",
"Val",
" ",
"for",
" ",
"real",
"s",
",",
" ",
"etc",
".",
" _",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"temp_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"(_",
"ii_",
"<_",
"len_",
"(_",
"l_",
")_",
"-_",
"1_",
")_",
":_",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"\",\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"End_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"End",
"Tag_",
"(_",
"tag_",
",_",
"indent_",
",_",
"primi",
"tiv",
"e\\u",
"type_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"XML",
"Dump",
"Table_",
"(_",
"self_",
",_",
"dict",
"\\u",
"name_",
",_",
"t_",
",_",
"indent_",
",_",
"attr",
"s",
"\\u",
"ptr_",
",_",
"sort",
"keys_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"Ra",
"re",
" ",
"case",
":",
" ",
"whe",
"n",
" ",
"\\u\\u",
"content",
"\\u\\u",
" ",
"there",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"\"\\u\\u",
"content",
"\\u\\u\"_",
"in_",
"t_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"attrs_",
"=_",
"self_",
"._",
"\\u",
"Fin",
"d",
"Attributes_",
"(_",
"t_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Key",
"Value_",
"(_",
"dict",
"\\u",
"name_",
",_",
"t_",
"[_",
"\"\\u\\u",
"content",
"\\u\\u\"_",
"]_",
",_",
"indent_",
",_",
"attrs_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Get",
" ",
"attribute",
"s",
",",
" ",
"Al",
"way",
"s",
" ",
"dump",
" ",
"start",
" ",
"tag_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"attr",
"s",
"\\u",
"ptr_",
"==_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"attrs_",
"=_",
"self_",
"._",
"\\u",
"Fin",
"d",
"Attributes_",
"(_",
"t_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"attrs_",
"=_",
"attr",
"s",
"\\u",
"ptr_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Start",
"Tag_",
"(_",
"dict",
"\\u",
"name_",
",_",
"attrs_",
",_",
"indent_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Normal",
"ly",
",",
" ",
"just",
" ",
"iterate",
" ",
"over",
" ",
"all",
" ",
"keys",
" ",
"for",
" ",
"nest",
"ed",
" ",
"content_",
"\\u\\u\\uNL\\u\\u\\u_",
"keys_",
"=_",
"t_",
"._",
"keys_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"sort",
"keys_",
":_",
"keys_",
"._",
"sort_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"key_",
"in_",
"keys_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"value_",
"=_",
"t_",
"[_",
"key_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Ski",
"p",
" ",
"over",
" ",
"keys",
" ",
"tha",
"t",
" ",
"have",
" ",
"alr",
"ead",
"y",
" ",
"bee",
"n",
" ",
"put",
" ",
"in",
" ",
"attributes_",
"\\u\\u\\uNL\\u\\u\\u_",
"k_",
"=_",
"str_",
"(_",
"key_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"key_",
"in_",
"attrs_",
"or_",
"k_",
"==_",
"\"\\u\\u",
"attr",
"s",
"\\u\\u\"_",
"or_",
"(_",
"len_",
"(_",
"k_",
")_",
">_",
"0_",
"and_",
"k_",
"[_",
"0_",
"]_",
"==_",
"self_",
"._",
"prepend",
"Char",
"\\u_",
"and_",
"k_",
"[_",
"1_",
":_",
"]_",
"in_",
"attrs_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"continue_",
"#",
" ",
"Ski",
"p",
" ",
"in",
" ",
"attrs_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Key",
"Value_",
"(_",
"key_",
",_",
"value_",
",_",
"indent_",
"+_",
"self_",
"._",
"indent",
"Increment",
"\\u_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Al",
"way",
"s",
" ",
"dump",
" ",
"end",
" ",
"tag_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"End",
"Tag_",
"(_",
"dict",
"\\u",
"name_",
",_",
"indent_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"XML",
"Dump",
"Primitive",
"_",
"(_",
"self_",
",_",
"key_",
",_",
"value_",
",_",
"indent_",
",_",
"attr",
"s",
"\\u",
"ptr_",
",_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"attr",
"s",
"\\u",
"ptr_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"attrs_",
"=_",
"self_",
"._",
"EMP",
"TY",
"Attr",
"s\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"attrs_",
"=_",
"attr",
"s",
"\\u",
"ptr_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"(_",
"self_",
"._",
"\\u",
"Is",
"Composit",
"e_",
"(_",
"value_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Exception_",
"(_",
"\"",
"Tr",
"ying",
" ",
"to",
" ",
"dump",
" ",
"a",
" ",
"composi",
"te",
" ",
"type",
" ",
"as",
" ",
"a",
" ",
"primi",
"tiv",
"e",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"value_",
"is_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Start",
"Tag_",
"(_",
"key_",
",_",
"attrs_",
",_",
"indent_",
",_",
"True_",
",_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"Start",
"Tag_",
"(_",
"key_",
",_",
"attrs_",
",_",
"indent_",
",_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Force",
" ",
"all",
" ",
"string",
"s",
" ",
"int",
"o",
" ",
"quote",
"s",
",",
" ",
"mess",
"y",
" ",
"but",
" ",
"will",
" ",
"alw",
"ay",
"s",
" ",
"work_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"with",
" ",
"XML",
"\\u",
"LOAD",
"\\u",
"EVAL",
"\\u",
"CONTE",
"NT",
" ",
"on",
" ",
"the",
" ",
"way",
" ",
"back",
" ",
"if",
" ",
"you",
" ",
"have",
" ",
"to",
" ",
"convert_",
"\\u\\u\\uNL\\u\\u\\u_",
"if_",
"(_",
"self_",
"._",
"options",
"\\u_",
"&_",
"XML",
"\\u",
"DUMP",
"\\u",
"STRING",
"S",
"\\u",
"AS",
"\\u",
"STRING",
"S_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"(_",
"type_",
"(_",
"value_",
")_",
"==_",
"str_",
")_",
":_",
"#",
" ",
"make",
" ",
"sure",
" ",
"pick",
" ",
"up",
" ",
"quote",
"s",
" _",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"self_",
"._",
"\\u",
"XML",
"Conten",
"t",
"Filter_",
"(_",
"repr_",
"(_",
"value_",
")_",
",_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"self_",
"._",
"\\u",
"XML",
"Conten",
"t",
"Filter_",
"(_",
"value_",
",_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
")_",
")_",
"#",
" ",
"Let",
" ",
"str",
" ",
"pick",
" _",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Mos",
"t",
" ",
"of",
" ",
"the",
" ",
"time",
",",
" ",
"we",
" ",
"can",
" ",
"keep",
" ",
"all",
" ",
"string",
"s",
" ",
"as",
"-",
"is",
" ",
"(",
"and",
" ",
"avoid",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"tho",
"se",
" ",
"nas",
"ty",
" ",
"'&",
"apos",
";'",
" ",
"quote",
"s",
" ",
"in",
" ",
"XML",
" ",
"aro",
"und",
" ",
"them",
"):",
" ",
"tho",
"se_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"string",
"s",
" ",
"tha",
"t",
" ",
"will",
" ",
"bec",
"ome",
" ",
"somet",
"hing",
" ",
"\"",
"real",
" ",
"values",
"\"",
" ",
"whe",
"n",
" ",
"Eval",
"led",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"need",
" ",
"to",
" ",
"have",
" ",
"quote",
"s",
" ",
"so",
" ",
"the",
"y",
" ",
"will",
" ",
"come",
" ",
"back",
" ",
"as",
" ",
"strings_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"whe",
"n",
" ",
"usi",
"ng",
" ",
"XML",
"\\u",
"LOAD",
"\\u",
"EVAL",
"\\u",
"CONTE",
"NT",
".",
" ",
" ",
"For",
" ",
"example",
":",
" ",
"'",
"123",
"'",
" ",
"is",
" ",
"a",
" ",
"string_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"but",
" ",
"whe",
"n",
" ",
"eval",
"ed",
",",
" ",
"will",
" ",
"bec",
"ome",
" ",
"a",
" ",
"number",
";",
" ",
" ",
"We",
" ",
"dump",
" ",
"this",
" ",
"as",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"\"&",
"apos",
";",
"123",
"&",
"apos",
";",
"\"",
" ",
"to",
" ",
"preserve",
" ",
"the",
" ",
"number",
"ness",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"elif_",
"(_",
"self_",
"._",
"options",
"\\u_",
"&_",
"XML",
"\\u",
"DUMP",
"\\u",
"STRING",
"S",
"\\u",
"BES",
"T",
"\\u",
"GUE",
"SS_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"(_",
"type_",
"(_",
"value_",
")_",
"==_",
"str_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"s_",
"=_",
"str_",
"(_",
"value_",
")_",
"#",
" ",
"no",
" ",
"quote",
"s",
" ",
"on",
" ",
"string_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"(_",
"len_",
"(_",
"s_",
")_",
"==_",
"0_",
"or_",
"#",
" ",
"alw",
"ay",
"s",
" ",
"dump",
" ",
"empty",
" ",
"string",
"s",
" ",
"with",
" ",
"&",
"apos",
"!",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"(_",
"len_",
"(_",
"s_",
")_",
">_",
"0_",
")_",
"and_",
"\\u\\u\\uNL\\u\\u\\u_",
"(_",
"s_",
"[_",
"0_",
"]_",
"._",
"isdigit_",
"(_",
")_",
"or_",
"s_",
"[_",
"0_",
"]_",
"==_",
"'('_",
"or_",
"s_",
"[_",
"0_",
"]_",
"==_",
"'-'_",
"or_",
"s_",
"[_",
"0_",
"]_",
"==_",
"'+'_",
")_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"If",
" ",
"it",
" ",
"starts",
" ",
"with",
" ",
"a",
" ",
"number",
" ",
"or",
" ",
"a",
" ",
"sign",
" ",
"or",
" ",
"'(",
"'",
" ",
"(",
"for",
" ",
"(",
"1",
"+",
"2j",
"),",
" _",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"probab",
"ly",
" ",
"a",
" ",
"number",
" ",
"and",
" ",
"we",
" ",
"WAN",
"T",
" ",
"to",
" ",
"string",
"ize_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"self_",
"._",
"\\u",
"XML",
"Conten",
"t",
"Filter_",
"(_",
"repr_",
"(_",
"value_",
")_",
",_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
")_",
")_",
"#",
" ",
"puts",
" ",
"quote",
"s",
" ",
"on",
" ",
"str_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"self_",
"._",
"\\u",
"XML",
"Conten",
"t",
"Filter_",
"(_",
"value_",
",_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
")_",
")_",
"#",
" ",
"no",
" ",
"quote",
"s",
"!",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"self_",
"._",
"\\u",
"XML",
"Conten",
"t",
"Filter_",
"(_",
"value_",
",_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
")_",
")_",
"#",
" ",
"Let",
" ",
"str",
" ",
"pick",
" _",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Default",
",",
" ",
"just",
" ",
"plo",
"p",
" ",
"content",
":",
" ",
"still",
" ",
"be",
" ",
"care",
"ful",
" ",
"of",
" ",
"<",
"empty",
"><",
"/",
"empty",
">:",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Sho",
"ul",
"d",
" ",
"tha",
"t",
" ",
"be",
" ",
"a",
" ",
"{}",
",",
" ",
"Non",
"e",
",",
" ",
"[]",
",",
" ",
"or",
" ",
"\"\"",
"?",
" ",
" ",
"With",
" ",
"this",
" ",
"option",
",",
" ",
"make",
"s",
" ",
"it_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"empty",
" ",
"string",
" ",
"(",
"you",
" ",
"don",
"'",
"t",
" ",
"need",
" ",
"this",
" ",
"option",
" ",
"if",
" ",
"you",
" ",
"are",
" ",
"using_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"XML",
"\\u",
"DUMP",
"\\u",
"STRING",
"S",
"\\u",
"BES",
"T",
"\\u",
"GUE",
"SS",
" ",
"or",
" ",
"XML",
"\\u",
"DUMP",
"\\u",
"STRING",
"S",
"\\u",
"AS",
"\\u",
"STRING",
"S_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"(_",
"self_",
"._",
"options",
"\\u_",
"&_",
"XML",
"\\u",
"DUMP",
"\\u",
"PREFER",
"\\u",
"EMP",
"TY",
"\\u",
"STRING",
"S_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"type_",
"(_",
"value_",
")_",
"==_",
"str_",
"and_",
"len_",
"(_",
"value_",
")_",
"==_",
"0_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"value_",
"=_",
"\"''\"_",
"#",
" ",
"Make",
"s",
" ",
"<",
"empty",
"><",
"/",
"empty",
">",
" ",
"int",
"o",
" ",
"empty",
" ",
"string_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"os",
"\\u_",
"._",
"write_",
"(_",
"self_",
"._",
"\\u",
"XML",
"Conten",
"t",
"Filter_",
"(_",
"value_",
",_",
"was",
"\\u",
"array",
"\\u",
"typecode_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"self_",
"._",
"\\u",
"XML",
"Dump",
"End",
"Tag_",
"(_",
"key_",
",_",
"indent_",
",_",
"True_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"XML",
"Dumper",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u",
"handle",
"Problem_",
"(_",
"self_",
",_",
"text_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"if_",
"(_",
"self_",
"._",
"mode",
"\\u_",
"==_",
"XML",
"Dumper",
"_",
"._",
"SIL",
"ENT",
"\\u",
"ON",
"\\u",
"ERROR_",
")_",
":_",
"return_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"(_",
"self_",
"._",
"mode",
"\\u_",
"==_",
"XML",
"Dumper",
"_",
"._",
"THRO",
"W",
"\\u",
"ON",
"\\u",
"ERROR_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Exception_",
",_",
"text_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"sys_",
"._",
"stderr_",
"._",
"write_",
"(_",
"text_",
"+_",
"\"\\\\",
"n",
"\"_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"Write",
"To",
"XML",
"Stream_",
"(_",
"v_",
",_",
"ofs_",
",_",
"top",
"\\u",
"level",
"\\u",
"key_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"options_",
"=_",
"XML",
"\\u",
"DUMP",
"\\u",
"PRE",
"TTY",
"_",
"|_",
"XML",
"\\u",
"STRI",
"CT",
"\\u",
"HDR",
"_",
"|_",
"XML",
"\\u",
"DUMP",
"\\u",
"STRING",
"S",
"\\u",
"BES",
"T",
"\\u",
"GUE",
"SS_",
",_",
"#",
" ",
"best",
" ",
"options",
" ",
"for",
" ",
"invert",
"ibl",
"e",
" ",
"transforms_",
"\\u\\u\\uNL\\u\\u\\u_",
"arr",
"\\u",
"disp_",
"=_",
"ARR",
"AY",
"DISP",
"OSI",
"TIO",
"N",
"\\u",
"AS",
"\\u",
"NUMERIC",
"\\u",
"WRAP",
"PER",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"prepend",
"\\u",
"char_",
"=_",
"XML",
"\\u",
"PREP",
"END",
"\\u",
"CHAR_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Write",
" ",
"a",
" ",
"Pyth",
"on",
" ",
"object",
" ",
"(",
"usual",
"ly",
" ",
"a",
" ",
"dict",
" ",
"or",
" ",
"list",
")",
" ",
" ",
"as",
" ",
"XML",
" ",
"to",
" ",
"a",
" ",
"stream",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"throw",
" ",
"a",
" ",
"runt",
"ime",
"-",
"error",
" ",
"if",
" ",
"anyt",
"hing",
" ",
"bad",
" ",
"go",
"es",
" ",
"down",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
"se",
" ",
"default",
" ",
"options",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"options",
"=",
"XML",
"\\u",
"DUMP",
"\\u",
"PRE",
"TTY",
" ",
"|",
" ",
"XML",
"\\u",
"STRI",
"CT",
"\\u",
"HDR",
" ",
"|",
" ",
"XML",
"\\u",
"DUMP",
"\\u",
"STRING",
"S",
"\\u",
"BES",
"T",
"\\u",
"GUE",
"SS",
" ",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"are",
" ",
"the",
" ",
"best",
" ",
"options",
" ",
"for",
" ",
"invert",
"ibl",
"e",
" ",
"transform",
"s",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Array",
" ",
"disposition",
":",
" ",
"AS",
"\\u",
"LIST",
" ",
"(",
"0",
")",
" ",
"mig",
"ht",
" ",
"be",
" ",
"bett",
"er",
" ",
"for",
" ",
"deal",
"ing",
" ",
"with",
" ",
"Pyth",
"on",
",",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"but",
" ",
"you",
" ",
"are",
" ",
"muc",
"h",
" ",
"less",
" ",
" ",
"like",
"ly",
" ",
"to",
" ",
"lose",
" ",
"informati",
"on",
" ",
"by",
" ",
"usi",
"ng",
" ",
"the",
" ",
"default",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"AS",
"\\u",
"NUMERIC",
"\\u",
"WRAP",
"PER",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"indent_",
"=_",
"2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"xd",
"_",
"=_",
"XML",
"Dumper",
"_",
"(_",
"ofs_",
",_",
"options_",
",_",
"arr",
"\\u",
"disp_",
",_",
"indent_",
",_",
"prepend",
"\\u",
"char_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"XML",
"Dumper",
"_",
"._",
"THRO",
"W",
"\\u",
"ON",
"\\u",
"ERROR_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"top",
"\\u",
"level",
"\\u",
"key_",
"==_",
"None_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"xd",
"_",
"._",
"XML",
"Dump",
"Value_",
"(_",
"v_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"xd",
"_",
"._",
"XML",
"Dump",
"Key",
"Value_",
"(_",
"top",
"\\u",
"level",
"\\u",
"key_",
",_",
"v_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"Write",
"To",
"XML",
"File_",
"(_",
"v_",
",_",
"filename_",
",_",
"top",
"\\u",
"level",
"\\u",
"key_",
"=_",
"None_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"options_",
"=_",
"XML",
"\\u",
"DUMP",
"\\u",
"PRE",
"TTY",
"_",
"|_",
"XML",
"\\u",
"STRI",
"CT",
"\\u",
"HDR",
"_",
"|_",
"XML",
"\\u",
"DUMP",
"\\u",
"STRING",
"S",
"\\u",
"BES",
"T",
"\\u",
"GUE",
"SS_",
",_",
"#",
" ",
"best",
" ",
"options",
" ",
"for",
" ",
"invert",
"ibl",
"e",
" ",
"transforms_",
"\\u\\u\\uNL\\u\\u\\u_",
"arr",
"\\u",
"disp_",
"=_",
"ARR",
"AY",
"DISP",
"OSI",
"TIO",
"N",
"\\u",
"AS",
"\\u",
"NUMERIC",
"\\u",
"WRAP",
"PER",
"_",
",_",
"\\u\\u\\uNL\\u\\u\\u_",
"prepend",
"\\u",
"char_",
"=_",
"XML",
"\\u",
"PREP",
"END",
"\\u",
"CHAR_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Write",
" ",
"a",
" ",
"Pyth",
"on",
" ",
"object",
" ",
"(",
"usual",
"ly",
" ",
"a",
" ",
"dict",
" ",
"or",
" ",
"list",
")",
" ",
" ",
"as",
" ",
"XML",
" ",
"to",
" ",
"a",
" ",
"file",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"throw",
" ",
"a",
" ",
"runt",
"ime",
"-",
"error",
" ",
"if",
" ",
"anyt",
"hing",
" ",
"bad",
" ",
"go",
"es",
" ",
"down",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"The",
"se",
" ",
"default",
" ",
"options",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"options",
"=",
"XML",
"\\u",
"DUMP",
"\\u",
"PRE",
"TTY",
" ",
"|",
" ",
"XML",
"\\u",
"STRI",
"CT",
"\\u",
"HDR",
" ",
"|",
" ",
"XML",
"\\u",
"DUMP",
"\\u",
"STRING",
"S",
"\\u",
"BES",
"T",
"\\u",
"GUE",
"SS",
" ",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"are",
" ",
"the",
" ",
"best",
" ",
"options",
" ",
"for",
" ",
"invert",
"ibl",
"e",
" ",
"transform",
"s",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Array",
" ",
"disposition",
":",
" ",
"AS",
"\\u",
"LIST",
" ",
"(",
"0",
")",
" ",
"mig",
"ht",
" ",
"be",
" ",
"bett",
"er",
" ",
"for",
" ",
"deal",
"ing",
" ",
"with",
" ",
"Pyth",
"on",
",",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"but",
" ",
"you",
" ",
"are",
" ",
"muc",
"h",
" ",
"less",
" ",
" ",
"like",
"ly",
" ",
"to",
" ",
"lose",
" ",
"informati",
"on",
" ",
"by",
" ",
"usi",
"ng",
" ",
"the",
" ",
"default",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"AS",
"\\u",
"NUMERIC",
"\\u",
"WRAP",
"PER",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"ofs_",
"=_",
"open_",
"(_",
"filename_",
",_",
"'",
"w",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Write",
"To",
"XML",
"Stream_",
"(_",
"v_",
",_",
"ofs_",
",_",
"top",
"\\u",
"level",
"\\u",
"key_",
",_",
"options_",
",_",
"arr",
"\\u",
"disp_",
",_",
"prepend",
"\\u",
"char_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Exception_",
",_",
"e_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"Exception_",
",_",
"e_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"Convert",
"To",
"XML_",
"(_",
"give",
"n",
"\\u",
"dict_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"Convert",
" ",
"the",
" ",
"give",
"n",
" ",
"Pyth",
"on",
" ",
"dictionar",
"y",
" ",
"to",
" ",
"XML",
" ",
"and",
" ",
"return",
" ",
"the",
" ",
"XML",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"(",
"a",
" ",
"text",
" ",
"string",
").",
" ",
" ",
"Thi",
"s",
" ",
"use",
"s",
" ",
"the",
" ",
"most",
" ",
"common",
" ",
"options",
" ",
"tha",
"t",
" ",
"tend",
" ",
"to",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"make",
" ",
"the",
" ",
"conversions",
" ",
"full",
"y",
" ",
"invert",
"ibl",
"e",
".\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"stream",
"\\u",
"thing_",
"=_",
"c",
"String",
"IO_",
"._",
"String",
"IO_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"Write",
"To",
"XML",
"Stream_",
"(_",
"give",
"n",
"\\u",
"dict_",
",_",
"stream",
"\\u",
"thing_",
",_",
"'",
"top",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"stream",
"\\u",
"thing_",
"._",
"getvalue_",
"(_",
")_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Except block handles 'BaseException' | saltstack/salt/tests/unit/modules/boto_secgroup_test.py | [
{
"content": "# -*- coding: utf-8 -*-\n\n# import Python Libs\nfrom __future__ import absolute_import\nimport random\nimport string\nfrom copy import deepcopy\nfrom distutils.version import LooseVersion # pylint: disable=import-error,no-name-in-module\n\n# Import Salt Testing Libs\nfrom salttesting.unit import skipIf, TestCase\nfrom salttesting.mock import NO_MOCK, NO_MOCK_REASON\nfrom salttesting.helpers import ensure_in_syspath\n\nensure_in_syspath('../../')\n\n# Import Salt libs\nimport salt.config\nimport salt.loader\n\n# Import Third Party Libs\n# pylint: disable=import-error\nfrom salt.ext.six.moves import range # pylint: disable=redefined-builtin\ntry:\n import boto\n HAS_BOTO = True\nexcept ImportError:\n HAS_BOTO = False\n\ntry:\n from moto import mock_ec2\n HAS_MOTO = True\nexcept ImportError:\n HAS_MOTO = False\n\n# pylint: enable=import-error\n\n# Import Salt Libs\nfrom salt.utils.odict import OrderedDict\nfrom salt.modules import boto_secgroup\n\n\nrequired_boto_version = '2.4.0'\nvpc_id = 'vpc-mjm05d27'\nregion = 'us-east-1'\naccess_key = 'GKTADJGHEIQSXMKKRBJ08H'\nsecret_key = 'askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs'\nconn_parameters = {'region': region, 'key': access_key, 'keyid': secret_key, 'profile': {}}\nboto_conn_parameters = {'aws_access_key_id': access_key, 'aws_secret_access_key': secret_key}\n\nopts = salt.config.DEFAULT_MASTER_OPTS\nutils = salt.loader.utils(opts, whitelist=['boto'])\nfuncs = salt.loader.minion_mods(opts, utils=utils)\nboto_secgroup.__salt__ = funcs\nboto_secgroup.__utils__ = utils\nboto_secgroup.__virtual__()\n\n\n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n from integration import run_tests # pylint: disable=import-error\n run_tests(BotoSecgroupTestCase, needs_daemon=False)\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Except",
"_",
"block_",
"handles_",
"'",
"Base",
"Except",
"ion",
"'_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"#",
" ",
"-*-",
" ",
"codi",
"ng",
":",
" ",
"utf",
"-",
"8",
" ",
"-*-",
"_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"import",
" ",
"Pyth",
"on",
" ",
"Lib",
"s_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"\\u\\u",
"future\\u\\u_",
"import_",
"abs",
"olute",
"\\u",
"import_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"random_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"string_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"copy_",
"import_",
"deepcopy_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"distutils_",
"._",
"version_",
"import_",
"Lo",
"ose",
"Version_",
"#",
" ",
"pylint",
":",
" ",
"disable",
"=",
"import",
"-",
"error",
",",
"no",
"-",
"name",
"-",
"in",
"-",
"module_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Import",
" ",
"Sal",
"t",
" ",
"Test",
"ing",
" ",
"Lib",
"s_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"salt",
"testing_",
"._",
"unit_",
"import_",
"skip",
"If_",
",_",
"Test",
"Case_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"salt",
"testing_",
"._",
"mock_",
"import_",
"NO",
"\\u",
"MOC",
"K_",
",_",
"NO",
"\\u",
"MOC",
"K",
"\\u",
"REASON",
"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"salt",
"testing_",
"._",
"helpers_",
"import_",
"ensure",
"\\u",
"in",
"\\u",
"sysp",
"ath_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"ensure",
"\\u",
"in",
"\\u",
"sysp",
"ath_",
"(_",
"'../../",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Import",
" ",
"Sal",
"t",
" ",
"libs_",
"\\u\\u\\uNL\\u\\u\\u_",
"import_",
"salt_",
"._",
"config_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"import_",
"salt_",
"._",
"loader_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Import",
" ",
"Thi",
"rd",
" ",
"Part",
"y",
" ",
"Lib",
"s_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"pylint",
":",
" ",
"disable",
"=",
"import",
"-",
"error_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"salt_",
"._",
"ext_",
"._",
"six_",
"._",
"moves_",
"import_",
"range_",
"#",
" ",
"pylint",
":",
" ",
"disable",
"=",
"rede",
"fined",
"-",
"builtin_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"import_",
"boto_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"HAS",
"\\u",
"BOT",
"O_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Import",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"HAS",
"\\u",
"BOT",
"O_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"try_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"moto",
"_",
"import_",
"mock",
"\\u",
"ec2_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"HAS",
"\\u",
"MOT",
"O_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"except_",
"Import",
"Error_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"HAS",
"\\u",
"MOT",
"O_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"pylint",
":",
" ",
"enable",
"=",
"import",
"-",
"error_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"#",
" ",
"Import",
" ",
"Sal",
"t",
" ",
"Lib",
"s_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"from_",
"salt_",
"._",
"utils_",
"._",
"odict_",
"import_",
"Order",
"ed",
"Dict_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"from_",
"salt_",
"._",
"modules_",
"import_",
"boto",
"\\u",
"secgr",
"oup_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"require",
"d\\u",
"boto",
"\\u",
"version_",
"=_",
"'",
"2.4",
".0",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"vpc",
"\\u",
"id_",
"=_",
"'",
"vpc",
"-",
"mj",
"m",
"05",
"d2",
"7",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"region_",
"=_",
"'",
"us",
"-",
"east",
"-1",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"access",
"\\u",
"key_",
"=_",
"'",
"GK",
"TA",
"DJ",
"GH",
"EI",
"QS",
"XM",
"KK",
"RB",
"J",
"0",
"8",
"H",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"secret",
"\\u",
"key_",
"=_",
"'",
"ask",
"dj",
"gh",
"sdf",
"jk",
"gh",
"Wu",
"p",
"Uj",
"asd",
"fl",
"kdf",
"kl",
"gj",
"sdf",
"ja",
"jk",
"gh",
"s",
"'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"conn",
"\\u",
"parameters_",
"=_",
"{_",
"'",
"region",
"'_",
":_",
"region_",
",_",
"'",
"key",
"'_",
":_",
"access",
"\\u",
"key_",
",_",
"'",
"keyid",
"'_",
":_",
"secret",
"\\u",
"key_",
",_",
"'",
"profile",
"'_",
":_",
"{_",
"}_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"boto",
"\\u",
"conn",
"\\u",
"parameters_",
"=_",
"{_",
"'",
"aws",
"\\u",
"access",
"\\u",
"key",
"\\u",
"id",
"'_",
":_",
"access",
"\\u",
"key_",
",_",
"'",
"aws",
"\\u",
"secret",
"\\u",
"access",
"\\u",
"key",
"'_",
":_",
"secret",
"\\u",
"key_",
"}_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"opts_",
"=_",
"salt_",
"._",
"config_",
"._",
"DEF",
"AUL",
"T",
"\\u",
"MASTER",
"\\u",
"OPTS_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"utils_",
"=_",
"salt_",
"._",
"loader_",
"._",
"utils_",
"(_",
"opts_",
",_",
"whitelist_",
"=_",
"[_",
"'",
"boto",
"'_",
"]_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"funcs_",
"=_",
"salt_",
"._",
"loader_",
"._",
"minion",
"\\u",
"mods_",
"(_",
"opts_",
",_",
"utils_",
"=_",
"utils_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"boto",
"\\u",
"secgr",
"oup_",
"._",
"\\u\\u",
"salt\\u\\u_",
"=_",
"funcs_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"boto",
"\\u",
"secgr",
"oup_",
"._",
"\\u\\u",
"util",
"s\\u\\u_",
"=_",
"utils_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"boto",
"\\u",
"secgr",
"oup_",
"._",
"\\u\\u",
"virtual",
"\\u\\u_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"if_",
"\\u\\u",
"name\\u\\u_",
"==_",
"'\\u",
"\\u",
"main",
"\\u\\u'_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"from_",
"integration_",
"import_",
"run",
"\\u",
"tests_",
"#",
" ",
"pylint",
":",
" ",
"disable",
"=",
"import",
"-",
"error_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"run",
"\\u",
"tests_",
"(_",
"Bot",
"o",
"Sec",
"group",
"Test",
"Case_",
",_",
"need",
"s",
"\\u",
"daemon_",
"=_",
"False_",
")_",
"\\u\\u\\uDEDENT\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,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2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
] |
Unused import | francelabs/datafari/windows/python/Lib/idlelib/idle_test/mock_idle.py | [
{
"content": "'''Mock classes that imitate idlelib modules or classes.\n\nAttributes and methods will be added as needed for tests.\n'''\n\nfrom idlelib.idle_test.mock_tk import Text\n\n\n\n\n\n",
"metadata": "root",
"header": "['module', '___EOS___']",
"index": 0
},
{
"content": "class Func(object):\n '''Mock function captures args and returns result set by test.\n\n Attributes:\n self.called - records call even if no args, kwds passed.\n self.result - set by init, returned by call.\n self.args - captures positional arguments.\n self.kwds - captures keyword arguments.\n\n Most common use will probably be to mock methods.\n Mock_tk.Var and Mbox_func are special variants of this.\n '''",
"metadata": "root.Func",
"header": "['module', '___EOS___']",
"index": 7
},
{
"content": " def __init__(self, result=None):\n self.called = False\n self.result = result\n self.args = None\n self.kwds = None",
"metadata": "root.Func.__init__",
"header": "['class', 'Func', '(', 'object', ')', ':', '___EOS___']",
"index": 19
},
{
"content": " def __call__(self, *args, **kwds):\n self.called = True\n self.args = args\n self.kwds = kwds\n if isinstance(self.result, BaseException):\n raise self.result\n else:\n return self.result",
"metadata": "root.Func.__call__",
"header": "['class', 'Func', '(', 'object', ')', ':', '___EOS___']",
"index": 24
},
{
"content": "class Editor(object):\n '''Minimally imitate EditorWindow.EditorWindow class.\n '''\n",
"metadata": "root.Editor",
"header": "['module', '___EOS___']",
"index": 34
},
{
"content": " def __init__(self, flist=None, filename=None, key=None, root=None):\n self.text = Text()\n self.undo = UndoDelegator()",
"metadata": "root.Editor.__init__",
"header": "['class', 'Editor', '(', 'object', ')', ':', '___EOS___']",
"index": 37
},
{
"content": " def get_selection_indices(self):\n first = self.text.index('1.0')\n last = self.text.index('end')\n return first, last",
"metadata": "root.Editor.get_selection_indices",
"header": "['class', 'Editor', '(', 'object', ')', ':', '___EOS___']",
"index": 41
},
{
"content": "class UndoDelegator(object):\n '''Minimally imitate UndoDelegator,UndoDelegator class.\n '''\n # A real undo block is only needed for user interaction.",
"metadata": "root.UndoDelegator",
"header": "['module', '___EOS___']",
"index": 47
},
{
"content": " def undo_block_start(*args):\n pass",
"metadata": "root.UndoDelegator.undo_block_start",
"header": "['class', 'UndoDelegator', '(', 'object', ')', ':', '___EOS___']",
"index": 51
},
{
"content": " def undo_block_stop(*args):\n pass",
"metadata": "root.UndoDelegator.undo_block_stop",
"header": "['class', 'UndoDelegator', '(', 'object', ')', ':', '___EOS___']",
"index": 53
}
] | [] | [] | 0 | false | [
"[CLS]_",
"Un",
"used_",
"import_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"'''",
"Moc",
"k",
" ",
"classe",
"s",
" ",
"tha",
"t",
" ",
"imit",
"ate",
" ",
"idle",
"lib",
" ",
"module",
"s",
" ",
"or",
" ",
"classe",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
"Attribute",
"s",
" ",
"and",
" ",
"method",
"s",
" ",
"will",
" ",
"be",
" ",
"adde",
"d",
" ",
"as",
" ",
"need",
"ed",
" ",
"for",
" ",
"tests",
".",
"\\",
"10",
";'",
"''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"from_",
"idle",
"lib_",
"._",
"idle",
"\\u",
"test_",
"._",
"mock",
"\\u",
"tk_",
"import_",
"Text_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"class_",
"Func_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"Moc",
"k",
" ",
"function",
" ",
"captures",
" ",
"args",
" ",
"and",
" ",
"return",
"s",
" ",
"result",
" ",
"set",
" ",
"by",
" ",
"test",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Attribute",
"s",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"self",
".",
"call",
"ed",
" ",
"-",
" ",
"record",
"s",
" ",
"call",
" ",
"even",
" ",
"if",
" ",
"no",
" ",
"args",
",",
" ",
"kwd",
"s",
" ",
"pass",
"ed",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"self",
".",
"result",
" ",
"-",
" ",
"set",
" ",
"by",
" ",
"init",
",",
" ",
"return",
"ed",
" ",
"by",
" ",
"call",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"self",
".",
"args",
" ",
"-",
" ",
"captures",
" ",
"positional",
" ",
"argu",
"ment",
"s",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"self",
".",
"kwd",
"s",
" ",
"-",
" ",
"captures",
" ",
"keyw",
"ord",
" ",
"argu",
"ment",
"s",
".",
"\\",
"10",
";",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Mos",
"t",
" ",
"common",
" ",
"use",
" ",
"will",
" ",
"probab",
"ly",
" ",
"be",
" ",
"to",
" ",
"mock",
" ",
"method",
"s",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Moc",
"k",
"\\u",
"tk",
".",
"Var",
" ",
"and",
" ",
"Mb",
"ox",
"\\u",
"func",
" ",
"are",
" ",
"special",
" ",
"variant",
"s",
" ",
"of",
" ",
"this",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Func_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"result_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"called_",
"=_",
"False_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"result_",
"=_",
"result_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"args_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"kwds_",
"=_",
"None_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Func_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"\\u\\u",
"call\\u\\u_",
"(_",
"self_",
",_",
"*_",
"args_",
",_",
"**_",
"kwds_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"called_",
"=_",
"True_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"args_",
"=_",
"args_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"kwds_",
"=_",
"kwds_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"if_",
"isinstance_",
"(_",
"self_",
"._",
"result_",
",_",
"Base",
"Exception_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"raise_",
"self_",
"._",
"result_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"else_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"return_",
"self_",
"._",
"result_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Editor_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"Mini",
"mall",
"y",
" ",
"imit",
"ate",
" ",
"Edit",
"or",
"Window",
".",
"Edit",
"or",
"Window",
" ",
"class",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Editor_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"def_",
"\\u\\u",
"init\\u\\u_",
"(_",
"self_",
",_",
"flist_",
"=_",
"None_",
",_",
"filename_",
"=_",
"None_",
",_",
"key_",
"=_",
"None_",
",_",
"root_",
"=_",
"None_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"self_",
"._",
"text_",
"=_",
"Text_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"self_",
"._",
"undo_",
"=_",
"Und",
"o",
"Del",
"egat",
"or_",
"(_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Editor_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"get",
"\\u",
"selection",
"\\u",
"indices_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"first_",
"=_",
"self_",
"._",
"text_",
"._",
"index_",
"(_",
"'",
"1.0",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"last_",
"=_",
"self_",
"._",
"text_",
"._",
"index_",
"(_",
"'",
"end",
"'_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"return_",
"first_",
",_",
"last_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"module_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"class_",
"Und",
"o",
"Del",
"egat",
"or_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"'''",
"Mini",
"mall",
"y",
" ",
"imit",
"ate",
" ",
"Und",
"o",
"Del",
"egat",
"or",
",",
"Und",
"o",
"Del",
"egat",
"or",
" ",
"class",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"'''_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"#",
" ",
"A",
" ",
"real",
" ",
"undo",
" ",
"block",
" ",
"is",
" ",
"only",
" ",
"need",
"ed",
" ",
"for",
" ",
"user",
" ",
"interacti",
"on",
"._",
"\\u\\u\\uNL\\u\\u\\u_",
"[SEP]_",
"class_",
"Und",
"o",
"Del",
"egat",
"or_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"def_",
"undo",
"\\u",
"block",
"\\u",
"start_",
"(_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"[SEP]_",
"class_",
"Und",
"o",
"Del",
"egat",
"or_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"undo",
"\\u",
"block",
"\\u",
"stop_",
"(_",
"*_",
"args_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"pass_"
] | [
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2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2,
2,
2,
2,
2
] |
Unused local variable | erickrf/nlpnet/nlpnet/taggers.py | [
{
"content": " def to_conll(self):\n \"\"\"\n Return a string representation of the sentence in CoNLL X format. \n \n Each line has:\n [number starting from 1] token _ POS POS _ head label\n \n Token numbers start from 1, root is referred as 0.\n POS is only available if the original parser used it.\n \"\"\"\n result = []\n for i in range(len(self.tokens)):\n token = self.tokens[i]\n head = self.heads[i] + 1\n label = self.labels[i]\n pos = self.pos[i] if self.pos else '_'\n \n line = u'{id}\\t{token}\\t_\\t{pos}\\t{pos}\\t_\\t{head}\\t{label}'\n result.append(line.format(id=i+1, pos=pos, head=head, label=label, token=token))\n \n return '\\n'.join(result)",
"metadata": "root.ParsedSentence.to_conll",
"header": "['class', 'ParsedSentence', '(', 'object', ')', ':', '___EOS___']",
"index": 155
}
] | [] | [] | 0 | true | [
"[CLS]_",
"Un",
"used_",
"local_",
"variable_",
"[SEP]_",
"class_",
"Pars",
"ed",
"Sentence",
"_",
"(_",
"object_",
")_",
":_",
"\\u\\u\\uEOS\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"def_",
"to",
"\\u",
"conl",
"l_",
"(_",
"self_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"\"\"\"",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Return",
" ",
"a",
" ",
"string",
" ",
"represent",
"ation",
" ",
"of",
" ",
"the",
" ",
"sentence",
" ",
"in",
" ",
"Co",
"NL",
"L",
" ",
"X",
" ",
"format",
".",
" ",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Ea",
"ch",
" ",
"line",
" ",
"has",
":",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"[",
"number",
" ",
"startin",
"g",
" ",
"from",
" ",
"1",
"]",
" ",
"token",
" ",
"\\u",
" ",
"POS",
" ",
"POS",
" ",
"\\u",
" ",
"head",
" ",
"label",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"Token",
" ",
"numbers",
" ",
"start",
" ",
"from",
" ",
"1",
",",
" ",
"root",
" ",
"is",
" ",
"referred",
" ",
"as",
" ",
"0.",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"POS",
" ",
"is",
" ",
"only",
" ",
"avail",
"able",
" ",
"if",
" ",
"the",
" ",
"original",
" ",
"parser",
" ",
"used",
" ",
"it",
".",
"\\",
"10",
";",
" ",
" ",
" ",
" ",
"\"\"\"_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"result_",
"=_",
"[_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"for_",
"i_",
"in_",
"range_",
"(_",
"len_",
"(_",
"self_",
"._",
"tokens_",
")_",
")_",
":_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uINDENT\\u\\u\\u ",
" _",
"token_",
"=_",
"self_",
"._",
"tokens_",
"[_",
"i_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"head_",
"=_",
"self_",
"._",
"heads_",
"[_",
"i_",
"]_",
"+_",
"1_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"label_",
"=_",
"self_",
"._",
"labels_",
"[_",
"i_",
"]_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"pos_",
"=_",
"self_",
"._",
"pos_",
"[_",
"i_",
"]_",
"if_",
"self_",
"._",
"pos_",
"else_",
"'\\u'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"line_",
"=_",
"u",
"'{",
"id",
"}\\\\",
"t",
"{",
"token",
"}\\\\",
"t",
"\\u\\\\",
"t",
"{",
"pos",
"}\\\\",
"t",
"{",
"pos",
"}\\\\",
"t",
"\\u\\\\",
"t",
"{",
"head",
"}\\\\",
"t",
"{",
"label",
"}'_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"result_",
"._",
"append_",
"(_",
"line_",
"._",
"format_",
"(_",
"id_",
"=_",
"i_",
"+_",
"1_",
",_",
"pos_",
"=_",
"pos_",
",_",
"head_",
"=_",
"head_",
",_",
"label_",
"=_",
"label_",
",_",
"token_",
"=_",
"token_",
")_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_",
"\\u\\u\\uNL\\u\\u\\u_",
"\\u\\u\\uDEDENT\\u\\u\\u_",
"return_",
"'\\\\",
"n",
"'_",
"._",
"join_",
"(_",
"result_",
")_",
"\\u\\u\\uNEWLINE\\u\\u\\u_"
] | [
4,
4,
4,
4,
4,
4,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,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