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
list
label_sequence
list
Imprecise assert
duerrp/pyexperiment/tests/test_config.py
[ { "content": " def test_in(self):\n \"\"\"Test the `in` function works for config\n \"\"\"\n conf.initialize()\n conf['section_1.a'] = 12\n self.assertTrue('section_1.a' in conf)\n self.assertFalse('section_1.f' in conf)", "metadata": "root.TestConf.test_in", "header": "['class', 'TestConf', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 52 }, { "content": " def test_in_uninitialized(self):\n \"\"\"Test the `in` function works for config\n \"\"\"\n conf['section_1.a'] = 12\n self.assertTrue('section_1.a' in conf)\n self.assertFalse('section_1.f' in conf)", "metadata": "root.TestConf.test_in_uninitialized", "header": "['class', 'TestConf', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 60 }, { "content": " def test_set_value(self):\n \"\"\"Test setting config values\n \"\"\"\n conf.load(self.filename)\n self.assertFalse('a' in conf)\n conf['a'] = 2\n self.assertTrue('a' in conf)\n self.assertEqual(conf['a'], 2)", "metadata": "root.TestConfFile.test_set_value", "header": "['class', 'TestConfFile', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 194 }, { "content": " def test_set_value_section(self):\n \"\"\"Test setting config values in new section\n \"\"\"\n conf.load(self.filename)\n self.assertFalse('a.b' in conf)\n conf['a.b'] = 2\n self.assertTrue('a.b' in conf)\n self.assertEqual(conf['a.b'], 2)", "metadata": "root.TestConfFile.test_set_value_section", "header": "['class', 'TestConfFile', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 203 }, { "content": " def test_get_or_set(self):\n \"\"\"Test get_or_setting config values\n \"\"\"\n conf.load(self.filename)\n self.assertRaises(KeyError, lambda: conf['a'])\n self.assertRaises(KeyError, conf.get, 'a')\n self.assertFalse('a' in conf)\n self.assertEqual(conf.get_or_set('a', 12), 12)\n self.assertEqual(conf.get('a'), 12)\n self.assertTrue('a' in conf)", "metadata": "root.TestConfFile.test_get_or_set", "header": "['class', 'TestConfFile', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 212 }, { "content": " def test_override_with_args(self):\n \"\"\"Test adding config options from dictionary\n \"\"\"\n conf.load(self.filename)\n self.assertTrue('section_1.a' in conf)\n self.assertEqual(conf['section_1.a'], '12')\n conf.override_with_args([('section_1.a', '13')])\n self.assertEqual(conf['section_1.a'], '13')", "metadata": "root.TestConfFile.test_override_with_args", "header": "['class', 'TestConfFile', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 230 }, { "content": " def test_load_with_spec(self):\n \"\"\"Test loading a configuration with a specification\n \"\"\"\n spec = (\"[section_1]\\n\"\n \"a = integer(min=0, default=5)\")\n conf.load(self.filename,\n spec=(\n [option.encode() for option in spec.split('\\n')]))\n self.assertTrue('section_1.a' in conf)\n self.assertIsInstance(conf['section_1.a'], int)\n self.assertEqual(conf['section_1.a'], 12)", "metadata": "root.TestConfSpec.test_load_with_spec", "header": "['class', 'TestConfSpec', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 311 }, { "content": " def test_load_with_nested_spec(self):\n \"\"\"Test loading a configuration with a nested specification\n \"\"\"\n spec = (\"[section_1]\\n\"\n \"[[section_a]]\\n\"\n \"a = integer(min=0, default=5)\")\n conf.load(self.filename,\n spec=(\n [option.encode() for option in spec.split('\\n')]))\n self.assertTrue('section_1.section_a.a' in conf)\n self.assertIsInstance(conf['section_1.section_a.a'], int)\n self.assertEqual(conf['section_1.section_a.a'], 5)\n\n self.assertTrue('section_1.a' in conf)\n self.assertIsInstance(conf['section_1.a'], str)\n self.assertEqual(conf['section_1.a'], '12')", "metadata": "root.TestConfSpec.test_load_with_nested_spec", "header": "['class', 'TestConfSpec', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 323 } ]
[ { "span": "self.assertTrue('section_1.a' in conf)", "start_line": 57, "start_column": 8, "end_line": 57, "end_column": 46 }, { "span": "self.assertFalse('section_1.f' in conf)", "start_line": 58, "start_column": 8, "end_line": 58, "end_column": 47 }, { "span": "self.assertTrue('section_1.a' in conf)", "start_line": 64, "start_column": 8, "end_line": 64, "end_column": 46 }, { "span": "self.assertFalse('section_1.f' in conf)", "start_line": 65, "start_column": 8, "end_line": 65, "end_column": 47 }, { "span": "self.assertFalse('a' in conf)", "start_line": 198, "start_column": 8, "end_line": 198, "end_column": 37 }, { "span": "self.assertTrue('a' in conf)", "start_line": 200, "start_column": 8, "end_line": 200, "end_column": 36 }, { "span": "self.assertFalse('a.b' in conf)", "start_line": 207, "start_column": 8, "end_line": 207, "end_column": 39 }, { "span": "self.assertTrue('a.b' in conf)", "start_line": 209, "start_column": 8, "end_line": 209, "end_column": 38 }, { "span": "self.assertFalse('a' in conf)", "start_line": 218, "start_column": 8, "end_line": 218, "end_column": 37 }, { "span": "self.assertTrue('a' in conf)", "start_line": 221, "start_column": 8, "end_line": 221, "end_column": 36 }, { "span": "self.assertTrue('section_1.a' in conf)", "start_line": 234, "start_column": 8, "end_line": 234, "end_column": 46 }, { "span": "self.assertTrue('section_1.a' in conf)", "start_line": 319, "start_column": 8, "end_line": 319, "end_column": 46 }, { "span": "self.assertTrue('section_1.section_a.a' in conf)", "start_line": 332, "start_column": 8, "end_line": 332, "end_column": 56 }, { "span": "self.assertTrue('section_1.a' in conf)", "start_line": 336, "start_column": 8, "end_line": 336, "end_column": 46 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Conf_", "(_", "unittest_", "._", "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", "in_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "the", " ", "`", "in", "`", " ", "function", " ", "works", " ", "for", " ", "config", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "initialize_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "[_", "'", "section", "\\u", "1", ".", "a", "'_", "]_", "=_", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "section", "\\u", "1", ".", "a", "'_", "in_", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "section", "\\u", "1", ".", "f", "'_", "in_", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Conf_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "in", "\\u", "unin", "itialized", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "the", " ", "`", "in", "`", " ", "function", " ", "works", " ", "for", " ", "config", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "[_", "'", "section", "\\u", "1", ".", "a", "'_", "]_", "=_", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "section", "\\u", "1", ".", "a", "'_", "in_", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "section", "\\u", "1", ".", "f", "'_", "in_", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Conf", "File_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "set\\u", "value_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "setti", "ng", " ", "config", " ", "values", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "load_", "(_", "self_", "._", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "a", "'_", "in_", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "[_", "'", "a", "'_", "]_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "a", "'_", "in_", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "conf_", "[_", "'", "a", "'_", "]_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Conf", "File_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "set\\u", "value", "\\u", "section_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "setti", "ng", " ", "config", " ", "values", " ", "in", " ", "new", " ", "section", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "load_", "(_", "self_", "._", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "a", ".", "b", "'_", "in_", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "[_", "'", "a", ".", "b", "'_", "]_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "a", ".", "b", "'_", "in_", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "conf_", "[_", "'", "a", ".", "b", "'_", "]_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Conf", "File_", "(_", "unittest_", "._", "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", "or", "\\u", "set_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "get", "\\u", "or", "\\u", "setti", "ng", " ", "config", " ", "values", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "load_", "(_", "self_", "._", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Key", "Error_", ",_", "lambda_", ":_", "conf_", "[_", "'", "a", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Key", "Error_", ",_", "conf_", "._", "get_", ",_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "a", "'_", "in_", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "conf_", "._", "get", "\\u", "or", "\\u", "set_", "(_", "'", "a", "'_", ",_", "12_", ")_", ",_", "12_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "conf_", "._", "get_", "(_", "'", "a", "'_", ")_", ",_", "12_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "a", "'_", "in_", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Conf", "File_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "override", "\\u", "with", "\\u", "args_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "addin", "g", " ", "config", " ", "options", " ", "from", " ", "dictionar", "y", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "load_", "(_", "self_", "._", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "section", "\\u", "1", ".", "a", "'_", "in_", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "conf_", "[_", "'", "section", "\\u", "1", ".", "a", "'_", "]_", ",_", "'", "1", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "override", "\\u", "with", "\\u", "args_", "(_", "[_", "(_", "'", "section", "\\u", "1", ".", "a", "'_", ",_", "'", "13", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "conf_", "[_", "'", "section", "\\u", "1", ".", "a", "'_", "]_", ",_", "'", "13", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Conf", "Spec_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "\\u", "with", "\\u", "spec_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "load", "ing", " ", "a", " ", "configura", "tion", " ", "with", " ", "a", " ", "specifica", "tion", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spec_", "=_", "(_", "\"[", "section", "\\u", "1", "]\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "a", " ", "=", " ", "integ", "er", "(", "min", "=", "0", ",", " ", "default", "=", "5", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "load_", "(_", "self_", "._", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "option_", "._", "encode_", "(_", ")_", "for_", "option_", "in_", "spec_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "section", "\\u", "1", ".", "a", "'_", "in_", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "conf_", "[_", "'", "section", "\\u", "1", ".", "a", "'_", "]_", ",_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "conf_", "[_", "'", "section", "\\u", "1", ".", "a", "'_", "]_", ",_", "12_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Conf", "Spec_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "\\u", "with", "\\u", "nest", "ed", "\\u", "spec_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "load", "ing", " ", "a", " ", "configura", "tion", " ", "with", " ", "a", " ", "nest", "ed", " ", "specifica", "tion", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spec_", "=_", "(_", "\"[", "section", "\\u", "1", "]\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"[", "[", "section", "\\u", "a", "]]", "\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "a", " ", "=", " ", "integ", "er", "(", "min", "=", "0", ",", " ", "default", "=", "5", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "load_", "(_", "self_", "._", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "spec_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "option_", "._", "encode_", "(_", ")_", "for_", "option_", "in_", "spec_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "section", "\\u", "1", ".", "section", "\\u", "a", ".", "a", "'_", "in_", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "conf_", "[_", "'", "section", "\\u", "1", ".", "section", "\\u", "a", ".", "a", "'_", "]_", ",_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "conf_", "[_", "'", "section", "\\u", "1", ".", "section", "\\u", "a", ".", "a", "'_", "]_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "section", "\\u", "1", ".", "a", "'_", "in_", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "conf_", "[_", "'", "section", "\\u", "1", ".", "a", "'_", "]_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "conf_", "[_", "'", "section", "\\u", "1", ".", "a", "'_", "]_", ",_", "'", "1", "2", "'_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
jamespacileo/django-pure-pagination/example_project/core/models.py
[ { "content": "from django.db import models\n\n# Create your models here.\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from django.db import models", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "your", " ", "model", "s", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
robclewley/compneuro/linear_ODE_2D.py
[ { "content": "\"\"\"\n2D linear ODE, Eq. 3.11 of Ch. 3\n\"\"\"\n\nfrom __future__ import division\n\nfrom PyDSTool import *\nfrom PyDSTool.Toolbox.phaseplane import *\n\nicdict = {'x': 0.4, 'y': 1.2}\npardict = {'a1': -9, 'a2': -5,\n 'a3': 1, 'a4': -3,\n 'b1': 7, 'b2': 1}\n\nDSargs = args()\nDSargs.name = 'lin2D'\nDSargs.ics = icdict\nDSargs.pars = pardict\nDSargs.tdata = [0, 10]\nDSargs.varspecs = {'x': 'a1*x + a2*y + b1',\n 'y': 'a3*x + a4*y + b2'}\n# The Jacobian matrix is the matrix of first derivatives of the RHS\n# with respect to x and y. Note the use of the triple-quoted string\n# to conveniently format the text. 't' is always given as the first\n# argument. The Jac is used by the code that finds fixed points, etc.\nDSargs.fnspecs = {'Jacobian': (['t', 'x', 'y'],\n \"\"\"[[a1, a2],\n [a3, a4]]\n \"\"\")}\n\nDS = Generator.Vode_ODEsystem(DSargs)\n\n# A function that tests the outcome of a given value of parameters or\n# initial conditions (either is optional)\n\n\npts1 = test_ic()\ndo_plots(pts1)\n\n# eps (epsilon) specifies the accuracy for the numerical\n# algorithm that finds the fixed points. Read the docstring\n# for more info!\nfp_coords = find_fixedpoints(DS, n=4, eps=1e-6,\n subdomain={'x': [-2,2],\n 'y': [-2,2]})\n\nprint \"%i fixed point(s) were found\" % len(fp_coords)\n\n# Find eigenvalues and vectors for the coordinates found\n# Copy this format and adapt for your model's coordinate names\nfp = fixedpoint_2D(DS, Point(fp_coords[0]), coords=['x', 'y'],\n eps=1e-6)\nprint fp.point, '\\n', fp.stability, fp.classification\n\nplt.figure(3)\n\n# A loop to test a distribution of initial conditions\nfor x0 in linspace(-1,1,10):\n pts = test_ic({'x': x0})\n plt.plot(pts['x'], pts['y'], 'b')\n\nfor y0 in linspace(1,-1,10):\n pts = test_ic({'y': y0})\n plt.plot(pts['x'], pts['y'], 'y')\n\n\nfor x0 in linspace(1,-1,10):\n pts = test_ic({'x': x0, 'y': -1})\n plt.plot(pts['x'], pts['y'], 'b')\n\nfor y0 in linspace(-1,1,10):\n pts = test_ic({'y': y0})\n plt.plot(pts['x'], pts['y'], 'y')\n\n\nplt.plot(fp.point['x'], fp.point['y'], 'ko', markersize=8)\n\ne1 = fp.evals[0]\ne2 = fp.evals[1]\n\nev1 = fp.evecs[0]\nev2 = fp.evecs[1]\n\nplt.plot([fp.point['x'], fp.point['x']+ev1['x']], [fp.point['y'], fp.point['y']+ev1['y']], 'k', linewidth=3)\nplt.plot([fp.point['x'], fp.point['x']+ev2['x']], [fp.point['y'], fp.point['y']+ev2['y']], 'k', linewidth=3)\n\n\n\n\nplt.figure(3)\nsol = get_real_sol(Point({'x': 1, 'y': 0.8}))\nplt.plot(sol['x'], sol['y'], 'm', linewidth=3)\n\n#plt.show()\n\n# ----------------------------------------------------------\n# Explore different coupling parameters\n\nprint \"\\n\\nRun through some matrix parameters...\"\n\nfrom time import sleep\n\nplt.figure(4)\nplt.xlabel('x')\nplt.ylabel('y')\n\nfor a1 in linspace(-10, 8, 8):\n print \"Testing a1 =\", a1\n\n pts2 = test_ic(pardict={'a2': -8, 'a1': a1})\n fp_coords2 = find_fixedpoints(DS, n=4, eps=1e-6,\n subdomain={'x': [-10,5],\n 'y': [-5,5]})\n if len(fp_coords2) > 0:\n fp2 = fixedpoint_2D(DS, Point(fp_coords2[0]), coords=['x', 'y'],\n eps=1e-6)\n if fp2.stability == 's':\n line = '-'\n fpcol = 'r'\n s = 'stable'\n else:\n # assume not the non-generic case of a 'center'\n line = '--'\n fpcol = 'g'\n s = 'unstable'\n print \"a1: %.3f, f.p. coords: (%.3f, %.3f), %s %s\" % (a1, fp2.point['x'],\n fp2.point['y'], s, fp2.classification)\n print \" with e'vals: \", fp2.evals\n plt.plot(pts2['x'], pts2['y'], line, label='%.3f' % a1)\n plt.plot(fp2.point['x'], fp2.point['y'], fpcol+'o', markersize=8)\n else:\n print \"a1: %.3f, (f.p. outside of domain)\" % a1\n plt.plot(pts2['x'], pts2['y'], label='%.3f' % a1)\n\n plt.xlim([-15,5])\n plt.ylim([-2,2])\n #plt.draw()\n #sleep(2)\n\nprint \"Finished\"\n\n#plt.legend(loc='upper left')\n\n# limits can sometimes need refreshing\nplt.xlim([-15,5])\nplt.ylim([-2,2])\nplt.show()\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def test_ic(icdict=None, pardict=None):\n if icdict is not None:\n DS.set(ics=icdict)\n if pardict is not None:\n DS.set(pars=pardict)\n traj = DS.compute('test')\n pts = traj.sample()\n return pts", "metadata": "root.test_ic", "header": "['module', '___EOS___']", "index": 34 }, { "content": "def do_plots(pts, fig_offset=0):\n plt.figure(1+fig_offset)\n plt.plot(pts['t'], pts['x'], 'g')\n plt.plot(pts['t'], pts['y'], 'r')\n plt.figure(2+fig_offset)\n plt.plot(pts['x'], pts['y'], 'k')", "metadata": "root.do_plots", "header": "['module', '___EOS___']", "index": 43 }, { "content": "def get_real_sol(IC):\n \"\"\"Return a pointset solution based on an explicit solution of the\n ODE when it has purely real eigenvalues\n \"\"\"\n c1, c2 = np.dot(np.linalg.inv(array([ev1, ev2]).T), IC-fp.point)\n\n # define a local function that uses c1, c2, and some of the globals\n def real_sol(t):\n \"\"\"Demonstration of explicit solution:\n Only works for non-oscillatory solutions\n with real eigenvalues!\n\n Accepts single scalars only\n \"\"\"\n assert isreal(e1)\n assert isreal(e2)\n return c1*ev1*np.exp(e1*t) + c2*ev2*np.exp(e2*t) + fp.point\n\n # make times\n ts = linspace(0, 7, 500)\n # empty state points list\n vs = []\n for t in ts:\n # appends array for each t\n vs.append(real_sol(t))\n\n # change vs from list of arrays to 2 x N array\n # transposed so that vs[0] is all x values,\n # vs[1] is all y values\n vs = array(vs).T\n return Pointset(coorddict={'x': vs[0], 'y': vs[1]},\n indepvararray=ts)", "metadata": "root.get_real_sol", "header": "['module', '___EOS___']", "index": 101 } ]
[ { "span": "from time import sleep", "start_line": 146, "start_column": 0, "end_line": 146, "end_column": 22 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "2", "D", " ", "linear", " ", "ODE", ",", " ", "Eq", ".", " ", "3.1", "1", " ", "of", " ", "Ch", ".", " ", "3", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "division_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Py", "DST", "ool_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Py", "DST", "ool_", "._", "Toolb", "ox_", "._", "phase", "plane_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ic", "dict_", "=_", "{_", "'", "x", "'_", ":_", "0.4_", ",_", "'", "y", "'_", ":_", "1.2_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "par", "dict_", "=_", "{_", "'", "a1", "'_", ":_", "-_", "9_", ",_", "'", "a2", "'_", ":_", "-_", "5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "a3", "'_", ":_", "1_", ",_", "'", "a4", "'_", ":_", "-_", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "b1", "'_", ":_", "7_", ",_", "'", "b2", "'_", ":_", "1_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DS", "args_", "=_", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DS", "args_", "._", "name_", "=_", "'", "lin", "2", "D", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DS", "args_", "._", "ics_", "=_", "ic", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DS", "args_", "._", "pars_", "=_", "par", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DS", "args_", "._", "tdata", "_", "=_", "[_", "0_", ",_", "10_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DS", "args_", "._", "vars", "pec", "s_", "=_", "{_", "'", "x", "'_", ":_", "'", "a1", "*", "x", " ", "+", " ", "a2", "*", "y", " ", "+", " ", "b1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "y", "'_", ":_", "'", "a3", "*", "x", " ", "+", " ", "a4", "*", "y", " ", "+", " ", "b2", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "Jacob", "ian", " ", "matrix", " ", "is", " ", "the", " ", "matrix", " ", "of", " ", "first", " ", "derivatives", " ", "of", " ", "the", " ", "RHS", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "respec", "t", " ", "to", " ", "x", " ", "and", " ", "y", ".", " ", "Not", "e", " ", "the", " ", "use", " ", "of", " ", "the", " ", "triple", "-", "quoted", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "convenien", "tl", "y", " ", "format", " ", "the", " ", "text", ".", " ", "'", "t", "'", " ", "is", " ", "alw", "ay", "s", " ", "give", "n", " ", "as", " ", "the", " ", "first_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "argu", "ment", ".", " ", "The", " ", "Ja", "c", " ", "is", " ", "used", " ", "by", " ", "the", " ", "code", " ", "tha", "t", " ", "find", "s", " ", "fixed", " ", "points", ",", " ", "etc", "._", "\\u\\u\\uNL\\u\\u\\u_", "DS", "args_", "._", "fn", "specs_", "=_", "{_", "'", "Jacob", "ian", "'_", ":_", "(_", "[_", "'", "t", "'_", ",_", "'", "x", "'_", ",_", "'", "y", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"[", "[", "a1", ",", " ", "a2", "],", "\\", "10", ";", " ", " ", " ", " ", " ", "[", "a3", ",", " ", "a4", "]]", "\\", "10", ";", " ", " ", " ", " ", " ", "\"\"\"_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DS_", "=_", "Generator_", "._", "Vo", "de", "\\u", "ODE", "system_", "(_", "DS", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "function", " ", "tha", "t", " ", "tests", " ", "the", " ", "outco", "me", " ", "of", " ", "a", " ", "give", "n", " ", "value", " ", "of", " ", "parameter", "s", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "initial", " ", "condition", "s", " ", "(", "eit", "her", " ", "is", " ", "option", "al", ")_", "\\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_", "pts", "1_", "=_", "test\\u", "ic_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "do", "\\u", "plots_", "(_", "pts", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "eps", " ", "(", "eps", "ilon", ")", " ", "speci", "fie", "s", " ", "the", " ", "accu", "rac", "y", " ", "for", " ", "the", " ", "numerical", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "algo", "rit", "hm", " ", "tha", "t", " ", "find", "s", " ", "the", " ", "fixed", " ", "points", ".", " ", "Read", " ", "the", " ", "docstring_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "more", " ", "info", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "fp", "\\u", "coords_", "=_", "find", "\\u", "fixed", "points_", "(_", "DS_", ",_", "n_", "=_", "4_", ",_", "eps_", "=_", "1e-6_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "subdomain_", "=_", "{_", "'", "x", "'_", ":_", "[_", "-_", "2_", ",_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "y", "'_", ":_", "[_", "-_", "2_", ",_", "2_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"%", "i", " ", "fixed", " ", "point", "(", "s", ")", " ", "wer", "e", " ", "found", "\"_", "%_", "len_", "(_", "fp", "\\u", "coords_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fin", "d", " ", "eigenvalues", " ", "and", " ", "vector", "s", " ", "for", " ", "the", " ", "coordinate", "s", " ", "found_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", " ", "this", " ", "format", " ", "and", " ", "adapt", " ", "for", " ", "your", " ", "model", "'", "s", " ", "coordinate", " ", "names_", "\\u\\u\\uNL\\u\\u\\u_", "fp_", "=_", "fixed", "point", "\\u", "2", "D_", "(_", "DS_", ",_", "Point_", "(_", "fp", "\\u", "coords_", "[_", "0_", "]_", ")_", ",_", "coords_", "=_", "[_", "'", "x", "'_", ",_", "'", "y", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "eps_", "=_", "1e-6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "fp_", "._", "point_", ",_", "'\\\\", "n", "'_", ",_", "fp_", "._", "stability", "_", ",_", "fp_", "._", "classification_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "figure_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "loop", " ", "to", " ", "test", " ", "a", " ", "distribu", "tion", " ", "of", " ", "initial", " ", "conditions_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x0_", "in_", "linspace_", "(_", "-_", "1_", ",_", "1_", ",_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pts_", "=_", "test\\u", "ic_", "(_", "{_", "'", "x", "'_", ":_", "x0_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "pts_", "[_", "'", "x", "'_", "]_", ",_", "pts_", "[_", "'", "y", "'_", "]_", ",_", "'", "b", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "y0_", "in_", "linspace_", "(_", "1_", ",_", "-_", "1_", ",_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pts_", "=_", "test\\u", "ic_", "(_", "{_", "'", "y", "'_", ":_", "y0_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "pts_", "[_", "'", "x", "'_", "]_", ",_", "pts_", "[_", "'", "y", "'_", "]_", ",_", "'", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "x0_", "in_", "linspace_", "(_", "1_", ",_", "-_", "1_", ",_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pts_", "=_", "test\\u", "ic_", "(_", "{_", "'", "x", "'_", ":_", "x0_", ",_", "'", "y", "'_", ":_", "-_", "1_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "pts_", "[_", "'", "x", "'_", "]_", ",_", "pts_", "[_", "'", "y", "'_", "]_", ",_", "'", "b", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "y0_", "in_", "linspace_", "(_", "-_", "1_", ",_", "1_", ",_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pts_", "=_", "test\\u", "ic_", "(_", "{_", "'", "y", "'_", ":_", "y0_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "pts_", "[_", "'", "x", "'_", "]_", ",_", "pts_", "[_", "'", "y", "'_", "]_", ",_", "'", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "plot_", "(_", "fp_", "._", "point_", "[_", "'", "x", "'_", "]_", ",_", "fp_", "._", "point_", "[_", "'", "y", "'_", "]_", ",_", "'", "ko", "'_", ",_", "markersize_", "=_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "e1_", "=_", "fp_", "._", "evals_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e2_", "=_", "fp_", "._", "evals_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ev", "1_", "=_", "fp_", "._", "eve", "cs_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ev", "2_", "=_", "fp_", "._", "eve", "cs_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "plot_", "(_", "[_", "fp_", "._", "point_", "[_", "'", "x", "'_", "]_", ",_", "fp_", "._", "point_", "[_", "'", "x", "'_", "]_", "+_", "ev", "1_", "[_", "'", "x", "'_", "]_", "]_", ",_", "[_", "fp_", "._", "point_", "[_", "'", "y", "'_", "]_", ",_", "fp_", "._", "point_", "[_", "'", "y", "'_", "]_", "+_", "ev", "1_", "[_", "'", "y", "'_", "]_", "]_", ",_", "'", "k", "'_", ",_", "linewidth_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "[_", "fp_", "._", "point_", "[_", "'", "x", "'_", "]_", ",_", "fp_", "._", "point_", "[_", "'", "x", "'_", "]_", "+_", "ev", "2_", "[_", "'", "x", "'_", "]_", "]_", ",_", "[_", "fp_", "._", "point_", "[_", "'", "y", "'_", "]_", ",_", "fp_", "._", "point_", "[_", "'", "y", "'_", "]_", "+_", "ev", "2_", "[_", "'", "y", "'_", "]_", "]_", ",_", "'", "k", "'_", ",_", "linewidth_", "=_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "figure_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sol_", "=_", "get", "\\u", "real", "\\u", "sol_", "(_", "Point_", "(_", "{_", "'", "x", "'_", ":_", "1_", ",_", "'", "y", "'_", ":_", "0.8_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "sol_", "[_", "'", "x", "'_", "]_", ",_", "sol_", "[_", "'", "y", "'_", "]_", ",_", "'", "m", "'_", ",_", "linewidth_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "plt", ".", "show", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Explo", "re", " ", "different", " ", "coupling", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"\\\\", "n", "\\\\", "n", "Run", " ", "through", " ", "some", " ", "matrix", " ", "parameter", "s", "...\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "time_", "import_", "sleep_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "figure_", "(_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlabel_", "(_", "'", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "'", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "a1_", "in_", "linspace_", "(_", "-_", "10_", ",_", "8_", ",_", "8_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Test", "ing", " ", "a1", " ", "=\"_", ",_", "a1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pts", "2_", "=_", "test\\u", "ic_", "(_", "par", "dict_", "=_", "{_", "'", "a2", "'_", ":_", "-_", "8_", ",_", "'", "a1", "'_", ":_", "a1_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fp", "\\u", "coords", "2_", "=_", "find", "\\u", "fixed", "points_", "(_", "DS_", ",_", "n_", "=_", "4_", ",_", "eps_", "=_", "1e-6_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "subdomain_", "=_", "{_", "'", "x", "'_", ":_", "[_", "-_", "10_", ",_", "5_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "y", "'_", ":_", "[_", "-_", "5_", ",_", "5_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "fp", "\\u", "coords", "2_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp", "2_", "=_", "fixed", "point", "\\u", "2", "D_", "(_", "DS_", ",_", "Point_", "(_", "fp", "\\u", "coords", "2_", "[_", "0_", "]_", ")_", ",_", "coords_", "=_", "[_", "'", "x", "'_", ",_", "'", "y", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "eps_", "=_", "1e-6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fp", "2_", "._", "stability", "_", "==_", "'", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "'-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fp", "col_", "=_", "'", "r", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "'", "stable", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "assume", " ", "not", " ", "the", " ", "non", "-", "gener", "ic", " ", "case", " ", "of", " ", "a", " ", "'", "center", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "'--'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fp", "col_", "=_", "'", "g", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "'", "unstable", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "a1", ":", " ", "%", ".3", "f", ",", " ", "f", ".", "p", ".", " ", "coords", ":", " ", "(%", ".3", "f", ",", " ", "%", ".3", "f", "),", " ", "%", "s", " ", "%", "s", "\"_", "%_", "(_", "a1_", ",_", "fp", "2_", "._", "point_", "[_", "'", "x", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fp", "2_", "._", "point_", "[_", "'", "y", "'_", "]_", ",_", "s_", ",_", "fp", "2_", "._", "classification_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", " ", " ", " ", "with", " ", "e", "'", "vals", ":", " ", "\"_", ",_", "fp", "2_", "._", "evals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "pts", "2_", "[_", "'", "x", "'_", "]_", ",_", "pts", "2_", "[_", "'", "y", "'_", "]_", ",_", "line_", ",_", "label_", "=_", "'%", ".3", "f", "'_", "%_", "a1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "fp", "2_", "._", "point_", "[_", "'", "x", "'_", "]_", ",_", "fp", "2_", "._", "point_", "[_", "'", "y", "'_", "]_", ",_", "fp", "col_", "+_", "'", "o", "'_", ",_", "markersize_", "=_", "8_", ")_", "\\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_", "\"", "a1", ":", " ", "%", ".3", "f", ",", " ", "(", "f", ".", "p", ".", " ", "outsi", "de", " ", "of", " ", "domain", ")\"_", "%_", "a1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "pts", "2_", "[_", "'", "x", "'_", "]_", ",_", "pts", "2_", "[_", "'", "y", "'_", "]_", ",_", "label_", "=_", "'%", ".3", "f", "'_", "%_", "a1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "xlim_", "(_", "[_", "-_", "15_", ",_", "5_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "[_", "-_", "2_", ",_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "plt", ".", "draw", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "sleep", "(", "2", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "Finish", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "plt", ".", "legend", "(", "loc", "='", "upper", " ", "left", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "limit", "s", " ", "can", " ", "somet", "imes", " ", "need", " ", "refre", "shing", "_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "xlim_", "(_", "[_", "-_", "15_", ",_", "5_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "[_", "-_", "2_", ",_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "ic_", "(_", "ic", "dict_", "=_", "None_", ",_", "par", "dict_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ic", "dict_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "DS_", "._", "set_", "(_", "ics_", "=_", "ic", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "par", "dict_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "DS_", "._", "set_", "(_", "pars_", "=_", "par", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "traj_", "=_", "DS_", "._", "compute_", "(_", "'", "test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pts_", "=_", "traj_", "._", "sample_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "pts_", "\\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_", "do", "\\u", "plots_", "(_", "pts_", ",_", "fig", "\\u", "offset_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plt_", "._", "figure_", "(_", "1_", "+_", "fig", "\\u", "offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "pts_", "[_", "'", "t", "'_", "]_", ",_", "pts_", "[_", "'", "x", "'_", "]_", ",_", "'", "g", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "pts_", "[_", "'", "t", "'_", "]_", ",_", "pts_", "[_", "'", "y", "'_", "]_", ",_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "figure_", "(_", "2_", "+_", "fig", "\\u", "offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "pts_", "[_", "'", "x", "'_", "]_", ",_", "pts_", "[_", "'", "y", "'_", "]_", ",_", "'", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "real", "\\u", "sol_", "(_", "IC_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "a", " ", "points", "et", " ", "solut", "ion", " ", "based", " ", "on", " ", "an", " ", "explicit", " ", "solut", "ion", " ", "of", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "ODE", " ", "whe", "n", " ", "it", " ", "has", " ", "pure", "ly", " ", "real", " ", "eigenvalues", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", ",_", "c2_", "=_", "np_", "._", "dot_", "(_", "np_", "._", "linalg_", "._", "inv_", "(_", "array_", "(_", "[_", "ev", "1_", ",_", "ev", "2_", "]_", ")_", "._", "T_", ")_", ",_", "IC_", "-_", "fp_", "._", "point_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "defin", "e", " ", "a", " ", "local", " ", "function", " ", "tha", "t", " ", "use", "s", " ", "c1", ",", " ", "c2", ",", " ", "and", " ", "some", " ", "of", " ", "the", " ", "globals_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "real", "\\u", "sol_", "(_", "t_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Demo", "nstr", "ation", " ", "of", " ", "explicit", " ", "solut", "ion", ":", "\\", "10", ";", " ", " ", " ", " ", "On", "ly", " ", "works", " ", "for", " ", "non", "-", "oscil", "lator", "y", " ", "solut", "ion", "s", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "real", " ", "eigenvalues", "!", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Accept", "s", " ", "single", " ", "scalars", " ", "only", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isr", "eal", "_", "(_", "e1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isr", "eal", "_", "(_", "e2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "c1_", "*_", "ev", "1_", "*_", "np_", "._", "exp_", "(_", "e1_", "*_", "t_", ")_", "+_", "c2_", "*_", "ev", "2_", "*_", "np_", "._", "exp_", "(_", "e2_", "*_", "t_", ")_", "+_", "fp_", "._", "point_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "times_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ts_", "=_", "linspace_", "(_", "0_", ",_", "7_", ",_", "500_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "empty", " ", "state", " ", "points", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "vs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "ts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "append", "s", " ", "array", " ", "for", " ", "each", " ", "t_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vs_", "._", "append_", "(_", "real", "\\u", "sol_", "(_", "t_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "change", " ", "vs", " ", "from", " ", "list", " ", "of", " ", "arrays", " ", "to", " ", "2", " ", "x", " ", "N", " ", "array_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "transpose", "d", " ", "so", " ", "tha", "t", " ", "vs", "[", "0", "]", " ", "is", " ", "all", " ", "x", " ", "values", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "vs", "[", "1", "]", " ", "is", " ", "all", " ", "y", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "vs_", "=_", "array_", "(_", "vs_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Point", "set_", "(_", "coord", "dict_", "=_", "{_", "'", "x", "'_", ":_", "vs_", "[_", "0_", "]_", ",_", "'", "y", "'_", ":_", "vs_", "[_", "1_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "indep", "vara", "rray_", "=_", "ts_", ")_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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results_t.py
[ { "content": "#\n# Copyright 2013, Couchbase, Inc.\n# All Rights Reserved\n#\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#\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,\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#\n\nfrom couchbase.tests.base import ConnectionTestCase\n\nINT_TYPES = None\ntry:\n INT_TYPES = (long, int)\nexcept:\n INT_TYPES = (int,)\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "except:", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 7 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2013", ",", " ", "Cou", "ch", "base", ",", " ", "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", "\")", "_", "\\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_", "#", "_", "\\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", ",_", "\\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_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "couch", "base_", "._", "tests_", "._", "base_", "import_", "Connect", "ion", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "INT", "\\u", "TYPES_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "INT", "\\u", "TYPES_", "=_", "(_", "long_", ",_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\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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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
PythonCharmers/python-future/tests/test_future/test_httplib.py
[ { "content": " def test_putheader(self):\n conn = client.HTTPConnection('example.com')\n conn.sock = FakeSocket(None)\n conn.putrequest('GET','/')\n conn.putheader('Content-length', 42)\n self.assertTrue(b'Content-length: 42' in conn._buffer)", "metadata": "root.HeaderTests.test_putheader", "header": "['class', 'HeaderTests', '(', 'TestCase', ')', ':', '___EOS___']", "index": 150 }, { "content": " def testTimeoutAttribute(self):\n '''This will prove that the timeout gets through\n HTTPConnection and into the socket.\n '''\n # default -- use global socket timeout\n self.assertTrue(socket.getdefaulttimeout() is None)\n socket.setdefaulttimeout(30)\n try:\n httpConn = client.HTTPConnection(HOST, TimeoutTest.PORT)\n httpConn.connect()\n finally:\n socket.setdefaulttimeout(None)\n self.assertEqual(httpConn.sock.gettimeout(), 30)\n httpConn.close()\n\n # no timeout -- do not use global socket default\n self.assertTrue(socket.getdefaulttimeout() is None)\n socket.setdefaulttimeout(30)\n try:\n httpConn = client.HTTPConnection(HOST, TimeoutTest.PORT,\n timeout=None)\n httpConn.connect()\n finally:\n socket.setdefaulttimeout(None)\n self.assertEqual(httpConn.sock.gettimeout(), None)\n httpConn.close()\n\n # a value\n httpConn = client.HTTPConnection(HOST, TimeoutTest.PORT, timeout=30)\n httpConn.connect()\n self.assertEqual(httpConn.sock.gettimeout(), 30)\n httpConn.close()", "metadata": "root.TimeoutTest.testTimeoutAttribute", "header": "['class', 'TimeoutTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 500 } ]
[ { "span": "self.assertTrue(b'Content-length: 42' in conn._buffer)", "start_line": 155, "start_column": 8, "end_line": 155, "end_column": 62 }, { "span": "self.assertTrue(socket.getdefaulttimeout() is None)", "start_line": 505, "start_column": 8, "end_line": 505, "end_column": 59 }, { "span": "self.assertTrue(socket.getdefaulttimeout() is None)", "start_line": 516, "start_column": 8, "end_line": 516, "end_column": 59 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Head", "er", "Tests_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "put", "header_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "=_", "client_", "._", "HTTP", "Connection_", "(_", "'", "example", ".", "com", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "._", "sock_", "=_", "Fake", "Socket_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "._", "put", "request_", "(_", "'", "GET", "'_", ",_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "._", "put", "header_", "(_", "'", "Conten", "t", "-", "length", "'_", ",_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "b", "'", "Conten", "t", "-", "length", ":", " ", "4", "2", "'_", "in_", "conn_", "._", "\\u", "buffer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "out", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Time", "out", "Attribute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Thi", "s", " ", "will", " ", "prove", " ", "tha", "t", " ", "the", " ", "timeo", "ut", " ", "gets", " ", "through", "\\", "10", ";", " ", " ", " ", " ", "HTTP", "Connect", "ion", " ", "and", " ", "int", "o", " ", "the", " ", "socket", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "default", " ", "--", " ", "use", " ", "global", " ", "socket", " ", "timeout_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "socket_", "._", "getde", "fault", "timeout_", "(_", ")_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "socket_", "._", "setdefault", "timeout_", "(_", "30_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "http", "Conn_", "=_", "client_", "._", "HTTP", "Connection_", "(_", "HOST_", ",_", "Time", "out", "Test_", "._", "PORT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http", "Conn_", "._", "connect_", "(_", ")_", "\\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 ", " _", "socket_", "._", "setdefault", "timeout_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "http", "Conn_", "._", "sock_", "._", "getti", "meo", "ut_", "(_", ")_", ",_", "30_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http", "Conn_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "no", " ", "timeo", "ut", " ", "--", " ", "do", " ", "not", " ", "use", " ", "global", " ", "socket", " ", "default_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "socket_", "._", "getde", "fault", "timeout_", "(_", ")_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "socket_", "._", "setdefault", "timeout_", "(_", "30_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "http", "Conn_", "=_", "client_", "._", "HTTP", "Connection_", "(_", "HOST_", ",_", "Time", "out", "Test_", "._", "PORT_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "timeout_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http", "Conn_", "._", "connect_", "(_", ")_", "\\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 ", " _", "socket_", "._", "setdefault", "timeout_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "http", "Conn_", "._", "sock_", "._", "getti", "meo", "ut_", "(_", ")_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http", "Conn_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "http", "Conn_", "=_", "client_", "._", "HTTP", "Connection_", "(_", "HOST_", ",_", "Time", "out", "Test_", "._", "PORT_", ",_", "timeout_", "=_", "30_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http", "Conn_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "http", "Conn_", "._", "sock_", "._", "getti", "meo", "ut_", "(_", ")_", ",_", "30_", ")_", "\\u\\u\\uNEWL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1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
kuri65536/python-for-android/python-modules/twisted/twisted/internet/wxsupport.py
[ { "content": "# Copyright (c) 2001-2004 Twisted Matrix Laboratories.\n# See LICENSE for details.\n\n# \n\"\"\"Old method of wxPython support for Twisted.\n\ntwisted.internet.wxreactor is probably a better choice.\n\nTo use::\n\n | # given a wxApp instance called myWxAppInstance:\n | from twisted.internet import wxsupport\n | wxsupport.install(myWxAppInstance)\n \nUse Twisted's APIs for running and stopping the event loop, don't use\nwxPython's methods.\n\nOn Windows the Twisted event loop might block when dialogs are open\nor menus are selected.\n\nMaintainer: Itamar Shtull-Trauring\n\"\"\"\n\nimport warnings\nwarnings.warn(\"wxsupport is not fully functional on Windows, wxreactor is better.\")\n\n# wxPython imports\nfrom wxPython.wx import wxApp\n\n# twisted imports\nfrom twisted.internet import reactor\nfrom twisted.python.runtime import platformType\n\n\n\n\n\n\n__all__ = [\"install\"]\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class wxRunner:\n \"\"\"Make sure GUI events are handled.\"\"\"\n \n ", "metadata": "root.wxRunner", "header": "['module', '___EOS___']", "index": 34 }, { "content": " def __init__(self, app):\n self.app = app", "metadata": "root.wxRunner.__init__", "header": "['class', 'wxRunner', ':', '___EOS___']", "index": 37 }, { "content": " def run(self):\n \"\"\"\n Execute pending WX events followed by WX idle events and\n reschedule.\n \"\"\"\n # run wx events\n while self.app.Pending():\n self.app.Dispatch()\n \n # run wx idle events\n self.app.ProcessIdle()\n reactor.callLater(0.02, self.run)", "metadata": "root.wxRunner.run", "header": "['class', 'wxRunner', ':', '___EOS___']", "index": 40 }, { "content": "def install(app):\n \"\"\"Install the wxPython support, given a wxApp instance\"\"\"\n runner = wxRunner(app)\n reactor.callLater(0.02, runner.run)", "metadata": "root.install", "header": "['module', '___EOS___']", "index": 54 } ]
[ { "span": "from wxPython.wx import wxApp", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 29 }, { "span": "from twisted.python.runtime import platformType", "start_line": 31, "start_column": 0, "end_line": 31, "end_column": 47 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "200", "1", "-", "2004", " ", "Twi", "sted", " ", "Matrix", " ", "Labo", "rator", "ies", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "LICENSE", " ", "for", " ", "deta", "il", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Old", " ", "method", " ", "of", " ", "wx", "Pyth", "on", " ", "support", " ", "for", " ", "Twi", "sted", ".", "\\", "10", ";", "\\", "10", ";", "twist", "ed", ".", "interne", "t", ".", "wx", "react", "or", " ", "is", " ", "probab", "ly", " ", "a", " ", "bett", "er", " ", "choice", ".", "\\", "10", ";", "\\", "10", ";", "To", " ", "use", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "#", " ", "give", "n", " ", "a", " ", "wx", "App", " ", "instance", " ", "call", "ed", " ", "my", "Wx", "App", "Insta", "nce", ":", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "from", " ", "twist", "ed", ".", "interne", "t", " ", "import", " ", "wx", "support", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "wx", "support", ".", "install", "(", "my", "Wx", "App", "Insta", "nce", ")", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", "Us", "e", " ", "Twi", "sted", "'", "s", " ", "API", "s", " ", "for", " ", "runn", "ing", " ", "and", " ", "stopping", " ", "the", " ", "event", " ", "loop", ",", " ", "don", "'", "t", " ", "use", "\\", "10", ";", "wx", "Pyth", "on", "'", "s", " ", "method", "s", ".", "\\", "10", ";", "\\", "10", ";", "On", " ", "Window", "s", " ", "the", " ", "Twi", "sted", " ", "event", " ", "loop", " ", "mig", "ht", " ", "block", " ", "whe", "n", " ", "dialog", "s", " ", "are", " ", "open", "\\", "10", ";", "or", " ", "menus", " ", "are", " ", "selecte", "d", ".", "\\", "10", ";", "\\", "10", ";", "Maint", "aine", "r", ":", " ", "It", "amar", " ", "Sh", "tul", "l", "-", "Tra", "uri", "ng", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "warnings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warnings_", "._", "warn_", "(_", "\"", "wx", "support", " ", "is", " ", "not", " ", "full", "y", " ", "functional", " ", "on", " ", "Window", "s", ",", " ", "wx", "react", "or", " ", "is", " ", "bett", "er", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "wx", "Pyth", "on", " ", "imports_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "wx", "Python_", "._", "wx_", "import_", "wx", "App_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "twist", "ed", " ", "imports_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "twisted_", "._", "internet_", "import_", "reactor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "twisted_", "._", "python_", "._", "runtime_", "import_", "platform", "Type_", "\\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", "all\\u\\u_", "=_", "[_", "\"", "install", "\"_", "]_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "wx", "Runner_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Make", " ", "sure", " ", "GU", "I", " ", "events", " ", "are", " ", "handle", "d", ".\"\"\"_", "\\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_", "wx", "Runner_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "app_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "app_", "=_", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "wx", "Runner_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Execut", "e", " ", "pend", "ing", " ", "WX", " ", "events", " ", "followe", "d", " ", "by", " ", "WX", " ", "idle", " ", "events", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "resc", "hedule", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "run", " ", "wx", " ", "events_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "self_", "._", "app_", "._", "Pend", "ing_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "app_", "._", "Dispa", "tch_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "run", " ", "wx", " ", "idle", " ", "events_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "app_", "._", "Process", "Id", "le_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reactor_", "._", "call", "Later_", "(_", "0.02_", ",_", "self_", "._", "run_", ")_", "\\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_", "install_", "(_", "app_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Install", " ", "the", " ", "wx", "Pyth", "on", " ", "support", ",", " ", "give", "n", " ", "a", " ", "wx", "App", " ", "instance", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "runner_", "=_", "wx", "Runner_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE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ndb-python/tests/kobench.py
[ { "content": "def populate(n):\n xs = [Foo() for i in xrange(n)]\n ks = model.put_multi(xs)", "metadata": "root.populate", "header": "['module', '___EOS___']", "index": 45 } ]
[ { "span": "ks ", "start_line": 47, "start_column": 2, "end_line": 47, "end_column": 4 } ]
[]
1
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_", "def_", "populate_", "(_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xs_", "=_", "[_", "Foo_", "(_", ")_", "for_", "i_", "in_", "xrange_", "(_", "n_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ks_", "=_", "model_", "._", "put", "\\u", "multi_", "(_", "xs_", ")_", "\\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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
daviddrysdale/python-phonenumbers/python/tests/testtzdata/data0.py
[ { "content": "\"\"\"Per-prefix data, mapping each prefix to a name.\n\nAuto-generated file, do not edit by hand.\n\"\"\"\nfrom phonenumbers.util import u\n\n# Copyright (C) 2011-2016 The Libphonenumber Authors\n#\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#\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,\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\ndata = {\n '1234':('America/New_York',),\n '612':('Australia/Sydney',),\n '1650960':('America/Los_Angeles',),\n '1201':('America/New_York',),\n '1604':('America/Winnipeg',),\n '1989':('Ameriac/Los_Angeles',),\n '1':('America/New_York', 'America/Chicago', 'America/Winnipeg', 'America/Los_Angeles'),\n '1212812':('America/New_York',),\n '1617423':('America/Chicago',),\n '82':('Asia/Seoul',),\n}\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from phonenumbers.util import u", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 31 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "Per", "-", "prefix", " ", "data", ",", " ", "mapping", " ", "each", " ", "prefix", " ", "to", " ", "a", " ", "name", ".", "\\", "10", ";", "\\", "10", ";", "Auto", "-", "generat", "ed", " ", "file", ",", " ", "do", " ", "not", " ", "edit", " ", "by", " ", "hand", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "phone", "numbers_", "._", "util_", "import_", "u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2011", "-", "2016", " ", "The", " ", "Lib", "phone", "number", " ", "Author", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\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_", "#", "_", "\\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", ",_", "\\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_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "1234", "'_", ":_", "(_", "'", "Ame", "rica", "/", "New", "\\u", "Yo", "rk", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "612", "'_", ":_", "(_", "'", "Aust", "ral", "ia", "/", "Sy", "dne", "y", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "165", "096", "0", "'_", ":_", "(_", "'", "Ame", "rica", "/", "Lo", "s", "\\u", "Angel", "es", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "1201", "'_", ":_", "(_", "'", "Ame", "rica", "/", "New", "\\u", "Yo", "rk", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "160", "4", "'_", ":_", "(_", "'", "Ame", "rica", "/", "Win", "nip", "eg", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "1989", "'_", ":_", "(_", "'", "Ame", "ria", "c", "/", "Lo", "s", "\\u", "Angel", "es", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "1", "'_", ":_", "(_", "'", "Ame", "rica", "/", "New", "\\u", "Yo", "rk", "'_", ",_", "'", "Ame", "rica", "/", "Chi", "cag", "o", "'_", ",_", "'", "Ame", "rica", "/", "Win", "nip", "eg", "'_", ",_", "'", "Ame", "rica", "/", "Lo", "s", "\\u", "Angel", "es", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "1212", "812", "'_", ":_", "(_", "'", "Ame", "rica", "/", "New", "\\u", "Yo", "rk", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "161", "742", "3", "'_", ":_", "(_", "'", "Ame", "rica", "/", "Chi", "cag", "o", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "8", "2", "'_", ":_", "(_", "'", "Asi", "a", "/", "Se", "oul", "'_", ",_", ")_", ",_", "\\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, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
treeio/treeio/treeio/services/models.py
[ { "content": "def email_caller_on_new_ticket(sender, instance, created, **kwargs):\n \"When a new ticket is created send an email to the caller\"\n if created:\n send_email_to_caller = False\n try:\n conf = ModuleSetting.get_for_module(\n 'treeio.services', 'send_email_to_caller')[0]\n send_email_to_caller = conf.value\n except:\n send_email_to_caller = getattr(\n settings, 'HARDTREE_SEND_EMAIL_TO_CALLER', True)\n\n if send_email_to_caller:\n # don't send email to yourself\n creator_contact = None\n if instance.creator:\n creator_contact = instance.creator.get_contact()\n\n if instance.caller and instance.caller != creator_contact:\n if not instance.reference:\n if instance.queue:\n instance.reference = instance.queue.ticket_code + \\\n str(instance.id)\n else:\n instance.reference = str(instance.id)\n instance.save()\n subject = \"[#%s] %s\" % (instance.reference, instance.name)\n\n # Construct context and render to html, body\n context = {'ticket': instance}\n try:\n conf = ModuleSetting.get_for_module(\n 'treeio.services', 'send_email_template')[0]\n send_email_template = conf.value\n html = render_string_template(send_email_template, context)\n except:\n html = render_to_string(\n 'services/emails/notify_caller', context, response_format='html')\n body = strip_tags(html)\n\n if instance.queue and instance.queue.message_stream:\n stream = instance.queue.message_stream\n if stream.outgoing_server_name:\n try:\n caller_email = instance.caller.get_email()\n if caller_email:\n toaddr = caller_email\n ssl = False\n if stream.outgoing_server_type == 'SMTP-SSL':\n ssl = True\n email = BaseEmail(stream.outgoing_server_name,\n stream.outgoing_server_username,\n stream.outgoing_password,\n stream.outgoing_email,\n toaddr, subject, body, html=html,\n ssl=ssl)\n email.process_email()\n except:\n pass", "metadata": "root.email_caller_on_new_ticket", "header": "['module', '___EOS___']", "index": 252 }, { "content": "def create_ticket_from_message(sender, instance, created, **kwargs):\n \"\"\"\n Get a signal from messaging.models\n Check if (new) message's stream is also assigned to Ticket Queue\n Create a new ticket from that message\n Rename original message title\n \"\"\"\n\n if created and getattr(instance, 'auto_notify', True):\n if instance.reply_to:\n tickets = instance.reply_to.ticket_set.all()\n for ticket in tickets:\n record = TicketRecord()\n record.sender = instance.author\n record.record_type = 'manual'\n record.body = instance.body\n record.save()\n record.about.add(ticket)\n ticket.set_last_updated()\n else:\n stream = instance.stream\n queues = TicketQueue.objects.filter(message_stream=stream)\n if stream and queues:\n queue = queues[0]\n ticket = Ticket()\n try:\n conf = ModuleSetting.get_for_module(\n 'treeio.services', 'default_ticket_status')[0]\n ticket.status = TicketStatus.objects.get(\n pk=long(conf.value))\n except:\n statuses = TicketStatus.objects.all()\n ticket.status = statuses[0]\n ticket.queue = queue\n ticket.caller = instance.author\n ticket.details = instance.body\n ticket.message = instance\n ticket.name = instance.title\n ticket.auto_notify = False\n ticket.save()\n try:\n if stream.creator:\n ticket.set_user(stream.creator)\n elif queue.creator:\n ticket.set_user(queue.creator)\n else:\n ticket.copy_permissions(queue)\n except:\n pass\n\n # Rename original message title\n instance.title = \"[#\" + ticket.reference + \"] \" + instance.title\n instance.save()", "metadata": "root.create_ticket_from_message", "header": "['module', '___EOS___']", "index": 315 } ]
[ { "span": "except:", "start_line": 260, "start_column": 8, "end_line": 260, "end_column": 15 }, { "span": "except:", "start_line": 287, "start_column": 16, "end_line": 287, "end_column": 23 }, { "span": "except:", "start_line": 309, "start_column": 24, "end_line": 309, "end_column": 31 }, { "span": "except:", "start_line": 345, "start_column": 16, "end_line": 345, "end_column": 23 }, { "span": "except:", "start_line": 362, "start_column": 16, "end_line": 362, "end_column": 23 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "email", "\\u", "caller", "\\u", "on", "\\u", "new", "\\u", "ticket_", "(_", "sender_", ",_", "instance_", ",_", "created_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Whe", "n", " ", "a", " ", "new", " ", "tick", "et", " ", "is", " ", "created", " ", "send", " ", "an", " ", "email", " ", "to", " ", "the", " ", "caller", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "created_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "send", "\\u", "email", "\\u", "to", "\\u", "caller_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conf_", "=_", "Modul", "e", "Setting_", "._", "get", "\\u", "for", "\\u", "module_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "treei", "o", ".", "service", "s", "'_", ",_", "'", "send", "\\u", "email", "\\u", "to", "\\u", "caller", "'_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "send", "\\u", "email", "\\u", "to", "\\u", "caller_", "=_", "conf_", "._", "value_", "\\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 ", " _", "send", "\\u", "email", "\\u", "to", "\\u", "caller_", "=_", "getattr_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "settings_", ",_", "'", "HARD", "TREE", "\\u", "SEND", "\\u", "EMA", "IL", "\\u", "TO", "\\u", "CALL", "ER", "'_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "send", "\\u", "email", "\\u", "to", "\\u", "caller_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "don", "'", "t", " ", "send", " ", "email", " ", "to", " ", "your", "self_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "creat", "or", "\\u", "contact_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "instance_", "._", "creator_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "creat", "or", "\\u", "contact_", "=_", "instance_", "._", "creator_", "._", "get", "\\u", "contact_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "instance_", "._", "caller_", "and_", "instance_", "._", "caller_", "!=_", "creat", "or", "\\u", "contact_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "instance_", "._", "reference_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "instance_", "._", "queue_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "instance_", "._", "reference_", "=_", "instance_", "._", "queue_", "._", "tick", "et", "\\u", "code_", "+_", "str_", "(_", "instance_", "._", "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 ", " ", " _", "instance_", "._", "reference_", "=_", "str_", "(_", "instance_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "instance_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "subject_", "=_", "\"[", "#", "%", "s", "]", " ", "%", "s", "\"_", "%_", "(_", "instance_", "._", "reference_", ",_", "instance_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Construct", " ", "context", " ", "and", " ", "render", " ", "to", " ", "html", ",", " ", "body_", "\\u\\u\\uNL\\u\\u\\u_", "context_", "=_", "{_", "'", "tick", "et", "'_", ":_", "instance_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "conf_", "=_", "Modul", "e", "Setting_", "._", "get", "\\u", "for", "\\u", "module_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "treei", "o", ".", "service", "s", "'_", ",_", "'", "send", "\\u", "email", "\\u", "template", "'_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "send", "\\u", "email", "\\u", "template_", "=_", "conf_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html_", "=_", "render", "\\u", "string", "\\u", "template_", "(_", "send", "\\u", "email", "\\u", "template_", ",_", "context_", ")_", "\\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 ", " ", "_", "html_", "=_", "render", "\\u", "to", "\\u", "string_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "service", "s", "/", "email", "s", "/", "notif", "y", "\\u", "caller", "'_", ",_", "context_", ",_", "response", "\\u", "format_", "=_", "'", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "body_", "=_", "strip", "\\u", "tags_", "(_", "html_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "instance_", "._", "queue_", "and_", "instance_", "._", "queue_", "._", "message", "\\u", "stream_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stream_", "=_", "instance_", "._", "queue_", "._", "message", "\\u", "stream_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "stream_", "._", "outgoing", "\\u", "server", "\\u", "name_", ":_", "\\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 ", " ", " _", "caller", "\\u", "email_", "=_", "instance_", "._", "caller_", "._", "get", "\\u", "email_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "caller", "\\u", "email_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "toadd", "r_", "=_", "caller", "\\u", "email_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ssl_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "stream_", "._", "outgoing", "\\u", "server", "\\u", "type_", "==_", "'", "SMT", "P", "-", "SS", "L", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ssl_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "email_", "=_", "Base", "Email_", "(_", "stream_", "._", "outgoing", "\\u", "server", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stream_", "._", "outgoing", "\\u", "server", "\\u", "username_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stream_", "._", "outgoing", "\\u", "password_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stream_", "._", "outgoing", "\\u", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "toadd", "r_", ",_", "subject_", ",_", "body_", ",_", "html_", "=_", "html_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ssl_", "=_", "ssl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "email_", "._", "process", "\\u", "email_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\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_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "create", "\\u", "tick", "et", "\\u", "from", "\\u", "message_", "(_", "sender_", ",_", "instance_", ",_", "created_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "a", " ", "signal", " ", "from", " ", "mess", "agin", "g", ".", "model", "s", "\\", "10", ";", " ", " ", " ", " ", "Check", " ", "if", " ", "(", "new", ")", " ", "message", "'", "s", " ", "stream", " ", "is", " ", "als", "o", " ", "assign", "ed", " ", "to", " ", "Ticke", "t", " ", "Queue", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "a", " ", "new", " ", "tick", "et", " ", "from", " ", "tha", "t", " ", "message", "\\", "10", ";", " ", " ", " ", " ", "Rename", " ", "original", " ", "message", " ", "title", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "created_", "and_", "getattr_", "(_", "instance_", ",_", "'", "auto", "\\u", "notif", "y", "'_", ",_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "instance_", "._", "repl", "y", "\\u", "to_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tickets_", "=_", "instance_", "._", "repl", "y", "\\u", "to_", "._", "tick", "et", "\\u", "set_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ticket_", "in_", "tickets_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "record_", "=_", "Ticke", "t", "Record_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "record_", "._", "sender_", "=_", "instance_", "._", "author_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "record_", "._", "record", "\\u", "type_", "=_", "'", "manu", "al", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "record_", "._", "body_", "=_", "instance_", "._", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "record_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "record_", "._", "about_", "._", "add_", "(_", "ticket_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "._", "set\\u", "last", "\\u", "updated_", "(_", ")_", "\\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 ", " _", "stream_", "=_", "instance_", "._", "stream_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "queues_", "=_", "Ticke", "t", "Queue_", "._", "objects_", "._", "filter_", "(_", "message", "\\u", "stream_", "=_", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "stream_", "and_", "queues_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "queue_", "=_", "queues_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "=_", "Ticket_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "conf_", "=_", "Modul", "e", "Setting_", "._", "get", "\\u", "for", "\\u", "module_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "treei", "o", ".", "service", "s", "'_", ",_", "'", "default", "\\u", "tick", "et", "\\u", "status", "'_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "._", "status_", "=_", "Ticke", "t", "Status_", "._", "objects_", "._", "get_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "pk_", "=_", "long_", "(_", "conf_", "._", "value_", ")_", ")_", "\\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 ", " ", "_", "statuses_", "=_", "Ticke", "t", "Status_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "._", "status_", "=_", "statuses_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ticket_", "._", "queue_", "=_", "queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "._", "caller_", "=_", "instance_", "._", "author_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "._", "details_", "=_", "instance_", "._", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "._", "message_", "=_", "instance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "._", "name_", "=_", "instance_", "._", "title_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "._", "auto", "\\u", "notify_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "stream_", "._", "creator_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ticket_", "._", "set\\u", "user_", "(_", "stream_", "._", "creator_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "queue_", "._", "creator_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ticket_", "._", "set\\u", "user_", "(_", "queue_", "._", "creator_", ")_", "\\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 ", " ", " _", "ticket_", "._", "copy", "\\u", "permissions_", "(_", "queue_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\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_", "#", " ", "Rename", " ", "original", " ", "message", " ", "title_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "instance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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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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'
armbues/ioc_parser/iocp.py
[ { "content": " def load_patterns(self, fpath):\n config = ConfigParser.ConfigParser()\n with open(fpath) as f:\n config.readfp(f)\n\n for ind_type in config.sections():\n try:\n ind_pattern = config.get(ind_type, 'pattern')\n except:\n continue\n\n if ind_pattern:\n ind_regex = re.compile(ind_pattern)\n self.patterns[ind_type] = ind_regex\n\n try:\n ind_defang = config.get(ind_type, 'defang')\n except:\n continue\n\n if ind_defang:\n self.defang[ind_type] = True", "metadata": "root.IOC_Parser.load_patterns", "header": "['class', 'IOC_Parser', '(', 'object', ')', ':', '___EOS___']", "index": 114 } ]
[ { "span": "except:", "start_line": 122, "start_column": 12, "end_line": 122, "end_column": 19 }, { "span": "except:", "start_line": 131, "start_column": 12, "end_line": 131, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "IOC", "\\u", "Parser_", "(_", "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_", "load", "\\u", "patterns_", "(_", "self_", ",_", "fpath_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "config_", "=_", "Config", "Parser_", "._", "Config", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "fpath_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "config_", "._", "readf", "p_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "ind", "\\u", "type_", "in_", "config_", "._", "sections_", "(_", ")_", ":_", "\\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 ", " _", "ind", "\\u", "pattern_", "=_", "config_", "._", "get_", "(_", "ind", "\\u", "type_", ",_", "'", "pattern", "'_", ")_", "\\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 ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ind", "\\u", "pattern_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ind", "\\u", "regex_", "=_", "re_", "._", "compile_", "(_", "ind", "\\u", "pattern_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "patterns_", "[_", "ind", "\\u", "type_", "]_", "=_", "ind", "\\u", "regex_", "\\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 ", " _", "ind", "\\u", "def", "ang_", "=_", "config_", "._", "get_", "(_", "ind", "\\u", "type_", ",_", "'", "def", "ang", "'_", ")_", "\\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 ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ind", "\\u", "def", "ang_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "def", "ang_", "[_", "ind", "\\u", "type_", "]_", "=_", "True_", "\\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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 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
los-cocos/cocos/utest/test_director_scene_changes.py
[ { "content": " def test_2_push_delegates_to_on_push(self):\n scene0 = director.scene\n scene1 = Scene()\n \n # clear the mockup event recorder\n director._utest_recorded_events = []\n \n director.push(scene1)\n\n # ... and check it called on_push with the correct parameters\n evtype, args = director._utest_recorded_events[0]\n assert evtype == \"on_push\"\n assert args == (scene1,)", "metadata": "root.Test_run.test_2_push_delegates_to_on_push", "header": "['class', 'Test_run', '(', 'object', ')', ':', '___EOS___']", "index": 47 } ]
[ { "span": "scene0 ", "start_line": 48, "start_column": 8, "end_line": 48, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "\\u", "run_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "2", "\\u", "push", "\\u", "delegate", "s", "\\u", "to", "\\u", "on", "\\u", "push_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scen", "e0_", "=_", "director_", "._", "scene_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scen", "e1_", "=_", "Scene_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "clear", " ", "the", " ", "mock", "up", " ", "event", " ", "recorder_", "\\u\\u\\uNL\\u\\u\\u_", "director_", "._", "\\u", "ute", "st", "\\u", "recorde", "d\\u", "events_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "director_", "._", "push_", "(_", "scen", "e1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", " ", "and", " ", "check", " ", "it", " ", "call", "ed", " ", "on", "\\u", "push", " ", "with", " ", "the", " ", "correct", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "evt", "ype_", ",_", "args_", "=_", "director_", "._", "\\u", "ute", "st", "\\u", "recorde", "d\\u", "events_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "evt", "ype_", "==_", "\"", "on", "\\u", "push", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "args_", "==_", "(_", "scen", "e1_", ",_", ")_", "\\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, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
rcaloras/bashhub-client/bashhub/bh.py
[ { "content": "#!/usr/bin/python\n\nfrom __future__ import print_function\nimport json\nimport sys\nimport requests\nfrom requests import ConnectionError\nimport cli.app\nimport os\nimport io\n\nfrom model import MinCommand\nfrom bashhub_globals import *\nimport rest_client\nfrom i_search import InteractiveSearch\n\n\n\n\nbh.add_param(\"-n\", \"--number\", help=\"Limit the number of previous commands. \\\n Default is 100.\", default=None, type=int)\n\nbh.add_param(\"query\", nargs='?', help=\"Like string to search for\", \\\n default=\"\", type=str)\n\nbh.add_param(\"-d\", \"--directory\", help=\"Search for commands within this \\\n directory.\", default=False, action='store_true')\n\nbh.add_param(\"-sys\", \"--system\", help=\"Search for commands created on this \\\n system.\", default= False, action='store_true')\n\nbh.add_param(\"-i\", \"--interactive\", help=\"Use interactive search. Allows you \\\n to select commands to run.\", default= False, action='store_true')\n\nbh.add_param(\"-dups\", \"--duplicates\", help=\"Include duplicates\", \\\n default=False, action='store_true')\n\n\nmain()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@cli.app.CommandLineApp\ndef bh(app):\n \"\"\"Parse command line arguments and call our REST API\"\"\"\n limit = app.params.number\n query = app.params.query\n system_name = BH_SYSTEM_NAME if app.params.system else None\n path = os.getcwd() if app.params.directory else None\n\n # By default show unique on the client.\n unique = not app.params.duplicates\n\n # If we're interactive, make sure we have a query\n if app.params.interactive and query == '':\n query = raw_input(\"(bashhub-i-search): \")\n\n # Call our rest api to search for commands\n commands = rest_client.search(\n limit = limit,\n path = path,\n query = query,\n system_name = system_name,\n unique = unique)\n\n if app.params.interactive:\n run_interactive(commands)\n else:\n print_commands(commands)", "metadata": "root.bh", "header": "['module', '___EOS___']", "index": 16 }, { "content": "def print_commands(commands):\n for command in reversed(commands):\n print(command.command)", "metadata": "root.print_commands", "header": "['module', '___EOS___']", "index": 44 }, { "content": "def run_interactive(commands):\n i_search = InteractiveSearch(commands, rest_client)\n i_search.run()\n # numpy bullshit since it doesn't return anything.\n # Consider submitting a patchset for it.\n command = i_search.return_value\n if command is not None:\n f = io.open(BH_HOME + '/response.bh','w+', encoding='utf-8')\n print(unicode(command.command), file=f)", "metadata": "root.run_interactive", "header": "['module', '___EOS___']", "index": 48 }, { "content": "def main():\n try:\n bh.run()\n except Exception as e:\n print(\"Oops, look like an exception occured: \" + str(e))\n sys.exit(1)\n except KeyboardInterrupt:\n # To allow Ctrl+C (^C). Print a new line to drop the prompt.\n print()\n sys.exit()", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 76 } ]
[ { "span": "import json", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 11 }, { "span": "import requests", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 15 }, { "span": "from requests import ConnectionError", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 36 }, { "span": "from model import MinCommand", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "requests_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "requests_", "import_", "Connect", "ion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "cli_", "._", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "io_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "model_", "import_", "Min", "Command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bash", "hub", "\\u", "globals_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "rest", "\\u", "client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "i", "\\u", "search_", "import_", "Interact", "ive", "Search_", "\\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_", "bh_", "._", "add", "\\u", "param_", "(_", "\"-", "n", "\"_", ",_", "\"--", "number", "\"_", ",_", "help_", "=_", "\"", "Limit", " ", "the", " ", "number", " ", "of", " ", "previ", "ous", " ", "command", "s", ".", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "Default", " ", "is", " ", "100", ".\"_", ",_", "default_", "=_", "None_", ",_", "type_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bh_", "._", "add", "\\u", "param_", "(_", "\"", "query", "\"_", ",_", "nargs_", "=_", "'?'_", ",_", "help_", "=_", "\"", "Lik", "e", " ", "string", " ", "to", " ", "search", " ", "for", "\"_", ",_", "default_", "=_", "\"\"_", ",_", "type_", "=_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bh_", "._", "add", "\\u", "param_", "(_", "\"-", "d", "\"_", ",_", "\"--", "director", "y", "\"_", ",_", "help_", "=_", "\"", "Sear", "ch", " ", "for", " ", "command", "s", " ", "within", " ", "this", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "director", "y", ".\"_", ",_", "default_", "=_", "False_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bh_", "._", "add", "\\u", "param_", "(_", "\"-", "sys", "\"_", ",_", "\"--", "system", "\"_", ",_", "help_", "=_", "\"", "Sear", "ch", " ", "for", " ", "command", "s", " ", "created", " ", "on", " ", "this", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "system", ".\"_", ",_", "default_", "=_", "False_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bh_", "._", "add", "\\u", "param_", "(_", "\"-", "i", "\"_", ",_", "\"--", "interactive", "\"_", ",_", "help_", "=_", "\"", "Us", "e", " ", "interactive", " ", "search", ".", " ", "All", "ow", "s", " ", "you", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "select", " ", "command", "s", " ", "to", " ", "run", ".\"_", ",_", "default_", "=_", "False_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bh_", "._", "add", "\\u", "param_", "(_", "\"-", "dup", "s", "\"_", ",_", "\"--", "duplicat", "es", "\"_", ",_", "help_", "=_", "\"", "Include", " ", "duplicat", "es", "\"_", ",_", "default_", "=_", "False_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ")_", "\\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_", "main_", "(_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "cli_", "._", "app_", "._", "Command", "Line", "App_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "bh_", "(_", "app_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Pars", "e", " ", "command", " ", "line", " ", "argu", "ment", "s", " ", "and", " ", "call", " ", "our", " ", "REST", " ", "API", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "limit_", "=_", "app_", "._", "params_", "._", "number_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "=_", "app_", "._", "params_", "._", "query_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system", "\\u", "name_", "=_", "BH", "\\u", "SYSTEM", "\\u", "NAME_", "if_", "app_", "._", "params_", "._", "system_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "os_", "._", "getcwd_", "(_", ")_", "if_", "app_", "._", "params_", "._", "directory_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "By", " ", "default", " ", "show", " ", "unique", " ", "on", " ", "the", " ", "client", "._", "\\u\\u\\uNL\\u\\u\\u_", "unique_", "=_", "not_", "app_", "._", "params_", "._", "duplicates_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", "'", "re", " ", "interactive", ",", " ", "make", " ", "sure", " ", "we", " ", "have", " ", "a", " ", "query_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "app_", "._", "params_", "._", "interactive_", "and_", "query_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "raw", "\\u", "input_", "(_", "\"(", "bash", "hub", "-", "i", "-", "search", "):", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Call", " ", "our", " ", "rest", " ", "api", " ", "to", " ", "search", " ", "for", " ", "commands_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "commands_", "=_", "rest", "\\u", "client_", "._", "search_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "limit_", "=_", "limit_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "query_", "=_", "query_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "system", "\\u", "name_", "=_", "system", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unique_", "=_", "unique_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "app_", "._", "params_", "._", "interactive_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "run", "\\u", "interactive_", "(_", "commands_", ")_", "\\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", "\\u", "commands_", "(_", "commands_", ")_", "\\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_", "print", "\\u", "commands_", "(_", "commands_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "command_", "in_", "reversed_", "(_", "commands_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "command_", "._", "command_", ")_", "\\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_", "run", "\\u", "interactive_", "(_", "commands_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i", "\\u", "search_", "=_", "Interact", "ive", "Search_", "(_", "commands_", ",_", "rest", "\\u", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i", "\\u", "search_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "nump", "y", " ", "bull", "shi", "t", " ", "sinc", "e", " ", "it", " ", "doe", "sn", "'", "t", " ", "return", " ", "anyt", "hing", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Consider", " ", "submit", "ting", " ", "a", " ", "patch", "set", " ", "for", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "command_", "=_", "i", "\\u", "search_", "._", "return", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "command_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "io_", "._", "open_", "(_", "BH", "\\u", "HOME_", "+_", "'/", "response", ".", "bh", "'_", ",_", "'", "w", "+'_", ",_", "encoding_", "=_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "unicode_", "(_", "command_", "._", "command_", ")_", ",_", "file_", "=_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\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 ", " _", "bh_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Oo", "ps", ",", " ", "look", " ", "like", " ", "an", " ", "exception", " ", "occure", "d", ":", " ", "\"_", "+_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "To", " ", "allow", " ", "Ctrl", "+", "C", " ", "(", "^", "C", ").", " ", "Print", " ", "a", " ", "new", " ", "line", " ", "to", " ", "drop", " ", "the", " ", "prompt", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", ")_", "\\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, 0, 1, 2, 2, 2, 2, 0, 1, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 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, 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 ]
Imprecise assert
html5lib/html5lib-python/html5lib/tests/test_parser2.py
[ { "content": " def test_namespace_html_elements_0_dom(self):\n parser = html5parser.HTMLParser(tree=self.dom_tree, namespaceHTMLElements=True)\n doc = parser.parse(\"<html></html>\")\n self.assertTrue(doc.childNodes[0].namespaceURI == namespaces[\"html\"])", "metadata": "root.MoreParserTests.test_namespace_html_elements_0_dom", "header": "['class', 'MoreParserTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 29 }, { "content": " def test_namespace_html_elements_1_dom(self):\n parser = html5parser.HTMLParser(tree=self.dom_tree, namespaceHTMLElements=False)\n doc = parser.parse(\"<html></html>\")\n self.assertTrue(doc.childNodes[0].namespaceURI is None)", "metadata": "root.MoreParserTests.test_namespace_html_elements_1_dom", "header": "['class', 'MoreParserTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 34 }, { "content": " def test_namespace_html_elements_0_etree(self):\n parser = html5parser.HTMLParser(namespaceHTMLElements=True)\n doc = parser.parse(\"<html></html>\")\n self.assertTrue(doc.tag == \"{%s}html\" % (namespaces[\"html\"],))", "metadata": "root.MoreParserTests.test_namespace_html_elements_0_etree", "header": "['class', 'MoreParserTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 39 }, { "content": " def test_namespace_html_elements_1_etree(self):\n parser = html5parser.HTMLParser(namespaceHTMLElements=False)\n doc = parser.parse(\"<html></html>\")\n self.assertTrue(doc.tag == \"html\")", "metadata": "root.MoreParserTests.test_namespace_html_elements_1_etree", "header": "['class', 'MoreParserTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 44 } ]
[ { "span": "self.assertTrue(doc.childNodes[0].namespaceURI == namespaces[\"html\"])", "start_line": 32, "start_column": 8, "end_line": 32, "end_column": 77 }, { "span": "self.assertTrue(doc.childNodes[0].namespaceURI is None)", "start_line": 37, "start_column": 8, "end_line": 37, "end_column": 63 }, { "span": "self.assertTrue(doc.tag == \"{%s}html\" % (namespaces[\"html\"],))", "start_line": 42, "start_column": 8, "end_line": 42, "end_column": 70 }, { "span": "self.assertTrue(doc.tag == \"html\")", "start_line": 47, "start_column": 8, "end_line": 47, "end_column": 42 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Mor", "e", "Parser", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "namespace", "\\u", "html", "\\u", "element", "s", "\\u", "0", "\\u", "dom_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "=_", "html", "5", "parser_", "._", "HTM", "LP", "arser", "_", "(_", "tree_", "=_", "self_", "._", "dom", "\\u", "tree_", ",_", "namespace", "HTM", "LE", "lement", "s_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "=_", "parser_", "._", "parse_", "(_", "\"<", "html", "><", "/", "html", ">\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "doc_", "._", "child", "Nodes_", "[_", "0_", "]_", "._", "namespace", "URI_", "==_", "namespaces_", "[_", "\"", "html", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mor", "e", "Parser", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "namespace", "\\u", "html", "\\u", "element", "s", "\\u", "1", "\\u", "dom_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "=_", "html", "5", "parser_", "._", "HTM", "LP", "arser", "_", "(_", "tree_", "=_", "self_", "._", "dom", "\\u", "tree_", ",_", "namespace", "HTM", "LE", "lement", "s_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "=_", "parser_", "._", "parse_", "(_", "\"<", "html", "><", "/", "html", ">\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "doc_", "._", "child", "Nodes_", "[_", "0_", "]_", "._", "namespace", "URI_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mor", "e", "Parser", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "namespace", "\\u", "html", "\\u", "element", "s", "\\u", "0", "\\u", "etree_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "=_", "html", "5", "parser_", "._", "HTM", "LP", "arser", "_", "(_", "namespace", "HTM", "LE", "lement", "s_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "=_", "parser_", "._", "parse_", "(_", "\"<", "html", "><", "/", "html", ">\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "doc_", "._", "tag_", "==_", "\"{", "%", "s", "}", "html", "\"_", "%_", "(_", "namespaces_", "[_", "\"", "html", "\"_", "]_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mor", "e", "Parser", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "namespace", "\\u", "html", "\\u", "element", "s", "\\u", "1", "\\u", "etree_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "=_", "html", "5", "parser_", "._", "HTM", "LP", "arser", "_", "(_", "namespace", "HTM", "LE", "lement", "s_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "=_", "parser_", "._", "parse_", "(_", "\"<", "html", "><", "/", "html", ">\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "doc_", "._", "tag_", "==_", "\"", "html", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused local variable
AppScale/appscale/AppServer/lib/webob_0_9/webob/exc.py
[ { "content": " def _make_body(self, environ, escape):\n args = {\n 'explanation': escape(self.explanation),\n 'detail': escape(self.detail or ''),\n 'comment': escape(self.comment or ''),\n }\n if self.comment:\n args['html_comment'] = '<!-- %s -->' % escape(self.comment)\n else:\n args['html_comment'] = ''\n body_tmpl = self.body_template_obj\n if WSGIHTTPException.body_template_obj is not self.body_template_obj:\n # Custom template; add headers to args\n for k, v in environ.items():\n args[k] = escape(v)\n for k, v in self.headers.items():\n args[k.lower()] = escape(v)\n t_obj = self.body_template_obj\n return t_obj.substitute(args)", "metadata": "root.WSGIHTTPException._make_body", "header": "['class', 'WSGIHTTPException', '(', 'Response', ',', 'HTTPException', ')', ':', '___NEWLINE___', '___NL___', '## You should set in subclasses:', '___NL___', '# code = 200', '___NL___', \"# title = 'OK'\", '___NL___', \"# explanation = 'why this happens'\", '___NL___', \"# body_template_obj = Template('response template')\", '___NL___', '___EOS___']", "index": 189 } ]
[ { "span": "body_tmpl ", "start_line": 199, "start_column": 8, "end_line": 199, "end_column": 17 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "WS", "GI", "HTTP", "Exception_", "(_", "Response_", ",_", "HTTP", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "You", " ", "shou", "ld", " ", "set", " ", "in", " ", "subclasses", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "code", " ", "=", " ", "200_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "title", " ", "=", " ", "'", "OK", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "expl", "anat", "ion", " ", "=", " ", "'", "wh", "y", " ", "this", " ", "happ", "ens", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "body", "\\u", "template", "\\u", "obj", " ", "=", " ", "Templa", "te", "('", "response", " ", "template", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "make", "\\u", "body_", "(_", "self_", ",_", "environ_", ",_", "escape_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "expl", "anat", "ion", "'_", ":_", "escape_", "(_", "self_", "._", "explanation_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deta", "il", "'_", ":_", "escape_", "(_", "self_", "._", "detail_", "or_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "comment", "'_", ":_", "escape_", "(_", "self_", "._", "comment_", "or_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "comment_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "[_", "'", "html", "\\u", "comment", "'_", "]_", "=_", "'<!", "--", " ", "%", "s", " ", "-->", "'_", "%_", "escape_", "(_", "self_", "._", "comment_", ")_", "\\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_", "[_", "'", "html", "\\u", "comment", "'_", "]_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "body", "\\u", "tmpl_", "=_", "self_", "._", "body", "\\u", "template", "\\u", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "WS", "GI", "HTTP", "Exception_", "._", "body", "\\u", "template", "\\u", "obj_", "is_", "not_", "self_", "._", "body", "\\u", "template", "\\u", "obj_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Custom", " ", "template", ";", " ", "add", " ", "header", "s", " ", "to", " ", "args_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "k_", ",_", "v_", "in_", "environ_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "[_", "k_", "]_", "=_", "escape_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "self_", "._", "headers_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "[_", "k_", "._", "lower_", "(_", ")_", "]_", "=_", "escape_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "t", "\\u", "obj_", "=_", "self_", "._", "body", "\\u", "template", "\\u", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "t", "\\u", "obj_", "._", "substitute_", "(_", "args_", ")_", "\\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, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
coleifer/peewee/playhouse/tests/test_keys.py
[ { "content": " def test_multiple_fks(self):\n a = User.create(username='a')\n b = User.create(username='b')\n c = User.create(username='c')\n\n self.assertEqual(list(a.relationships), [])\n self.assertEqual(list(a.related_to), [])\n\n r_ab = Relationship.create(from_user=a, to_user=b)\n self.assertEqual(list(a.relationships), [r_ab])\n self.assertEqual(list(a.related_to), [])\n self.assertEqual(list(b.relationships), [])\n self.assertEqual(list(b.related_to), [r_ab])\n\n r_bc = Relationship.create(from_user=b, to_user=c)\n\n following = User.select().join(\n Relationship, on=Relationship.to_user\n ).where(Relationship.from_user == a)\n self.assertEqual(list(following), [b])\n\n followers = User.select().join(\n Relationship, on=Relationship.from_user\n ).where(Relationship.to_user == a.id)\n self.assertEqual(list(followers), [])\n\n following = User.select().join(\n Relationship, on=Relationship.to_user\n ).where(Relationship.from_user == b.id)\n self.assertEqual(list(following), [c])\n\n followers = User.select().join(\n Relationship, on=Relationship.from_user\n ).where(Relationship.to_user == b.id)\n self.assertEqual(list(followers), [a])\n\n following = User.select().join(\n Relationship, on=Relationship.to_user\n ).where(Relationship.from_user == c.id)\n self.assertEqual(list(following), [])\n\n followers = User.select().join(\n Relationship, on=Relationship.from_user\n ).where(Relationship.to_user == c.id)\n self.assertEqual(list(followers), [b])", "metadata": "root.TestMultipleForeignKeysJoining.test_multiple_fks", "header": "['class', 'TestMultipleForeignKeysJoining', '(', 'ModelTestCase', ')', ':', '___EOS___']", "index": 119 }, { "content": " def test_delete_instance(self):\n u1, u2 = [User.create(username='u%s' % i) for i in range(2)]\n ut1 = UserThing.create(thing='t1', user=u1)\n ut2 = UserThing.create(thing='t2', user=u1)\n ut3 = UserThing.create(thing='t1', user=u2)\n ut4 = UserThing.create(thing='t3', user=u2)\n\n res = ut1.delete_instance()\n self.assertEqual(res, 1)\n self.assertEqual(\n [x.thing for x in UserThing.select().order_by(UserThing.thing)],\n ['t1', 't2', 't3'])", "metadata": "root.TestCompositePrimaryKey.test_delete_instance", "header": "['class', 'TestCompositePrimaryKey', '(', 'ModelTestCase', ')', ':', '___EOS___']", "index": 278 }, { "content": " def test_constraint_creation(self):\n class FKC_a(TestModel):\n name = CharField()\n\n fkc_deferred = DeferredRelation()\n\n class FKC_b(TestModel):\n fkc_a = ForeignKeyField(fkc_deferred)\n\n fkc_deferred.set_model(FKC_a)\n\n with test_db.transaction() as txn:\n FKC_b.drop_table(True)\n FKC_a.drop_table(True)\n FKC_a.create_table()\n FKC_b.create_table()\n\n # Foreign key constraint is not enforced.\n fb = FKC_b.create(fkc_a=-1000)\n fb.delete_instance()\n\n # Add constraint.\n test_db.create_foreign_key(FKC_b, FKC_b.fkc_a)\n\n def _trigger_exc():\n with test_db.savepoint() as s1:\n fb = FKC_b.create(fkc_a=-1000)\n\n self.assertRaises(IntegrityError, _trigger_exc)\n\n fa = FKC_a.create(name='fa')\n fb = FKC_b.create(fkc_a=fa)\n txn.rollback()", "metadata": "root.TestForeignKeyConstraints.test_constraint_creation", "header": "['class', 'TestForeignKeyConstraints', '(', 'ModelTestCase', ')', ':', '___EOS___']", "index": 423 } ]
[ { "span": "r_bc ", "start_line": 133, "start_column": 8, "end_line": 133, "end_column": 12 }, { "span": "ut2 ", "start_line": 281, "start_column": 8, "end_line": 281, "end_column": 11 }, { "span": "ut3 ", "start_line": 282, "start_column": 8, "end_line": 282, "end_column": 11 }, { "span": "ut4 ", "start_line": 283, "start_column": 8, "end_line": 283, "end_column": 11 }, { "span": "fb ", "start_line": 449, "start_column": 20, "end_line": 449, "end_column": 22 }, { "span": "fb ", "start_line": 454, "start_column": 12, "end_line": 454, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Multipl", "e", "Fore", "ign", "Keys", "Join", "ing_", "(_", "Model", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "multiple", "\\u", "fk", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "User_", "._", "create_", "(_", "username_", "=_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "User_", "._", "create_", "(_", "username_", "=_", "'", "b", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "User_", "._", "create_", "(_", "username_", "=_", "'", "c", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "a_", "._", "relationships_", ")_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "a_", "._", "relate", "d\\u", "to_", ")_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r", "\\u", "ab_", "=_", "Relationship", "_", "._", "create_", "(_", "from", "\\u", "user_", "=_", "a_", ",_", "to", "\\u", "user_", "=_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "a_", "._", "relationships_", ")_", ",_", "[_", "r", "\\u", "ab_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "a_", "._", "relate", "d\\u", "to_", ")_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "b_", "._", "relationships_", ")_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "b_", "._", "relate", "d\\u", "to_", ")_", ",_", "[_", "r", "\\u", "ab_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r", "\\u", "bc_", "=_", "Relationship", "_", "._", "create_", "(_", "from", "\\u", "user_", "=_", "b_", ",_", "to", "\\u", "user_", "=_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "following_", "=_", "User_", "._", "select_", "(_", ")_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Relationship", "_", ",_", "on_", "=_", "Relationship", "_", "._", "to", "\\u", "user_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "where_", "(_", "Relationship", "_", "._", "from", "\\u", "user_", "==_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "following_", ")_", ",_", "[_", "b_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "followers", "_", "=_", "User_", "._", "select_", "(_", ")_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Relationship", "_", ",_", "on_", "=_", "Relationship", "_", "._", "from", "\\u", "user_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "where_", "(_", "Relationship", "_", "._", "to", "\\u", "user_", "==_", "a_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "followers", "_", ")_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "following_", "=_", "User_", "._", "select_", "(_", ")_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Relationship", "_", ",_", "on_", "=_", "Relationship", "_", "._", "to", "\\u", "user_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "where_", "(_", "Relationship", "_", "._", "from", "\\u", "user_", "==_", "b_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "following_", ")_", ",_", "[_", "c_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "followers", "_", "=_", "User_", "._", "select_", "(_", ")_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Relationship", "_", ",_", "on_", "=_", "Relationship", "_", "._", "from", "\\u", "user_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "where_", "(_", "Relationship", "_", "._", "to", "\\u", "user_", "==_", "b_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "followers", "_", ")_", ",_", "[_", "a_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "following_", "=_", "User_", "._", "select_", "(_", ")_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Relationship", "_", ",_", "on_", "=_", "Relationship", "_", "._", "to", "\\u", "user_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "where_", "(_", "Relationship", "_", "._", "from", "\\u", "user_", "==_", "c_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "following_", ")_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "followers", "_", "=_", "User_", "._", "select_", "(_", ")_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Relationship", "_", ",_", "on_", "=_", "Relationship", "_", "._", "from", "\\u", "user_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "where_", "(_", "Relationship", "_", "._", "to", "\\u", "user_", "==_", "c_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "followers", "_", ")_", ",_", "[_", "b_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Composit", "e", "Prim", "ary", "Key_", "(_", "Model", "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", "instance_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "u1_", ",_", "u2_", "=_", "[_", "User_", "._", "create_", "(_", "username_", "=_", "'", "u", "%", "s", "'_", "%_", "i_", ")_", "for_", "i_", "in_", "range_", "(_", "2_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ut", "1_", "=_", "User", "Thing_", "._", "create_", "(_", "thing_", "=_", "'", "t1", "'_", ",_", "user_", "=_", "u1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ut", "2_", "=_", "User", "Thing_", "._", "create_", "(_", "thing_", "=_", "'", "t2", "'_", ",_", "user_", "=_", "u1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ut", "3_", "=_", "User", "Thing_", "._", "create_", "(_", "thing_", "=_", "'", "t1", "'_", ",_", "user_", "=_", "u2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ut", "4_", "=_", "User", "Thing_", "._", "create_", "(_", "thing_", "=_", "'", "t3", "'_", ",_", "user_", "=_", "u2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "ut", "1_", "._", "delete", "\\u", "instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "res_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "x_", "._", "thing_", "for_", "x_", "in_", "User", "Thing_", "._", "select_", "(_", ")_", "._", "order", "\\u", "by_", "(_", "User", "Thing_", "._", "thing_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "t1", "'_", ",_", "'", "t2", "'_", ",_", "'", "t3", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fore", "ign", "Key", "Constraints_", "(_", "Model", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "constraint", "\\u", "creation_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "FK", "C", "\\u", "a_", "(_", "Test", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "Char", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fk", "c\\u", "deferred_", "=_", "Defe", "rre", "d", "Relation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "FK", "C", "\\u", "b_", "(_", "Test", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fk", "c\\u", "a_", "=_", "Fore", "ign", "Key", "Field_", "(_", "fk", "c\\u", "deferred_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fk", "c\\u", "deferred_", "._", "set\\u", "model_", "(_", "FK", "C", "\\u", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "test\\u", "db_", "._", "transaction_", "(_", ")_", "as_", "txn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "FK", "C", "\\u", "b_", "._", "drop", "\\u", "table_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FK", "C", "\\u", "a_", "._", "drop", "\\u", "table_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FK", "C", "\\u", "a_", "._", "create", "\\u", "table_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FK", "C", "\\u", "b_", "._", "create", "\\u", "table_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fore", "ign", " ", "key", " ", "constraint", " ", "is", " ", "not", " ", "enforce", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "fb_", "=_", "FK", "C", "\\u", "b_", "._", "create_", "(_", "fk", "c\\u", "a_", "=_", "-_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fb_", "._", "delete", "\\u", "instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "constraint", "._", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "db_", "._", "create", "\\u", "foreign", "\\u", "key_", "(_", "FK", "C", "\\u", "b_", ",_", "FK", "C", "\\u", "b_", "._", "fk", "c\\u", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "trigger", "\\u", "exc_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "test\\u", "db_", "._", "savep", "oint_", "(_", ")_", "as_", "s1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "fb_", "=_", "FK", "C", "\\u", "b_", "._", "create_", "(_", "fk", "c\\u", "a_", "=_", "-_", "1000_", ")_", "\\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_", "._", "assert", "Raises_", "(_", "Int", "egr", "it", "y", "Error_", ",_", "\\u", "trigger", "\\u", "exc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fa_", "=_", "FK", "C", "\\u", "a_", "._", "create_", "(_", "name_", "=_", "'", "fa", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fb_", "=_", "FK", "C", "\\u", "b_", "._", "create_", "(_", "fk", "c\\u", "a_", "=_", "fa_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txn_", "._", "rollback_", "(_", ")_" ]
[ 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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
flags/Reactor-3/reactor-3.py
[ { "content": "\"\"\"Reactor 3\"\"\"\n\nimport logging\n\nlogger = logging.getLogger()\nlogger.setLevel(logging.DEBUG)\nconsole_formatter = logging.Formatter('[%(asctime)s-%(levelname)s] %(message)s',datefmt='%H:%M:%S %m/%d/%y')\nch = logging.StreamHandler()\nch.setFormatter(console_formatter)\nlogger.addHandler(ch)\n\nfrom globals import *\nfrom inputs import *\nfrom player import *\n\nimport libtcodpy as tcod\nimport render_fast_los\nimport render_map\n\nimport graphics as gfx\nimport traceback\nimport cProfile\nimport maputils\nimport worldgen\nimport mainmenu\nimport language\nimport profiles\nimport missions\nimport threads\nimport network\nimport drawing\nimport weapons\nimport effects\nimport numbers\nimport dialog\nimport random\nimport numpy\nimport tiles\nimport menus\nimport logic\nimport locks\nimport items\nimport life\nimport time\nimport maps\nimport fov\nimport smp\nimport sys\n\nCYTHON_ENABLED = True\n\n\n\n\n\n\n\nif __name__ == '__main__':\n\tprofiles.version_check()\n\t\n\t#TODO: Replace with \"module_sanity_check\"\n\t#Optional Cython-compiled modules\n\ttry:\n\t\timport render_map\n\t\timport render_los\n\t\t\n\t\tif render_map.VERSION == MAP_RENDER_VERSION:\n\t\t\tCYTHON_ENABLED = True\n\t\telse:\n\t\t\tlogging.error('[Cython] render_map is out of date!')\n\t\t\tlogging.error('[Cython] Run \\'python compile_cython_modules.py build_ext --inplace\\'')\n\t\t\tsys.exit(1)\n\t\t\n\texcept ImportError, e:\n\t\tCYTHON_ENABLED = False\n\t\tlogging.warning('[Cython] ImportError with module: %s' % e)\n\t\tlogging.warning('[Cython] Certain functions can run faster if compiled with Cython.')\n\t\tlogging.warning('[Cython] Run \\'python compile_cython_modules.py build_ext --inplace\\'')\n\t\n\tlogging.info(WINDOW_TITLE)\n\tgfx.log(WINDOW_TITLE)\n\t\n\tif os.path.exists('git-version.txt'):\n\t\twith open('git-version.txt', 'r') as ver:\n\t\t\tlogging.info('Build %s' % ver.readline().strip())\n\t\n\tlogging.debug('Renderer: %s' % tcod.sys_get_renderer())\n\t\n\ttiles.create_all_tiles()\n\tlanguage.load_strings()\n\tmissions.load_all_missions()\n\talife.rawparse.create_function_map()\n\tlocks.create_lock('camera_free', locked=True)\n\t\n\tgfx.init_libtcod()\n\tthreads.init()\n\t#smp.init()\n\n\tSETTINGS['draw z-levels below'] = True\n\tSETTINGS['draw z-levels above'] = True\n\t\n\tlife.initiate_life('human')\n\tlife.initiate_life('dog')\n\tlife.initiate_life('night_terror')\n\t\n\titems.initiate_all_items()\n\t\n\tSETTINGS['running'] = 3\n\t\n\tif '--menu' in sys.argv:\n\t\tSETTINGS['running'] = 1\n\telif '--quick' in sys.argv:\n\t\tfor world in profiles.get_worlds():\n\t\t\tworldgen.load_world(world)\n\t\t\tbreak\n\t\t\n\t\tif SETTINGS['controlling']:\n\t\t\tSETTINGS['running'] = 2\n\t\t\tgfx.prepare_map_views()\n\t\telse:\n\t\t\tlogging.debug('No active player found. Going back to menu.')\n\t\t\tSETTINGS['running'] = 1\n\t\n\tif '--debug' in sys.argv:\n\t\t_debug_host = network.DebugHost()\n\t\t_debug_host.start()\n\t\tWORLD_INFO['debug'] = _debug_host\n\t\n\tif '--profile' in sys.argv:\n\t\tlogging.info('Profiling. Exit when completed.')\n\t\tcProfile.run('loop()','profile.dat')\n\t\tsys.exit()\n\t\n\ttry:\n\t\tloop()\n\texcept KeyboardInterrupt:\n\t\tSETTINGS['running'] = False\n\texcept Exception, e:\n\t\ttraceback.print_exc(file=sys.stdout)\n\t\tSETTINGS['running'] = False\n\t\t\n\t\tif 'debug' in WORLD_INFO:\n\t\t\tWORLD_INFO['debug'].quit()\n\t\n\tif 'debug' in WORLD_INFO:\n\t\tWORLD_INFO['debug'].quit()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def move_camera(pos, scroll=False):\n\t_orig_pos = CAMERA_POS[:]\n\t\n\tif SETTINGS['controlling'] and SETTINGS['following'] == SETTINGS['controlling'] and locks.is_locked('camera_free'):\n\t\t_life = LIFE[SETTINGS['controlling']]\n\t\t_top_left = MAP_SIZE[:]\n\t\t_bot_right = [0, 0, 0]\n\t\t_seen = False\n\t\t\n\t\tfor life_id in LIFE[SETTINGS['controlling']]['seen']:\n\t\t\tif LIFE[life_id]['dead']:\n\t\t\t\tcontinue\n\t\t\t\n\t\t\tif brain.knows_alife_by_id(LIFE[SETTINGS['controlling']], life_id)['alignment'] in ['trust', 'feign_trust']:\n\t\t\t\tcontinue\n\t\t\t\n\t\t\t_seen = True\n\t\t\t\n\t\t\tif LIFE[life_id]['pos'][0] < _top_left[0]:\n\t\t\t\t_top_left[0] = LIFE[life_id]['pos'][0]\n\t\t\t\n\t\t\tif LIFE[life_id]['pos'][1] < _top_left[1]:\n\t\t\t\t_top_left[1] = LIFE[life_id]['pos'][1]\n\t\t\t\n\t\t\tif LIFE[life_id]['pos'][0] > _bot_right[0]:\n\t\t\t\t_bot_right[0] = LIFE[life_id]['pos'][0]\n\t\t\t\n\t\t\tif LIFE[life_id]['pos'][1] > _bot_right[1]:\n\t\t\t\t_bot_right[1] = LIFE[life_id]['pos'][1]\n\t\t\t\n\t\t\t_target_pos = numbers.lerp_velocity(_top_left, _bot_right, 0.5)\n\t\t\tpos = numbers.lerp_velocity(pos, _target_pos, .35)[:2]\n\t\t\tpos.append(2)\n\t\t\t\n\t\t\tbrain.flag(_life, 'camera_lean', value=_target_pos[:])\n\t\t\tbrain.flag(_life, 'camera_lean_time', value=WORLD_INFO['ticks'])\n\t\t\t\n\t\t\t_future_time = brain.get_flag(_life, 'camera_lean_time_future')\n\t\t\tif not _future_time or WORLD_INFO['ticks']>_future_time:\n\t\t\t\tbrain.flag(_life, 'camera_lean_time_future', value=WORLD_INFO['ticks']+30)\n\t\t\n\t\tif brain.get_flag(_life, 'camera_lean'):\n\t\t\tif _seen:\n\t\t\t\t_st = WORLD_INFO['ticks']-(brain.get_flag(_life, 'camera_lean_time_future')-30)\n\t\t\t\t_et = brain.get_flag(_life, 'camera_lean_time_future')-(brain.get_flag(_life, 'camera_lean_time_future')-30)\n\t\t\t\t_lerp = 1-numbers.clip(_st/float(_et), 0, 1.0)\n\t\t\t\t\n\t\t\t\tpos = numbers.lerp_velocity(pos, brain.get_flag(_life, 'camera_lean'), _lerp)[:2]\n\t\t\t\tpos.append(2)\n\t\t\telse:\n\t\t\t\tif WORLD_INFO['ticks']-brain.get_flag(_life, 'camera_lean_time')<=20:\n\t\t\t\t\t_lerp = .45-numbers.clip((WORLD_INFO['ticks']-brain.get_flag(_life, 'camera_lean_time'))/30.0, 0, .45)\n\t\t\t\t\tpos = numbers.lerp_velocity(pos, brain.get_flag(_life, 'camera_lean'), _lerp)[:2]\n\t\t\t\t\tpos.append(2)\n\t\t\t\telse:\n\t\t\t\t\tbrain.unflag(_life, 'camera_lean')\n\t\t\t\t\tbrain.unflag(_life, 'camera_lean_time')\n\t\n\tCAMERA_POS[0] = int(round(numbers.clip(pos[0]-(MAP_WINDOW_SIZE[0]/2), 0, MAP_SIZE[0]-MAP_WINDOW_SIZE[0])))\n\tCAMERA_POS[1] = int(round(numbers.clip(pos[1]-(MAP_WINDOW_SIZE[1]/2), 0, MAP_SIZE[1]-MAP_WINDOW_SIZE[1])))\n\tCAMERA_POS[2] = int(round(pos[2]))\n\t\n\tif not _orig_pos == CAMERA_POS:\n\t\tgfx.refresh_view('map')\n\telif SETTINGS['controlling'] and not alife.brain.get_flag(LIFE[SETTINGS['controlling']], 'redraw') == pos:\n\t\tgfx.refresh_view('map')\n\t\n\tif SETTINGS['controlling']:\n\t\talife.brain.flag(LIFE[SETTINGS['controlling']], 'redraw', value=pos[:])", "metadata": "root.move_camera", "header": "['module', '___EOS___']", "index": 52 }, { "content": "def draw_targeting():\n\tif SETTINGS['following'] and not SETTINGS['controlling'] == SETTINGS['following'] and LIFE[SETTINGS['following']]['path']:\n\t\tSELECTED_TILES[0] = [(p[0], p[1], 2) for p in LIFE[SETTINGS['following']]['path']]\n\t\n\tif LIFE[SETTINGS['controlling']] and LIFE[SETTINGS['controlling']]['targeting']:\n\t\t\n\t\tSELECTED_TILES[0] = []\n\t\tfor pos in drawing.diag_line(LIFE[SETTINGS['controlling']]['pos'],LIFE[SETTINGS['controlling']]['targeting']):\n\t\t\tSELECTED_TILES[0].append((pos[0],pos[1],LIFE[SETTINGS['controlling']]['pos'][2]))", "metadata": "root.draw_targeting", "header": "['module', '___EOS___']", "index": 122 }, { "content": "def death():\n\t_player = LIFE[SETTINGS['controlling']]\n\t\n\tmaps.reset_lights()\n\tFADE_TO_WHITE[0] += .5\n\t\n\t_time_since_death = FADE_TO_WHITE[0]\n\t_time_alive = round(numbers.clip((_player['time_of_death']-_player['created'])/float(WORLD_INFO['length_of_day']), 0.1, 9999), 2)\n\t_string = 'You die.'\n\t_sub_string = _player['cause_of_death']\n\t_col = int(round(255*numbers.clip((_time_since_death/100.0)-random.uniform(0, 0.15), 0, 1)))\n\t\n\t\n\tif _time_alive == 1:\n\t\t_sub_sub_string = 'Lived 1 day'\n\telse:\n\t\tif _time_alive < 1:\n\t\t\t_sub_sub_string = 'Lived less than a day'\n\t\telse:\n\t\t\t_sub_sub_string = 'Lived %0.1f days' % (_time_alive)\n\t\n\tgfx.fade_to_black(1)\t\n\t\n\tgfx.blit_string((MAP_WINDOW_SIZE[0]/2)-len(_string)/2,\n\t MAP_WINDOW_SIZE[1]/2,\n\t _string,\n\t 'map',\n\t fore_color=tcod.Color(_col, 0, 0),\n\t back_color=tcod.Color(0, 0, 0))\n\t\n\tgfx.blit_string((MAP_WINDOW_SIZE[0]/2)-len(_sub_string)/2,\n\t (MAP_WINDOW_SIZE[1]/2)+2,\n\t _sub_string,\n\t 'map',\n\t fore_color=tcod.Color(int(round(_col*.75)), int(round(_col*.75)), int(round(_col*.75))),\n\t back_color=tcod.Color(0, 0, 0))\n\t\n\tgfx.blit_string((MAP_WINDOW_SIZE[0]/2)-len(_sub_sub_string)/2,\n\t (MAP_WINDOW_SIZE[1]/2)+4,\n\t _sub_sub_string,\n\t 'map',\n\t fore_color=tcod.Color(int(round(_col*.75)), int(round(_col*.75)), int(round(_col*.75))),\n\t back_color=tcod.Color(0, 0, 0))\n\t\n\tif _time_since_death>=350:\n\t\tworldgen.save_world()\n\t\tworldgen.reset_world()\n\n\t\tgfx.clear_scene()\n\t\t\n\t\tSETTINGS['running'] = 1\n\t\treturn False\n\t\n\treturn True", "metadata": "root.death", "header": "['module', '___EOS___']", "index": 132 }, { "content": "def main():\n\t_player_moved = False\n\t_refresh_map = False\n\t\n\tget_input()\n\thandle_input()\n\t\n\tif not LIFE[SETTINGS['controlling']]['dead']:\n\t\tif LIFE[SETTINGS['controlling']]['asleep']:\n\t\t\tgfx.fade_to_black(255)\n\t\t\tgfx.start_of_frame()\n\t\t\tgfx.end_of_frame()\n\t\n\t\twhile LIFE[SETTINGS['controlling']]['asleep']:\n\t\t\t_played_moved = True\n\t\t\t_refresh_map = True\n\n\t\t\tgfx.title(LIFE[SETTINGS['controlling']]['asleep_reason'])\n\t\t\tlogic.tick_all_objects(ignore_tickrate=True, ignore_pause=True)\n\t\t\t\n\t\t\tif LIFE[SETTINGS['controlling']]['dead']:\n\t\t\t\tbreak\n\telse:\n\t\t_player_moved = True\n\t\n\tif _refresh_map:\n\t\tgfx.refresh_view('map')\n\t\n\tif not _player_moved:\n\t\tif logic.tick_all_objects(ignore_tickrate=True):\n\t\t\t_player_moved = True\n\t\n\tdraw_targeting()\n\tmove_camera(SETTINGS['camera_track'])\n\t\n\t#TODO: Deselect so we can get rid of this call\n\tif SELECTED_TILES[0]:\n\t\tgfx.refresh_view('map')\n\t\n\tif not SETTINGS['last_camera_pos'] == SETTINGS['camera_track'][:]:\n\t\tif EVENTS or MENUS:\n\t\t\t_visible_chunks = sight.scan_surroundings(LIFE[SETTINGS['following']], judge=False, get_chunks=True)\n\t\t\talife.brain.flag(LIFE[SETTINGS['following']], 'visible_chunks', value=_visible_chunks)\n\t\n\t\t\t_cam_x = numbers.clip(LIFE[SETTINGS['following']]['pos'][0]-MAP_WINDOW_SIZE[0]/2, 0, MAP_SIZE[0]-MAP_WINDOW_SIZE[0]/2)\n\t\t\t_cam_y = numbers.clip(LIFE[SETTINGS['following']]['pos'][1]-MAP_WINDOW_SIZE[1]/2, 0, MAP_SIZE[1]-MAP_WINDOW_SIZE[1]/2)\n\t\t\t\n\t\telse:\n\t\t\t_visible_chunks = sight.scan_surroundings(LIFE[SETTINGS['controlling']], judge=False, get_chunks=True)\n\t\t\talife.brain.flag(LIFE[SETTINGS['controlling']], 'visible_chunks', value=_visible_chunks)\n\t\t\t\n\t\tSETTINGS['last_camera_pos'] = SETTINGS['camera_track'][:]\n\t\n\t_cam_x = numbers.clip(LIFE[SETTINGS['controlling']]['pos'][0]-MAP_WINDOW_SIZE[0]/2, 0, MAP_SIZE[0]-MAP_WINDOW_SIZE[0]/2)\n\t_cam_y = numbers.clip(LIFE[SETTINGS['controlling']]['pos'][1]-MAP_WINDOW_SIZE[1]/2, 0, MAP_SIZE[1]-MAP_WINDOW_SIZE[1]/2)\n\t\n\tmaps.render_lights()\n\t\n\tif '--worldmap' in sys.argv:\n\t\trender_map.render_map(WORLD_INFO['map'], force_camera_pos=(_cam_x, _cam_y, 2))\n\telse:\n\t\trender_map.render_map(WORLD_INFO['map'], los=LIFE[SETTINGS['controlling']]['fov'], force_camera_pos=(_cam_x, _cam_y, 2))\n\t\n\titems.draw_items()\n\tlife.draw_life()\n\t\n\tif LIFE[SETTINGS['controlling']]['dead'] and not EVENTS:\n\t\tif not death():\n\t\t\treturn False\n\t\n\tif SETTINGS['draw life info'] and SETTINGS['following']:\n\t\tlife.draw_life_info()\n\t\n\tgfx.draw_message_box()\n\t\n\tmenus.align_menus()\n\tmenus.draw_menus()\n\t\n\tgfx.draw_status_line()\n\tgfx.draw_console()\n\tgfx.start_of_frame()\n\tgfx.end_of_frame()\n\t\n\tif '--fps' in sys.argv:\n\t\tprint tcod.sys_get_fps()\n\t\n\tif (SETTINGS['recording'] and _player_moved and not EVENTS and not MENUS) or '--worldmap' in sys.argv:\n\t\tgfx.screenshot()\n\t\t\n\t\tif '--worldmap' in sys.argv:\n\t\t\tSETTINGS['running'] = False", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 187 }, { "content": "def loop():\n\twhile SETTINGS['running']:\n\t\tif SETTINGS['running'] == 1:\n\t\t\tif not MENUS:\n\t\t\t\tmainmenu.switch_to_main_menu()\n\t\t\n\t\t\tget_input()\n\t\t\thandle_input()\n\t\t\tmainmenu.draw_main_menu()\n\t\telif SETTINGS['running'] == 2:\n\t\t\tmain()\n\t\telif SETTINGS['running'] == 3:\n\t\t\tmainmenu.draw_intro()\n\t\n\tworldgen.cleanup()", "metadata": "root.loop", "header": "['module', '___EOS___']", "index": 279 } ]
[ { "span": "import render_fast_los", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 22 }, { "span": "import maputils", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 15 }, { "span": "import weapons", "start_line": 31, "start_column": 0, "end_line": 31, "end_column": 14 }, { "span": "import effects", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 14 }, { "span": "import dialog", "start_line": 34, "start_column": 0, "end_line": 34, "end_column": 13 }, { "span": "import numpy", "start_line": 36, "start_column": 0, "end_line": 36, "end_column": 12 }, { "span": "import time", "start_line": 43, "start_column": 0, "end_line": 43, "end_column": 11 }, { "span": "import fov", "start_line": 45, "start_column": 0, "end_line": 45, "end_column": 10 }, { "span": "import smp", "start_line": 46, "start_column": 0, "end_line": 46, "end_column": 10 }, { "span": "import render_los", "start_line": 302, "start_column": 2, "end_line": 302, "end_column": 19 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "Reactor", " ", "3", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "set", "Level_", "(_", "logging_", "._", "DEBUG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "console", "\\u", "formatter_", "=_", "logging_", "._", "Formatter_", "(_", "'[", "%", "(", "asc", "time", ")", "s", "-%", "(", "level", "name", ")", "s", "]", " ", "%", "(", "message", ")", "s", "'_", ",_", "datefmt_", "=_", "'%", "H", ":", "%", "M", ":", "%", "S", " ", "%", "m", "/", "%", "d", "/", "%", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ch_", "=_", "logging_", "._", "Stream", "Handler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ch_", "._", "set", "Formatter_", "(_", "console", "\\u", "formatter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "add", "Handler_", "(_", "ch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "globals_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "inputs_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "player_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "libt", "cod", "py_", "as_", "tcod", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "render", "\\u", "fast", "\\u", "los", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "render", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "graphics_", "as_", "gfx", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "c", "Profile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "map", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "world", "gen_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "main", "menu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "language_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "profiles_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "missio", "ns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "threads_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "network_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "drawing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "weapon", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "effects_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numbers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "dialog_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tiles_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "menus_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "locks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "items_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "life_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "maps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "fov", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "smp", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "CY", "THO", "N", "\\u", "ENABLED_", "=_", "True_", "\\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\\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_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "profiles_", "._", "version", "\\u", "check_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "TOD", "O", ":", " ", "Replace", " ", "with", " ", "\"", "module", "\\u", "sanity", "\\u", "check", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Optio", "nal", " ", "Cython", "-", "compile", "d", " ", "modules_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "import_", "render", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "render", "\\u", "los", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "render", "\\u", "map_", "._", "VERSION_", "==_", "MAP", "\\u", "RENDER", "\\u", "VERSION_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "CY", "THO", "N", "\\u", "ENABLED_", "=_", "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\t", "\t\t_", "logging_", "._", "error_", "(_", "'[", "Cython", "]", " ", "render", "\\u", "map", " ", "is", " ", "out", " ", "of", " ", "date", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "error_", "(_", "'[", "Cython", "]", " ", "Run", " ", "\\\\'", "python", " ", "compile", "\\u", "cython", "\\u", "module", "s", ".", "py", " ", "build", "\\u", "ext", " ", "--", "inpla", "ce", "\\\\''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "CY", "THO", "N", "\\u", "ENABLED_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "warning_", "(_", "'[", "Cython", "]", " ", "Import", "Error", " ", "with", " ", "module", ":", " ", "%", "s", "'_", "%_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "warning_", "(_", "'[", "Cython", "]", " ", "Cert", "ain", " ", "function", "s", " ", "can", " ", "run", " ", "faste", "r", " ", "if", " ", "compile", "d", " ", "with", " ", "Cython", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "warning_", "(_", "'[", "Cython", "]", " ", "Run", " ", "\\\\'", "python", " ", "compile", "\\u", "cython", "\\u", "module", "s", ".", "py", " ", "build", "\\u", "ext", " ", "--", "inpla", "ce", "\\\\''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logging_", "._", "info_", "(_", "WIND", "OW", "\\u", "TITLE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gfx", "_", "._", "log_", "(_", "WIND", "OW", "\\u", "TITLE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "'", "git", "-", "version", ".", "txt", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "with_", "open_", "(_", "'", "git", "-", "version", ".", "txt", "'_", ",_", "'", "r", "'_", ")_", "as_", "ver_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "logging_", "._", "info_", "(_", "'", "Build", " ", "%", "s", "'_", "%_", "ver_", "._", "readline_", "(_", ")_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "Render", "er", ":", " ", "%", "s", "'_", "%_", "tcod", "_", "._", "sys", "\\u", "get", "\\u", "renderer_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tiles_", "._", "create", "\\u", "all", "\\u", "tiles_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "language_", "._", "load", "\\u", "strings_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "missio", "ns_", "._", "load", "\\u", "all", "\\u", "missio", "ns_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ali", "fe_", "._", "raw", "parse_", "._", "create", "\\u", "function", "\\u", "map_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "locks_", "._", "create", "\\u", "lock_", "(_", "'", "came", "ra", "\\u", "free", "'_", ",_", "locked_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gfx", "_", "._", "init", "\\u", "libtcod_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "threads_", "._", "init_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "smp", ".", "init", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "SETTINGS_", "[_", "'", "draw", " ", "z", "-", "level", "s", " ", "belo", "w", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SETTINGS_", "[_", "'", "draw", " ", "z", "-", "level", "s", " ", "above", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "life_", "._", "initiate", "\\u", "life_", "(_", "'", "human", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "life_", "._", "initiate", "\\u", "life_", "(_", "'", "dog", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "life_", "._", "initiate", "\\u", "life_", "(_", "'", "night", "\\u", "terr", "or", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "items_", "._", "initiate", "\\u", "all", "\\u", "items_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "SETTINGS_", "[_", "'", "runn", "ing", "'_", "]_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'--", "menu", "'_", "in_", "sys_", "._", "argv_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "SETTINGS_", "[_", "'", "runn", "ing", "'_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'--", "quick", "'_", "in_", "sys_", "._", "argv_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "for_", "world_", "in_", "profiles_", "._", "get", "\\u", "world", "s_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "world", "gen_", "._", "load", "\\u", "world_", "(_", "world_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "SETTINGS_", "[_", "'", "runn", "ing", "'_", "]_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gfx", "_", "._", "prepar", "e\\u", "map", "\\u", "views_", "(_", ")_", "\\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", "\t\t_", "logging_", "._", "debug_", "(_", "'", "No", " ", "active", " ", "player", " ", "found", ".", " ", "Go", "ing", " ", "back", " ", "to", " ", "menu", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SETTINGS_", "[_", "'", "runn", "ing", "'_", "]_", "=_", "1_", "\\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_", "'--", "debug", "'_", "in_", "sys_", "._", "argv_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "debug", "\\u", "host_", "=_", "network_", "._", "Deb", "ug", "Host_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "debug", "\\u", "host_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WORLD", "\\u", "INFO_", "[_", "'", "debug", "'_", "]_", "=_", "\\u", "debug", "\\u", "host_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'--", "profile", "'_", "in_", "sys_", "._", "argv_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "logging_", "._", "info_", "(_", "'", "Profil", "ing", ".", " ", "Exi", "t", " ", "whe", "n", " ", "complete", "d", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c", "Profile_", "._", "run_", "(_", "'", "loop", "()'_", ",_", "'", "profile", ".", "dat", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", ")_", "\\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\t", "\t_", "loop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "SETTINGS_", "[_", "'", "runn", "ing", "'_", "]_", "=_", "False_", "\\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\t", "\t_", "traceback_", "._", "print", "\\u", "exc_", "(_", "file_", "=_", "sys_", "._", "stdout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SETTINGS_", "[_", "'", "runn", "ing", "'_", "]_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "debug", "'_", "in_", "WORLD", "\\u", "INFO_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "WORLD", "\\u", "INFO_", "[_", "'", "debug", "'_", "]_", "._", "quit_", "(_", ")_", "\\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_", "'", "debug", "'_", "in_", "WORLD", "\\u", "INFO_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "WORLD", "\\u", "INFO_", "[_", "'", "debug", "'_", "]_", "._", "quit_", "(_", ")_", "\\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_", "move", "\\u", "camera_", "(_", "pos_", ",_", "scroll_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\\u", "orig", "\\u", "pos_", "=_", "CAMER", "A", "\\u", "POS_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "and_", "SETTINGS_", "[_", "'", "follow", "ing", "'_", "]_", "==_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "and_", "locks_", "._", "is", "\\u", "locked_", "(_", "'", "came", "ra", "\\u", "free", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "life_", "=_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "top", "\\u", "left_", "=_", "MAP", "\\u", "SIZE_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "bot", "\\u", "right_", "=_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "seen_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "life", "\\u", "id_", "in_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", "[_", "'", "see", "n", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "LIF", "E_", "[_", "life", "\\u", "id_", "]_", "[_", "'", "dead", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "brain_", "._", "knows", "\\u", "ali", "fe", "\\u", "by", "\\u", "id_", "(_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", ",_", "life", "\\u", "id_", ")_", "[_", "'", "alignme", "nt", "'_", "]_", "in_", "[_", "'", "trust", "'_", ",_", "'", "fei", "gn", "\\u", "trust", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "seen_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "LIF", "E_", "[_", "life", "\\u", "id_", "]_", "[_", "'", "pos", "'_", "]_", "[_", "0_", "]_", "<_", "\\u", "top", "\\u", "left_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "\\u", "top", "\\u", "left_", "[_", "0_", "]_", "=_", "LIF", "E_", "[_", "life", "\\u", "id_", "]_", "[_", "'", "pos", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "LIF", "E_", "[_", "life", "\\u", "id_", "]_", "[_", "'", "pos", "'_", "]_", "[_", "1_", "]_", "<_", "\\u", "top", "\\u", "left_", "[_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "\\u", "top", "\\u", "left_", "[_", "1_", "]_", "=_", "LIF", "E_", "[_", "life", "\\u", "id_", "]_", "[_", "'", "pos", "'_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "LIF", "E_", "[_", "life", "\\u", "id_", "]_", "[_", "'", "pos", "'_", "]_", "[_", "0_", "]_", ">_", "\\u", "bot", "\\u", "right_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "\\u", "bot", "\\u", "right_", "[_", "0_", "]_", "=_", "LIF", "E_", "[_", "life", "\\u", "id_", "]_", "[_", "'", "pos", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "LIF", "E_", "[_", "life", "\\u", "id_", "]_", "[_", "'", "pos", "'_", "]_", "[_", "1_", "]_", ">_", "\\u", "bot", "\\u", "right_", "[_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "\\u", "bot", "\\u", "right_", "[_", "1_", "]_", "=_", "LIF", "E_", "[_", "life", "\\u", "id_", "]_", "[_", "'", "pos", "'_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "target", "\\u", "pos_", "=_", "numbers_", "._", "ler", "p", "\\u", "velocity_", "(_", "\\u", "top", "\\u", "left_", ",_", "\\u", "bot", "\\u", "right_", ",_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "numbers_", "._", "ler", "p", "\\u", "velocity_", "(_", "pos_", ",_", "\\u", "target", "\\u", "pos_", ",_", ".3", "5_", ")_", "[_", ":_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "._", "append_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "brain_", "._", "flag_", "(_", "\\u", "life_", ",_", "'", "came", "ra", "\\u", "lean", "'_", ",_", "value_", "=_", "\\u", "target", "\\u", "pos_", "[_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "brain_", "._", "flag_", "(_", "\\u", "life_", ",_", "'", "came", "ra", "\\u", "lean", "\\u", "time", "'_", ",_", "value_", "=_", "WORLD", "\\u", "INFO_", "[_", "'", "tick", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "future", "\\u", "time_", "=_", "brain_", "._", "get", "\\u", "flag_", "(_", "\\u", "life_", ",_", "'", "came", "ra", "\\u", "lean", "\\u", "time", "\\u", "future", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "\\u", "future", "\\u", "time_", "or_", "WORLD", "\\u", "INFO_", "[_", "'", "tick", "s", "'_", "]_", ">_", "\\u", "future", "\\u", "time_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "brain_", "._", "flag_", "(_", "\\u", "life_", ",_", "'", "came", "ra", "\\u", "lean", "\\u", "time", "\\u", "future", "'_", ",_", "value_", "=_", "WORLD", "\\u", "INFO_", "[_", "'", "tick", "s", "'_", "]_", "+_", "30_", ")_", "\\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_", "brain_", "._", "get", "\\u", "flag_", "(_", "\\u", "life_", ",_", "'", "came", "ra", "\\u", "lean", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "\\u", "seen_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "\\u", "st_", "=_", "WORLD", "\\u", "INFO_", "[_", "'", "tick", "s", "'_", "]_", "-_", "(_", "brain_", "._", "get", "\\u", "flag_", "(_", "\\u", "life_", ",_", "'", "came", "ra", "\\u", "lean", "\\u", "time", "\\u", "future", "'_", ")_", "-_", "30_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "et_", "=_", "brain_", "._", "get", "\\u", "flag_", "(_", "\\u", "life_", ",_", "'", "came", "ra", "\\u", "lean", "\\u", "time", "\\u", "future", "'_", ")_", "-_", "(_", "brain_", "._", "get", "\\u", "flag_", "(_", "\\u", "life_", ",_", "'", "came", "ra", "\\u", "lean", "\\u", "time", "\\u", "future", "'_", ")_", "-_", "30_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "ler", "p_", "=_", "1_", "-_", "numbers_", "._", "clip_", "(_", "\\u", "st_", "/_", "float_", "(_", "\\u", "et_", ")_", ",_", "0_", ",_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pos_", "=_", "numbers_", "._", "ler", "p", "\\u", "velocity_", "(_", "pos_", ",_", "brain_", "._", "get", "\\u", "flag_", "(_", "\\u", "life_", ",_", "'", "came", "ra", "\\u", "lean", "'_", ")_", ",_", "\\u", "ler", "p_", ")_", "[_", ":_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "._", "append_", "(_", "2_", ")_", "\\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", "\t\t\t_", "if_", "WORLD", "\\u", "INFO_", "[_", "'", "tick", "s", "'_", "]_", "-_", "brain_", "._", "get", "\\u", "flag_", "(_", "\\u", "life_", ",_", "'", "came", "ra", "\\u", "lean", "\\u", "time", "'_", ")_", "<=_", "20_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "\\u", "ler", "p_", "=_", ".4", "5_", "-_", "numbers_", "._", "clip_", "(_", "(_", "WORLD", "\\u", "INFO_", "[_", "'", "tick", "s", "'_", "]_", "-_", "brain_", "._", "get", "\\u", "flag_", "(_", "\\u", "life_", ",_", "'", "came", "ra", "\\u", "lean", "\\u", "time", "'_", ")_", ")_", "/_", "30.0_", ",_", "0_", ",_", ".4", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "numbers_", "._", "ler", "p", "\\u", "velocity_", "(_", "pos_", ",_", "brain_", "._", "get", "\\u", "flag_", "(_", "\\u", "life_", ",_", "'", "came", "ra", "\\u", "lean", "'_", ")_", ",_", "\\u", "ler", "p_", ")_", "[_", ":_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "._", "append_", "(_", "2_", ")_", "\\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", "\t\t\t\t_", "brain_", "._", "unf", "lag_", "(_", "\\u", "life_", ",_", "'", "came", "ra", "\\u", "lean", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "brain_", "._", "unf", "lag_", "(_", "\\u", "life_", ",_", "'", "came", "ra", "\\u", "lean", "\\u", "time", "'_", ")_", "\\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_", "CAMER", "A", "\\u", "POS_", "[_", "0_", "]_", "=_", "int_", "(_", "round_", "(_", "numbers_", "._", "clip_", "(_", "pos_", "[_", "0_", "]_", "-_", "(_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "0_", "]_", "/_", "2_", ")_", ",_", "0_", ",_", "MAP", "\\u", "SIZE_", "[_", "0_", "]_", "-_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "0_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CAMER", "A", "\\u", "POS_", "[_", "1_", "]_", "=_", "int_", "(_", "round_", "(_", "numbers_", "._", "clip_", "(_", "pos_", "[_", "1_", "]_", "-_", "(_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "1_", "]_", "/_", "2_", ")_", ",_", "0_", ",_", "MAP", "\\u", "SIZE_", "[_", "1_", "]_", "-_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "1_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CAMER", "A", "\\u", "POS_", "[_", "2_", "]_", "=_", "int_", "(_", "round_", "(_", "pos_", "[_", "2_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "\\u", "orig", "\\u", "pos_", "==_", "CAMER", "A", "\\u", "POS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "gfx", "_", "._", "refre", "sh", "\\u", "view_", "(_", "'", "map", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "and_", "not_", "ali", "fe_", "._", "brain_", "._", "get", "\\u", "flag_", "(_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", ",_", "'", "redraw", "'_", ")_", "==_", "pos_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "gfx", "_", "._", "refre", "sh", "\\u", "view_", "(_", "'", "map", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "ali", "fe_", "._", "brain_", "._", "flag_", "(_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", ",_", "'", "redraw", "'_", ",_", "value_", "=_", "pos_", "[_", ":_", "]_", ")_", "\\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_", "draw", "\\u", "targeti", "ng_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "SETTINGS_", "[_", "'", "follow", "ing", "'_", "]_", "and_", "not_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "==_", "SETTINGS_", "[_", "'", "follow", "ing", "'_", "]_", "and_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "follow", "ing", "'_", "]_", "]_", "[_", "'", "path", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "SELECTED", "\\u", "TILE", "S_", "[_", "0_", "]_", "=_", "[_", "(_", "p_", "[_", "0_", "]_", ",_", "p_", "[_", "1_", "]_", ",_", "2_", ")_", "for_", "p_", "in_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "follow", "ing", "'_", "]_", "]_", "[_", "'", "path", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", "and_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", "[_", "'", "targeti", "ng", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "SELECTED", "\\u", "TILE", "S_", "[_", "0_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pos_", "in_", "drawing_", "._", "diag", "\\u", "line_", "(_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", "[_", "'", "pos", "'_", "]_", ",_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", "[_", "'", "targeti", "ng", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "SELECTED", "\\u", "TILE", "S_", "[_", "0_", "]_", "._", "append_", "(_", "(_", "pos_", "[_", "0_", "]_", ",_", "pos_", "[_", "1_", "]_", ",_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", "[_", "'", "pos", "'_", "]_", "[_", "2_", "]_", ")_", ")_", "\\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_", "death", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\\u", "player_", "=_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "maps_", "._", "reset", "\\u", "lights_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FA", "DE", "\\u", "TO", "\\u", "WHITE_", "[_", "0_", "]_", "+=_", ".5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "time", "\\u", "sinc", "e\\u", "death", "_", "=_", "FA", "DE", "\\u", "TO", "\\u", "WHITE_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "time", "\\u", "alive_", "=_", "round_", "(_", "numbers_", "._", "clip_", "(_", "(_", "\\u", "player_", "[_", "'", "time", "\\u", "of", "\\u", "death", "'_", "]_", "-_", "\\u", "player_", "[_", "'", "created", "'_", "]_", ")_", "/_", "float_", "(_", "WORLD", "\\u", "INFO_", "[_", "'", "length", "\\u", "of", "\\u", "day", "'_", "]_", ")_", ",_", "0.1_", ",_", "9999_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "string_", "=_", "'", "You", " ", "die", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "sub\\u", "string_", "=_", "\\u", "player_", "[_", "'", "caus", "e\\u", "of", "\\u", "death", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "col_", "=_", "int_", "(_", "round_", "(_", "255_", "*_", "numbers_", "._", "clip_", "(_", "(_", "\\u", "time", "\\u", "sinc", "e\\u", "death", "_", "/_", "100.0_", ")_", "-_", "random_", "._", "uniform_", "(_", "0_", ",_", "0.15_", ")_", ",_", "0_", ",_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\\u", "time", "\\u", "alive_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "sub\\u", "sub\\u", "string_", "=_", "'", "Live", "d", " ", "1", " ", "day", "'_", "\\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", "\t_", "if_", "\\u", "time", "\\u", "alive_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "\\u", "sub\\u", "sub\\u", "string_", "=_", "'", "Live", "d", " ", "less", " ", "than", " ", "a", " ", "day", "'_", "\\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", "\t\t_", "\\u", "sub\\u", "sub\\u", "string_", "=_", "'", "Live", "d", " ", "%", "0.", "1f", " ", "day", "s", "'_", "%_", "(_", "\\u", "time", "\\u", "alive_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "gfx", "_", "._", "fade", "\\u", "to", "\\u", "black_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gfx", "_", "._", "blit", "\\u", "string_", "(_", "(_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "0_", "]_", "/_", "2_", ")_", "-_", "len_", "(_", "\\u", "string_", ")_", "/_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "1_", "]_", "/_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "string_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "map", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fore", "\\u", "color_", "=_", "tcod", "_", "._", "Color_", "(_", "\\u", "col_", ",_", "0_", ",_", "0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "back", "\\u", "color_", "=_", "tcod", "_", "._", "Color_", "(_", "0_", ",_", "0_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gfx", "_", "._", "blit", "\\u", "string_", "(_", "(_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "0_", "]_", "/_", "2_", ")_", "-_", "len_", "(_", "\\u", "sub\\u", "string_", ")_", "/_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "1_", "]_", "/_", "2_", ")_", "+_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "sub\\u", "string_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "map", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fore", "\\u", "color_", "=_", "tcod", "_", "._", "Color_", "(_", "int_", "(_", "round_", "(_", "\\u", "col_", "*_", ".75", "_", ")_", ")_", ",_", "int_", "(_", "round_", "(_", "\\u", "col_", "*_", ".75", "_", ")_", ")_", ",_", "int_", "(_", "round_", "(_", "\\u", "col_", "*_", ".75", "_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "back", "\\u", "color_", "=_", "tcod", "_", "._", "Color_", "(_", "0_", ",_", "0_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gfx", "_", "._", "blit", "\\u", "string_", "(_", "(_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "0_", "]_", "/_", "2_", ")_", "-_", "len_", "(_", "\\u", "sub\\u", "sub\\u", "string_", ")_", "/_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "1_", "]_", "/_", "2_", ")_", "+_", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "sub\\u", "sub\\u", "string_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "map", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fore", "\\u", "color_", "=_", "tcod", "_", "._", "Color_", "(_", "int_", "(_", "round_", "(_", "\\u", "col_", "*_", ".75", "_", ")_", ")_", ",_", "int_", "(_", "round_", "(_", "\\u", "col_", "*_", ".75", "_", ")_", ")_", ",_", "int_", "(_", "round_", "(_", "\\u", "col_", "*_", ".75", "_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "back", "\\u", "color_", "=_", "tcod", "_", "._", "Color_", "(_", "0_", ",_", "0_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\\u", "time", "\\u", "sinc", "e\\u", "death", "_", ">=_", "350_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "world", "gen_", "._", "save", "\\u", "world_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "world", "gen_", "._", "reset", "\\u", "world_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gfx", "_", "._", "clear", "\\u", "scene_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "SETTINGS_", "[_", "'", "runn", "ing", "'_", "]_", "=_", "1_", "\\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_", "return_", "True_", "\\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_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\\u", "player", "\\u", "moved_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "refre", "sh", "\\u", "map_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "get", "\\u", "input_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handle", "\\u", "input_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", "[_", "'", "dead", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", "[_", "'", "asl", "eep", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "gfx", "_", "._", "fade", "\\u", "to", "\\u", "black_", "(_", "255_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gfx", "_", "._", "start", "\\u", "of", "\\u", "frame_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gfx", "_", "._", "end", "\\u", "of", "\\u", "frame_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", "[_", "'", "asl", "eep", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "\\u", "played", "\\u", "moved_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "refre", "sh", "\\u", "map_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gfx", "_", "._", "title_", "(_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", "[_", "'", "asl", "eep", "\\u", "reason", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logic_", "._", "tick", "\\u", "all", "\\u", "objects_", "(_", "ignore", "\\u", "tick", "rate_", "=_", "True_", ",_", "ignore", "\\u", "pause_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", "[_", "'", "dead", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "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\t", "\t_", "\\u", "player", "\\u", "moved_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u", "refre", "sh", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "gfx", "_", "._", "refre", "sh", "\\u", "view_", "(_", "'", "map", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "\\u", "player", "\\u", "moved_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "logic_", "._", "tick", "\\u", "all", "\\u", "objects_", "(_", "ignore", "\\u", "tick", "rate_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "\\u", "player", "\\u", "moved_", "=_", "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_", "draw", "\\u", "targeti", "ng_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "move", "\\u", "camera_", "(_", "SETTINGS_", "[_", "'", "came", "ra", "\\u", "track", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "TOD", "O", ":", " ", "Des", "elect", " ", "so", " ", "we", " ", "can", " ", "get", " ", "rid", " ", "of", " ", "this", " ", "call_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "SELECTED", "\\u", "TILE", "S_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "gfx", "_", "._", "refre", "sh", "\\u", "view_", "(_", "'", "map", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "SETTINGS_", "[_", "'", "last", "\\u", "came", "ra", "\\u", "pos", "'_", "]_", "==_", "SETTINGS_", "[_", "'", "came", "ra", "\\u", "track", "'_", "]_", "[_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "EVENTS", "_", "or_", "MENU", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "\\u", "visi", "ble", "\\u", "chunks_", "=_", "sight", "_", "._", "scan", "\\u", "surround", "ings_", "(_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "follow", "ing", "'_", "]_", "]_", ",_", "judge", "_", "=_", "False_", ",_", "get", "\\u", "chunks_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ali", "fe_", "._", "brain_", "._", "flag_", "(_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "follow", "ing", "'_", "]_", "]_", ",_", "'", "visi", "ble", "\\u", "chunks", "'_", ",_", "value_", "=_", "\\u", "visi", "ble", "\\u", "chunks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "cam", "\\u", "x_", "=_", "numbers_", "._", "clip_", "(_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "follow", "ing", "'_", "]_", "]_", "[_", "'", "pos", "'_", "]_", "[_", "0_", "]_", "-_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "0_", "]_", "/_", "2_", ",_", "0_", ",_", "MAP", "\\u", "SIZE_", "[_", "0_", "]_", "-_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "0_", "]_", "/_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "cam", "\\u", "y_", "=_", "numbers_", "._", "clip_", "(_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "follow", "ing", "'_", "]_", "]_", "[_", "'", "pos", "'_", "]_", "[_", "1_", "]_", "-_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "1_", "]_", "/_", "2_", ",_", "0_", ",_", "MAP", "\\u", "SIZE_", "[_", "1_", "]_", "-_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "1_", "]_", "/_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "\\u", "visi", "ble", "\\u", "chunks_", "=_", "sight", "_", "._", "scan", "\\u", "surround", "ings_", "(_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", ",_", "judge", "_", "=_", "False_", ",_", "get", "\\u", "chunks_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ali", "fe_", "._", "brain_", "._", "flag_", "(_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", ",_", "'", "visi", "ble", "\\u", "chunks", "'_", ",_", "value_", "=_", "\\u", "visi", "ble", "\\u", "chunks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "SETTINGS_", "[_", "'", "last", "\\u", "came", "ra", "\\u", "pos", "'_", "]_", "=_", "SETTINGS_", "[_", "'", "came", "ra", "\\u", "track", "'_", "]_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "cam", "\\u", "x_", "=_", "numbers_", "._", "clip_", "(_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", "[_", "'", "pos", "'_", "]_", "[_", "0_", "]_", "-_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "0_", "]_", "/_", "2_", ",_", "0_", ",_", "MAP", "\\u", "SIZE_", "[_", "0_", "]_", "-_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "0_", "]_", "/_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "cam", "\\u", "y_", "=_", "numbers_", "._", "clip_", "(_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", "[_", "'", "pos", "'_", "]_", "[_", "1_", "]_", "-_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "1_", "]_", "/_", "2_", ",_", "0_", ",_", "MAP", "\\u", "SIZE_", "[_", "1_", "]_", "-_", "MAP", "\\u", "WIND", "OW", "\\u", "SIZE_", "[_", "1_", "]_", "/_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "maps_", "._", "render", "\\u", "lights_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'--", "world", "map", "'_", "in_", "sys_", "._", "argv_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "render", "\\u", "map_", "._", "render", "\\u", "map_", "(_", "WORLD", "\\u", "INFO_", "[_", "'", "map", "'_", "]_", ",_", "force", "\\u", "came", "ra", "\\u", "pos_", "=_", "(_", "\\u", "cam", "\\u", "x_", ",_", "\\u", "cam", "\\u", "y_", ",_", "2_", ")_", ")_", "\\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", "\t_", "render", "\\u", "map_", "._", "render", "\\u", "map_", "(_", "WORLD", "\\u", "INFO_", "[_", "'", "map", "'_", "]_", ",_", "los", "_", "=_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", "[_", "'", "fov", "'_", "]_", ",_", "force", "\\u", "came", "ra", "\\u", "pos_", "=_", "(_", "\\u", "cam", "\\u", "x_", ",_", "\\u", "cam", "\\u", "y_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "items_", "._", "draw", "\\u", "items_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "life_", "._", "draw", "\\u", "life_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "LIF", "E_", "[_", "SETTINGS_", "[_", "'", "controll", "ing", "'_", "]_", "]_", "[_", "'", "dead", "'_", "]_", "and_", "not_", "EVENTS", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "not_", "death", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "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_", "if_", "SETTINGS_", "[_", "'", "draw", " ", "life", " ", "info", "'_", "]_", "and_", "SETTINGS_", "[_", "'", "follow", "ing", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "life_", "._", "draw", "\\u", "life", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "gfx", "_", "._", "draw", "\\u", "message", "\\u", "box_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "menus_", "._", "align", "\\u", "menus_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "menus_", "._", "draw", "\\u", "menus_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gfx", "_", "._", "draw", "\\u", "status", "\\u", "line_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gfx", "_", "._", "draw", "\\u", "console_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gfx", "_", "._", "start", "\\u", "of", "\\u", "frame_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gfx", "_", "._", "end", "\\u", "of", "\\u", "frame_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'--", "fp", "s", "'_", "in_", "sys_", "._", "argv_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "print_", "tcod", "_", "._", "sys", "\\u", "get", "\\u", "fps_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "SETTINGS_", "[_", "'", "record", "ing", "'_", "]_", "and_", "\\u", "player", "\\u", "moved_", "and_", "not_", "EVENTS", "_", "and_", "not_", "MENU", "S_", ")_", "or_", "'--", "world", "map", "'_", "in_", "sys_", "._", "argv_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "gfx", "_", "._", "screenshot_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'--", "world", "map", "'_", "in_", "sys_", "._", "argv_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "SETTINGS_", "[_", "'", "runn", "ing", "'_", "]_", "=_", "False_", "\\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_", "loop_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "while_", "SETTINGS_", "[_", "'", "runn", "ing", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "SETTINGS_", "[_", "'", "runn", "ing", "'_", "]_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "not_", "MENU", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "main", "menu_", "._", "switch", "\\u", "to", "\\u", "main", "\\u", "menu_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "get", "\\u", "input_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handle", "\\u", "input_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "main", "menu_", "._", "draw", "\\u", "main", "\\u", "menu_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "SETTINGS_", "[_", "'", "runn", "ing", "'_", "]_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "main_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "SETTINGS_", "[_", "'", "runn", "ing", "'_", "]_", "==_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "main", "menu_", "._", "draw", "\\u", "intro_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "world", "gen_", "._", "cleanup_", "(_", ")_", "\\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, 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, 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 ]
Unused import
ilastik/ilastik-0.5/ilastik/modules/unsupervised_decomposition/core/algorithms/__init__.py
[ { "content": "import unsupervisedDecompositionBase, unsupervisedDecompositionPCA, unsupervisedDecompositionPLSA", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import unsupervisedDecompositionBase, unsupervisedDecompositionPCA, unsupervisedDecompositionPLSA", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 97 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "unsup", "ervi", "sed", "Decomp", "osition", "Base_", ",_", "unsup", "ervi", "sed", "Decomp", "osition", "PCA", "_", ",_", "unsup", "ervi", "sed", "Decomp", "osition", "PL", "SA", "_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Except block handles 'BaseException'
Rapptz/discord.py/discord/opus.py
[ { "content": "# -*- coding: utf-8 -*-\n\n\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-2016 Rapptz\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the \"Software\"),\nto deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense,\nand/or sell copies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n\"\"\"\n\nimport ctypes\nimport ctypes.util\nimport array\nfrom .errors import DiscordException\nimport logging\n\nlog = logging.getLogger(__name__)\nc_int_ptr = ctypes.POINTER(ctypes.c_int)\nc_int16_ptr = ctypes.POINTER(ctypes.c_int16)\nc_float_ptr = ctypes.POINTER(ctypes.c_float)\n\n\nEncoderStructPtr = ctypes.POINTER(EncoderStruct)\n\n# A list of exported functions.\n# The first argument is obviously the name.\n# The second one are the types of arguments it takes.\n# The third is the result type.\nexported_functions = [\n ('opus_strerror', [ctypes.c_int], ctypes.c_char_p),\n ('opus_encoder_get_size', [ctypes.c_int], ctypes.c_int),\n ('opus_encoder_create', [ctypes.c_int, ctypes.c_int, ctypes.c_int, c_int_ptr], EncoderStructPtr),\n ('opus_encode', [EncoderStructPtr, c_int16_ptr, ctypes.c_int, ctypes.c_char_p, ctypes.c_int32], ctypes.c_int32),\n ('opus_encoder_ctl', None, ctypes.c_int32),\n ('opus_encoder_destroy', [EncoderStructPtr], None)\n]\n\n\ntry:\n _lib = libopus_loader(ctypes.util.find_library('opus'))\nexcept:\n _lib = None\n\n\n\n\n\n\n# Some constants...\nOK = 0\nAPPLICATION_AUDIO = 2049\nAPPLICATION_VOIP = 2048\nAPPLICATION_LOWDELAY = 2051\nCTL_SET_BITRATE = 4002\nCTL_SET_BANDWIDTH = 4008\n\nband_ctl = {\n 'narrow': 1101,\n 'medium': 1102,\n 'wide': 1103,\n 'superwide': 1104,\n 'full': 1105,\n}\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "except:", "start_line": 78, "start_column": 0, "end_line": 78, "end_column": 7 } ]
[]
1
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_", "\"\"\"", "\\", "10", ";", "The", " ", "MIT", " ", "License", " ", "(", "MIT", ")", "\\", "10", ";", "\\", "10", ";", "Copy", "right", " ", "(", "c", ")", " ", "201", "5", "-", "2016", " ", "Ra", "ppt", "z", "\\", "10", ";", "\\", "10", ";", "Permi", "ssion", " ", "is", " ", "here", "by", " ", "grant", "ed", ",", " ", "free", " ", "of", " ", "charge", ",", " ", "to", " ", "any", " ", "person", " ", "obtain", "ing", " ", "a", "\\", "10", ";", "copy", " ", "of", " ", "this", " ", "software", " ", "and", " ", "associate", "d", " ", "documentation", " ", "files", " ", "(", "the", " ", "\"", "Sof", "twa", "re", "\")", ",", "\\", "10", ";", "to", " ", "deal", " ", "in", " ", "the", " ", "Sof", "twa", "re", " ", "with", "out", " ", "restriction", ",", " ", "inclu", "ding", " ", "with", "out", " ", "limit", "ation", "\\", "10", ";", "the", " ", "rights", " ", "to", " ", "use", ",", " ", "copy", ",", " ", "modif", "y", ",", " ", "merge", ",", " ", "publi", "sh", ",", " ", "distribute", ",", " ", "subli", "cens", "e", ",", "\\", "10", ";", "and", "/", "or", " ", "sell", " ", "copie", "s", " ", "of", " ", "the", " ", "Sof", "twa", "re", ",", " ", "and", " ", "to", " ", "permit", " ", "person", "s", " ", "to", " ", "who", "m", " ", "the", "\\", "10", ";", "Sof", "twa", "re", " ", "is", " ", "fur", "nish", "ed", " ", "to", " ", "do", " ", "so", ",", " ", "subject", " ", "to", " ", "the", " ", "follow", "ing", " ", "condition", "s", ":", "\\", "10", ";", "\\", "10", ";", "The", " ", "above", " ", "copyr", "ight", " ", "notice", " ", "and", " ", "this", " ", "permissi", "on", " ", "notice", " ", "sha", "ll", " ", "be", " ", "include", "d", " ", "in", "\\", "10", ";", "all", " ", "copie", "s", " ", "or", " ", "substa", "nti", "al", " ", "porti", "ons", " ", "of", " ", "the", " ", "Sof", "twa", "re", ".", "\\", "10", ";", "\\", "10", ";", "THE", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "\"", "AS", " ", "IS", "\",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TY", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "EXPR", "ESS", "\\", "10", ";", "OR", " ", "IMPL", "IED", ",", " ", "INC", "LU", "DING", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", " ", "THE", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", ",", "\\", "10", ";", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "AND", " ", "NON", "INF", "RING", "EME", "NT", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", "\\", "10", ";", "AUTHOR", "S", " ", "OR", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "CLA", "IM", ",", " ", "DA", "MAGE", "S", " ", "OR", " ", "OTHER", "\\", "10", ";", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "AN", " ", "ACTI", "ON", " ", "OF", " ", "CONTR", "ACT", ",", " ", "TOR", "T", " ", "OR", " ", "OTHER", "WI", "SE", ",", " ", "ARI", "SIN", "G", "\\", "10", ";", "FROM", ",", " ", "OUT", " ", "OF", " ", "OR", " ", "IN", " ", "CONNECTION", " ", "WITH", " ", "THE", " ", "SOFT", "WARE", " ", "OR", " ", "THE", " ", "USE", " ", "OR", " ", "OTHER", "\\", "10", ";", "DEA", "LING", "S", " ", "IN", " ", "THE", " ", "SOFT", "WARE", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "ctypes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ctypes_", "._", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "array_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "errors_", "import_", "Disco", "rd", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "=_", "logging_", "._", "get", "Logger_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c\\u", "int\\u", "ptr_", "=_", "ctypes_", "._", "POINTER_", "(_", "ctypes_", "._", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c\\u", "int", "16", "\\u", "ptr_", "=_", "ctypes_", "._", "POINTER_", "(_", "ctypes_", "._", "c\\u", "int16_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c\\u", "float", "\\u", "ptr_", "=_", "ctypes_", "._", "POINTER_", "(_", "ctypes_", "._", "c\\u", "float_", ")_", "\\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_", "Encode", "r", "Stru", "ct", "Ptr_", "=_", "ctypes_", "._", "POINTER_", "(_", "Encode", "r", "Struct_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "list", " ", "of", " ", "exported", " ", "function", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "first", " ", "argu", "ment", " ", "is", " ", "ob", "vio", "usl", "y", " ", "the", " ", "name", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "second", " ", "one", " ", "are", " ", "the", " ", "types", " ", "of", " ", "argu", "ment", "s", " ", "it", " ", "take", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "third", " ", "is", " ", "the", " ", "result", " ", "type", "._", "\\u\\u\\uNL\\u\\u\\u_", "exported", "\\u", "functions_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "opu", "s", "\\u", "stre", "rror", "'_", ",_", "[_", "ctypes_", "._", "c\\u", "int_", "]_", ",_", "ctypes_", "._", "c\\u", "char", "\\u", "p_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "opu", "s", "\\u", "encode", "r", "\\u", "get", "\\u", "size", "'_", ",_", "[_", "ctypes_", "._", "c\\u", "int_", "]_", ",_", "ctypes_", "._", "c\\u", "int_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "opu", "s", "\\u", "encode", "r", "\\u", "create", "'_", ",_", "[_", "ctypes_", "._", "c\\u", "int_", ",_", "ctypes_", "._", "c\\u", "int_", ",_", "ctypes_", "._", "c\\u", "int_", ",_", "c\\u", "int\\u", "ptr_", "]_", ",_", "Encode", "r", "Stru", "ct", "Ptr_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "opu", "s", "\\u", "encode", "'_", ",_", "[_", "Encode", "r", "Stru", "ct", "Ptr_", ",_", "c\\u", "int", "16", "\\u", "ptr_", ",_", "ctypes_", "._", "c\\u", "int_", ",_", "ctypes_", "._", "c\\u", "char", "\\u", "p_", ",_", "ctypes_", "._", "c\\u", "int32_", "]_", ",_", "ctypes_", "._", "c\\u", "int32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "opu", "s", "\\u", "encode", "r", "\\u", "ctl", "'_", ",_", "None_", ",_", "ctypes_", "._", "c\\u", "int32_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "opu", "s", "\\u", "encode", "r", "\\u", "destroy", "'_", ",_", "[_", "Encode", "r", "Stru", "ct", "Ptr_", "]_", ",_", "None_", ")_", "\\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 ", " _", "\\u", "lib_", "=_", "lib", "opu", "s", "\\u", "loader_", "(_", "ctypes_", "._", "util_", "._", "find", "\\u", "library_", "(_", "'", "opu", "s", "'_", ")_", ")_", "\\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 ", " _", "\\u", "lib_", "=_", "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\\uNL\\u\\u\\u_", "#", " ", "Some", " ", "constant", "s", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "OK_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "APPLICATION", "\\u", "AUDIO", "_", "=_", "204", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "APPLICATION", "\\u", "VO", "IP_", "=_", "2048_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "APPLICATION", "\\u", "LOW", "DELAY_", "=_", "205", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CTL", "\\u", "SET", "\\u", "BIT", "RATE_", "=_", "400", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CTL", "\\u", "SET", "\\u", "BAND", "WIDTH_", "=_", "400", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "band", "\\u", "ctl_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "narrow", "'_", ":_", "1101", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "'_", ":_", "1102", "_", ",_", "\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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
Masood-M/yalih/maltype.py
[ { "content": "import string\nimport re\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Maltype:\n \n files = [] # Store all the file names that are of the same maltype\n rule = \"\" # Store the rule\n maltype_num = 0\n \n \n\n \n \n \n \n ", "metadata": "root.Maltype", "header": "['module', '___EOS___']", "index": 3 }, { "content": " def __init__(self, f, num):\n self.files = []\n self.files.append(f);\n self.maltype_num = num;", "metadata": "root.Maltype.__init__", "header": "['class', 'Maltype', ':', '___EOS___']", "index": 9 }, { "content": " def remove_file(self, f):\n self.files.remove(f);", "metadata": "root.Maltype.remove_file", "header": "['class', 'Maltype', ':', '___EOS___']", "index": 14 }, { "content": " def add_file(self, f):\n self.files.append(f);", "metadata": "root.Maltype.add_file", "header": "['class', 'Maltype', ':', '___EOS___']", "index": 17 }, { "content": " def get_maltype_num(self):\n return self.maltype_num", "metadata": "root.Maltype.get_maltype_num", "header": "['class', 'Maltype', ':', '___EOS___']", "index": 20 }, { "content": " def get_files(self):\n return self.files", "metadata": "root.Maltype.get_files", "header": "['class', 'Maltype', ':', '___EOS___']", "index": 23 }, { "content": " def set_rule(self, rule):\n self.rule = rule", "metadata": "root.Maltype.set_rule", "header": "['class', 'Maltype', ':', '___EOS___']", "index": 26 }, { "content": " def get_rule(self):\n return self.rule", "metadata": "root.Maltype.get_rule", "header": "['class', 'Maltype', ':', '___EOS___']", "index": 29 }, { "content": " def count_rule_string(self, rule):\n return len(re.findall(\"\\$string\", str(rule)))", "metadata": "root.Maltype.count_rule_string", "header": "['class', 'Maltype', ':', '___EOS___']", "index": 32 } ]
[ { "span": "import string", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 13 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\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_", "Mal", "type_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "files_", "=_", "[_", "]_", "#", " ", "Stor", "e", " ", "all", " ", "the", " ", "file", " ", "names", " ", "tha", "t", " ", "are", " ", "of", " ", "the", " ", "same", " ", "mal", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule_", "=_", "\"\"_", "#", " ", "Stor", "e", " ", "the", " ", "rule_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mal", "type", "\\u", "num_", "=_", "0_", "\\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_", "Mal", "type_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "f_", ",_", "num_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "files_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "files_", "._", "append_", "(_", "f_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mal", "type", "\\u", "num_", "=_", "num_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mal", "type_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "remove", "\\u", "file_", "(_", "self_", ",_", "f_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "files_", "._", "remove_", "(_", "f_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mal", "type_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "file_", "(_", "self_", ",_", "f_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "files_", "._", "append_", "(_", "f_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mal", "type_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "mal", "type", "\\u", "num_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "mal", "type", "\\u", "num_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mal", "type_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "files_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "files_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mal", "type_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "rule_", "(_", "self_", ",_", "rule_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "rule_", "=_", "rule_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mal", "type_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "rule_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "rule_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mal", "type_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "count", "\\u", "rule", "\\u", "string_", "(_", "self_", ",_", "rule_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "len_", "(_", "re_", "._", "findall_", "(_", "\"\\\\", "$", "string", "\"_", ",_", "str_", "(_", "rule_", ")_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 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, 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, 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, 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, 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, 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, 4, 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 ]
Unused import
memex-explorer/memex-explorer/source/apps/crawl_space/tests/test_crawl.py
[ { "content": "from __future__ import unicode_literals\n\nimport os\nimport shutil\nimport json\n\n# Test\nfrom memex.test_utils.unit_test_utils import UnitTestSkeleton, form_errors, get_object\nfrom django.test import TestCase\nfrom django.core.files.uploadedfile import SimpleUploadedFile\n\nimport pytest\n\n# App\nfrom apps.crawl_space.forms import AddCrawlForm\nfrom apps.crawl_space.models import Crawl, CrawlModel\nfrom base.models import Project, SeedsList, alphanumeric_validator\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def assert_form_errors(response, *errors):\n \"\"\"Given a response, assert that only the given `errors`\n are present in the form response.\"\"\"\n\n efe = expected_form_errors = set(errors)\n assert set(form_errors(response).keys()) - efe == set()", "metadata": "root.assert_form_errors", "header": "['module', '___EOS___']", "index": 19 }, { "content": "class TestViews(UnitTestSkeleton):\n\n\n\n", "metadata": "root.TestViews", "header": "['module', '___EOS___']", "index": 27 }, { "content": " @classmethod\n def setUpClass(cls):\n \"\"\"Initialize a test project and crawl model,\n and save them to the test database.\"\"\"\n super(TestViews, cls).setUpClass()\n\n cls.test_project = Project(\n name = \"Test\",\n description = \"Test Project Description\"\n )\n cls.test_project.save()\n\n cls.test_seeds_list = SeedsList(\n name = \"Test Seeds\",\n seeds = json.dumps([\n \"http://www.reddit.com/r/aww\",\n \"http://gizmodo.com/of-course-japan-has-an-island-where-cats-outnumber-peop-1695365964\",\n \"http://en.wikipedia.org/wiki/Cat\",\n \"http://www.catchannel.com/\",\n \"http://mashable.com/category/cats/\",\n \"http://www.huffingtonpost.com/news/cats/\",\n \"http://www.lolcats.com/\"\n ]),\n )\n cls.test_seeds_list.save()\n\n cls.test_crawl = Crawl(\n name = \"Test Crawl\",\n description = \"Test Crawl Description\",\n crawler = \"nutch\",\n config = \"config_default\",\n project = cls.test_project,\n seeds_object = cls.test_seeds_list\n )\n cls.test_crawl.save()", "metadata": "root.TestViews.setUpClass", "header": "['class', 'TestViews', '(', 'UnitTestSkeleton', ')', ':', '___EOS___']", "index": 29 }, { "content": " @classmethod\n def get_seeds(self):\n \"\"\"Return a new instance of SimpleUploadedFile. This file can only\n be used once.\"\"\"\n\n return SimpleUploadedFile('ht.seeds', bytes('This is some content.\\n'), 'utf-8')", "metadata": "root.TestViews.get_seeds", "header": "['class', 'TestViews', '(', 'UnitTestSkeleton', ')', ':', '___EOS___']", "index": 65 }, { "content": " @property\n def crawl_slugs(self):\n \"\"\"Return a dictionary with a \"test\" project slug and\n a \"test-crawl\" crawl slug.\"\"\"\n\n return dict(slugs=dict(\n project_slug=\"test\",\n crawl_slug=\"test-crawl\"))", "metadata": "root.TestViews.crawl_slugs", "header": "['class', 'TestViews', '(', 'UnitTestSkeleton', ')', ':', '___EOS___']", "index": 72 }, { "content": " def test_crawl_delete(self):\n response = self.post('base:crawl_space:delete_crawl',\n **self.crawl_slugs)\n assert 'base/project.html' in response.template_name", "metadata": "root.TestViews.test_crawl_delete", "header": "['class', 'TestViews', '(', 'UnitTestSkeleton', ')', ':', '___EOS___']", "index": 81 } ]
[ { "span": "import os", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 9 }, { "span": "import shutil", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 13 }, { "span": "from memex.test_utils.unit_test_utils import UnitTestSkeleton, form_errors, get_object", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 86 }, { "span": "from django.test import TestCase", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 32 }, { "span": "import pytest", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 13 }, { "span": "from apps.crawl_space.forms import AddCrawlForm", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 47 }, { "span": "from apps.crawl_space.models import Crawl, CrawlModel", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 53 }, { "span": "from base.models import Project, SeedsList, alphanumeric_validator", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 66 } ]
[]
1
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_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "shutil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "meme", "x_", "._", "test\\u", "utils_", "._", "unit", "\\u", "test\\u", "utils_", "import_", "Unit", "Test", "Skeleton", "_", ",_", "form", "\\u", "errors_", ",_", "get", "\\u", "object_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "test_", "import_", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "files_", "._", "uploade", "dfile", "_", "import_", "Simple", "Upload", "ed", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "pytest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "App_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "apps_", "._", "crawl", "\\u", "space_", "._", "forms_", "import_", "Add", "Crawl", "Form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "apps_", "._", "crawl", "\\u", "space_", "._", "models_", "import_", "Crawl", "_", ",_", "Crawl", "Model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "base_", "._", "models_", "import_", "Project_", ",_", "See", "ds", "List_", ",_", "alphanumeric", "\\u", "validator_", "\\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_", "assert", "\\u", "form", "\\u", "errors_", "(_", "response_", ",_", "*_", "errors_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Give", "n", " ", "a", " ", "response", ",", " ", "assert", " ", "tha", "t", " ", "only", " ", "the", " ", "give", "n", " ", "`", "error", "s", "`", "\\", "10", ";", " ", " ", " ", " ", "are", " ", "presen", "t", " ", "in", " ", "the", " ", "form", " ", "response", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "efe", "_", "=_", "expected", "\\u", "form", "\\u", "errors_", "=_", "set_", "(_", "errors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "set_", "(_", "form", "\\u", "errors_", "(_", "response_", ")_", "._", "keys_", "(_", ")_", ")_", "-_", "efe", "_", "==_", "set_", "(_", ")_", "\\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_", "Test", "Views_", "(_", "Unit", "Test", "Skeleton", "_", ")_", ":_", "\\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", "Views_", "(_", "Unit", "Test", "Skeleton", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "set", "Up", "Class_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Initializ", "e", " ", "a", " ", "test", " ", "project", " ", "and", " ", "crawl", " ", "model", ",", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "save", " ", "them", " ", "to", " ", "the", " ", "test", " ", "databa", "se", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Test", "Views_", ",_", "cls_", ")_", "._", "set", "Up", "Class_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cls_", "._", "test\\u", "project_", "=_", "Project_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"", "Test", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "\"", "Test", " ", "Project", " ", "Descripti", "on", "\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "test\\u", "project_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cls_", "._", "test\\u", "seeds", "\\u", "list_", "=_", "See", "ds", "List_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"", "Test", " ", "See", "ds", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seeds_", "=_", "json_", "._", "dumps_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "http", "://", "www", ".", "reddit", ".", "com", "/", "r", "/", "aw", "w", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "http", "://", "gi", "zm", "odo", ".", "com", "/", "of", "-", "course", "-", "jap", "an", "-", "has", "-", "an", "-", "island", "-", "where", "-", "cat", "s", "-", "out", "number", "-", "pe", "op", "-1", "695", "365", "964", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "http", "://", "en", ".", "wikip", "edia", ".", "org", "/", "wiki", "/", "Cat", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "http", "://", "www", ".", "catch", "anne", "l", ".", "com", "/\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "http", "://", "mas", "hab", "le", ".", "com", "/", "category", "/", "cat", "s", "/\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "http", "://", "www", ".", "huff", "ing", "ton", "post", ".", "com", "/", "news", "/", "cat", "s", "/\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "http", "://", "www", ".", "lol", "cat", "s", ".", "com", "/\"_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "test\\u", "seeds", "\\u", "list_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cls_", "._", "test\\u", "crawl", "_", "=_", "Crawl", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"", "Test", " ", "Crawl", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "\"", "Test", " ", "Crawl", " ", "Descripti", "on", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "crawler_", "=_", "\"", "nut", "ch", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "config_", "=_", "\"", "config", "\\u", "default", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "project_", "=_", "cls_", "._", "test\\u", "project_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seeds", "\\u", "object_", "=_", "cls_", "._", "test\\u", "seeds", "\\u", "list_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "test\\u", "crawl", "_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Views_", "(_", "Unit", "Test", "Skeleton", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "seeds_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "a", " ", "new", " ", "instance", " ", "of", " ", "Simple", "Upload", "ed", "File", ".", " ", "Thi", "s", " ", "file", " ", "can", " ", "only", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "used", " ", "onc", "e", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Simple", "Upload", "ed", "File_", "(_", "'", "ht", ".", "seeds", "'_", ",_", "bytes_", "(_", "'", "Thi", "s", " ", "is", " ", "some", " ", "content", ".\\\\", "n", "'_", ")_", ",_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Views_", "(_", "Unit", "Test", "Skeleton", "_", ")_", ":_", "\\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_", "crawl", "\\u", "slug", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "a", " ", "dictionar", "y", " ", "with", " ", "a", " ", "\"", "test", "\"", " ", "project", " ", "slug", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "\"", "test", "-", "crawl", "\"", " ", "crawl", " ", "slug", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "dict_", "(_", "slug", "s_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "project", "\\u", "slug_", "=_", "\"", "test", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "crawl", "\\u", "slug_", "=_", "\"", "test", "-", "crawl", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Views_", "(_", "Unit", "Test", "Skeleton", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "crawl", "\\u", "delete_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "post_", "(_", "'", "base", ":", "crawl", "\\u", "space", ":", "delete", "\\u", "crawl", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
Unused import
dimagi/commcare-hq/corehq/ex-submodules/casexml/apps/case/tests/test_rebuild.py
[ { "content": "import uuid\nfrom couchdbkit.exceptions import ResourceNotFound\nfrom django.test import TestCase, SimpleTestCase\nfrom casexml.apps.case import const\nfrom casexml.apps.case.cleanup import rebuild_case_from_forms\nfrom casexml.apps.case.exceptions import MissingServerDate\nfrom casexml.apps.case.mock import CaseBlock\nfrom casexml.apps.case.models import CommCareCase, CommCareCaseAction\nfrom datetime import datetime, timedelta\nfrom copy import deepcopy\nfrom casexml.apps.case.tests.util import delete_all_cases\nfrom casexml.apps.case.util import primary_actions, post_case_blocks\nfrom corehq.form_processor.backends.couch.update_strategy import CouchCaseUpdateStrategy, _action_sort_key_function\nfrom corehq.form_processor.exceptions import CaseNotFound\nfrom corehq.form_processor.interfaces.dbaccessors import CaseAccessors, FormAccessors\nfrom corehq.form_processor.models import RebuildWithReason\nfrom corehq.form_processor.tests.utils import run_with_all_backends\nfrom corehq.form_processor.utils.general import should_use_sql_backend\nfrom couchforms.models import XFormInstance\n\nREBUILD_TEST_DOMAIN = 'rebuild-test'\n\n\n\n\n\n\n\n\n\nEMPTY_DATE = object()\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def _post_util(create=False, case_id=None, user_id=None, owner_id=None,\n case_type=None, form_extras=None, close=False, date_modified=None,\n **kwargs):\n\n form_extras = form_extras or {}\n form_extras['domain'] = REBUILD_TEST_DOMAIN\n\n uid = lambda: uuid.uuid4().hex\n case_id = case_id or uid()\n block = CaseBlock(create=create,\n case_id=case_id,\n user_id=user_id or uid(),\n owner_id=owner_id or uid(),\n case_type=case_type or 'test',\n date_modified=date_modified,\n update=kwargs,\n close=close).as_xml()\n post_case_blocks([block], form_extras)\n return case_id", "metadata": "root._post_util", "header": "['module', '___EOS___']", "index": 23 }, { "content": "class CaseRebuildTest(TestCase):\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.CaseRebuildTest", "header": "['module', '___EOS___']", "index": 44 }, { "content": " @classmethod\n def setUpClass(cls):\n delete_all_cases()", "metadata": "root.CaseRebuildTest.setUpClass", "header": "['class', 'CaseRebuildTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 46 }, { "content": " def _assertListEqual(self, l1, l2, include_ordering=True):\n if include_ordering:\n self.assertEqual(len(l1), len(l2))\n for i in range(len(l1)):\n self.assertEqual(l1[i], l2[i])\n else:\n # this is built in so just use it\n self.assertListEqual(l1, l2)", "metadata": "root.CaseRebuildTest._assertListEqual", "header": "['class', 'CaseRebuildTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 50 }, { "content": " def _assertListNotEqual(self, l1, l2, msg=None, include_ordering=True):\n try:\n self._assertListEqual(l1, l2, include_ordering=include_ordering)\n except self.failureException:\n pass # this is what we want\n else:\n self.fail(msg)", "metadata": "root.CaseRebuildTest._assertListNotEqual", "header": "['class', 'CaseRebuildTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 59 }, { "content": " def test_couch_action_equality(self):\n case_id = _post_util(create=True)\n _post_util(case_id=case_id, p1='p1', p2='p2')\n\n case = CommCareCase.get(case_id)\n self.assertEqual(2, len(case.actions)) # create + update\n self.assertTrue(case.actions[0] != case.actions[1])\n self.assertTrue(case.actions[1] == case.actions[1])\n\n orig = case.actions[1]\n copy = CommCareCaseAction.wrap(orig._doc.copy())\n self.assertTrue(copy != case.actions[0])\n self.assertTrue(copy == orig)\n\n copy.server_date = copy.server_date + timedelta(seconds=1)\n self.assertTrue(copy != orig)\n copy.server_date = orig.server_date\n self.assertTrue(copy == orig)\n\n copy.updated_unknown_properties['p1'] = 'not-p1'\n self.assertTrue(copy != orig)\n copy.updated_unknown_properties['p1'] = 'p1'\n self.assertTrue(copy == orig)\n copy.updated_unknown_properties['pnew'] = ''\n self.assertTrue(copy != orig)", "metadata": "root.CaseRebuildTest.test_couch_action_equality", "header": "['class', 'CaseRebuildTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 67 }, { "content": " def test_couch_soft_rebuild(self):\n user_id = 'test-basic-rebuild-user'\n now = datetime.utcnow()\n case_id = _post_util(create=True, user_id=user_id, date_modified=now)\n _post_util(case_id=case_id, p1='p1-1', p2='p2-1', user_id=user_id, date_modified=now)\n _post_util(case_id=case_id, p2='p2-2', p3='p3-2', user_id=user_id, date_modified=now)\n\n # check initial state\n case = CommCareCase.get(case_id)\n self.assertEqual(case.p1, 'p1-1') # original\n self.assertEqual(case.p2, 'p2-2') # updated\n self.assertEqual(case.p3, 'p3-2') # new\n self.assertEqual(3, len(case.actions)) # create + 2 updates\n a1 = case.actions[1]\n self.assertEqual(a1.updated_unknown_properties['p1'], 'p1-1')\n self.assertEqual(a1.updated_unknown_properties['p2'], 'p2-1')\n a2 = case.actions[2]\n self.assertEqual(a2.updated_unknown_properties['p2'], 'p2-2')\n self.assertEqual(a2.updated_unknown_properties['p3'], 'p3-2')\n\n # rebuild by flipping the actions\n case.actions = [case.actions[0], a2, a1]\n case.xform_ids = [case.xform_ids[0], case.xform_ids[2], case.xform_ids[1]]\n CouchCaseUpdateStrategy(case).soft_rebuild_case()\n self.assertEqual(case.p1, 'p1-1') # original\n self.assertEqual(case.p2, 'p2-1') # updated (back!)\n self.assertEqual(case.p3, 'p3-2') # new", "metadata": "root.CaseRebuildTest.test_couch_soft_rebuild", "header": "['class', 'CaseRebuildTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 93 }, { "content": " def test_couch_action_comparison(self):\n user_id = 'test-action-comparison-user'\n case_id = _post_util(create=True, property='a1 wins', user_id=user_id)\n _post_util(case_id=case_id, property='a2 wins', user_id=user_id)\n _post_util(case_id=case_id, property='a3 wins', user_id=user_id)\n\n # check initial state\n case = CommCareCase.get(case_id)\n create, a1, a2, a3 = deepcopy(list(case.actions))\n self.assertEqual('a3 wins', case.property)\n self.assertEqual(a1.updated_unknown_properties['property'], 'a1 wins')\n self.assertEqual(a2.updated_unknown_properties['property'], 'a2 wins')\n self.assertEqual(a3.updated_unknown_properties['property'], 'a3 wins')\n\n def _confirm_action_order(case, expected_actions):\n actual_actions = case.actions[1:] # always assume create is first and removed\n for expected, actual in zip(expected_actions, actual_actions):\n self.assertEqual(expected.updated_unknown_properties['property'],\n actual.updated_unknown_properties['property'])\n\n _confirm_action_order(case, [a1, a2, a3])\n\n # test initial rebuild does nothing\n update_strategy = CouchCaseUpdateStrategy(case)\n update_strategy.soft_rebuild_case()\n _confirm_action_order(case, [a1, a2, a3])\n\n # test sorting by server date\n case.actions[2].server_date = case.actions[2].server_date + timedelta(days=1)\n update_strategy.soft_rebuild_case()\n _confirm_action_order(case, [a1, a3, a2])\n\n # test sorting by date within the same day\n case = CommCareCase.get(case_id)\n _confirm_action_order(case, [a1, a2, a3])\n case.actions[2].date = case.actions[3].date + timedelta(minutes=1)\n CouchCaseUpdateStrategy(case).soft_rebuild_case()\n _confirm_action_order(case, [a1, a3, a2])\n\n # test original form order\n case = CommCareCase.get(case_id)\n case.actions[3].server_date = case.actions[2].server_date\n case.actions[3].date = case.actions[2].date\n case.xform_ids = [a1.xform_id, a3.xform_id, a2.xform_id]\n CouchCaseUpdateStrategy(case).soft_rebuild_case()\n _confirm_action_order(case, [a1, a3, a2])\n\n # test create comes before update\n case = CommCareCase.get(case_id)\n case.actions = [a1, create, a2, a3]\n CouchCaseUpdateStrategy(case).soft_rebuild_case()\n _confirm_action_order(case, [a1, a2, a3])", "metadata": "root.CaseRebuildTest.test_couch_action_comparison", "header": "['class', 'CaseRebuildTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 121 }, { "content": " @run_with_all_backends\n def test_rebuild_empty(self):\n self.assertEqual(None, rebuild_case_from_forms('anydomain', 'notarealid', RebuildWithReason(reason='test')))", "metadata": "root.CaseRebuildTest.test_rebuild_empty", "header": "['class', 'CaseRebuildTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 174 }, { "content": " def test_couch_rebuild_deleted_case(self):\n \"\"\"\n Note: Can't run this on SQL because if a case gets hard deleted then there is no way to find\n out which forms created / updated it without going through ALL the forms in the domain.\n ie. there is no SQL equivalent to the \"form_case_index/form_case_index\" couch view\n \"\"\"\n case_id = _post_util(create=True)\n _post_util(case_id=case_id, p1='p1', p2='p2')\n\n # delete initial case\n delete_all_cases()\n\n with self.assertRaises(CaseNotFound):\n CaseAccessors(REBUILD_TEST_DOMAIN).get_case(case_id)\n\n case = rebuild_case_from_forms(REBUILD_TEST_DOMAIN, case_id, RebuildWithReason(reason='test'))\n self.assertEqual(case.p1, 'p1')\n self.assertEqual(case.p2, 'p2')\n self.assertEqual(2, len(primary_actions(case))) # create + update", "metadata": "root.CaseRebuildTest.test_couch_rebuild_deleted_case", "header": "['class', 'CaseRebuildTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 178 }, { "content": " def test_couch_reconcile_actions(self):\n now = datetime.utcnow()\n # make sure we timestamp everything so they have the right order\n case_id = _post_util(create=True, form_extras={'received_on': now})\n _post_util(case_id=case_id, p1='p1-1', p2='p2-1', form_extras={'received_on': now + timedelta(seconds=1)})\n _post_util(case_id=case_id, p2='p2-2', p3='p3-2', form_extras={'received_on': now + timedelta(seconds=2)})\n case = CommCareCase.get(case_id)\n update_strategy = CouchCaseUpdateStrategy(case)\n\n original_actions = [deepcopy(a) for a in case.actions]\n original_form_ids = [id for id in case.xform_ids]\n self.assertEqual(3, len(original_actions))\n self.assertEqual(3, len(original_form_ids))\n self._assertListEqual(original_actions, case.actions)\n\n # test reordering\n case.actions = [case.actions[2], case.actions[1], case.actions[0]]\n self._assertListNotEqual(original_actions, case.actions)\n update_strategy.reconcile_actions()\n self._assertListEqual(original_actions, case.actions)\n\n # test duplication\n case.actions = case.actions * 3\n self.assertEqual(9, len(case.actions))\n self._assertListNotEqual(original_actions, case.actions)\n update_strategy.reconcile_actions()\n self._assertListEqual(original_actions, case.actions)\n\n # test duplication, even when dates are off\n case.actions = original_actions + [deepcopy(case.actions[2])]\n case.actions[-1].server_date = case.actions[-1].server_date + timedelta(seconds=1)\n self._assertListNotEqual(original_actions, case.actions)\n update_strategy.reconcile_actions()\n self._assertListEqual(original_actions, case.actions)\n\n # test duplication with different properties is actually\n # treated differently\n case.actions = original_actions + [deepcopy(case.actions[2])]\n case.actions[-1].updated_unknown_properties['new'] = 'mismatch'\n self.assertEqual(4, len(case.actions))\n self._assertListNotEqual(original_actions, case.actions)\n update_strategy.reconcile_actions()\n self._assertListNotEqual(original_actions, case.actions)\n\n # test clean slate rebuild\n case = rebuild_case_from_forms(REBUILD_TEST_DOMAIN, case_id, RebuildWithReason(reason='test'))\n self._assertListEqual(original_actions, primary_actions(case))\n self._assertListEqual(original_form_ids, case.xform_ids)", "metadata": "root.CaseRebuildTest.test_couch_reconcile_actions", "header": "['class', 'CaseRebuildTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 198 }, { "content": " @run_with_all_backends\n def test_archiving_only_form(self):\n \"\"\"\n Checks that archiving the only form associated with the case archives\n the case and unarchiving unarchives it.\n \"\"\"\n case_id = _post_util(create=True, p1='p1-1', p2='p2-1')\n case_accessors = CaseAccessors(REBUILD_TEST_DOMAIN)\n case = case_accessors.get_case(case_id)\n\n self.assertFalse(case.is_deleted)\n if should_use_sql_backend(REBUILD_TEST_DOMAIN):\n self.assertEqual(1, len(case.actions))\n else:\n self.assertEqual(2, len(case.actions))\n [form_id] = case.xform_ids\n form = FormAccessors(REBUILD_TEST_DOMAIN).get_form(form_id)\n\n form.archive()\n case = case_accessors.get_case(case_id)\n\n self.assertTrue(case.is_deleted)\n # should just have the 'rebuild' action\n self.assertEqual(1, len(case.actions))\n self.assertTrue(case.actions[0].is_case_rebuild)\n\n form.unarchive()\n case = case_accessors.get_case(case_id)\n self.assertFalse(case.is_deleted)\n self.assertEqual(3, len(case.actions))\n self.assertTrue(case.actions[-1].is_case_rebuild)", "metadata": "root.CaseRebuildTest.test_archiving_only_form", "header": "['class', 'CaseRebuildTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 247 }, { "content": " @run_with_all_backends\n def test_form_archiving(self):\n now = datetime.utcnow()\n # make sure we timestamp everything so they have the right order\n case_id = _post_util(create=True, p1='p1-1', p2='p2-1',\n form_extras={'received_on': now})\n _post_util(case_id=case_id, p2='p2-2', p3='p3-2', p4='p4-2',\n form_extras={'received_on': now + timedelta(seconds=1)})\n _post_util(case_id=case_id, p4='p4-3', p5='p5-3', close=True,\n form_extras={'received_on': now + timedelta(seconds=2)})\n\n case_accessors = CaseAccessors(REBUILD_TEST_DOMAIN)\n case = case_accessors.get_case(case_id)\n closed_by = case.closed_by\n closed_on = case.closed_on\n self.assertNotEqual('', closed_by)\n self.assertNotEqual(None, closed_on)\n\n def _check_initial_state(case):\n self.assertTrue(case.closed)\n self.assertEqual(closed_by, case.closed_by)\n self.assertEqual(closed_on, case.closed_on)\n self.assertEqual(case.get_case_property('p1'), 'p1-1') # original\n self.assertEqual(case.get_case_property('p2'), 'p2-2') # updated in second post\n self.assertEqual(case.get_case_property('p3'), 'p3-2') # new in second post\n self.assertEqual(case.get_case_property('p4'), 'p4-3') # updated in third post\n self.assertEqual(case.get_case_property('p5'), 'p5-3') # new in third post\n if should_use_sql_backend(REBUILD_TEST_DOMAIN):\n # SQL stores one transaction per form\n self.assertEqual(3, len(primary_actions(case))) # create + update + close\n else:\n self.assertEqual(5, len(primary_actions(case))) # create + 3 updates + close\n\n _check_initial_state(case)\n\n # verify xform/action states\n [f1, f2, f3] = case.xform_ids\n if should_use_sql_backend(REBUILD_TEST_DOMAIN):\n [create, update, close] = case.actions\n self.assertEqual(f1, create.form_id)\n self.assertEqual(f2, update.form_id)\n self.assertEqual(f3, close.form_id)\n else:\n [create, u1, u2, u3, close] = case.actions\n self.assertEqual(f1, create.form_id)\n self.assertEqual(f1, u1.form_id)\n self.assertEqual(f2, u2.form_id)\n self.assertEqual(f3, u3.form_id)\n\n # todo: should this be the behavior for archiving the create form?\n form_acessors = FormAccessors(REBUILD_TEST_DOMAIN)\n f1_doc = form_acessors.get_form(f1)\n f1_doc.archive()\n case = case_accessors.get_case(case_id)\n\n if should_use_sql_backend(REBUILD_TEST_DOMAIN):\n self.assertEqual(2, len(primary_actions(case)))\n else:\n self.assertEqual(3, len(primary_actions(case)))\n\n [u2, u3] = case.xform_ids\n self.assertEqual(f2, u2)\n self.assertEqual(f3, u3)\n\n self.assertTrue(case.closed) # no change\n self.assertFalse('p1' in case.dynamic_case_properties()) # should disappear entirely\n self.assertEqual(case.get_case_property('p2'), 'p2-2') # no change\n self.assertEqual(case.get_case_property('p3'), 'p3-2') # no change\n self.assertEqual(case.get_case_property('p4'), 'p4-3') # no change\n self.assertEqual(case.get_case_property('p5'), 'p5-3') # no change\n\n def _reset(form_id):\n form_doc = form_acessors.get_form(form_id)\n form_doc.unarchive()\n case = case_accessors.get_case(case_id)\n _check_initial_state(case)\n\n _reset(f1)\n\n f2_doc = form_acessors.get_form(f2)\n f2_doc.archive()\n case = case_accessors.get_case(case_id)\n\n if should_use_sql_backend(REBUILD_TEST_DOMAIN):\n self.assertEqual(2, len(primary_actions(case)))\n else:\n self.assertEqual(4, len(primary_actions(case)))\n\n [u1, u3] = case.xform_ids\n self.assertEqual(f1, u1)\n self.assertEqual(f3, u3)\n\n self.assertTrue(case.closed) # no change\n self.assertEqual(case.get_case_property('p1'), 'p1-1') # original\n self.assertEqual(case.get_case_property('p2'), 'p2-1') # loses second form update\n self.assertFalse('p3' in case.dynamic_case_properties()) # should disappear entirely\n self.assertEqual(case.get_case_property('p4'), 'p4-3') # no change\n self.assertEqual(case.get_case_property('p5'), 'p5-3') # no change\n\n _reset(f2)\n\n f3_doc = form_acessors.get_form(f3)\n f3_doc.archive()\n case = case_accessors.get_case(case_id)\n\n if should_use_sql_backend(REBUILD_TEST_DOMAIN):\n self.assertEqual(2, len(primary_actions(case)))\n else:\n self.assertEqual(3, len(primary_actions(case)))\n\n [u1, u2] = case.xform_ids\n self.assertEqual(f1, u1)\n self.assertEqual(f2, u2)\n\n self.assertFalse(case.closed) # reopened!\n self.assertEqual('', case.closed_by)\n self.assertEqual(None, case.closed_on)\n self.assertEqual(case.get_case_property('p1'), 'p1-1') # original\n self.assertEqual(case.get_case_property('p2'), 'p2-2') # original\n self.assertEqual(case.get_case_property('p3'), 'p3-2') # new in second post\n self.assertEqual(case.get_case_property('p4'), 'p4-2') # loses third form update\n self.assertFalse('p5' in case.dynamic_case_properties()) # should disappear entirely\n _reset(f3)", "metadata": "root.CaseRebuildTest.test_form_archiving", "header": "['class', 'CaseRebuildTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 279 }, { "content": " @run_with_all_backends\n def test_archie_modified_on(self):\n case_id = uuid.uuid4().hex\n now = datetime.utcnow().replace(microsecond=0)\n earlier = now - timedelta(hours=1)\n way_earlier = now - timedelta(days=1)\n # make sure we timestamp everything so they have the right order\n create_block = CaseBlock(case_id, create=True, date_modified=way_earlier)\n post_case_blocks(\n [create_block.as_xml()], form_extras={'received_on': way_earlier}\n )\n update_block = CaseBlock(case_id, update={'foo': 'bar'}, date_modified=earlier)\n post_case_blocks(\n [update_block.as_xml()], form_extras={'received_on': earlier}\n )\n\n case_accessors = CaseAccessors(REBUILD_TEST_DOMAIN)\n case = case_accessors.get_case(case_id)\n self.assertEqual(earlier, case.modified_on)\n\n second_form = FormAccessors(REBUILD_TEST_DOMAIN).get_form(case.xform_ids[-1])\n second_form.archive()\n case = case_accessors.get_case(case_id)\n self.assertEqual(way_earlier, case.modified_on)", "metadata": "root.CaseRebuildTest.test_archie_modified_on", "header": "['class', 'CaseRebuildTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 403 }, { "content": " @run_with_all_backends\n def test_archive_against_deleted_case(self):\n now = datetime.utcnow()\n # make sure we timestamp everything so they have the right order\n case_id = _post_util(create=True, p1='p1', form_extras={'received_on': now})\n _post_util(case_id=case_id, p2='p2',\n form_extras={'received_on': now + timedelta(seconds=1)})\n _post_util(case_id=case_id, p3='p3',\n form_extras={'received_on': now + timedelta(seconds=2)})\n\n case_accessors = CaseAccessors(REBUILD_TEST_DOMAIN)\n case = case_accessors.get_case(case_id)\n case_accessors.soft_delete_cases([case_id])\n\n [f1, f2, f3] = case.xform_ids\n f2_doc = FormAccessors(REBUILD_TEST_DOMAIN).get_form(f2)\n f2_doc.archive()\n case = case_accessors.get_case(case_id)\n self.assertTrue(case.is_deleted)", "metadata": "root.CaseRebuildTest.test_archive_against_deleted_case", "header": "['class', 'CaseRebuildTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 428 }, { "content": "class TestCheckActionOrder(SimpleTestCase):\n\n\n\n", "metadata": "root.TestCheckActionOrder", "header": "['module', '___EOS___']", "index": 449 }, { "content": " def test_already_sorted(self):\n case = CommCareCase(actions=[\n CommCareCaseAction(server_date=datetime(2001, 1, 1, 0, 0, 0)),\n CommCareCaseAction(server_date=datetime(2001, 1, 2, 0, 0, 0)),\n CommCareCaseAction(server_date=datetime(2001, 1, 3, 0, 0, 0)),\n ])\n self.assertTrue(CouchCaseUpdateStrategy(case).check_action_order())", "metadata": "root.TestCheckActionOrder.test_already_sorted", "header": "['class', 'TestCheckActionOrder', '(', 'SimpleTestCase', ')', ':', '___EOS___']", "index": 451 }, { "content": " def test_out_of_order(self):\n case = CommCareCase(actions=[\n CommCareCaseAction(server_date=datetime(2001, 1, 1, 0, 0, 0)),\n CommCareCaseAction(server_date=datetime(2001, 1, 3, 0, 0, 0)),\n CommCareCaseAction(server_date=datetime(2001, 1, 2, 0, 0, 0)),\n ])\n self.assertFalse(CouchCaseUpdateStrategy(case).check_action_order())", "metadata": "root.TestCheckActionOrder.test_out_of_order", "header": "['class', 'TestCheckActionOrder', '(', 'SimpleTestCase', ')', ':', '___EOS___']", "index": 459 }, { "content": " def test_sorted_with_none(self):\n case = CommCareCase(actions=[\n CommCareCaseAction(server_date=datetime(2001, 1, 1, 0, 0, 0)),\n CommCareCaseAction(server_date=None),\n CommCareCaseAction(server_date=datetime(2001, 1, 2, 0, 0, 0)),\n CommCareCaseAction(server_date=datetime(2001, 1, 3, 0, 0, 0)),\n ])\n self.assertTrue(CouchCaseUpdateStrategy(case).check_action_order())", "metadata": "root.TestCheckActionOrder.test_sorted_with_none", "header": "['class', 'TestCheckActionOrder', '(', 'SimpleTestCase', ')', ':', '___EOS___']", "index": 467 }, { "content": " def test_out_of_order_with_none(self):\n case = CommCareCase(actions=[\n CommCareCaseAction(server_date=datetime(2001, 1, 1, 0, 0, 0)),\n CommCareCaseAction(server_date=datetime(2001, 1, 3, 0, 0, 0)),\n CommCareCaseAction(server_date=None),\n CommCareCaseAction(server_date=datetime(2001, 1, 2, 0, 0, 0)),\n ])\n self.assertFalse(CouchCaseUpdateStrategy(case).check_action_order())", "metadata": "root.TestCheckActionOrder.test_out_of_order_with_none", "header": "['class', 'TestCheckActionOrder', '(', 'SimpleTestCase', ')', ':', '___EOS___']", "index": 476 }, { "content": "class TestActionSortKey(SimpleTestCase):\n\n\n\n\n\n\n\n\n", "metadata": "root.TestActionSortKey", "header": "['module', '___EOS___']", "index": 486 }, { "content": " def test_missing_server_date(self):\n case = CommCareCase(actions=[\n _make_action(server_date=datetime(2001, 1, 1)),\n _make_action(server_date=None, phone_date=datetime(2001, 1, 1)),\n ])\n with self.assertRaises(MissingServerDate):\n sorted(case.actions, key=_action_sort_key_function(case))", "metadata": "root.TestActionSortKey.test_missing_server_date", "header": "['class', 'TestActionSortKey', '(', 'SimpleTestCase', ')', ':', '___EOS___']", "index": 488 }, { "content": " def test_missing_phone_date(self):\n case = CommCareCase(actions=[\n _make_action(server_date=datetime(2001, 1, 1)),\n _make_action(server_date=datetime(2001, 1, 1), phone_date=None),\n ])\n with self.assertRaises(MissingServerDate):\n sorted(case.actions, key=_action_sort_key_function(case))", "metadata": "root.TestActionSortKey.test_missing_phone_date", "header": "['class', 'TestActionSortKey', '(', 'SimpleTestCase', ')', ':', '___EOS___']", "index": 496 }, { "content": " def test_sort_by_server_date(self):\n expected_actions = (\n (0, _make_action(server_date=datetime(2001, 1, 1))),\n (2, _make_action(server_date=datetime(2001, 1, 3))),\n (1, _make_action(server_date=datetime(2001, 1, 2))),\n )\n self._test(expected_actions)", "metadata": "root.TestActionSortKey.test_sort_by_server_date", "header": "['class', 'TestActionSortKey', '(', 'SimpleTestCase', ')', ':', '___EOS___']", "index": 504 }, { "content": " def test_sort_by_server_date_precise(self):\n expected_actions = (\n (1, _make_action(server_date=datetime(2001, 1, 1, 0, 0, 1))),\n (0, _make_action(server_date=datetime(2001, 1, 1, 0, 0, 0))),\n )\n self._test(expected_actions)", "metadata": "root.TestActionSortKey.test_sort_by_server_date_precise", "header": "['class', 'TestActionSortKey', '(', 'SimpleTestCase', ')', ':', '___EOS___']", "index": 512 }, { "content": " def test_default_to_phone_date_on_same_day(self):\n expected_actions = (\n (1, _make_action(server_date=datetime(2001, 1, 1, 0, 0, 0), phone_date=datetime(2001, 1, 1, 0, 0, 1))),\n (0, _make_action(server_date=datetime(2001, 1, 1, 0, 0, 1), phone_date=datetime(2001, 1, 1, 0, 0, 0))),\n )\n self._test(expected_actions)", "metadata": "root.TestActionSortKey.test_default_to_phone_date_on_same_day", "header": "['class', 'TestActionSortKey', '(', 'SimpleTestCase', ')', ':', '___EOS___']", "index": 519 }, { "content": " def test_create_before_update(self):\n expected_actions = (\n (1, _make_action(server_date=datetime(2001, 1, 1), action_type=const.CASE_ACTION_UPDATE)),\n (0, _make_action(server_date=datetime(2001, 1, 1), action_type=const.CASE_ACTION_CREATE)),\n )\n self._test(expected_actions)", "metadata": "root.TestActionSortKey.test_create_before_update", "header": "['class', 'TestActionSortKey', '(', 'SimpleTestCase', ')', ':', '___EOS___']", "index": 526 }, { "content": " def test_update_before_close(self):\n expected_actions = (\n (1, _make_action(server_date=datetime(2001, 1, 1), action_type=const.CASE_ACTION_CLOSE)),\n (0, _make_action(server_date=datetime(2001, 1, 1), action_type=const.CASE_ACTION_UPDATE)),\n )\n self._test(expected_actions)", "metadata": "root.TestActionSortKey.test_update_before_close", "header": "['class', 'TestActionSortKey', '(', 'SimpleTestCase', ')', ':', '___EOS___']", "index": 533 }, { "content": " def test_different_usernames_default_to_server_date(self):\n expected_actions = (\n (0, _make_action(server_date=datetime(2001, 1, 1, 0, 0, 0),\n phone_date=datetime(2001, 1, 1, 0, 0, 1),\n user_id='user1')),\n (1, _make_action(server_date=datetime(2001, 1, 1, 0, 0, 1),\n phone_date=datetime(2001, 1, 1, 0, 0, 0),\n user_id='user2')),\n )\n self._test(expected_actions)", "metadata": "root.TestActionSortKey.test_different_usernames_default_to_server_date", "header": "['class', 'TestActionSortKey', '(', 'SimpleTestCase', ')', ':', '___EOS___']", "index": 540 }, { "content": " def _test(self, action_tuples):\n \"\"\"\n Takes in an iterable of tuples of the form: (expected_index, action).\n\n Calls the sort function on the actions in the order of the tuples and\n then asserts that they end up sorted in the order specified by the expected_index\n values.\n \"\"\"\n case = CommCareCase(actions=[tup[1] for tup in action_tuples])\n sorted_actions = sorted(case.actions, key=_action_sort_key_function(case))\n for index, action in action_tuples:\n self.assertEqual(action, sorted_actions[index])", "metadata": "root.TestActionSortKey._test", "header": "['class', 'TestActionSortKey', '(', 'SimpleTestCase', ')', ':', '___EOS___']", "index": 551 }, { "content": "def _make_action(server_date, phone_date=EMPTY_DATE, action_type=const.CASE_ACTION_UPDATE, user_id='someuserid'):\n if phone_date == EMPTY_DATE:\n phone_date = server_date\n return CommCareCaseAction(action_type=action_type, server_date=server_date, date=phone_date, user_id=user_id)", "metadata": "root._make_action", "header": "['module', '___EOS___']", "index": 567 } ]
[ { "span": "from couchdbkit.exceptions import ResourceNotFound", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 50 }, { "span": "from couchforms.models import XFormInstance", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 43 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "couchdb", "kit_", "._", "exceptions_", "import_", "Reso", "urc", "e", "Not", "Found_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "test_", "import_", "Test", "Case_", ",_", "Simple", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "case", "xml_", "._", "apps_", "._", "case_", "import_", "const_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "case", "xml_", "._", "apps_", "._", "case_", "._", "cleanup_", "import_", "rebu", "ild", "\\u", "case", "\\u", "from", "\\u", "forms_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "case", "xml_", "._", "apps_", "._", "case_", "._", "exceptions_", "import_", "Missing", "Server", "Date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "case", "xml_", "._", "apps_", "._", "case_", "._", "mock_", "import_", "Case", "Block_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "case", "xml_", "._", "apps_", "._", "case_", "._", "models_", "import_", "Comm", "Care", "Case_", ",_", "Comm", "Care", "Case", "Action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "datetime_", "import_", "datetime_", ",_", "timedelta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "copy_", "import_", "deepcopy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "case", "xml_", "._", "apps_", "._", "case_", "._", "tests_", "._", "util_", "import_", "delete", "\\u", "all", "\\u", "cases_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "case", "xml_", "._", "apps_", "._", "case_", "._", "util_", "import_", "primary", "\\u", "actions_", ",_", "post", "\\u", "case", "\\u", "blocks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "form", "\\u", "processor_", "._", "backends_", "._", "couch", "_", "._", "update", "\\u", "strategy_", "import_", "Cou", "ch", "Case", "Update", "Strategy_", ",_", "\\u", "action", "\\u", "sort", "\\u", "key", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "form", "\\u", "processor_", "._", "exceptions_", "import_", "Case", "Not", "Found_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "form", "\\u", "processor_", "._", "interfaces_", "._", "dba", "ccess", "ors_", "import_", "Case", "Accessor", "s_", ",_", "Form", "Accessor", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "form", "\\u", "processor_", "._", "models_", "import_", "Reb", "uild", "With", "Reason_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "form", "\\u", "processor_", "._", "tests_", "._", "utils_", "import_", "run", "\\u", "with", "\\u", "all", "\\u", "backends_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core", "hq", "_", "._", "form", "\\u", "processor_", "._", "utils_", "._", "general_", "import_", "shou", "ld", "\\u", "use", "\\u", "sql", "\\u", "backend_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "couch", "forms_", "._", "models_", "import_", "XF", "orm", "Instance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", "=_", "'", "rebu", "ild", "-", "test", "'_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "EMP", "TY", "\\u", "DATE_", "=_", "object_", "(_", ")_", "\\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_", "def_", "\\u", "post", "\\u", "util_", "(_", "create_", "=_", "False_", ",_", "case", "\\u", "id_", "=_", "None_", ",_", "user", "\\u", "id_", "=_", "None_", ",_", "owner", "\\u", "id_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "case", "\\u", "type_", "=_", "None_", ",_", "form", "\\u", "extras_", "=_", "None_", ",_", "close_", "=_", "False_", ",_", "date", "\\u", "modified_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form", "\\u", "extras_", "=_", "form", "\\u", "extras_", "or_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form", "\\u", "extras_", "[_", "'", "domain", "'_", "]_", "=_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "uid_", "=_", "lambda_", ":_", "uuid_", "._", "uuid4_", "(_", ")_", "._", "hex_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case", "\\u", "id_", "=_", "case", "\\u", "id_", "or_", "uid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "block_", "=_", "Case", "Block_", "(_", "create_", "=_", "create_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "case", "\\u", "id_", "=_", "case", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "id_", "=_", "user", "\\u", "id_", "or_", "uid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "owner", "\\u", "id_", "=_", "owner", "\\u", "id_", "or_", "uid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "case", "\\u", "type_", "=_", "case", "\\u", "type_", "or_", "'", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "date", "\\u", "modified_", "=_", "date", "\\u", "modified_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "update_", "=_", "kwargs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "close_", "=_", "close_", ")_", "._", "as", "\\u", "xml_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post", "\\u", "case", "\\u", "blocks_", "(_", "[_", "block_", "]_", ",_", "form", "\\u", "extras_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "case", "\\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_", "class_", "Case", "Reb", "uild", "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_", "\\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_", "Case", "Reb", "uild", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "set", "Up", "Class_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "delete", "\\u", "all", "\\u", "cases_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Case", "Reb", "uild", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "assert", "List", "Equal_", "(_", "self_", ",_", "l1_", ",_", "l2_", ",_", "include", "\\u", "ordering_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "include", "\\u", "ordering_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "l1_", ")_", ",_", "len_", "(_", "l2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "l1_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "l1_", "[_", "i_", "]_", ",_", "l2_", "[_", "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_", "#", " ", "this", " ", "is", " ", "bui", "lt", " ", "in", " ", "so", " ", "just", " ", "use", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "List", "Equal_", "(_", "l1_", ",_", "l2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Case", "Reb", "uild", "Test_", "(_", "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_", "\\u", "assert", "List", "Not", "Equal_", "(_", "self_", ",_", "l1_", ",_", "l2_", ",_", "msg_", "=_", "None_", ",_", "include", "\\u", "ordering_", "=_", "True_", ")_", ":_", "\\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 ", " _", "self_", "._", "\\u", "assert", "List", "Equal_", "(_", "l1_", ",_", "l2_", ",_", "include", "\\u", "ordering_", "=_", "include", "\\u", "ordering_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "self_", "._", "fail", "ure", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "#", " ", "this", " ", "is", " ", "what", " ", "we", " ", "want_", "\\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_", "._", "fail_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Case", "Reb", "uild", "Test_", "(_", "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", "couch", "\\u", "action", "\\u", "equality", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "case", "\\u", "id_", "=_", "\\u", "post", "\\u", "util_", "(_", "create_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "post", "\\u", "util_", "(_", "case", "\\u", "id_", "=_", "case", "\\u", "id_", ",_", "p1_", "=_", "'", "p1", "'_", ",_", "p2_", "=_", "'", "p2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "case_", "=_", "Comm", "Care", "Case_", "._", "get_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "2_", ",_", "len_", "(_", "case_", "._", "actions_", ")_", ")_", "#", " ", "create", " ", "+", " ", "update_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "case_", "._", "actions_", "[_", "0_", "]_", "!=_", "case_", "._", "actions_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "case_", "._", "actions_", "[_", "1_", "]_", "==_", "case_", "._", "actions_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "orig_", "=_", "case_", "._", "actions_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "copy_", "=_", "Comm", "Care", "Case", "Action_", "._", "wrap_", "(_", "orig_", "._", "\\u", "doc_", "._", "copy_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "copy_", "!=_", "case_", "._", "actions_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "copy_", "==_", "orig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "copy_", "._", "server", "\\u", "date_", "=_", "copy_", "._", "server", "\\u", "date_", "+_", "timedelta_", "(_", "seconds_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "copy_", "!=_", "orig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "copy_", "._", "server", "\\u", "date_", "=_", "orig_", "._", "server", "\\u", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "copy_", "==_", "orig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "copy_", "._", "update", "d\\u", "unknown", "\\u", "properties_", "[_", "'", "p1", "'_", "]_", "=_", "'", "not", "-", "p1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "copy_", "!=_", "orig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "copy_", "._", "update", "d\\u", "unknown", "\\u", "properties_", "[_", "'", "p1", "'_", "]_", "=_", "'", "p1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "copy_", "==_", "orig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "copy_", "._", "update", "d\\u", "unknown", "\\u", "properties_", "[_", "'", "pne", "w", "'_", "]_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "copy_", "!=_", "orig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Case", "Reb", "uild", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "couch", "\\u", "soft", "\\u", "rebuild_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "id_", "=_", "'", "test", "-", "basic", "-", "rebu", "ild", "-", "user", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "now_", "=_", "datetime_", "._", "utcnow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case", "\\u", "id_", "=_", "\\u", "post", "\\u", "util_", "(_", "create_", "=_", "True_", ",_", "user", "\\u", "id_", "=_", "user", "\\u", "id_", ",_", "date", "\\u", "modified_", "=_", "now_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "post", "\\u", "util_", "(_", "case", "\\u", "id_", "=_", "case", "\\u", "id_", ",_", "p1_", "=_", "'", "p1", "-1", "'_", ",_", "p2_", "=_", "'", "p2", "-1", "'_", ",_", "user", "\\u", "id_", "=_", "user", "\\u", "id_", ",_", "date", "\\u", "modified_", "=_", "now_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "post", "\\u", "util_", "(_", "case", "\\u", "id_", "=_", "case", "\\u", "id_", ",_", "p2_", "=_", "'", "p2", "-", "2", "'_", ",_", "p3_", "=_", "'", "p3", "-", "2", "'_", ",_", "user", "\\u", "id_", "=_", "user", "\\u", "id_", ",_", "date", "\\u", "modified_", "=_", "now_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "initial", " ", "state_", "\\u\\u\\uNL\\u\\u\\u_", "case_", "=_", "Comm", "Care", "Case_", "._", "get_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "p1_", ",_", "'", "p1", "-1", "'_", ")_", "#", " ", "original_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "p2_", ",_", "'", "p2", "-", "2", "'_", ")_", "#", " ", "updated_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "p3_", ",_", "'", "p3", "-", "2", "'_", ")_", "#", " ", "new_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "3_", ",_", "len_", "(_", "case_", "._", "actions_", ")_", ")_", "#", " ", "create", " ", "+", " ", "2", " ", "updates_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a1_", "=_", "case_", "._", "actions_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a1_", "._", "update", "d\\u", "unknown", "\\u", "properties_", "[_", "'", "p1", "'_", "]_", ",_", "'", "p1", "-1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a1_", "._", "update", "d\\u", "unknown", "\\u", "properties_", "[_", "'", "p2", "'_", "]_", ",_", "'", "p2", "-1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a2_", "=_", "case_", "._", "actions_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a2_", "._", "update", "d\\u", "unknown", "\\u", "properties_", "[_", "'", "p2", "'_", "]_", ",_", "'", "p2", "-", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a2_", "._", "update", "d\\u", "unknown", "\\u", "properties_", "[_", "'", "p3", "'_", "]_", ",_", "'", "p3", "-", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "rebu", "ild", " ", "by", " ", "flip", "ping", " ", "the", " ", "actions_", "\\u\\u\\uNL\\u\\u\\u_", "case_", "._", "actions_", "=_", "[_", "case_", "._", "actions_", "[_", "0_", "]_", ",_", "a2_", ",_", "a1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "._", "xform", "\\u", "ids_", "=_", "[_", "case_", "._", "xform", "\\u", "ids_", "[_", "0_", "]_", ",_", "case_", "._", "xform", "\\u", "ids_", "[_", "2_", "]_", ",_", "case_", "._", "xform", "\\u", "ids_", "[_", "1_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Cou", "ch", "Case", "Update", "Strategy_", "(_", "case_", ")_", "._", "soft", "\\u", "rebu", "ild", "\\u", "case_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "p1_", ",_", "'", "p1", "-1", "'_", ")_", "#", " ", "original_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "p2_", ",_", "'", "p2", "-1", "'_", ")_", "#", " ", "update", "d", " ", "(", "back", "!)", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "p3_", ",_", "'", "p3", "-", "2", "'_", ")_", "#", " ", "new_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Case", "Reb", "uild", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "couch", "\\u", "action", "\\u", "comparison_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "id_", "=_", "'", "test", "-", "action", "-", "compa", "ris", "on", "-", "user", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case", "\\u", "id_", "=_", "\\u", "post", "\\u", "util_", "(_", "create_", "=_", "True_", ",_", "property_", "=_", "'", "a1", " ", "wins", "'_", ",_", "user", "\\u", "id_", "=_", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "post", "\\u", "util_", "(_", "case", "\\u", "id_", "=_", "case", "\\u", "id_", ",_", "property_", "=_", "'", "a2", " ", "wins", "'_", ",_", "user", "\\u", "id_", "=_", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "post", "\\u", "util_", "(_", "case", "\\u", "id_", "=_", "case", "\\u", "id_", ",_", "property_", "=_", "'", "a3", " ", "wins", "'_", ",_", "user", "\\u", "id_", "=_", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "initial", " ", "state_", "\\u\\u\\uNL\\u\\u\\u_", "case_", "=_", "Comm", "Care", "Case_", "._", "get_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create_", ",_", "a1_", ",_", "a2_", ",_", "a3_", "=_", "deepcopy_", "(_", "list_", "(_", "case_", "._", "actions_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "a3", " ", "wins", "'_", ",_", "case_", "._", "property_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a1_", "._", "update", "d\\u", "unknown", "\\u", "properties_", "[_", "'", "property", "'_", "]_", ",_", "'", "a1", " ", "wins", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a2_", "._", "update", "d\\u", "unknown", "\\u", "properties_", "[_", "'", "property", "'_", "]_", ",_", "'", "a2", " ", "wins", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a3_", "._", "update", "d\\u", "unknown", "\\u", "properties_", "[_", "'", "property", "'_", "]_", ",_", "'", "a3", " ", "wins", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "confirm", "\\u", "action", "\\u", "order_", "(_", "case_", ",_", "expected", "\\u", "actions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "actual", "\\u", "actions_", "=_", "case_", "._", "actions_", "[_", "1_", ":_", "]_", "#", " ", "alw", "ay", "s", " ", "assume", " ", "create", " ", "is", " ", "first", " ", "and", " ", "removed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "expected_", ",_", "actual_", "in_", "zip_", "(_", "expected", "\\u", "actions_", ",_", "actual", "\\u", "actions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "expected_", "._", "update", "d\\u", "unknown", "\\u", "properties_", "[_", "'", "property", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "actual_", "._", "update", "d\\u", "unknown", "\\u", "properties_", "[_", "'", "property", "'_", "]_", ")_", "\\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", "confirm", "\\u", "action", "\\u", "order_", "(_", "case_", ",_", "[_", "a1_", ",_", "a2_", ",_", "a3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "initial", " ", "rebu", "ild", " ", "doe", "s", " ", "nothing_", "\\u\\u\\uNL\\u\\u\\u_", "update", "\\u", "strategy_", "=_", "Cou", "ch", "Case", "Update", "Strategy_", "(_", "case_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "\\u", "strategy_", "._", "soft", "\\u", "rebu", "ild", "\\u", "case_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "confirm", "\\u", "action", "\\u", "order_", "(_", "case_", ",_", "[_", "a1_", ",_", "a2_", ",_", "a3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "sorting", " ", "by", " ", "server", " ", "date_", "\\u\\u\\uNL\\u\\u\\u_", "case_", "._", "actions_", "[_", "2_", "]_", "._", "server", "\\u", "date_", "=_", "case_", "._", "actions_", "[_", "2_", "]_", "._", "server", "\\u", "date_", "+_", "timedelta_", "(_", "days_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "\\u", "strategy_", "._", "soft", "\\u", "rebu", "ild", "\\u", "case_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "confirm", "\\u", "action", "\\u", "order_", "(_", "case_", ",_", "[_", "a1_", ",_", "a3_", ",_", "a2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "sorting", " ", "by", " ", "date", " ", "within", " ", "the", " ", "same", " ", "day_", "\\u\\u\\uNL\\u\\u\\u_", "case_", "=_", "Comm", "Care", "Case_", "._", "get_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "confirm", "\\u", "action", "\\u", "order_", "(_", "case_", ",_", "[_", "a1_", ",_", "a2_", ",_", "a3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "._", "actions_", "[_", "2_", "]_", "._", "date_", "=_", "case_", "._", "actions_", "[_", "3_", "]_", "._", "date_", "+_", "timedelta_", "(_", "minutes_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Cou", "ch", "Case", "Update", "Strategy_", "(_", "case_", ")_", "._", "soft", "\\u", "rebu", "ild", "\\u", "case_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "confirm", "\\u", "action", "\\u", "order_", "(_", "case_", ",_", "[_", "a1_", ",_", "a3_", ",_", "a2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "original", " ", "form", " ", "order_", "\\u\\u\\uNL\\u\\u\\u_", "case_", "=_", "Comm", "Care", "Case_", "._", "get_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "._", "actions_", "[_", "3_", "]_", "._", "server", "\\u", "date_", "=_", "case_", "._", "actions_", "[_", "2_", "]_", "._", "server", "\\u", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "._", "actions_", "[_", "3_", "]_", "._", "date_", "=_", "case_", "._", "actions_", "[_", "2_", "]_", "._", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "._", "xform", "\\u", "ids_", "=_", "[_", "a1_", "._", "xform", "\\u", "id_", ",_", "a3_", "._", "xform", "\\u", "id_", ",_", "a2_", "._", "xform", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Cou", "ch", "Case", "Update", "Strategy_", "(_", "case_", ")_", "._", "soft", "\\u", "rebu", "ild", "\\u", "case_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "confirm", "\\u", "action", "\\u", "order_", "(_", "case_", ",_", "[_", "a1_", ",_", "a3_", ",_", "a2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "create", " ", "come", "s", " ", "bef", "ore", " ", "update_", "\\u\\u\\uNL\\u\\u\\u_", "case_", "=_", "Comm", "Care", "Case_", "._", "get_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "._", "actions_", "=_", "[_", "a1_", ",_", "create_", ",_", "a2_", ",_", "a3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Cou", "ch", "Case", "Update", "Strategy_", "(_", "case_", ")_", "._", "soft", "\\u", "rebu", "ild", "\\u", "case_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "confirm", "\\u", "action", "\\u", "order_", "(_", "case_", ",_", "[_", "a1_", ",_", "a2_", ",_", "a3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Case", "Reb", "uild", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "run", "\\u", "with", "\\u", "all", "\\u", "backends_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "rebu", "ild", "\\u", "empty_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "None_", ",_", "rebu", "ild", "\\u", "case", "\\u", "from", "\\u", "forms_", "(_", "'", "any", "domain", "'_", ",_", "'", "nota", "reali", "d", "'_", ",_", "Reb", "uild", "With", "Reason_", "(_", "reason_", "=_", "'", "test", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Case", "Reb", "uild", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "couch", "\\u", "rebu", "ild", "\\u", "delete", "d\\u", "case_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", ":", " ", "Can", "'", "t", " ", "run", " ", "this", " ", "on", " ", "SQL", " ", "bec", "aus", "e", " ", "if", " ", "a", " ", "case", " ", "gets", " ", "hard", " ", "delete", "d", " ", "then", " ", "there", " ", "is", " ", "no", " ", "way", " ", "to", " ", "find", "\\", "10", ";", " ", " ", " ", " ", "out", " ", "whi", "ch", " ", "forms", " ", "created", " ", "/", " ", "update", "d", " ", "it", " ", "with", "out", " ", "goi", "ng", " ", "through", " ", "ALL", " ", "the", " ", "forms", " ", "in", " ", "the", " ", "domain", ".", "\\", "10", ";", " ", " ", " ", " ", "ie", ".", " ", "there", " ", "is", " ", "no", " ", "SQL", " ", "equivalent", " ", "to", " ", "the", " ", "\"", "form", "\\u", "case", "\\u", "index", "/", "form", "\\u", "case", "\\u", "index", "\"", " ", "couch", " ", "view", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case", "\\u", "id_", "=_", "\\u", "post", "\\u", "util_", "(_", "create_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "post", "\\u", "util_", "(_", "case", "\\u", "id_", "=_", "case", "\\u", "id_", ",_", "p1_", "=_", "'", "p1", "'_", ",_", "p2_", "=_", "'", "p2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", " ", "initial", " ", "case_", "\\u\\u\\uNL\\u\\u\\u_", "delete", "\\u", "all", "\\u", "cases_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Case", "Not", "Found_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Case", "Accessor", "s_", "(_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", ")_", "._", "get", "\\u", "case_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "case_", "=_", "rebu", "ild", "\\u", "case", "\\u", "from", "\\u", "forms_", "(_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", ",_", "case", "\\u", "id_", ",_", "Reb", "uild", "With", "Reason_", "(_", "reason_", "=_", "'", "test", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "p1_", ",_", "'", "p1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "p2_", ",_", "'", "p2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "2_", ",_", "len_", "(_", "primary", "\\u", "actions_", "(_", "case_", ")_", ")_", ")_", "#", " ", "create", " ", "+", " ", "update_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Case", "Reb", "uild", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "couch", "\\u", "reconcile", "\\u", "actions_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "now_", "=_", "datetime_", "._", "utcnow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "we", " ", "timestamp", " ", "every", "thing", " ", "so", " ", "the", "y", " ", "have", " ", "the", " ", "right", " ", "order_", "\\u\\u\\uNL\\u\\u\\u_", "case", "\\u", "id_", "=_", "\\u", "post", "\\u", "util_", "(_", "create_", "=_", "True_", ",_", "form", "\\u", "extras_", "=_", "{_", "'", "receive", "d\\u", "on", "'_", ":_", "now_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "post", "\\u", "util_", "(_", "case", "\\u", "id_", "=_", "case", "\\u", "id_", ",_", "p1_", "=_", "'", "p1", "-1", "'_", ",_", "p2_", "=_", "'", "p2", "-1", "'_", ",_", "form", "\\u", "extras_", "=_", "{_", "'", "receive", "d\\u", "on", "'_", ":_", "now_", "+_", "timedelta_", "(_", "seconds_", "=_", "1_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "post", "\\u", "util_", "(_", "case", "\\u", "id_", "=_", "case", "\\u", "id_", ",_", "p2_", "=_", "'", "p2", "-", "2", "'_", ",_", "p3_", "=_", "'", "p3", "-", "2", "'_", ",_", "form", "\\u", "extras_", "=_", "{_", "'", "receive", "d\\u", "on", "'_", ":_", "now_", "+_", "timedelta_", "(_", "seconds_", "=_", "2_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "=_", "Comm", "Care", "Case_", "._", "get_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "\\u", "strategy_", "=_", "Cou", "ch", "Case", "Update", "Strategy_", "(_", "case_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "original", "\\u", "actions_", "=_", "[_", "deepcopy_", "(_", "a_", ")_", "for_", "a_", "in_", "case_", "._", "actions_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "original", "\\u", "form", "\\u", "ids_", "=_", "[_", "id_", "for_", "id_", "in_", "case_", "._", "xform", "\\u", "ids_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "3_", ",_", "len_", "(_", "original", "\\u", "actions_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "3_", ",_", "len_", "(_", "original", "\\u", "form", "\\u", "ids_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "List", "Equal_", "(_", "original", "\\u", "actions_", ",_", "case_", "._", "actions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "reorder", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "case_", "._", "actions_", "=_", "[_", "case_", "._", "actions_", "[_", "2_", "]_", ",_", "case_", "._", "actions_", "[_", "1_", "]_", ",_", "case_", "._", "actions_", "[_", "0_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "List", "Not", "Equal_", "(_", "original", "\\u", "actions_", ",_", "case_", "._", "actions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "\\u", "strategy_", "._", "reconcile", "\\u", "actions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "List", "Equal_", "(_", "original", "\\u", "actions_", ",_", "case_", "._", "actions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "duplicat", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "case_", "._", "actions_", "=_", "case_", "._", "actions_", "*_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "9_", ",_", "len_", "(_", "case_", "._", "actions_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "List", "Not", "Equal_", "(_", "original", "\\u", "actions_", ",_", "case_", "._", "actions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "\\u", "strategy_", "._", "reconcile", "\\u", "actions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "List", "Equal_", "(_", "original", "\\u", "actions_", ",_", "case_", "._", "actions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "duplicat", "ion", ",", " ", "even", " ", "whe", "n", " ", "dates", " ", "are", " ", "off_", "\\u\\u\\uNL\\u\\u\\u_", "case_", "._", "actions_", "=_", "original", "\\u", "actions_", "+_", "[_", "deepcopy_", "(_", "case_", "._", "actions_", "[_", "2_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "._", "actions_", "[_", "-_", "1_", "]_", "._", "server", "\\u", "date_", "=_", "case_", "._", "actions_", "[_", "-_", "1_", "]_", "._", "server", "\\u", "date_", "+_", "timedelta_", "(_", "seconds_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "List", "Not", "Equal_", "(_", "original", "\\u", "actions_", ",_", "case_", "._", "actions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "\\u", "strategy_", "._", "reconcile", "\\u", "actions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "List", "Equal_", "(_", "original", "\\u", "actions_", ",_", "case_", "._", "actions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "duplicat", "ion", " ", "with", " ", "different", " ", "proper", "ties", " ", "is", " ", "actual", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "treat", "ed", " ", "different", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "case_", "._", "actions_", "=_", "original", "\\u", "actions_", "+_", "[_", "deepcopy_", "(_", "case_", "._", "actions_", "[_", "2_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "._", "actions_", "[_", "-_", "1_", "]_", "._", "update", "d\\u", "unknown", "\\u", "properties_", "[_", "'", "new", "'_", "]_", "=_", "'", "mism", "atch", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "4_", ",_", "len_", "(_", "case_", "._", "actions_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "List", "Not", "Equal_", "(_", "original", "\\u", "actions_", ",_", "case_", "._", "actions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "\\u", "strategy_", "._", "reconcile", "\\u", "actions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "List", "Not", "Equal_", "(_", "original", "\\u", "actions_", ",_", "case_", "._", "actions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "clean", " ", "slate", " ", "rebuild_", "\\u\\u\\uNL\\u\\u\\u_", "case_", "=_", "rebu", "ild", "\\u", "case", "\\u", "from", "\\u", "forms_", "(_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", ",_", "case", "\\u", "id_", ",_", "Reb", "uild", "With", "Reason_", "(_", "reason_", "=_", "'", "test", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "List", "Equal_", "(_", "original", "\\u", "actions_", ",_", "primary", "\\u", "actions_", "(_", "case_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "List", "Equal_", "(_", "original", "\\u", "form", "\\u", "ids_", ",_", "case_", "._", "xform", "\\u", "ids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Case", "Reb", "uild", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "run", "\\u", "with", "\\u", "all", "\\u", "backends_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "archi", "ving", "\\u", "only", "\\u", "form_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Check", "s", " ", "tha", "t", " ", "archi", "ving", " ", "the", " ", "only", " ", "form", " ", "associate", "d", " ", "with", " ", "the", " ", "case", " ", "archives", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "case", " ", "and", " ", "una", "rchi", "ving", " ", "una", "rchi", "ves", " ", "it", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case", "\\u", "id_", "=_", "\\u", "post", "\\u", "util_", "(_", "create_", "=_", "True_", ",_", "p1_", "=_", "'", "p1", "-1", "'_", ",_", "p2_", "=_", "'", "p2", "-1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case", "\\u", "accessor", "s_", "=_", "Case", "Accessor", "s_", "(_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "=_", "case", "\\u", "accessor", "s_", "._", "get", "\\u", "case_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "case_", "._", "is", "\\u", "deleted_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "shou", "ld", "\\u", "use", "\\u", "sql", "\\u", "backend_", "(_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "len_", "(_", "case_", "._", "actions_", ")_", ")_", "\\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_", "(_", "2_", ",_", "len_", "(_", "case_", "._", "actions_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[_", "form", "\\u", "id_", "]_", "=_", "case_", "._", "xform", "\\u", "ids_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "Form", "Accessor", "s_", "(_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", ")_", "._", "get", "\\u", "form_", "(_", "form", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "form_", "._", "archive_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "=_", "case", "\\u", "accessor", "s_", "._", "get", "\\u", "case_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "case_", "._", "is", "\\u", "deleted_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "shou", "ld", " ", "just", " ", "have", " ", "the", " ", "'", "rebu", "ild", "'", " ", "action_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "len_", "(_", "case_", "._", "actions_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "case_", "._", "actions_", "[_", "0_", "]_", "._", "is", "\\u", "case", "\\u", "rebuild_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "form_", "._", "una", "rchi", "ve_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "=_", "case", "\\u", "accessor", "s_", "._", "get", "\\u", "case_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "case_", "._", "is", "\\u", "deleted_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "3_", ",_", "len_", "(_", "case_", "._", "actions_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "case_", "._", "actions_", "[_", "-_", "1_", "]_", "._", "is", "\\u", "case", "\\u", "rebuild_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Case", "Reb", "uild", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "run", "\\u", "with", "\\u", "all", "\\u", "backends_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "form", "\\u", "archi", "ving", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "now_", "=_", "datetime_", "._", "utcnow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "we", " ", "timestamp", " ", "every", "thing", " ", "so", " ", "the", "y", " ", "have", " ", "the", " ", "right", " ", "order_", "\\u\\u\\uNL\\u\\u\\u_", "case", "\\u", "id_", "=_", "\\u", "post", "\\u", "util_", "(_", "create_", "=_", "True_", ",_", "p1_", "=_", "'", "p1", "-1", "'_", ",_", "p2_", "=_", "'", "p2", "-1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "form", "\\u", "extras_", "=_", "{_", "'", "receive", "d\\u", "on", "'_", ":_", "now_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "post", "\\u", "util_", "(_", "case", "\\u", "id_", "=_", "case", "\\u", "id_", ",_", "p2_", "=_", "'", "p2", "-", "2", "'_", ",_", "p3_", "=_", "'", "p3", "-", "2", "'_", ",_", "p4_", "=_", "'", "p4", "-", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "form", "\\u", "extras_", "=_", "{_", "'", "receive", "d\\u", "on", "'_", ":_", "now_", "+_", "timedelta_", "(_", "seconds_", "=_", "1_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "post", "\\u", "util_", "(_", "case", "\\u", "id_", "=_", "case", "\\u", "id_", ",_", "p4_", "=_", "'", "p4", "-", "3", "'_", ",_", "p5", "_", "=_", "'", "p5", "-", "3", "'_", ",_", "close_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "form", "\\u", "extras_", "=_", "{_", "'", "receive", "d\\u", "on", "'_", ":_", "now_", "+_", "timedelta_", "(_", "seconds_", "=_", "2_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "case", "\\u", "accessor", "s_", "=_", "Case", "Accessor", "s_", "(_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "=_", "case", "\\u", "accessor", "s_", "._", "get", "\\u", "case_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "close", "d\\u", "by_", "=_", "case_", "._", "close", "d\\u", "by_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "close", "d\\u", "on_", "=_", "case_", "._", "close", "d\\u", "on_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "''_", ",_", "close", "d\\u", "by_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "None_", ",_", "close", "d\\u", "on_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "check", "\\u", "initial", "\\u", "state_", "(_", "case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "case_", "._", "closed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "close", "d\\u", "by_", ",_", "case_", "._", "close", "d\\u", "by_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "close", "d\\u", "on_", ",_", "case_", "._", "close", "d\\u", "on_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "case", "\\u", "property_", "(_", "'", "p1", "'_", ")_", ",_", "'", "p1", "-1", "'_", ")_", "#", " ", "original_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "case", "\\u", "property_", "(_", "'", "p2", "'_", ")_", ",_", "'", "p2", "-", "2", "'_", ")_", "#", " ", "update", "d", " ", "in", " ", "second", " ", "post_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "case", "\\u", "property_", "(_", "'", "p3", "'_", ")_", ",_", "'", "p3", "-", "2", "'_", ")_", "#", " ", "new", " ", "in", " ", "second", " ", "post_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "case", "\\u", "property_", "(_", "'", "p4", "'_", ")_", ",_", "'", "p4", "-", "3", "'_", ")_", "#", " ", "update", "d", " ", "in", " ", "third", " ", "post_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "case", "\\u", "property_", "(_", "'", "p5", "'_", ")_", ",_", "'", "p5", "-", "3", "'_", ")_", "#", " ", "new", " ", "in", " ", "third", " ", "post_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "shou", "ld", "\\u", "use", "\\u", "sql", "\\u", "backend_", "(_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "SQL", " ", "store", "s", " ", "one", " ", "transaction", " ", "per", " ", "form_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "3_", ",_", "len_", "(_", "primary", "\\u", "actions_", "(_", "case_", ")_", ")_", ")_", "#", " ", "create", " ", "+", " ", "update", " ", "+", " ", "close_", "\\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_", "(_", "5_", ",_", "len_", "(_", "primary", "\\u", "actions_", "(_", "case_", ")_", ")_", ")_", "#", " ", "create", " ", "+", " ", "3", " ", "update", "s", " ", "+", " ", "close_", "\\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", "check", "\\u", "initial", "\\u", "state_", "(_", "case_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "verify", " ", "xform", "/", "action", " ", "states_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "f1_", ",_", "f2_", ",_", "f3_", "]_", "=_", "case_", "._", "xform", "\\u", "ids_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "shou", "ld", "\\u", "use", "\\u", "sql", "\\u", "backend_", "(_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "[_", "create_", ",_", "update_", ",_", "close_", "]_", "=_", "case_", "._", "actions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f1_", ",_", "create_", "._", "form", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f2_", ",_", "update_", "._", "form", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f3_", ",_", "close_", "._", "form", "\\u", "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 ", " _", "[_", "create_", ",_", "u1_", ",_", "u2_", ",_", "u", "3_", ",_", "close_", "]_", "=_", "case_", "._", "actions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f1_", ",_", "create_", "._", "form", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f1_", ",_", "u1_", "._", "form", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f2_", ",_", "u2_", "._", "form", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f3_", ",_", "u", "3_", "._", "form", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "todo", ":", " ", "shou", "ld", " ", "this", " ", "be", " ", "the", " ", "behavior", " ", "for", " ", "archi", "ving", " ", "the", " ", "create", " ", "form", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "form", "\\u", "aces", "sor", "s_", "=_", "Form", "Accessor", "s_", "(_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f1", "\\u", "doc_", "=_", "form", "\\u", "aces", "sor", "s_", "._", "get", "\\u", "form_", "(_", "f1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f1", "\\u", "doc_", "._", "archive_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "=_", "case", "\\u", "accessor", "s_", "._", "get", "\\u", "case_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "shou", "ld", "\\u", "use", "\\u", "sql", "\\u", "backend_", "(_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "2_", ",_", "len_", "(_", "primary", "\\u", "actions_", "(_", "case_", ")_", ")_", ")_", "\\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_", "(_", "3_", ",_", "len_", "(_", "primary", "\\u", "actions_", "(_", "case_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[_", "u2_", ",_", "u", "3_", "]_", "=_", "case_", "._", "xform", "\\u", "ids_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f2_", ",_", "u2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f3_", ",_", "u", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "case_", "._", "closed_", ")_", "#", " ", "no", " ", "change_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "p1", "'_", "in_", "case_", "._", "dynami", "c\\u", "case", "\\u", "properties_", "(_", ")_", ")_", "#", " ", "shou", "ld", " ", "disapp", "ear", " ", "entire", "ly_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "case", "\\u", "property_", "(_", "'", "p2", "'_", ")_", ",_", "'", "p2", "-", "2", "'_", ")_", "#", " ", "no", " ", "change_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "case", "\\u", "property_", "(_", "'", "p3", "'_", ")_", ",_", "'", "p3", "-", "2", "'_", ")_", "#", " ", "no", " ", "change_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "case", "\\u", "property_", "(_", "'", "p4", "'_", ")_", ",_", "'", "p4", "-", "3", "'_", ")_", "#", " ", "no", " ", "change_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "case", "\\u", "property_", "(_", "'", "p5", "'_", ")_", ",_", "'", "p5", "-", "3", "'_", ")_", "#", " ", "no", " ", "change_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "reset_", "(_", "form", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form", "\\u", "doc_", "=_", "form", "\\u", "aces", "sor", "s_", "._", "get", "\\u", "form_", "(_", "form", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form", "\\u", "doc_", "._", "una", "rchi", "ve_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "=_", "case", "\\u", "accessor", "s_", "._", "get", "\\u", "case_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "check", "\\u", "initial", "\\u", "state_", "(_", "case_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "reset_", "(_", "f1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f2", "\\u", "doc_", "=_", "form", "\\u", "aces", "sor", "s_", "._", "get", "\\u", "form_", "(_", "f2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f2", "\\u", "doc_", "._", "archive_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "=_", "case", "\\u", "accessor", "s_", "._", "get", "\\u", "case_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "shou", "ld", "\\u", "use", "\\u", "sql", "\\u", "backend_", "(_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "2_", ",_", "len_", "(_", "primary", "\\u", "actions_", "(_", "case_", ")_", ")_", ")_", "\\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_", "(_", "4_", ",_", "len_", "(_", "primary", "\\u", "actions_", "(_", "case_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[_", "u1_", ",_", "u", "3_", "]_", "=_", "case_", "._", "xform", "\\u", "ids_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f1_", ",_", "u1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f3_", ",_", "u", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "case_", "._", "closed_", ")_", "#", " ", "no", " ", "change_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "case", "\\u", "property_", "(_", "'", "p1", "'_", ")_", ",_", "'", "p1", "-1", "'_", ")_", "#", " ", "original_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "case", "\\u", "property_", "(_", "'", "p2", "'_", ")_", ",_", "'", "p2", "-1", "'_", ")_", "#", " ", "lose", "s", " ", "second", " ", "form", " ", "update_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "p3", "'_", "in_", "case_", "._", "dynami", "c\\u", "case", "\\u", "properties_", "(_", ")_", ")_", "#", " ", "shou", "ld", " ", "disapp", "ear", " ", "entire", "ly_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "case", "\\u", "property_", "(_", "'", "p4", "'_", ")_", ",_", "'", "p4", "-", "3", "'_", ")_", "#", " ", "no", " ", "change_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "case", "\\u", "property_", "(_", "'", "p5", "'_", ")_", ",_", "'", "p5", "-", "3", "'_", ")_", "#", " ", "no", " ", "change_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "reset_", "(_", "f2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f3", "\\u", "doc_", "=_", "form", "\\u", "aces", "sor", "s_", "._", "get", "\\u", "form_", "(_", "f3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f3", "\\u", "doc_", "._", "archive_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "=_", "case", "\\u", "accessor", "s_", "._", "get", "\\u", "case_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "shou", "ld", "\\u", "use", "\\u", "sql", "\\u", "backend_", "(_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "2_", ",_", "len_", "(_", "primary", "\\u", "actions_", "(_", "case_", ")_", ")_", ")_", "\\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_", "(_", "3_", ",_", "len_", "(_", "primary", "\\u", "actions_", "(_", "case_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[_", "u1_", ",_", "u2_", "]_", "=_", "case_", "._", "xform", "\\u", "ids_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f1_", ",_", "u1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f2_", ",_", "u2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "case_", "._", "closed_", ")_", "#", " ", "reo", "pene", "d", "!", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "''_", ",_", "case_", "._", "close", "d\\u", "by_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "None_", ",_", "case_", "._", "close", "d\\u", "on_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "case", "\\u", "property_", "(_", "'", "p1", "'_", ")_", ",_", "'", "p1", "-1", "'_", ")_", "#", " ", "original_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "case", "\\u", "property_", "(_", "'", "p2", "'_", ")_", ",_", "'", "p2", "-", "2", "'_", ")_", "#", " ", "original_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "case", "\\u", "property_", "(_", "'", "p3", "'_", ")_", ",_", "'", "p3", "-", "2", "'_", ")_", "#", " ", "new", " ", "in", " ", "second", " ", "post_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "case", "\\u", "property_", "(_", "'", "p4", "'_", ")_", ",_", "'", "p4", "-", "2", "'_", ")_", "#", " ", "lose", "s", " ", "third", " ", "form", " ", "update_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "p5", "'_", "in_", "case_", "._", "dynami", "c\\u", "case", "\\u", "properties_", "(_", ")_", ")_", "#", " ", "shou", "ld", " ", "disapp", "ear", " ", "entire", "ly_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "reset_", "(_", "f3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Case", "Reb", "uild", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "run", "\\u", "with", "\\u", "all", "\\u", "backends_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "archi", "e\\u", "modifi", "ed", "\\u", "on_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "case", "\\u", "id_", "=_", "uuid_", "._", "uuid4_", "(_", ")_", "._", "hex_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "now_", "=_", "datetime_", "._", "utcnow_", "(_", ")_", "._", "replace_", "(_", "microsecond_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ear", "lie", "r_", "=_", "now_", "-_", "timedelta_", "(_", "hours_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "way", "\\u", "ear", "lie", "r_", "=_", "now_", "-_", "timedelta_", "(_", "days_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "we", " ", "timestamp", " ", "every", "thing", " ", "so", " ", "the", "y", " ", "have", " ", "the", " ", "right", " ", "order_", "\\u\\u\\uNL\\u\\u\\u_", "create", "\\u", "block_", "=_", "Case", "Block_", "(_", "case", "\\u", "id_", ",_", "create_", "=_", "True_", ",_", "date", "\\u", "modified_", "=_", "way", "\\u", "ear", "lie", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post", "\\u", "case", "\\u", "blocks_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "create", "\\u", "block_", "._", "as", "\\u", "xml_", "(_", ")_", "]_", ",_", "form", "\\u", "extras_", "=_", "{_", "'", "receive", "d\\u", "on", "'_", ":_", "way", "\\u", "ear", "lie", "r_", "}_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "\\u", "block_", "=_", "Case", "Block_", "(_", "case", "\\u", "id_", ",_", "update_", "=_", "{_", "'", "foo", "'_", ":_", "'", "bar", "'_", "}_", ",_", "date", "\\u", "modified_", "=_", "ear", "lie", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post", "\\u", "case", "\\u", "blocks_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "update", "\\u", "block_", "._", "as", "\\u", "xml_", "(_", ")_", "]_", ",_", "form", "\\u", "extras_", "=_", "{_", "'", "receive", "d\\u", "on", "'_", ":_", "ear", "lie", "r_", "}_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "case", "\\u", "accessor", "s_", "=_", "Case", "Accessor", "s_", "(_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "=_", "case", "\\u", "accessor", "s_", "._", "get", "\\u", "case_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "ear", "lie", "r_", ",_", "case_", "._", "modifi", "ed", "\\u", "on_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "second", "\\u", "form_", "=_", "Form", "Accessor", "s_", "(_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", ")_", "._", "get", "\\u", "form_", "(_", "case_", "._", "xform", "\\u", "ids_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "second", "\\u", "form_", "._", "archive_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "=_", "case", "\\u", "accessor", "s_", "._", "get", "\\u", "case_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "way", "\\u", "ear", "lie", "r_", ",_", "case_", "._", "modifi", "ed", "\\u", "on_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Case", "Reb", "uild", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "run", "\\u", "with", "\\u", "all", "\\u", "backends_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "archive", "\\u", "against", "\\u", "delete", "d\\u", "case_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "now_", "=_", "datetime_", "._", "utcnow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "we", " ", "timestamp", " ", "every", "thing", " ", "so", " ", "the", "y", " ", "have", " ", "the", " ", "right", " ", "order_", "\\u\\u\\uNL\\u\\u\\u_", "case", "\\u", "id_", "=_", "\\u", "post", "\\u", "util_", "(_", "create_", "=_", "True_", ",_", "p1_", "=_", "'", "p1", "'_", ",_", "form", "\\u", "extras_", "=_", "{_", "'", "receive", "d\\u", "on", "'_", ":_", "now_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "post", "\\u", "util_", "(_", "case", "\\u", "id_", "=_", "case", "\\u", "id_", ",_", "p2_", "=_", "'", "p2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "form", "\\u", "extras_", "=_", "{_", "'", "receive", "d\\u", "on", "'_", ":_", "now_", "+_", "timedelta_", "(_", "seconds_", "=_", "1_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "post", "\\u", "util_", "(_", "case", "\\u", "id_", "=_", "case", "\\u", "id_", ",_", "p3_", "=_", "'", "p3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "form", "\\u", "extras_", "=_", "{_", "'", "receive", "d\\u", "on", "'_", ":_", "now_", "+_", "timedelta_", "(_", "seconds_", "=_", "2_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "case", "\\u", "accessor", "s_", "=_", "Case", "Accessor", "s_", "(_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "=_", "case", "\\u", "accessor", "s_", "._", "get", "\\u", "case_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case", "\\u", "accessor", "s_", "._", "soft", "\\u", "delete", "\\u", "cases_", "(_", "[_", "case", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "f1_", ",_", "f2_", ",_", "f3_", "]_", "=_", "case_", "._", "xform", "\\u", "ids_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f2", "\\u", "doc_", "=_", "Form", "Accessor", "s_", "(_", "REB", "UI", "LD", "\\u", "TEST", "\\u", "DOMAIN_", ")_", "._", "get", "\\u", "form_", "(_", "f2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f2", "\\u", "doc_", "._", "archive_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "=_", "case", "\\u", "accessor", "s_", "._", "get", "\\u", "case_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "case_", "._", "is", "\\u", "deleted_", ")_", "\\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", "Check", "Action", "Order_", "(_", "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_", "[SEP]_", "class_", "Test", "Check", "Action", "Order_", "(_", "Simple", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "alr", "ead", "y", "\\u", "sorted_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "case_", "=_", "Comm", "Care", "Case_", "(_", "actions_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Comm", "Care", "Case", "Action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Comm", "Care", "Case", "Action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "2_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Comm", "Care", "Case", "Action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "3_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "Cou", "ch", "Case", "Update", "Strategy_", "(_", "case_", ")_", "._", "check", "\\u", "action", "\\u", "order_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Check", "Action", "Order_", "(_", "Simple", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "out", "\\u", "of", "\\u", "order_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "case_", "=_", "Comm", "Care", "Case_", "(_", "actions_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Comm", "Care", "Case", "Action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Comm", "Care", "Case", "Action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "3_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Comm", "Care", "Case", "Action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "2_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "Cou", "ch", "Case", "Update", "Strategy_", "(_", "case_", ")_", "._", "check", "\\u", "action", "\\u", "order_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Check", "Action", "Order_", "(_", "Simple", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sorte", "d\\u", "with", "\\u", "none_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "case_", "=_", "Comm", "Care", "Case_", "(_", "actions_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Comm", "Care", "Case", "Action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Comm", "Care", "Case", "Action_", "(_", "server", "\\u", "date_", "=_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Comm", "Care", "Case", "Action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "2_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Comm", "Care", "Case", "Action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "3_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "Cou", "ch", "Case", "Update", "Strategy_", "(_", "case_", ")_", "._", "check", "\\u", "action", "\\u", "order_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Check", "Action", "Order_", "(_", "Simple", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "out", "\\u", "of", "\\u", "order", "\\u", "with", "\\u", "none_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "case_", "=_", "Comm", "Care", "Case_", "(_", "actions_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Comm", "Care", "Case", "Action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Comm", "Care", "Case", "Action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "3_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Comm", "Care", "Case", "Action_", "(_", "server", "\\u", "date_", "=_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Comm", "Care", "Case", "Action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "2_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "Cou", "ch", "Case", "Update", "Strategy_", "(_", "case_", ")_", "._", "check", "\\u", "action", "\\u", "order_", "(_", ")_", ")_", "\\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", "Action", "Sort", "Key_", "(_", "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\\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", "Action", "Sort", "Key_", "(_", "Simple", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "missi", "ng", "\\u", "server", "\\u", "date_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "case_", "=_", "Comm", "Care", "Case_", "(_", "actions_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", "=_", "None_", ",_", "phone", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Missing", "Server", "Date_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sorted_", "(_", "case_", "._", "actions_", ",_", "key_", "=_", "\\u", "action", "\\u", "sort", "\\u", "key", "\\u", "function_", "(_", "case_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Action", "Sort", "Key_", "(_", "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", "missi", "ng", "\\u", "phone", "\\u", "date_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "case_", "=_", "Comm", "Care", "Case_", "(_", "actions_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ")_", ",_", "phone", "\\u", "date_", "=_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Missing", "Server", "Date_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sorted_", "(_", "case_", "._", "actions_", ",_", "key_", "=_", "\\u", "action", "\\u", "sort", "\\u", "key", "\\u", "function_", "(_", "case_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Action", "Sort", "Key_", "(_", "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", "sort", "\\u", "by", "\\u", "server", "\\u", "date_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected", "\\u", "actions_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "2_", ",_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "3_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "2_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test_", "(_", "expected", "\\u", "actions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Action", "Sort", "Key_", "(_", "Simple", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sort", "\\u", "by", "\\u", "server", "\\u", "date", "\\u", "precise", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected", "\\u", "actions_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ",_", "0_", ",_", "0_", ",_", "1_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test_", "(_", "expected", "\\u", "actions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Action", "Sort", "Key_", "(_", "Simple", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "default", "\\u", "to", "\\u", "phone", "\\u", "date", "\\u", "on", "\\u", "same", "\\u", "day_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected", "\\u", "actions_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ",_", "phone", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ",_", "0_", ",_", "0_", ",_", "1_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ",_", "0_", ",_", "0_", ",_", "1_", ")_", ",_", "phone", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test_", "(_", "expected", "\\u", "actions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Action", "Sort", "Key_", "(_", "Simple", "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", "bef", "ore", "\\u", "update_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected", "\\u", "actions_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ")_", ",_", "action", "\\u", "type_", "=_", "const_", "._", "CASE", "\\u", "ACTI", "ON", "\\u", "UPDATE_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ")_", ",_", "action", "\\u", "type_", "=_", "const_", "._", "CASE", "\\u", "ACTI", "ON", "\\u", "CREATE_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test_", "(_", "expected", "\\u", "actions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Action", "Sort", "Key_", "(_", "Simple", "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", "bef", "ore", "\\u", "close_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected", "\\u", "actions_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ")_", ",_", "action", "\\u", "type_", "=_", "const_", "._", "CASE", "\\u", "ACTI", "ON", "\\u", "CLOSE_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ")_", ",_", "action", "\\u", "type_", "=_", "const_", "._", "CASE", "\\u", "ACTI", "ON", "\\u", "UPDATE_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test_", "(_", "expected", "\\u", "actions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Action", "Sort", "Key_", "(_", "Simple", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "different", "\\u", "usernames", "\\u", "default", "\\u", "to", "\\u", "server", "\\u", "date_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected", "\\u", "actions_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "phone", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ",_", "0_", ",_", "0_", ",_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "id_", "=_", "'", "user", "1", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "1_", ",_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ",_", "0_", ",_", "0_", ",_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "phone", "\\u", "date_", "=_", "datetime_", "(_", "2001_", ",_", "1_", ",_", "1_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "id_", "=_", "'", "user", "2", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test_", "(_", "expected", "\\u", "actions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Action", "Sort", "Key_", "(_", "Simple", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "test_", "(_", "self_", ",_", "action", "\\u", "tuples_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Tak", "es", " ", "in", " ", "an", " ", "iterable", " ", "of", " ", "tuple", "s", " ", "of", " ", "the", " ", "form", ":", " ", "(", "expected", "\\u", "index", ",", " ", "action", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Calls", " ", "the", " ", "sort", " ", "function", " ", "on", " ", "the", " ", "action", "s", " ", "in", " ", "the", " ", "order", " ", "of", " ", "the", " ", "tuple", "s", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "then", " ", "asserts", " ", "tha", "t", " ", "the", "y", " ", "end", " ", "up", " ", "sorte", "d", " ", "in", " ", "the", " ", "order", " ", "specified", " ", "by", " ", "the", " ", "expected", "\\u", "index", "\\", "10", ";", " ", " ", " ", " ", "values", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "=_", "Comm", "Care", "Case_", "(_", "actions_", "=_", "[_", "tup_", "[_", "1_", "]_", "for_", "tup_", "in_", "action", "\\u", "tuples_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sorte", "d\\u", "actions_", "=_", "sorted_", "(_", "case_", "._", "actions_", ",_", "key_", "=_", "\\u", "action", "\\u", "sort", "\\u", "key", "\\u", "function_", "(_", "case_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "index_", ",_", "action_", "in_", "action", "\\u", "tuples_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "action_", ",_", "sorte", "d\\u", "actions_", "[_", "index_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "make", "\\u", "action_", "(_", "server", "\\u", "date_", ",_", "phone", "\\u", "date_", "=_", "EMP", "TY", "\\u", "DATE_", ",_", "action", "\\u", "type_", "=_", "const_", "._", "CASE", "\\u", "ACTI", "ON", "\\u", "UPDATE_", ",_", "user", "\\u", "id_", "=_", "'", "some", "user", "id", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "phone", "\\u", "date_", "==_", "EMP", "TY", "\\u", "DATE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "phone", "\\u", "date_", "=_", "server", "\\u", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Comm", "Care", "Case", "Action_", "(_", "action", "\\u", "type_", "=_", "action", "\\u", "type_", ",_", "server", "\\u", "date_", "=_", "server", "\\u", "date_", ",_", "date_", "=_", "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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 ]
Unused import
kylef-archive/lithium/lithium/blog/urls.py
[ { "content": "from django.conf.urls.defaults import *\nfrom django.core.urlresolvers import get_callable\nfrom django.core.urlresolvers import RegexURLPattern\n\nfrom lithium.conf import settings\nfrom lithium.views.date_based import *\nfrom lithium.blog.models import Post\nfrom lithium.blog.feeds import LatestPosts, LatestPostsByTag, LatestPostsByAuthor\nfrom lithium.blog.decorators import private_post_decorator\n\nlist_dict = {\n 'queryset': Post.on_site.all(),\n 'date_field': 'pub_date',\n 'paginate_by': settings.BLOG_PAGINATE_BY,\n 'template_object_name': 'post',\n}\n\ndetail_dict = {\n 'queryset': Post.on_site.all(),\n 'date_field': 'pub_date',\n 'template_object_name': 'post',\n}\n\nurlpatterns = patterns('',\n url(r'^(?P<year>\\d{4})/(?P<month>[a-z]{3})/(?P<day>\\w{1,2})/(?P<slug>[-\\w]+)/$', private_post_decorator(object_detail), detail_dict, 'blog.post_detail'),\n url(r'^(?P<year>\\d{4})/(?P<month>[a-z]{3})/(?P<day>\\w{1,2})/$', private_post_decorator(archive_day), list_dict, 'blog.archive_day'),\n url(r'^(?P<year>\\d{4})/(?P<month>[a-z]{3})/$', private_post_decorator(archive_month), list_dict, 'blog.archive_month'),\n url(r'^(?P<year>\\d{4})/$', private_post_decorator(archive_year), list_dict, 'blog.archive_year'),\n url(r'^$', private_post_decorator(archive_index), list_dict, 'blog.post_list'),\n url(r'^author/(?P<author>[-\\w]+)/?$', private_post_decorator(archive_index), list_dict, 'blog.author_detail'),\n url(r'^tag/(?P<tag>[-\\w]+)/$', private_post_decorator(archive_index), list_dict, 'blog.category_detail'),\n)\n\nfeeds = {\n 'latest': LatestPosts,\n 'tag': LatestPostsByTag,\n 'author': LatestPostsByAuthor,\n}\n\nurlpatterns += patterns('django.contrib.syndication.views',\n url(r'^feed/(?P<url>.*)/$', 'feed', {'feed_dict': feeds}, name='blog.feeds'),\n)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from django.core.urlresolvers import get_callable", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 49 }, { "span": "from django.core.urlresolvers import RegexURLPattern", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 52 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "conf_", "._", "urls_", "._", "defaults_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "get", "\\u", "callable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "Rege", "x", "URL", "Pattern_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lith", "ium_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lith", "ium_", "._", "views_", "._", "date", "\\u", "based", "_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lith", "ium_", "._", "blog_", "._", "models_", "import_", "Post_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lith", "ium_", "._", "blog_", "._", "feeds_", "import_", "Late", "st", "Posts", "_", ",_", "Late", "st", "Posts", "By", "Tag_", ",_", "Late", "st", "Posts", "By", "Author_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lith", "ium_", "._", "blog_", "._", "decorators_", "import_", "private", "\\u", "post", "\\u", "decorator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "list", "\\u", "dict_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "querys", "et", "'_", ":_", "Post_", "._", "on", "\\u", "site_", "._", "all_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "field", "'_", ":_", "'", "pub", "\\u", "date", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "paginate", "\\u", "by", "'_", ":_", "settings_", "._", "BLO", "G", "\\u", "PA", "GIN", "ATE", "\\u", "BY", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "template", "\\u", "object\\u", "name", "'_", ":_", "'", "post", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "deta", "il", "\\u", "dict_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "querys", "et", "'_", ":_", "Post_", "._", "on", "\\u", "site_", "._", "all_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "field", "'_", ":_", "'", "pub", "\\u", "date", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "template", "\\u", "object\\u", "name", "'_", ":_", "'", "post", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "urlpatterns_", "=_", "patterns_", "(_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "^", "(?", "P", "<", "year", ">\\\\", "d", "{", "4", "})", "/(", "?", "P", "<", "month", ">[", "a", "-", "z", "]{", "3", "})", "/(", "?", "P", "<", "day", ">\\\\", "w", "{", "1", ",", "2", "})", "/(", "?", "P", "<", "slug", ">[-", "\\\\", "w", "]+)/$'_", ",_", "private", "\\u", "post", "\\u", "decorator_", "(_", "object\\u", "detail_", ")_", ",_", "deta", "il", "\\u", "dict_", ",_", "'", "blog", ".", "post", "\\u", "deta", "il", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "^", "(?", "P", "<", "year", ">\\\\", "d", "{", "4", "})", "/(", "?", "P", "<", "month", ">[", "a", "-", "z", "]{", "3", "})", "/(", "?", "P", "<", "day", ">\\\\", "w", "{", "1", ",", "2", "})", "/$'_", ",_", "private", "\\u", "post", "\\u", "decorator_", "(_", "archive", "\\u", "day_", ")_", ",_", "list", "\\u", "dict_", ",_", "'", "blog", ".", "archive", "\\u", "day", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "^", "(?", "P", "<", "year", ">\\\\", "d", "{", "4", "})", "/(", "?", "P", "<", "month", ">[", "a", "-", "z", "]{", "3", "})", "/$'_", ",_", "private", "\\u", "post", "\\u", "decorator_", "(_", "archive", "\\u", "month_", ")_", ",_", "list", "\\u", "dict_", ",_", "'", "blog", ".", "archive", "\\u", "month", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "^", "(?", "P", "<", "year", ">\\\\", "d", "{", "4", "})", "/$'_", ",_", "private", "\\u", "post", "\\u", "decorator_", "(_", "archive", "\\u", "year_", ")_", ",_", "list", "\\u", "dict_", ",_", "'", "blog", ".", "archive", "\\u", "year", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "^", "$'_", ",_", "private", "\\u", "post", "\\u", "decorator_", "(_", "archive", "\\u", "index_", ")_", ",_", "list", "\\u", "dict_", ",_", "'", "blog", ".", "post", "\\u", "list", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "^", "author", "/(", "?", "P", "<", "author", ">[-", "\\\\", "w", "]+)", "/?$'_", ",_", "private", "\\u", "post", "\\u", "decorator_", "(_", "archive", "\\u", "index_", ")_", ",_", "list", "\\u", "dict_", ",_", "'", "blog", ".", "author", "\\u", "deta", "il", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "^", "tag", "/(", "?", "P", "<", "tag", ">[-", "\\\\", "w", "]+)/$'_", ",_", "private", "\\u", "post", "\\u", "decorator_", "(_", "archive", "\\u", "index_", ")_", ",_", "list", "\\u", "dict_", ",_", "'", "blog", ".", "category", "\\u", "deta", "il", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "feeds_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "late", "st", "'_", ":_", "Late", "st", "Posts", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tag", "'_", ":_", "Late", "st", "Posts", "By", "Tag_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "author", "'_", ":_", "Late", "st", "Posts", "By", "Author_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "urlpatterns_", "+=_", "patterns_", "(_", "'", "django", ".", "contrib", ".", "syn", "dicat", "ion", ".", "views", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "'", "^", "feed", "/(", "?", "P", "<", "url", ">.*)", "/$'_", ",_", "'", "feed", "'_", ",_", "{_", "'", "feed", "\\u", "dict", "'_", ":_", "feeds_", "}_", ",_", "name_", "=_", "'", "blog", ".", "feed", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
rvanlaar/easy-transifex/src/transifex/transifex/resources/tests/lib/validators/__init__.py
[ { "content": "# -*- coding: utf-8 -*-\n\nfrom __future__ import with_statement\nfrom django.test import TestCase\nfrom transifex.languages.models import Language\nfrom transifex.resources.formats.validators import *\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestValidators(TestCase):\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TestValidators", "header": "['module', '___EOS___']", "index": 8 }, { "content": " def test_empty_translation(self):\n old = 'old'\n new = ''\n v = BaseValidator()\n v(old, new)", "metadata": "root.TestValidators.test_empty_translation", "header": "['class', 'TestValidators', '(', 'TestCase', ')', ':', '___EOS___']", "index": 10 }, { "content": " def test_spaces(self):\n v = SpaceValidator()\n old = \"as\"\n new = \" \"\n self.assertRaises(ValidationError, v, old, new)\n new = \" \\t\"\n self.assertRaises(ValidationError, v, old, new)", "metadata": "root.TestValidators.test_spaces", "header": "['class', 'TestValidators', '(', 'TestCase', ')', ':', '___EOS___']", "index": 16 }, { "content": " def test_brackets(self):\n v = MatchingBracketsValidator()\n for c in MatchingBracketsValidator.bracket_chars:\n old = c + \"string\"\n new = c + \"trans\"\n v(old, new)\n new = \"trans\" + c\n v(old, new)\n new = \"tr\" + c + \"ans\"\n v(old, new)\n new = \"trans\"\n self.assertRaises(ValidationError, v, old, new)\n for c1 in MatchingBracketsValidator.bracket_chars:\n for c2 in MatchingBracketsValidator.bracket_chars:\n old = 'a' + c1 + 'b' + c2 + 'c'\n new = c1 + 'abc' + c2\n v(old, new)\n new = c2 + 'abc' + c1\n v\n new = c1 + 'abc'\n self.assertRaises(ValidationError, v, old, new)\n new = c2 + 'abc'\n self.assertRaises(ValidationError, v, old, new)", "metadata": "root.TestValidators.test_brackets", "header": "['class', 'TestValidators', '(', 'TestCase', ')', ':', '___EOS___']", "index": 24 }, { "content": " def test_urls(self):\n v = UrlsValidator()\n old = \"blah http://www.transifex.net blah\"\n new = \"blah http://www.transifex.net blah\"\n v(old, new)\n new = \"blah www.transifex.net blah\"\n self.assertRaises(ValidationError, v, old, new)\n new = \"blah http://www.tranisfex.net blah\"\n self.assertRaises(ValidationError, v, old, new)\n new = \"blah-blah\"\n self.assertRaises(ValidationError, v, old, new)\n\n old = \"blah http://www.transifex.net blah https://indifex.com\"\n new = \"blah http://www.transifex.net blah https://indifex.com\"\n v(old, new)\n new = \"blah https://indifex.com\"\n self.assertRaises(ValidationError, v, old, new)", "metadata": "root.TestValidators.test_urls", "header": "['class', 'TestValidators', '(', 'TestCase', ')', ':', '___EOS___']", "index": 48 }, { "content": " def test_emails(self):\n v = EmailAddressesValidator()\n old = \"blah [email protected]\"\n new = \"blah [email protected] blah\"\n v(old, new)\n new = \"blah [email protected] blah\"\n self.assertRaises(ValidationError, v, old, new)\n old = \"blah [email protected] and [email protected] blah\"\n new = \"blah [email protected] and [email protected] blah\"\n v(old, new)\n new = \"blah [email protected] blah\"\n self.assertRaises(ValidationError, v, old, new)", "metadata": "root.TestValidators.test_emails", "header": "['class', 'TestValidators', '(', 'TestCase', ')', ':', '___EOS___']", "index": 66 }, { "content": " def test_start_newlines(self):\n v = NewLineAtBeginningValidator()\n old = \"asdaf\"\n new = \"asdasa\"\n v(old, new)\n old = \"\\n asdasa\"\n self.assertRaises(ValidationError, v, old, new)\n new = \"\\nasdasdsaafsaf\"\n v(old, new)\n old = \"asadaaf\"\n self.assertRaises(ValidationError, v, old, new)", "metadata": "root.TestValidators.test_start_newlines", "header": "['class', 'TestValidators', '(', 'TestCase', ')', ':', '___EOS___']", "index": 79 }, { "content": " def test_start_newlines(self):\n v = NewLineAtEndValidator()\n old = \"asdaf\"\n new = \"asdasa\"\n v(old, new)\n old = \"asdasa\\n\"\n self.assertRaises(ValidationError, v, old, new)\n new = \"asdasdsaafsaf\\n\"\n v(old, new)\n old = \"asadaaf\"\n self.assertRaises(ValidationError, v, old, new)", "metadata": "root.TestValidators.test_start_newlines", "header": "['class', 'TestValidators', '(', 'TestCase', ')', ':', '___EOS___']", "index": 91 }, { "content": " def test_numbers(self):\n v = NumbersValidator()\n old = \"asa0asda1as+2afd-3asdas0.12asda\"\n new = \"asa0asda1as+2afd-3asdas0.12asda\"\n v(old, new)\n new = \"asa0asda1as+2afd-3asdas0,12asda\"\n v(old, new)\n new = \"asa0asda1as+2afd-3asdas012asda\"\n self.assertRaises(ValidationError, v, old, new)\n new = \"asaasda1as+2afd-3asdas012asda\"\n self.assertRaises(ValidationError, v, old, new)\n new = \"asa0asda1as-2afd-3asdas0.12asda\"\n self.assertRaises(ValidationError, v, old, new)\n old = \"as as das dsa \"\n new = \"agre dsg fs sa d\"\n v(old, new)", "metadata": "root.TestValidators.test_numbers", "header": "['class', 'TestValidators', '(', 'TestCase', ')', ':', '___EOS___']", "index": 103 }, { "content": " def test_printf_formats(self):\n\n class Language(object):\n pass\n\n sl = Language()\n sl.nplurals = 2\n tl = Language()\n tl.nplurals = 2\n v = PrintfFormatNumberValidator(sl, tl)\n old = \"%s %d\"\n new = \"%s %d\"\n v(old, new)\n new = \"%f\"\n self.assertRaises(ValidationError, v, old, new)\n tl.nplurals = 3\n new = \"%f %s %x\"\n v(old, new)", "metadata": "root.TestValidators.test_printf_formats", "header": "['class', 'TestValidators', '(', 'TestCase', ')', ':', '___EOS___']", "index": 120 }, { "content": " def test_source_printf_format(self):\n v = PrintfFormatSourceValidator()\n old = \"%s %d asda\"\n new = \"%d %s asagsfdsf %f\"\n v(old, new)\n new = \"%d\"\n self.assertRaises(ValidationError, v, old, new)\n new = \"%s\"\n self.assertRaises(ValidationError, v, old, new)\n old = \"%s %d\"\n new = \"%2$d %1$s\"\n v(old, new)\n\n old = \"%(foo)s %(bar)s\"\n new = \"%(fo0)s %(bar)s\"\n with self.assertRaises(ValidationError) as cm:\n v(old, new)\n self.assertIn('foo', unicode(cm.exception))\n new = \"%(foo)s\"\n with self.assertRaises(ValidationError) as cm:\n v(old, new)\n self.assertIn('bar', unicode(cm.exception))\n new = \"%(bar)s\"\n with self.assertRaises(ValidationError) as cm:\n v(old, new)\n self.assertIn('foo', unicode(cm.exception))\n new = \"%(bar)s %(foo)s\"\n v(old, new)", "metadata": "root.TestValidators.test_source_printf_format", "header": "['class', 'TestValidators', '(', 'TestCase', ')', ':', '___EOS___']", "index": 139 }, { "content": " def test_translation_printf_format(self):\n v = PrintfFormatTranslationValidator()\n old = \"%s %d asda %f\"\n new = \"%d %s asagsfdsf %f\"\n v(old, new)\n old = \"%d %s\"\n self.assertRaises(ValidationError, v, old, new)\n old = \"%s %d asda %k\"\n self.assertRaises(ValidationError, v, old, new)\n\n old = \"%s %d\"\n new = \"%2$d %1$s\"\n v(old, new)\n\n old = \"%(foo)s %(bar)s\"\n new = \"%(fo0)s %(bar)s\"\n with self.assertRaises(ValidationError) as cm:\n v(old, new)\n self.assertIn('fo0', unicode(cm.exception))\n new = \"%(baz)s\"\n with self.assertRaises(ValidationError) as cm:\n v(old, new)\n self.assertIn('baz', unicode(cm.exception))\n new = \"%(bar)s %(foo)s\"\n v(old, new)", "metadata": "root.TestValidators.test_translation_printf_format", "header": "['class', 'TestValidators', '(', 'TestCase', ')', ':', '___EOS___']", "index": 168 }, { "content": " def test_singular_printf_number(self):\n\n class Language(object):\n pass\n\n sl = Language()\n sl.nplurals = 2\n tl = Language()\n tl.nplurals = 2\n v = PrintfFormatPluralizedNumberValidator(sl, tl, rule=5)\n old = \"%s apples\"\n new = \"apples\"\n self.assertRaises(ValidationError, v, old, new)\n v.rule = 1\n new = \"apple\"\n v(old, new)\n v.rule = 5\n tl.nplurals = 5\n v(old, new)", "metadata": "root.TestValidators.test_singular_printf_number", "header": "['class', 'TestValidators', '(', 'TestCase', ')', ':', '___EOS___']", "index": 194 }, { "content": " def test_singular_printf_source(self):\n v = PrintfFormatPluralizedSourceValidator(rule=5)\n old = \"%s apples\"\n new = \"apples\"\n self.assertRaises(ValidationError, v, old, new)\n v.rule = 1\n new = \"apple\"\n v(old, new)", "metadata": "root.TestValidators.test_singular_printf_source", "header": "['class', 'TestValidators', '(', 'TestCase', ')', ':', '___EOS___']", "index": 214 } ]
[ { "span": "from transifex.languages.models import Language", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 47 } ]
[]
1
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_", "from_", "\\u\\u", "future\\u\\u_", "import_", "with", "\\u", "statement_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "test_", "import_", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "trans", "ife", "x_", "._", "languages_", "._", "models_", "import_", "Language_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "trans", "ife", "x_", "._", "resources_", "._", "formats_", "._", "validators_", "import_", "*_", "\\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", "Validat", "ors_", "(_", "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_", "[SEP]_", "class_", "Test", "Validat", "ors_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "empty", "\\u", "translation_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old_", "=_", "'", "old", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "Base", "Validator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Validat", "ors_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "spaces_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Spac", "e", "Validator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"", "as", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", " ", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", " ", " ", "\\\\", "t", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Validat", "ors_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "brackets", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Match", "ing", "Bracket", "s", "Validator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "Match", "ing", "Bracket", "s", "Validator_", "._", "bracket", "\\u", "chars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old_", "=_", "c_", "+_", "\"", "string", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "c_", "+_", "\"", "trans", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "trans", "\"_", "+_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "tr", "\"_", "+_", "c_", "+_", "\"", "ans", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "trans", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "c1_", "in_", "Match", "ing", "Bracket", "s", "Validator_", "._", "bracket", "\\u", "chars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "c2_", "in_", "Match", "ing", "Bracket", "s", "Validator_", "._", "bracket", "\\u", "chars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old_", "=_", "'", "a", "'_", "+_", "c1_", "+_", "'", "b", "'_", "+_", "c2_", "+_", "'", "c", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "c1_", "+_", "'", "abc", "'_", "+_", "c2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "c2_", "+_", "'", "abc", "'_", "+_", "c1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "c1_", "+_", "'", "abc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "c2_", "+_", "'", "abc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Validat", "ors_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "urls_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Urls", "Validator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"", "bla", "h", " ", "http", "://", "www", ".", "trans", "ife", "x", ".", "net", " ", "bla", "h", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "bla", "h", " ", "http", "://", "www", ".", "trans", "ife", "x", ".", "net", " ", "bla", "h", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "bla", "h", " ", "www", ".", "trans", "ife", "x", ".", "net", " ", "bla", "h", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "bla", "h", " ", "http", "://", "www", ".", "tran", "isf", "ex", ".", "net", " ", "bla", "h", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "bla", "h", "-", "bla", "h", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "old_", "=_", "\"", "bla", "h", " ", "http", "://", "www", ".", "trans", "ife", "x", ".", "net", " ", "bla", "h", " ", "https", "://", "indi", "fe", "x", ".", "com", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "bla", "h", " ", "http", "://", "www", ".", "trans", "ife", "x", ".", "net", " ", "bla", "h", " ", "https", "://", "indi", "fe", "x", ".", "com", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "bla", "h", " ", "https", "://", "indi", "fe", "x", ".", "com", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Validat", "ors_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "emails_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Ema", "il", "Address", "es", "Validator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"", "bla", "h", " ", "me", "@", "indi", "fe", "x", ".", "com", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "bla", "h", " ", "me", "@", "indi", "fe", "x", ".", "com", " ", "bla", "h", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "bla", "h", " ", "you", "@", "indi", "fe", "x", ".", "com", " ", "bla", "h", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"", "bla", "h", " ", "me", "@", "indi", "fe", "x", ".", "com", " ", "and", " ", "me", "@", "gma", "il", ".", "com", " ", "bla", "h", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "bla", "h", " ", "me", "@", "indi", "fe", "x", ".", "com", " ", "and", " ", "me", "@", "gma", "il", ".", "com", " ", "bla", "h", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "bla", "h", " ", "you", "@", "indi", "fe", "x", ".", "com", " ", "bla", "h", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Validat", "ors_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "start", "\\u", "newlines_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "New", "Line", "At", "Begin", "ning", "Validator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"", "asd", "af", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "asd", "asa", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"\\\\", "n", " ", "asd", "asa", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"\\\\", "nas", "das", "dsa", "af", "saf", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"", "asa", "da", "af", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Validat", "ors_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "start", "\\u", "newlines_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "New", "Line", "At", "End", "Validator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"", "asd", "af", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "asd", "asa", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"", "asd", "asa", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "asd", "asd", "sa", "af", "saf", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"", "asa", "da", "af", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Validat", "ors_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "numbers_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Number", "s", "Validator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"", "asa", "0a", "sda", "1a", "s", "+", "2a", "fd", "-", "3a", "sda", "s0", ".12", "asd", "a", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "asa", "0a", "sda", "1a", "s", "+", "2a", "fd", "-", "3a", "sda", "s0", ".12", "asd", "a", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "asa", "0a", "sda", "1a", "s", "+", "2a", "fd", "-", "3a", "sda", "s0", ",", "1", "2a", "sda", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "asa", "0a", "sda", "1a", "s", "+", "2a", "fd", "-", "3a", "sda", "s0", "1", "2a", "sda", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "asa", "asd", "a1", "as", "+", "2a", "fd", "-", "3a", "sda", "s0", "1", "2a", "sda", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "asa", "0a", "sda", "1a", "s", "-", "2a", "fd", "-", "3a", "sda", "s0", ".12", "asd", "a", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"", "as", " ", "as", " ", "das", " ", "dsa", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "agr", "e", " ", "ds", "g", " ", "fs", " ", "sa", " ", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Validat", "ors_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "printf", "\\u", "formats_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Language_", "(_", "object_", ")_", ":_", "\\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_", "sl_", "=_", "Language_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sl_", "._", "npl", "ural", "s_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tl_", "=_", "Language_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tl_", "._", "npl", "ural", "s_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "Print", "f", "Format", "Number", "Validator_", "(_", "sl_", ",_", "tl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"%", "s", " ", "%", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"%", "s", " ", "%", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"%", "f", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tl_", "._", "npl", "ural", "s_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"%", "f", " ", "%", "s", " ", "%", "x", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Validat", "ors_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "source", "\\u", "printf", "\\u", "format_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Print", "f", "Format", "Sou", "rce", "Validator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"%", "s", " ", "%", "d", " ", "asd", "a", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"%", "d", " ", "%", "s", " ", "asa", "gs", "fds", "f", " ", "%", "f", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"%", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"%", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"%", "s", " ", "%", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"%", "2", "$", "d", " ", "%", "1", "$", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "old_", "=_", "\"%", "(", "foo", ")", "s", " ", "%", "(", "bar", ")", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"%", "(", "fo", "0", ")", "s", " ", "%", "(", "bar", ")", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ")_", "as_", "cm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "foo", "'_", ",_", "unicode_", "(_", "cm_", "._", "exception_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"%", "(", "foo", ")", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ")_", "as_", "cm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "bar", "'_", ",_", "unicode_", "(_", "cm_", "._", "exception_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"%", "(", "bar", ")", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ")_", "as_", "cm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "foo", "'_", ",_", "unicode_", "(_", "cm_", "._", "exception_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"%", "(", "bar", ")", "s", " ", "%", "(", "foo", ")", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Validat", "ors_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "translatio", "n", "\\u", "printf", "\\u", "format_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Print", "f", "Format", "Translat", "ion", "Validator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"%", "s", " ", "%", "d", " ", "asd", "a", " ", "%", "f", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"%", "d", " ", "%", "s", " ", "asa", "gs", "fds", "f", " ", "%", "f", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"%", "d", " ", "%", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"%", "s", " ", "%", "d", " ", "asd", "a", " ", "%", "k", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "old_", "=_", "\"%", "s", " ", "%", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"%", "2", "$", "d", " ", "%", "1", "$", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "old_", "=_", "\"%", "(", "foo", ")", "s", " ", "%", "(", "bar", ")", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"%", "(", "fo", "0", ")", "s", " ", "%", "(", "bar", ")", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ")_", "as_", "cm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "fo", "0", "'_", ",_", "unicode_", "(_", "cm_", "._", "exception_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"%", "(", "ba", "z", ")", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ")_", "as_", "cm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "ba", "z", "'_", ",_", "unicode_", "(_", "cm_", "._", "exception_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"%", "(", "bar", ")", "s", " ", "%", "(", "foo", ")", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Validat", "ors_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "singular", "\\u", "printf", "\\u", "number_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Language_", "(_", "object_", ")_", ":_", "\\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_", "sl_", "=_", "Language_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sl_", "._", "npl", "ural", "s_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tl_", "=_", "Language_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tl_", "._", "npl", "ural", "s_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "Print", "f", "Format", "Plur", "alize", "d", "Number", "Validator_", "(_", "sl_", ",_", "tl_", ",_", "rule_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"%", "s", " ", "apple", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "apple", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "._", "rule_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "apple", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "._", "rule_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tl_", "._", "npl", "ural", "s_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Validat", "ors_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "singular", "\\u", "printf", "\\u", "source_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Print", "f", "Format", "Plur", "alize", "d", "Sou", "rce", "Validator_", "(_", "rule_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "\"%", "s", " ", "apple", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "apple", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Validat", "ion", "Error_", ",_", "v_", ",_", "old_", ",_", "new_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "._", "rule_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new_", "=_", "\"", "apple", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "(_", "old_", ",_", "new_", ")_" ]
[ 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 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, 4, 2, 2, 2, 2, 2, 2, 2,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n \"\"\" Executes it \"\"\"\n self.y = self.x\n pass", "metadata": "root.CompBase.execute", "header": "['class', 'CompBase', '(', 'Component', ')', ':', '___EOS___']", "index": 3136 } ]
[ { "span": "pass", "start_line": 3139, "start_column": 8, "end_line": 3139, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "class_", "Comp", "Base_", "(_", "Component_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "execute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Execut", "es", " ", "it", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "y_", "=_", "self_", "._", "x_", "\\u\\u\\uNEWLINE\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2 ]
Imprecise assert
realpython/flask-registration/tests/test_config.py
[ { "content": " def test_app_is_development(self):\n self.assertTrue(app.config['DEBUG'] is True)\n self.assertTrue(app.config['WTF_CSRF_ENABLED'] is False)\n self.assertTrue(app.config['DEBUG_TB_ENABLED'] is True)", "metadata": "root.TestDevelopmentConfig.test_app_is_development", "header": "['class', 'TestDevelopmentConfig', '(', 'TestCase', ')', ':', '___EOS___']", "index": 17 }, { "content": " def test_app_is_testing(self):\n self.assertTrue(current_app.config['TESTING'])\n self.assertTrue(app.config['DEBUG'] is False)\n self.assertTrue(app.config['BCRYPT_LOG_ROUNDS'] == 1)\n self.assertTrue(app.config['WTF_CSRF_ENABLED'] is False)", "metadata": "root.TestTestingConfig.test_app_is_testing", "header": "['class', 'TestTestingConfig', '(', 'TestCase', ')', ':', '___EOS___']", "index": 29 }, { "content": " def test_app_is_production(self):\n self.assertTrue(app.config['DEBUG'] is False)\n self.assertTrue(app.config['DEBUG_TB_ENABLED'] is False)\n self.assertTrue(app.config['WTF_CSRF_ENABLED'] is True)\n self.assertTrue(app.config['BCRYPT_LOG_ROUNDS'] == 13)", "metadata": "root.TestProductionConfig.test_app_is_production", "header": "['class', 'TestProductionConfig', '(', 'TestCase', ')', ':', '___EOS___']", "index": 42 } ]
[ { "span": "self.assertTrue(app.config['DEBUG'] is True)", "start_line": 18, "start_column": 8, "end_line": 18, "end_column": 52 }, { "span": "self.assertTrue(app.config['WTF_CSRF_ENABLED'] is False)", "start_line": 19, "start_column": 8, "end_line": 19, "end_column": 64 }, { "span": "self.assertTrue(app.config['DEBUG_TB_ENABLED'] is True)", "start_line": 20, "start_column": 8, "end_line": 20, "end_column": 63 }, { "span": "self.assertTrue(app.config['DEBUG'] is False)", "start_line": 31, "start_column": 8, "end_line": 31, "end_column": 53 }, { "span": "self.assertTrue(app.config['BCRYPT_LOG_ROUNDS'] == 1)", "start_line": 32, "start_column": 8, "end_line": 32, "end_column": 61 }, { "span": "self.assertTrue(app.config['WTF_CSRF_ENABLED'] is False)", "start_line": 33, "start_column": 8, "end_line": 33, "end_column": 64 }, { "span": "self.assertTrue(app.config['DEBUG'] is False)", "start_line": 43, "start_column": 8, "end_line": 43, "end_column": 53 }, { "span": "self.assertTrue(app.config['DEBUG_TB_ENABLED'] is False)", "start_line": 44, "start_column": 8, "end_line": 44, "end_column": 64 }, { "span": "self.assertTrue(app.config['WTF_CSRF_ENABLED'] is True)", "start_line": 45, "start_column": 8, "end_line": 45, "end_column": 63 }, { "span": "self.assertTrue(app.config['BCRYPT_LOG_ROUNDS'] == 13)", "start_line": 46, "start_column": 8, "end_line": 46, "end_column": 62 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Dev", "elo", "pme", "nt", "Config_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "app", "\\u", "is", "\\u", "develop", "ment_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "app_", "._", "config_", "[_", "'", "DEBU", "G", "'_", "]_", "is_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "app_", "._", "config_", "[_", "'", "WT", "F", "\\u", "CSRF", "\\u", "ENABLE", "D", "'_", "]_", "is_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "app_", "._", "config_", "[_", "'", "DEBU", "G", "\\u", "TB", "\\u", "ENABLE", "D", "'_", "]_", "is_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Test", "ing", "Config_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "app", "\\u", "is", "\\u", "testing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "current", "\\u", "app_", "._", "config_", "[_", "'", "TESTING", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "app_", "._", "config_", "[_", "'", "DEBU", "G", "'_", "]_", "is_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "app_", "._", "config_", "[_", "'", "BC", "RY", "PT", "\\u", "LOG", "\\u", "ROUND", "S", "'_", "]_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "app_", "._", "config_", "[_", "'", "WT", "F", "\\u", "CSRF", "\\u", "ENABLE", "D", "'_", "]_", "is_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Product", "ion", "Config_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "app", "\\u", "is", "\\u", "production_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "app_", "._", "config_", "[_", "'", "DEBU", "G", "'_", "]_", "is_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "app_", "._", "config_", "[_", "'", "DEBU", "G", "\\u", "TB", "\\u", "ENABLE", "D", "'_", "]_", "is_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "app_", "._", "config_", "[_", "'", "WT", "F", "\\u", "CSRF", "\\u", "ENABLE", "D", "'_", "]_", "is_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "app_", "._", "config_", "[_", "'", "BC", "RY", "PT", "\\u", "LOG", "\\u", "ROUND", "S", "'_", "]_", "==_", "13_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused import
codeinn/vcs/vcs/utils/hgcompat.py
[ { "content": "\"\"\"\nMercurial libs compatibility\n\"\"\"\n\nfrom mercurial import archival, merge as hg_merge, patch, ui\nfrom mercurial.commands import clone, nullid, pull\nfrom mercurial.context import memctx, memfilectx\nfrom mercurial.error import RepoError, RepoLookupError, Abort\nfrom mercurial.hgweb.common import get_contact\nfrom mercurial.localrepo import localrepository\nfrom mercurial.match import match\nfrom mercurial.mdiff import diffopts\nfrom mercurial.node import hex\nfrom mercurial.encoding import tolocal\nfrom mercurial import discovery\nfrom mercurial import localrepo\nfrom mercurial import scmutil\nfrom mercurial.discovery import findcommonoutgoing\n\nfrom mercurial.util import url as hg_url\n\n# those authnadlers are patched for python 2.6.5 bug an\n# infinit looping when given invalid resources\nfrom mercurial.url import httpbasicauthhandler, httpdigestauthhandler\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from mercurial import archival, merge as hg_merge, patch, ui", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 60 }, { "span": "from mercurial.commands import clone, nullid, pull", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 50 }, { "span": "from mercurial.context import memctx, memfilectx", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 48 }, { "span": "from mercurial.error import RepoError, RepoLookupError, Abort", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 61 }, { "span": "from mercurial.hgweb.common import get_contact", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 46 }, { "span": "from mercurial.localrepo import localrepository", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 47 }, { "span": "from mercurial.match import match", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 33 }, { "span": "from mercurial.mdiff import diffopts", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 36 }, { "span": "from mercurial.node import hex", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 30 }, { "span": "from mercurial.encoding import tolocal", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 38 }, { "span": "from mercurial import discovery", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 31 }, { "span": "from mercurial import localrepo", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 31 }, { "span": "from mercurial import scmutil", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 29 }, { "span": "from mercurial.discovery import findcommonoutgoing", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 50 }, { "span": "from mercurial.util import url as hg_url", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 40 }, { "span": "from mercurial.url import httpbasicauthhandler, httpdigestauthhandler", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 69 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Merc", "uri", "al", " ", "libs", " ", "compatibility", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "mercur", "ial_", "import_", "archi", "val_", ",_", "merge_", "as_", "hg", "\\u", "merge_", ",_", "patch_", ",_", "ui_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mercur", "ial_", "._", "commands_", "import_", "clone_", ",_", "null", "id_", ",_", "pull_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mercur", "ial_", "._", "context_", "import_", "memc", "tx_", ",_", "mem", "filec", "tx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mercur", "ial_", "._", "error_", "import_", "Rep", "o", "Error_", ",_", "Rep", "o", "Look", "up", "Error_", ",_", "Abort_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mercur", "ial_", "._", "hg", "web_", "._", "common_", "import_", "get", "\\u", "contact_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mercur", "ial_", "._", "local", "repo_", "import_", "local", "repository_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mercur", "ial_", "._", "match_", "import_", "match_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mercur", "ial_", "._", "mdi", "ff_", "import_", "diff", "opts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mercur", "ial_", "._", "node_", "import_", "hex_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mercur", "ial_", "._", "encoding_", "import_", "tol", "ocal", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mercur", "ial_", "import_", "discovery_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mercur", "ial_", "import_", "local", "repo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mercur", "ial_", "import_", "scm", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mercur", "ial_", "._", "discovery_", "import_", "find", "common", "outgoing", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "mercur", "ial_", "._", "util_", "import_", "url_", "as_", "hg", "\\u", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tho", "se", " ", "auth", "nad", "ler", "s", " ", "are", " ", "patche", "d", " ", "for", " ", "python", " ", "2.6", ".5", " ", "bug", " ", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "infini", "t", " ", "looping", " ", "whe", "n", " ", "give", "n", " ", "invalid", " ", "resources_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "mercur", "ial_", "._", "url_", "import_", "http", "basic", "auth", "handler_", ",_", "http", "digest", "auth", "handler_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Except block handles 'BaseException'
sightmachine/SimpleCV/scripts/install/mac/findmods.py
[ { "content": "#!/usr/bin/python\n\nfrom SimpleCV import *\nimport re\nfrom types import NoneType\n\n#this is a utility just to make sure that the modules/versions you're\n#using on the current system match what is in the install scrip\n\neasy_installed_pkgs = dict()\neasy_installed_path = \"/Library/Python/2.6/site-packages\";\n\nfor k in sys.modules.keys():\n if type(sys.modules[k]) == NoneType:\n continue\n\n fn = \"\"\n try:\n fn = sys.modules[k].__file__\n except:\n continue\n\n if (re.match(easy_installed_path, fn)):\n junk, relpath = re.split(easy_installed_path, fn)\n dirs = re.split(\"/\", relpath)\n easy_installed_pkgs[dirs[1]] = 1\n\n\nfor egg in easy_installed_pkgs.keys():\n print easy_installed_path + \"/\" + egg\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "except:", "start_line": 19, "start_column": 4, "end_line": 19, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Simple", "CV_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "types_", "import_", "Non", "e", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "this", " ", "is", " ", "a", " ", "utility", " ", "just", " ", "to", " ", "make", " ", "sure", " ", "tha", "t", " ", "the", " ", "module", "s", "/", "version", "s", " ", "you", "'", "re_", "\\u\\u\\uNL\\u\\u\\u_", "#", "usi", "ng", " ", "on", " ", "the", " ", "current", " ", "system", " ", "match", " ", "what", " ", "is", " ", "in", " ", "the", " ", "install", " ", "scri", "p_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "easy", "\\u", "install", "ed", "\\u", "pkgs_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "easy", "\\u", "install", "ed", "\\u", "path_", "=_", "\"/", "Libr", "ary", "/", "Pyth", "on", "/", "2.6", "/", "site", "-", "package", "s", "\"_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", "in_", "sys_", "._", "modules_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "sys_", "._", "modules_", "[_", "k_", "]_", ")_", "==_", "Non", "e", "Type_", ":_", "\\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_", "fn_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fn_", "=_", "sys_", "._", "modules_", "[_", "k_", "]_", "._", "\\u\\u", "file\\u\\u_", "\\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 ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "re_", "._", "match_", "(_", "easy", "\\u", "install", "ed", "\\u", "path_", ",_", "fn_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "junk", "_", ",_", "relpath_", "=_", "re_", "._", "split_", "(_", "easy", "\\u", "install", "ed", "\\u", "path_", ",_", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dirs_", "=_", "re_", "._", "split_", "(_", "\"/\"_", ",_", "relpath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "easy", "\\u", "install", "ed", "\\u", "pkgs_", "[_", "dirs_", "[_", "1_", "]_", "]_", "=_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "egg", "_", "in_", "easy", "\\u", "install", "ed", "\\u", "pkgs_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "easy", "\\u", "install", "ed", "\\u", "path_", "+_", "\"/\"_", "+_", "egg", "_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
RobotWebTools/rosbridge_suite/rosbridge_server/src/tornado/test/simple_httpclient_test.py
[ { "content": "from __future__ import absolute_import, division, print_function, with_statement\n\nimport collections\nfrom contextlib import closing\nimport errno\nimport gzip\nimport logging\nimport os\nimport re\nimport socket\nimport sys\n\nfrom tornado import gen\nfrom tornado.httpclient import AsyncHTTPClient\nfrom tornado.httputil import HTTPHeaders\nfrom tornado.ioloop import IOLoop\nfrom tornado.log import gen_log, app_log\nfrom tornado.netutil import Resolver, bind_sockets\nfrom tornado.simple_httpclient import SimpleAsyncHTTPClient, _default_ca_certs\nfrom tornado.test.httpclient_test import ChunkHandler, CountdownHandler, HelloWorldHandler\nfrom tornado.test import httpclient_test\nfrom tornado.testing import AsyncHTTPTestCase, AsyncHTTPSTestCase, AsyncTestCase, bind_unused_port, ExpectLog\nfrom tornado.test.util import skipOnTravis, skipIfNoIPv6\nfrom tornado.web import RequestHandler, Application, asynchronous, url, stream_request_body\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", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class SimpleHTTPClientCommonTestCase(httpclient_test.HTTPClientCommonTestCase):", "metadata": "root.SimpleHTTPClientCommonTestCase", "header": "['module', '___EOS___']", "index": 26 }, { "content": " def get_http_client(self):\n client = SimpleAsyncHTTPClient(io_loop=self.io_loop,\n force_instance=True)\n self.assertTrue(isinstance(client, SimpleAsyncHTTPClient))\n return client", "metadata": "root.SimpleHTTPClientCommonTestCase.get_http_client", "header": "['class', 'SimpleHTTPClientCommonTestCase', '(', 'httpclient_test', '.', 'HTTPClientCommonTestCase', ')', ':', '___EOS___']", "index": 27 }, { "content": "class TriggerHandler(RequestHandler):\n", "metadata": "root.TriggerHandler", "header": "['module', '___EOS___']", "index": 34 }, { "content": " def initialize(self, queue, wake_callback):\n self.queue = queue\n self.wake_callback = wake_callback", "metadata": "root.TriggerHandler.initialize", "header": "['class', 'TriggerHandler', '(', 'RequestHandler', ')', ':', '___EOS___']", "index": 35 }, { "content": " @asynchronous\n def get(self):\n logging.debug(\"queuing trigger\")\n self.queue.append(self.finish)\n if self.get_argument(\"wake\", \"true\") == \"true\":\n self.wake_callback()", "metadata": "root.TriggerHandler.get", "header": "['class', 'TriggerHandler', '(', 'RequestHandler', ')', ':', '___EOS___']", "index": 39 }, { "content": "class HangHandler(RequestHandler):", "metadata": "root.HangHandler", "header": "['module', '___EOS___']", "index": 47 }, { "content": " @asynchronous\n def get(self):\n pass", "metadata": "root.HangHandler.get", "header": "['class', 'HangHandler', '(', 'RequestHandler', ')', ':', '___EOS___']", "index": 48 }, { "content": "class ContentLengthHandler(RequestHandler):", "metadata": "root.ContentLengthHandler", "header": "['module', '___EOS___']", "index": 53 }, { "content": " def get(self):\n self.set_header(\"Content-Length\", self.get_argument(\"value\"))\n self.write(\"ok\")", "metadata": "root.ContentLengthHandler.get", "header": "['class', 'ContentLengthHandler', '(', 'RequestHandler', ')', ':', '___EOS___']", "index": 54 }, { "content": "class HeadHandler(RequestHandler):", "metadata": "root.HeadHandler", "header": "['module', '___EOS___']", "index": 59 }, { "content": " def head(self):\n self.set_header(\"Content-Length\", \"7\")", "metadata": "root.HeadHandler.head", "header": "['class', 'HeadHandler', '(', 'RequestHandler', ')', ':', '___EOS___']", "index": 60 }, { "content": "class OptionsHandler(RequestHandler):", "metadata": "root.OptionsHandler", "header": "['module', '___EOS___']", "index": 64 }, { "content": " def options(self):\n self.set_header(\"Access-Control-Allow-Origin\", \"*\")\n self.write(\"ok\")", "metadata": "root.OptionsHandler.options", "header": "['class', 'OptionsHandler', '(', 'RequestHandler', ')', ':', '___EOS___']", "index": 65 }, { "content": "class NoContentHandler(RequestHandler):", "metadata": "root.NoContentHandler", "header": "['module', '___EOS___']", "index": 70 }, { "content": " def get(self):\n if self.get_argument(\"error\", None):\n self.set_header(\"Content-Length\", \"5\")\n self.write(\"hello\")\n self.set_status(204)", "metadata": "root.NoContentHandler.get", "header": "['class', 'NoContentHandler', '(', 'RequestHandler', ')', ':', '___EOS___']", "index": 71 }, { "content": "class SeeOtherPostHandler(RequestHandler):", "metadata": "root.SeeOtherPostHandler", "header": "['module', '___EOS___']", "index": 78 }, { "content": " def post(self):\n redirect_code = int(self.request.body)\n assert redirect_code in (302, 303), \"unexpected body %r\" % self.request.body\n self.set_header(\"Location\", \"/see_other_get\")\n self.set_status(redirect_code)", "metadata": "root.SeeOtherPostHandler.post", "header": "['class', 'SeeOtherPostHandler', '(', 'RequestHandler', ')', ':', '___EOS___']", "index": 79 }, { "content": "class SeeOtherGetHandler(RequestHandler):", "metadata": "root.SeeOtherGetHandler", "header": "['module', '___EOS___']", "index": 86 }, { "content": " def get(self):\n if self.request.body:\n raise Exception(\"unexpected body %r\" % self.request.body)\n self.write(\"ok\")", "metadata": "root.SeeOtherGetHandler.get", "header": "['class', 'SeeOtherGetHandler', '(', 'RequestHandler', ')', ':', '___EOS___']", "index": 87 }, { "content": "class HostEchoHandler(RequestHandler):", "metadata": "root.HostEchoHandler", "header": "['module', '___EOS___']", "index": 93 }, { "content": " def get(self):\n self.write(self.request.headers[\"Host\"])", "metadata": "root.HostEchoHandler.get", "header": "['class', 'HostEchoHandler', '(', 'RequestHandler', ')', ':', '___EOS___']", "index": 94 }, { "content": "class NoContentLengthHandler(RequestHandler):", "metadata": "root.NoContentLengthHandler", "header": "['module', '___EOS___']", "index": 98 }, { "content": " @gen.coroutine\n def get(self):\n # Emulate the old HTTP/1.0 behavior of returning a body with no\n # content-length. Tornado handles content-length at the framework\n # level so we have to go around it.\n stream = self.request.connection.stream\n yield stream.write(b\"HTTP/1.0 200 OK\\r\\n\\r\\n\"\n b\"hello\")\n stream.close()", "metadata": "root.NoContentLengthHandler.get", "header": "['class', 'NoContentLengthHandler', '(', 'RequestHandler', ')', ':', '___EOS___']", "index": 99 }, { "content": "class EchoPostHandler(RequestHandler):", "metadata": "root.EchoPostHandler", "header": "['module', '___EOS___']", "index": 110 }, { "content": " def post(self):\n self.write(self.request.body)", "metadata": "root.EchoPostHandler.post", "header": "['class', 'EchoPostHandler', '(', 'RequestHandler', ')', ':', '___EOS___']", "index": 111 }, { "content": "@stream_request_body\nclass RespondInPrepareHandler(RequestHandler):", "metadata": "root.RespondInPrepareHandler", "header": "['module', '___EOS___']", "index": 115 }, { "content": " def prepare(self):\n self.set_status(403)\n self.finish(\"forbidden\")", "metadata": "root.RespondInPrepareHandler.prepare", "header": "['class', 'RespondInPrepareHandler', '(', 'RequestHandler', ')', ':', '___EOS___']", "index": 117 }, { "content": "class SimpleHTTPClientTestMixin(object):\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.SimpleHTTPClientTestMixin", "header": "['module', '___EOS___']", "index": 122 }, { "content": " def get_app(self):\n # callable objects to finish pending /trigger requests\n self.triggers = collections.deque()\n return Application([\n url(\"/trigger\", TriggerHandler, dict(queue=self.triggers,\n wake_callback=self.stop)),\n url(\"/chunk\", ChunkHandler),\n url(\"/countdown/([0-9]+)\", CountdownHandler, name=\"countdown\"),\n url(\"/hang\", HangHandler),\n url(\"/hello\", HelloWorldHandler),\n url(\"/content_length\", ContentLengthHandler),\n url(\"/head\", HeadHandler),\n url(\"/options\", OptionsHandler),\n url(\"/no_content\", NoContentHandler),\n url(\"/see_other_post\", SeeOtherPostHandler),\n url(\"/see_other_get\", SeeOtherGetHandler),\n url(\"/host_echo\", HostEchoHandler),\n url(\"/no_content_length\", NoContentLengthHandler),\n url(\"/echo_post\", EchoPostHandler),\n url(\"/respond_in_prepare\", RespondInPrepareHandler),\n ], gzip=True)", "metadata": "root.SimpleHTTPClientTestMixin.get_app", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 123 }, { "content": " def test_singleton(self):\n # Class \"constructor\" reuses objects on the same IOLoop\n self.assertTrue(SimpleAsyncHTTPClient(self.io_loop) is\n SimpleAsyncHTTPClient(self.io_loop))\n # unless force_instance is used\n self.assertTrue(SimpleAsyncHTTPClient(self.io_loop) is not\n SimpleAsyncHTTPClient(self.io_loop,\n force_instance=True))\n # different IOLoops use different objects\n with closing(IOLoop()) as io_loop2:\n self.assertTrue(SimpleAsyncHTTPClient(self.io_loop) is not\n SimpleAsyncHTTPClient(io_loop2))", "metadata": "root.SimpleHTTPClientTestMixin.test_singleton", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 145 }, { "content": " def test_connection_limit(self):\n with closing(self.create_client(max_clients=2)) as client:\n self.assertEqual(client.max_clients, 2)\n seen = []\n # Send 4 requests. Two can be sent immediately, while the others\n # will be queued\n for i in range(4):\n client.fetch(self.get_url(\"/trigger\"),\n lambda response, i=i: (seen.append(i), self.stop()))\n self.wait(condition=lambda: len(self.triggers) == 2)\n self.assertEqual(len(client.queue), 2)\n\n # Finish the first two requests and let the next two through\n self.triggers.popleft()()\n self.triggers.popleft()()\n self.wait(condition=lambda: (len(self.triggers) == 2 and\n len(seen) == 2))\n self.assertEqual(set(seen), set([0, 1]))\n self.assertEqual(len(client.queue), 0)\n\n # Finish all the pending requests\n self.triggers.popleft()()\n self.triggers.popleft()()\n self.wait(condition=lambda: len(seen) == 4)\n self.assertEqual(set(seen), set([0, 1, 2, 3]))\n self.assertEqual(len(self.triggers), 0)", "metadata": "root.SimpleHTTPClientTestMixin.test_connection_limit", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 158 }, { "content": " def test_redirect_connection_limit(self):\n # following redirects should not consume additional connections\n with closing(self.create_client(max_clients=1)) as client:\n client.fetch(self.get_url('/countdown/3'), self.stop,\n max_redirects=3)\n response = self.wait()\n response.rethrow()", "metadata": "root.SimpleHTTPClientTestMixin.test_redirect_connection_limit", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 185 }, { "content": " def test_default_certificates_exist(self):\n open(_default_ca_certs()).close()", "metadata": "root.SimpleHTTPClientTestMixin.test_default_certificates_exist", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 193 }, { "content": " def test_gzip(self):\n # All the tests in this file should be using gzip, but this test\n # ensures that it is in fact getting compressed.\n # Setting Accept-Encoding manually bypasses the client's\n # decompression so we can see the raw data.\n response = self.fetch(\"/chunk\", use_gzip=False,\n headers={\"Accept-Encoding\": \"gzip\"})\n self.assertEqual(response.headers[\"Content-Encoding\"], \"gzip\")\n self.assertNotEqual(response.body, b\"asdfqwer\")\n # Our test data gets bigger when gzipped. Oops. :)\n self.assertEqual(len(response.body), 34)\n f = gzip.GzipFile(mode=\"r\", fileobj=response.buffer)\n self.assertEqual(f.read(), b\"asdfqwer\")", "metadata": "root.SimpleHTTPClientTestMixin.test_gzip", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 196 }, { "content": " def test_max_redirects(self):\n response = self.fetch(\"/countdown/5\", max_redirects=3)\n self.assertEqual(302, response.code)\n # We requested 5, followed three redirects for 4, 3, 2, then the last\n # unfollowed redirect is to 1.\n self.assertTrue(response.request.url.endswith(\"/countdown/5\"))\n self.assertTrue(response.effective_url.endswith(\"/countdown/2\"))\n self.assertTrue(response.headers[\"Location\"].endswith(\"/countdown/1\"))", "metadata": "root.SimpleHTTPClientTestMixin.test_max_redirects", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 210 }, { "content": " def test_header_reuse(self):\n # Apps may reuse a headers object if they are only passing in constant\n # headers like user-agent. The header object should not be modified.\n headers = HTTPHeaders({'User-Agent': 'Foo'})\n self.fetch(\"/hello\", headers=headers)\n self.assertEqual(list(headers.get_all()), [('User-Agent', 'Foo')])", "metadata": "root.SimpleHTTPClientTestMixin.test_header_reuse", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 219 }, { "content": " def test_see_other_redirect(self):\n for code in (302, 303):\n response = self.fetch(\"/see_other_post\", method=\"POST\", body=\"%d\" % code)\n self.assertEqual(200, response.code)\n self.assertTrue(response.request.url.endswith(\"/see_other_post\"))\n self.assertTrue(response.effective_url.endswith(\"/see_other_get\"))\n # request is the original request, is a POST still\n self.assertEqual(\"POST\", response.request.method)", "metadata": "root.SimpleHTTPClientTestMixin.test_see_other_redirect", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 226 }, { "content": " @skipOnTravis\n def test_request_timeout(self):\n response = self.fetch('/trigger?wake=false', request_timeout=0.1)\n self.assertEqual(response.code, 599)\n self.assertTrue(0.099 < response.request_time < 0.15, response.request_time)\n self.assertEqual(str(response.error), \"HTTP 599: Timeout\")\n # trigger the hanging request to let it clean up after itself\n self.triggers.popleft()()", "metadata": "root.SimpleHTTPClientTestMixin.test_request_timeout", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 235 }, { "content": " @skipIfNoIPv6\n def test_ipv6(self):\n try:\n [sock] = bind_sockets(None, '::1', family=socket.AF_INET6)\n port = sock.getsockname()[1]\n self.http_server.add_socket(sock)\n except socket.gaierror as e:\n if e.args[0] == socket.EAI_ADDRFAMILY:\n # python supports ipv6, but it's not configured on the network\n # interface, so skip this test.\n return\n raise\n url = '%s://[::1]:%d/hello' % (self.get_protocol(), port)\n\n # ipv6 is currently enabled by default but can be disabled\n self.http_client.fetch(url, self.stop, allow_ipv6=False)\n response = self.wait()\n self.assertEqual(response.code, 599)\n\n self.http_client.fetch(url, self.stop)\n response = self.wait()\n self.assertEqual(response.body, b\"Hello world!\")", "metadata": "root.SimpleHTTPClientTestMixin.test_ipv6", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 244 }, { "content": " def xtest_multiple_content_length_accepted(self):\n response = self.fetch(\"/content_length?value=2,2\")\n self.assertEqual(response.body, b\"ok\")\n response = self.fetch(\"/content_length?value=2,%202,2\")\n self.assertEqual(response.body, b\"ok\")\n\n response = self.fetch(\"/content_length?value=2,4\")\n self.assertEqual(response.code, 599)\n response = self.fetch(\"/content_length?value=2,%202,3\")\n self.assertEqual(response.code, 599)", "metadata": "root.SimpleHTTPClientTestMixin.xtest_multiple_content_length_accepted", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 267 }, { "content": " def test_head_request(self):\n response = self.fetch(\"/head\", method=\"HEAD\")\n self.assertEqual(response.code, 200)\n self.assertEqual(response.headers[\"content-length\"], \"7\")\n self.assertFalse(response.body)", "metadata": "root.SimpleHTTPClientTestMixin.test_head_request", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 278 }, { "content": " def test_options_request(self):\n response = self.fetch(\"/options\", method=\"OPTIONS\")\n self.assertEqual(response.code, 200)\n self.assertEqual(response.headers[\"content-length\"], \"2\")\n self.assertEqual(response.headers[\"access-control-allow-origin\"], \"*\")\n self.assertEqual(response.body, b\"ok\")", "metadata": "root.SimpleHTTPClientTestMixin.test_options_request", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 284 }, { "content": " def test_no_content(self):\n response = self.fetch(\"/no_content\")\n self.assertEqual(response.code, 204)\n # 204 status doesn't need a content-length, but tornado will\n # add a zero content-length anyway.\n #\n # A test without a content-length header is included below\n # in HTTP204NoContentTestCase.\n self.assertEqual(response.headers[\"Content-length\"], \"0\")\n\n # 204 status with non-zero content length is malformed\n with ExpectLog(gen_log, \"Malformed HTTP message\"):\n response = self.fetch(\"/no_content?error=1\")\n self.assertEqual(response.code, 599)", "metadata": "root.SimpleHTTPClientTestMixin.test_no_content", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 291 }, { "content": " def test_host_header(self):\n host_re = re.compile(b\"^localhost:[0-9]+$\")\n response = self.fetch(\"/host_echo\")\n self.assertTrue(host_re.match(response.body))\n\n url = self.get_url(\"/host_echo\").replace(\"http://\", \"http://me:secret@\")\n self.http_client.fetch(url, self.stop)\n response = self.wait()\n self.assertTrue(host_re.match(response.body), response.body)", "metadata": "root.SimpleHTTPClientTestMixin.test_host_header", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 306 }, { "content": " def test_connection_refused(self):\n server_socket, port = bind_unused_port()\n server_socket.close()\n with ExpectLog(gen_log, \".*\", required=False):\n self.http_client.fetch(\"http://localhost:%d/\" % port, self.stop)\n response = self.wait()\n self.assertEqual(599, response.code)\n\n if sys.platform != 'cygwin':\n # cygwin returns EPERM instead of ECONNREFUSED here\n contains_errno = str(errno.ECONNREFUSED) in str(response.error)\n if not contains_errno and hasattr(errno, \"WSAECONNREFUSED\"):\n contains_errno = str(errno.WSAECONNREFUSED) in str(response.error)\n self.assertTrue(contains_errno, response.error)\n # This is usually \"Connection refused\".\n # On windows, strerror is broken and returns \"Unknown error\".\n expected_message = os.strerror(errno.ECONNREFUSED)\n self.assertTrue(expected_message in str(response.error),\n response.error)", "metadata": "root.SimpleHTTPClientTestMixin.test_connection_refused", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 316 }, { "content": " def test_queue_timeout(self):\n with closing(self.create_client(max_clients=1)) as client:\n client.fetch(self.get_url('/trigger'), self.stop,\n request_timeout=10)\n # Wait for the trigger request to block, not complete.\n self.wait()\n client.fetch(self.get_url('/hello'), self.stop,\n connect_timeout=0.1)\n response = self.wait()\n\n self.assertEqual(response.code, 599)\n self.assertTrue(response.request_time < 1, response.request_time)\n self.assertEqual(str(response.error), \"HTTP 599: Timeout\")\n self.triggers.popleft()()\n self.wait()", "metadata": "root.SimpleHTTPClientTestMixin.test_queue_timeout", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 336 }, { "content": " def test_no_content_length(self):\n response = self.fetch(\"/no_content_length\")\n self.assertEquals(b\"hello\", response.body)", "metadata": "root.SimpleHTTPClientTestMixin.test_no_content_length", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 352 }, { "content": " def sync_body_producer(self, write):\n write(b'1234')\n write(b'5678')", "metadata": "root.SimpleHTTPClientTestMixin.sync_body_producer", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 356 }, { "content": " @gen.coroutine\n def async_body_producer(self, write):\n yield write(b'1234')\n yield gen.Task(IOLoop.current().add_callback)\n yield write(b'5678')", "metadata": "root.SimpleHTTPClientTestMixin.async_body_producer", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 360 }, { "content": " def test_sync_body_producer_chunked(self):\n response = self.fetch(\"/echo_post\", method=\"POST\",\n body_producer=self.sync_body_producer)\n response.rethrow()\n self.assertEqual(response.body, b\"12345678\")", "metadata": "root.SimpleHTTPClientTestMixin.test_sync_body_producer_chunked", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 366 }, { "content": " def test_sync_body_producer_content_length(self):\n response = self.fetch(\"/echo_post\", method=\"POST\",\n body_producer=self.sync_body_producer,\n headers={'Content-Length': '8'})\n response.rethrow()\n self.assertEqual(response.body, b\"12345678\")", "metadata": "root.SimpleHTTPClientTestMixin.test_sync_body_producer_content_length", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 372 }, { "content": " def test_async_body_producer_chunked(self):\n response = self.fetch(\"/echo_post\", method=\"POST\",\n body_producer=self.async_body_producer)\n response.rethrow()\n self.assertEqual(response.body, b\"12345678\")", "metadata": "root.SimpleHTTPClientTestMixin.test_async_body_producer_chunked", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 379 }, { "content": " def test_async_body_producer_content_length(self):\n response = self.fetch(\"/echo_post\", method=\"POST\",\n body_producer=self.async_body_producer,\n headers={'Content-Length': '8'})\n response.rethrow()\n self.assertEqual(response.body, b\"12345678\")", "metadata": "root.SimpleHTTPClientTestMixin.test_async_body_producer_content_length", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 385 }, { "content": " def test_100_continue(self):\n response = self.fetch(\"/echo_post\", method=\"POST\",\n body=b\"1234\",\n expect_100_continue=True)\n self.assertEqual(response.body, b\"1234\")", "metadata": "root.SimpleHTTPClientTestMixin.test_100_continue", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 392 }, { "content": " def test_100_continue_early_response(self):\n def body_producer(write):\n raise Exception(\"should not be called\")\n response = self.fetch(\"/respond_in_prepare\", method=\"POST\",\n body_producer=body_producer,\n expect_100_continue=True)\n self.assertEqual(response.code, 403)", "metadata": "root.SimpleHTTPClientTestMixin.test_100_continue_early_response", "header": "['class', 'SimpleHTTPClientTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 398 }, { "content": "class SimpleHTTPClientTestCase(SimpleHTTPClientTestMixin, AsyncHTTPTestCase):\n", "metadata": "root.SimpleHTTPClientTestCase", "header": "['module', '___EOS___']", "index": 407 }, { "content": " def setUp(self):\n super(SimpleHTTPClientTestCase, self).setUp()\n self.http_client = self.create_client()", "metadata": "root.SimpleHTTPClientTestCase.setUp", "header": "['class', 'SimpleHTTPClientTestCase', '(', 'SimpleHTTPClientTestMixin', ',', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 408 }, { "content": " def create_client(self, **kwargs):\n return SimpleAsyncHTTPClient(self.io_loop, force_instance=True,\n **kwargs)", "metadata": "root.SimpleHTTPClientTestCase.create_client", "header": "['class', 'SimpleHTTPClientTestCase', '(', 'SimpleHTTPClientTestMixin', ',', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 412 }, { "content": "class SimpleHTTPSClientTestCase(SimpleHTTPClientTestMixin, AsyncHTTPSTestCase):\n", "metadata": "root.SimpleHTTPSClientTestCase", "header": "['module', '___EOS___']", "index": 417 }, { "content": " def setUp(self):\n super(SimpleHTTPSClientTestCase, self).setUp()\n self.http_client = self.create_client()", "metadata": "root.SimpleHTTPSClientTestCase.setUp", "header": "['class', 'SimpleHTTPSClientTestCase', '(', 'SimpleHTTPClientTestMixin', ',', 'AsyncHTTPSTestCase', ')', ':', '___EOS___']", "index": 418 }, { "content": " def create_client(self, **kwargs):\n return SimpleAsyncHTTPClient(self.io_loop, force_instance=True,\n defaults=dict(validate_cert=False),\n **kwargs)", "metadata": "root.SimpleHTTPSClientTestCase.create_client", "header": "['class', 'SimpleHTTPSClientTestCase', '(', 'SimpleHTTPClientTestMixin', ',', 'AsyncHTTPSTestCase', ')', ':', '___EOS___']", "index": 422 }, { "content": "class CreateAsyncHTTPClientTestCase(AsyncTestCase):\n\n", "metadata": "root.CreateAsyncHTTPClientTestCase", "header": "['module', '___EOS___']", "index": 428 }, { "content": " def setUp(self):\n super(CreateAsyncHTTPClientTestCase, self).setUp()\n self.saved = AsyncHTTPClient._save_configuration()", "metadata": "root.CreateAsyncHTTPClientTestCase.setUp", "header": "['class', 'CreateAsyncHTTPClientTestCase', '(', 'AsyncTestCase', ')', ':', '___EOS___']", "index": 429 }, { "content": " def tearDown(self):\n AsyncHTTPClient._restore_configuration(self.saved)\n super(CreateAsyncHTTPClientTestCase, self).tearDown()", "metadata": "root.CreateAsyncHTTPClientTestCase.tearDown", "header": "['class', 'CreateAsyncHTTPClientTestCase', '(', 'AsyncTestCase', ')', ':', '___EOS___']", "index": 433 }, { "content": " def test_max_clients(self):\n AsyncHTTPClient.configure(SimpleAsyncHTTPClient)\n with closing(AsyncHTTPClient(\n self.io_loop, force_instance=True)) as client:\n self.assertEqual(client.max_clients, 10)\n with closing(AsyncHTTPClient(\n self.io_loop, max_clients=11, force_instance=True)) as client:\n self.assertEqual(client.max_clients, 11)\n\n # Now configure max_clients statically and try overriding it\n # with each way max_clients can be passed\n AsyncHTTPClient.configure(SimpleAsyncHTTPClient, max_clients=12)\n with closing(AsyncHTTPClient(\n self.io_loop, force_instance=True)) as client:\n self.assertEqual(client.max_clients, 12)\n with closing(AsyncHTTPClient(\n self.io_loop, max_clients=13, force_instance=True)) as client:\n self.assertEqual(client.max_clients, 13)\n with closing(AsyncHTTPClient(\n self.io_loop, max_clients=14, force_instance=True)) as client:\n self.assertEqual(client.max_clients, 14)", "metadata": "root.CreateAsyncHTTPClientTestCase.test_max_clients", "header": "['class', 'CreateAsyncHTTPClientTestCase', '(', 'AsyncTestCase', ')', ':', '___EOS___']", "index": 437 }, { "content": "class HTTP100ContinueTestCase(AsyncHTTPTestCase):\n\n\n", "metadata": "root.HTTP100ContinueTestCase", "header": "['module', '___EOS___']", "index": 460 }, { "content": " def respond_100(self, request):\n self.request = request\n self.request.connection.stream.write(\n b\"HTTP/1.1 100 CONTINUE\\r\\n\\r\\n\",\n self.respond_200)", "metadata": "root.HTTP100ContinueTestCase.respond_100", "header": "['class', 'HTTP100ContinueTestCase', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 461 }, { "content": " def respond_200(self):\n self.request.connection.stream.write(\n b\"HTTP/1.1 200 OK\\r\\nContent-Length: 1\\r\\n\\r\\nA\",\n self.request.connection.stream.close)", "metadata": "root.HTTP100ContinueTestCase.respond_200", "header": "['class', 'HTTP100ContinueTestCase', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 467 }, { "content": " def get_app(self):\n # Not a full Application, but works as an HTTPServer callback\n return self.respond_100", "metadata": "root.HTTP100ContinueTestCase.get_app", "header": "['class', 'HTTP100ContinueTestCase', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 472 }, { "content": " def test_100_continue(self):\n res = self.fetch('/')\n self.assertEqual(res.body, b'A')", "metadata": "root.HTTP100ContinueTestCase.test_100_continue", "header": "['class', 'HTTP100ContinueTestCase', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 476 }, { "content": "class HTTP204NoContentTestCase(AsyncHTTPTestCase):\n\n", "metadata": "root.HTTP204NoContentTestCase", "header": "['module', '___EOS___']", "index": 481 }, { "content": " def respond_204(self, request):\n # A 204 response never has a body, even if doesn't have a content-length\n # (which would otherwise mean read-until-close). Tornado always\n # sends a content-length, so we simulate here a server that sends\n # no content length and does not close the connection.\n #\n # Tests of a 204 response with a Content-Length header are included\n # in SimpleHTTPClientTestMixin.\n request.connection.stream.write(\n b\"HTTP/1.1 204 No content\\r\\n\\r\\n\")", "metadata": "root.HTTP204NoContentTestCase.respond_204", "header": "['class', 'HTTP204NoContentTestCase', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 482 }, { "content": " def get_app(self):\n return self.respond_204", "metadata": "root.HTTP204NoContentTestCase.get_app", "header": "['class', 'HTTP204NoContentTestCase', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 493 }, { "content": " def test_204_no_content(self):\n resp = self.fetch('/')\n self.assertEqual(resp.code, 204)\n self.assertEqual(resp.body, b'')", "metadata": "root.HTTP204NoContentTestCase.test_204_no_content", "header": "['class', 'HTTP204NoContentTestCase', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 496 }, { "content": "class HostnameMappingTestCase(AsyncHTTPTestCase):\n\n\n", "metadata": "root.HostnameMappingTestCase", "header": "['module', '___EOS___']", "index": 502 }, { "content": " def setUp(self):\n super(HostnameMappingTestCase, self).setUp()\n self.http_client = SimpleAsyncHTTPClient(\n self.io_loop,\n hostname_mapping={\n 'www.example.com': '127.0.0.1',\n ('foo.example.com', 8000): ('127.0.0.1', self.get_http_port()),\n })", "metadata": "root.HostnameMappingTestCase.setUp", "header": "['class', 'HostnameMappingTestCase', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 503 }, { "content": " def get_app(self):\n return Application([url(\"/hello\", HelloWorldHandler), ])", "metadata": "root.HostnameMappingTestCase.get_app", "header": "['class', 'HostnameMappingTestCase', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 512 }, { "content": " def test_hostname_mapping(self):\n self.http_client.fetch(\n 'http://www.example.com:%d/hello' % self.get_http_port(), self.stop)\n response = self.wait()\n response.rethrow()\n self.assertEqual(response.body, b'Hello world!')", "metadata": "root.HostnameMappingTestCase.test_hostname_mapping", "header": "['class', 'HostnameMappingTestCase', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 515 }, { "content": " def test_port_mapping(self):\n self.http_client.fetch('http://foo.example.com:8000/hello', self.stop)\n response = self.wait()\n response.rethrow()\n self.assertEqual(response.body, b'Hello world!')", "metadata": "root.HostnameMappingTestCase.test_port_mapping", "header": "['class', 'HostnameMappingTestCase', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 522 }, { "content": "class ResolveTimeoutTestCase(AsyncHTTPTestCase):\n\n", "metadata": "root.ResolveTimeoutTestCase", "header": "['module', '___EOS___']", "index": 529 }, { "content": " def setUp(self):\n # Dummy Resolver subclass that never invokes its callback.\n class BadResolver(Resolver):\n def resolve(self, *args, **kwargs):\n pass\n\n super(ResolveTimeoutTestCase, self).setUp()\n self.http_client = SimpleAsyncHTTPClient(\n self.io_loop,\n resolver=BadResolver())", "metadata": "root.ResolveTimeoutTestCase.setUp", "header": "['class', 'ResolveTimeoutTestCase', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 530 }, { "content": " def get_app(self):\n return Application([url(\"/hello\", HelloWorldHandler), ])", "metadata": "root.ResolveTimeoutTestCase.get_app", "header": "['class', 'ResolveTimeoutTestCase', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 541 }, { "content": " def test_resolve_timeout(self):\n response = self.fetch('/hello', connect_timeout=0.1)\n self.assertEqual(response.code, 599)", "metadata": "root.ResolveTimeoutTestCase.test_resolve_timeout", "header": "['class', 'ResolveTimeoutTestCase', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 544 }, { "content": "class MaxHeaderSizeTest(AsyncHTTPTestCase):\n\n\n", "metadata": "root.MaxHeaderSizeTest", "header": "['module', '___EOS___']", "index": 549 }, { "content": " def get_app(self):\n class SmallHeaders(RequestHandler):\n def get(self):\n self.set_header(\"X-Filler\", \"a\" * 100)\n self.write(\"ok\")\n\n class LargeHeaders(RequestHandler):\n def get(self):\n self.set_header(\"X-Filler\", \"a\" * 1000)\n self.write(\"ok\")\n\n return Application([('/small', SmallHeaders),\n ('/large', LargeHeaders)])", "metadata": "root.MaxHeaderSizeTest.get_app", "header": "['class', 'MaxHeaderSizeTest', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 550 }, { "content": " def get_http_client(self):\n return SimpleAsyncHTTPClient(io_loop=self.io_loop, max_header_size=1024)", "metadata": "root.MaxHeaderSizeTest.get_http_client", "header": "['class', 'MaxHeaderSizeTest', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 564 }, { "content": " def test_small_headers(self):\n response = self.fetch('/small')\n response.rethrow()\n self.assertEqual(response.body, b'ok')", "metadata": "root.MaxHeaderSizeTest.test_small_headers", "header": "['class', 'MaxHeaderSizeTest', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 567 }, { "content": " def test_large_headers(self):\n with ExpectLog(gen_log, \"Unsatisfiable read\"):\n response = self.fetch('/large')\n self.assertEqual(response.code, 599)", "metadata": "root.MaxHeaderSizeTest.test_large_headers", "header": "['class', 'MaxHeaderSizeTest', '(', 'AsyncHTTPTestCase', ')', ':', '___EOS___']", "index": 572 } ]
[ { "span": "from tornado.log import gen_log, app_log", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 40 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", ",_", "division_", ",_", "print", "\\u", "function_", ",_", "with", "\\u", "statement_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "contextlib_", "import_", "closing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "errno_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "gzip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "tornado_", "import_", "gen_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tornado_", "._", "httpc", "lient_", "import_", "Async", "HTTP", "Client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tornado_", "._", "http", "util_", "import_", "HTTP", "Headers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tornado_", "._", "ioloop_", "import_", "IO", "Loop_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tornado_", "._", "log_", "import_", "gen", "\\u", "log_", ",_", "app", "\\u", "log_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tornado_", "._", "net", "util_", "import_", "Resolver_", ",_", "bind", "\\u", "sockets_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tornado_", "._", "simple", "\\u", "httpc", "lient_", "import_", "Simple", "Async", "HTTP", "Client_", ",_", "\\u", "default", "\\u", "ca", "\\u", "certs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tornado_", "._", "test_", "._", "httpc", "lien", "t", "\\u", "test_", "import_", "Chunk", "Handler_", ",_", "Count", "down", "Handler_", ",_", "Hell", "o", "Wor", "ld", "Handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tornado_", "._", "test_", "import_", "httpc", "lien", "t", "\\u", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tornado_", "._", "testing_", "import_", "Async", "HTTP", "Test", "Case_", ",_", "Async", "HTTP", "ST", "est", "Case_", ",_", "Async", "Test", "Case_", ",_", "bind", "\\u", "unu", "sed", "\\u", "port_", ",_", "Expect", "Log_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tornado_", "._", "test_", "._", "util_", "import_", "skip", "On", "Tra", "vis_", ",_", "skip", "If", "No", "IP", "v6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tornado_", "._", "web_", "import_", "Request", "Handler_", ",_", "Application_", ",_", "async", "hronous", "_", ",_", "url_", ",_", "stream", "\\u", "request", "\\u", "body_", "\\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_", "\\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_", "\\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_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Simple", "HTTP", "Client", "Common", "Test", "Case_", "(_", "httpc", "lien", "t", "\\u", "test_", "._", "HTTP", "Client", "Common", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Common", "Test", "Case_", "(_", "httpc", "lien", "t", "\\u", "test_", "._", "HTTP", "Client", "Common", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "http", "\\u", "client_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "Simple", "Async", "HTTP", "Client_", "(_", "io", "\\u", "loop_", "=_", "self_", "._", "io", "\\u", "loop_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "force", "\\u", "instance_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "client_", ",_", "Simple", "Async", "HTTP", "Client_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "client_", "\\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_", "Trigger", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Trigger", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "initialize_", "(_", "self_", ",_", "queue_", ",_", "wake", "\\u", "callback_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "queue_", "=_", "queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wake", "\\u", "callback_", "=_", "wake", "\\u", "callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Trigger", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "async", "hronous", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "\"", "que", "uin", "g", " ", "trigger", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "queue_", "._", "append_", "(_", "self_", "._", "finish_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "get", "\\u", "argument_", "(_", "\"", "wake", "\"_", ",_", "\"", "true", "\"_", ")_", "==_", "\"", "true", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "wake", "\\u", "callback_", "(_", ")_", "\\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_", "Hang", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hang", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "async", "hronous", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get_", "(_", "self_", ")_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Conten", "t", "Length", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Conten", "t", "Length", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "header_", "(_", "\"", "Conten", "t", "-", "Length", "\"_", ",_", "self_", "._", "get", "\\u", "argument_", "(_", "\"", "value", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "write_", "(_", "\"", "ok", "\"_", ")_", "\\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_", "Head", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Head", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "head_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "header_", "(_", "\"", "Conten", "t", "-", "Length", "\"_", ",_", "\"", "7", "\"_", ")_", "\\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_", "Optio", "ns", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Optio", "ns", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "options_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "header_", "(_", "\"", "Access", "-", "Control", "-", "All", "ow", "-", "Orig", "in", "\"_", ",_", "\"*\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "write_", "(_", "\"", "ok", "\"_", ")_", "\\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_", "No", "Conten", "t", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "No", "Conten", "t", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "get", "\\u", "argument_", "(_", "\"", "error", "\"_", ",_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "header_", "(_", "\"", "Conten", "t", "-", "Length", "\"_", ",_", "\"", "5", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "write_", "(_", "\"", "hell", "o", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "set\\u", "status_", "(_", "204_", ")_", "\\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_", "See", "Ot", "her", "Post", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "See", "Ot", "her", "Post", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "post_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "redirec", "t", "\\u", "code_", "=_", "int_", "(_", "self_", "._", "request_", "._", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "redirec", "t", "\\u", "code_", "in_", "(_", "302_", ",_", "303_", ")_", ",_", "\"", "unexpected", " ", "body", " ", "%", "r", "\"_", "%_", "self_", "._", "request_", "._", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set\\u", "header_", "(_", "\"", "Locat", "ion", "\"_", ",_", "\"/", "see", "\\u", "other", "\\u", "get", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set\\u", "status_", "(_", "redirec", "t", "\\u", "code_", ")_", "\\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_", "See", "Ot", "her", "Get", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "See", "Ot", "her", "Get", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "request_", "._", "body_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "\"", "unexpected", " ", "body", " ", "%", "r", "\"_", "%_", "self_", "._", "request_", "._", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "write_", "(_", "\"", "ok", "\"_", ")_", "\\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_", "Host", "Ech", "o", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Host", "Ech", "o", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "self_", "._", "request_", "._", "headers_", "[_", "\"", "Host", "\"_", "]_", ")_", "\\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_", "No", "Conten", "t", "Length", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "No", "Conten", "t", "Length", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "gen_", "._", "coroutine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Emulat", "e", " ", "the", " ", "old", " ", "HTTP", "/", "1.0", " ", "behavior", " ", "of", " ", "return", "ing", " ", "a", " ", "body", " ", "with", " ", "no_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "content", "-", "length", ".", " ", " ", "Tor", "nad", "o", " ", "handle", "s", " ", "content", "-", "length", " ", "at", " ", "the", " ", "framework_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "level", " ", "so", " ", "we", " ", "have", " ", "to", " ", "go", " ", "aro", "und", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stream_", "=_", "self_", "._", "request_", "._", "connection_", "._", "stream_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "stream_", "._", "write_", "(_", "b", "\"", "HTTP", "/", "1.0", " ", "200", " ", "OK", "\\\\", "r", "\\\\", "n", "\\\\", "r", "\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "b", "\"", "hell", "o", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stream_", "._", "close_", "(_", ")_", "\\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_", "Ech", "o", "Post", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ech", "o", "Post", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "post_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "self_", "._", "request_", "._", "body_", ")_", "\\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_", "@_", "stream", "\\u", "request", "\\u", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Respo", "nd", "In", "Prepare", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Respo", "nd", "In", "Prepare", "Handler_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "prepare_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "status_", "(_", "403_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "finish_", "(_", "\"", "forbidden", "\"_", ")_", "\\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_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\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\\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_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "app_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "calla", "ble", " ", "object", "s", " ", "to", " ", "finish", " ", "pend", "ing", " ", "/", "trigger", " ", "requests_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "triggers_", "=_", "collections_", "._", "deque_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Application_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "\"/", "trigger", "\"_", ",_", "Trigger", "Handler_", ",_", "dict_", "(_", "queue_", "=_", "self_", "._", "triggers_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "wake", "\\u", "callback_", "=_", "self_", "._", "stop_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "\"/", "chunk", "\"_", ",_", "Chunk", "Handler_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "\"/", "countdown", "/([", "0", "-", "9", "]+)\"", "_", ",_", "Count", "down", "Handler_", ",_", "name_", "=_", "\"", "countdown", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "\"/", "hang", "\"_", ",_", "Hang", "Handler_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "\"/", "hell", "o", "\"_", ",_", "Hell", "o", "Wor", "ld", "Handler_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "\"/", "content", "\\u", "length", "\"_", ",_", "Conten", "t", "Length", "Handler_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "\"/", "head", "\"_", ",_", "Head", "Handler_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "\"/", "options", "\"_", ",_", "Optio", "ns", "Handler_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "\"/", "no", "\\u", "content", "\"_", ",_", "No", "Conten", "t", "Handler_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "\"/", "see", "\\u", "other", "\\u", "post", "\"_", ",_", "See", "Ot", "her", "Post", "Handler_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "\"/", "see", "\\u", "other", "\\u", "get", "\"_", ",_", "See", "Ot", "her", "Get", "Handler_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "\"/", "host", "\\u", "echo", "\"_", ",_", "Host", "Ech", "o", "Handler_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "\"/", "no", "\\u", "content", "\\u", "length", "\"_", ",_", "No", "Conten", "t", "Length", "Handler_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "\"/", "echo", "\\u", "post", "\"_", ",_", "Ech", "o", "Post", "Handler_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "\"/", "respond", "\\u", "in", "\\u", "prepar", "e", "\"_", ",_", "Respo", "nd", "In", "Prepare", "Handler_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "gzip_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "singleton_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Class", " ", "\"", "construct", "or", "\"", " ", "reus", "es", " ", "object", "s", " ", "on", " ", "the", " ", "same", " ", "IO", "Loop_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "Simple", "Async", "HTTP", "Client_", "(_", "self_", "._", "io", "\\u", "loop_", ")_", "is_", "\\u\\u\\uNL\\u\\u\\u_", "Simple", "Async", "HTTP", "Client_", "(_", "self_", "._", "io", "\\u", "loop_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "unl", "ess", " ", "force", "\\u", "instance", " ", "is", " ", "used_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "Simple", "Async", "HTTP", "Client_", "(_", "self_", "._", "io", "\\u", "loop_", ")_", "is_", "not_", "\\u\\u\\uNL\\u\\u\\u_", "Simple", "Async", "HTTP", "Client_", "(_", "self_", "._", "io", "\\u", "loop_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "force", "\\u", "instance_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "different", " ", "IO", "Loop", "s", " ", "use", " ", "different", " ", "objects_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "closing_", "(_", "IO", "Loop_", "(_", ")_", ")_", "as_", "io", "\\u", "loop", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "Simple", "Async", "HTTP", "Client_", "(_", "self_", "._", "io", "\\u", "loop_", ")_", "is_", "not_", "\\u\\u\\uNL\\u\\u\\u_", "Simple", "Async", "HTTP", "Client_", "(_", "io", "\\u", "loop", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "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_", "test\\u", "connecti", "on", "\\u", "limit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "closing_", "(_", "self_", "._", "create", "\\u", "client_", "(_", "max", "\\u", "clients_", "=_", "2_", ")_", ")_", "as_", "client_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "client_", "._", "max", "\\u", "clients_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "seen_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sen", "d", " ", "4", " ", "request", "s", ".", " ", " ", "Tw", "o", " ", "can", " ", "be", " ", "sent", " ", "immediate", "ly", ",", " ", "whi", "le", " ", "the", " ", "others_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "will", " ", "be", " ", "queue", "d_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "._", "fetch_", "(_", "self_", "._", "get", "\\u", "url_", "(_", "\"/", "trigger", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", "response_", ",_", "i_", "=_", "i_", ":_", "(_", "seen_", "._", "append_", "(_", "i_", ")_", ",_", "self_", "._", "stop_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "wait_", "(_", "condition_", "=_", "lambda_", ":_", "len_", "(_", "self_", "._", "triggers_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "client_", "._", "queue_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Finish", " ", "the", " ", "first", " ", "two", " ", "request", "s", " ", "and", " ", "let", " ", "the", " ", "next", " ", "two", " ", "through_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "triggers_", "._", "popleft_", "(_", ")_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "triggers_", "._", "popleft_", "(_", ")_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wait_", "(_", "condition_", "=_", "lambda_", ":_", "(_", "len_", "(_", "self_", "._", "triggers_", ")_", "==_", "2_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "seen_", ")_", "==_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "set_", "(_", "seen_", ")_", ",_", "set_", "(_", "[_", "0_", ",_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "client_", "._", "queue_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Finish", " ", "all", " ", "the", " ", "pend", "ing", " ", "requests_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "triggers_", "._", "popleft_", "(_", ")_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "triggers_", "._", "popleft_", "(_", ")_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wait_", "(_", "condition_", "=_", "lambda_", ":_", "len_", "(_", "seen_", ")_", "==_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "set_", "(_", "seen_", ")_", ",_", "set_", "(_", "[_", "0_", ",_", "1_", ",_", "2_", ",_", "3_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "self_", "._", "triggers_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "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_", "test\\u", "redirec", "t", "\\u", "connecti", "on", "\\u", "limit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "follow", "ing", " ", "redirec", "ts", " ", "shou", "ld", " ", "not", " ", "consume", " ", "addition", "al", " ", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "closing_", "(_", "self_", "._", "create", "\\u", "client_", "(_", "max", "\\u", "clients_", "=_", "1_", ")_", ")_", "as_", "client_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "._", "fetch_", "(_", "self_", "._", "get", "\\u", "url_", "(_", "'/", "countdown", "/", "3", "'_", ")_", ",_", "self_", "._", "stop_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "redirects_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "._", "ret", "hro", "w_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "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_", "test\\u", "default", "\\u", "certificates", "\\u", "exist_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "open_", "(_", "\\u", "default", "\\u", "ca", "\\u", "certs_", "(_", ")_", ")_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "gzip_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "All", " ", "the", " ", "tests", " ", "in", " ", "this", " ", "file", " ", "shou", "ld", " ", "be", " ", "usi", "ng", " ", "gzip", ",", " ", "but", " ", "this", " ", "test_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ensure", "s", " ", "tha", "t", " ", "it", " ", "is", " ", "in", " ", "fact", " ", "getti", "ng", " ", "compress", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sett", "ing", " ", "Accept", "-", "Enco", "ding", " ", "manu", "ally", " ", "bypass", "es", " ", "the", " ", "client", "'", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "decompress", "ion", " ", "so", " ", "we", " ", "can", " ", "see", " ", "the", " ", "raw", " ", "data", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "chunk", "\"_", ",_", "use", "\\u", "gzip_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "=_", "{_", "\"", "Accept", "-", "Enco", "ding", "\"_", ":_", "\"", "gzip", "\"_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "headers_", "[_", "\"", "Conten", "t", "-", "Enco", "ding", "\"_", "]_", ",_", "\"", "gzip", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "response_", "._", "body_", ",_", "b", "\"", "asd", "fq", "wer", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ou", "r", " ", "test", " ", "data", " ", "gets", " ", "bigger", " ", "whe", "n", " ", "gzip", "ped", ".", " ", " ", "Oo", "ps", ".", " ", " ", ":)", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "response_", "._", "body_", ")_", ",_", "34_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "gzip_", "._", "Gz", "ip", "File_", "(_", "mode_", "=_", "\"", "r", "\"_", ",_", "fileobj_", "=_", "response_", "._", "buffer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f_", "._", "read_", "(_", ")_", ",_", "b", "\"", "asd", "fq", "wer", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "max", "\\u", "redirects_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "countdown", "/", "5", "\"_", ",_", "max", "\\u", "redirects_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "302_", ",_", "response_", "._", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "request", "ed", " ", "5", ",", " ", "followe", "d", " ", "three", " ", "redirec", "ts", " ", "for", " ", "4", ",", " ", "3", ",", " ", "2", ",", " ", "then", " ", "the", " ", "last_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unfol", "lowe", "d", " ", "redirec", "t", " ", "is", " ", "to", " ", "1._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "._", "request_", "._", "url_", "._", "endswith_", "(_", "\"/", "countdown", "/", "5", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "._", "effective", "\\u", "url_", "._", "endswith_", "(_", "\"/", "countdown", "/", "2", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "._", "headers_", "[_", "\"", "Locat", "ion", "\"_", "]_", "._", "endswith_", "(_", "\"/", "countdown", "/", "1", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "header", "\\u", "reuse_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "App", "s", " ", "may", " ", "reus", "e", " ", "a", " ", "header", "s", " ", "object", " ", "if", " ", "the", "y", " ", "are", " ", "only", " ", "passi", "ng", " ", "in", " ", "constant_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "header", "s", " ", "like", " ", "user", "-", "agent", ".", " ", " ", "The", " ", "header", " ", "object", " ", "shou", "ld", " ", "not", " ", "be", " ", "modifi", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "=_", "HTTP", "Headers_", "(_", "{_", "'", "User", "-", "Agent", "'_", ":_", "'", "Foo", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fetch_", "(_", "\"/", "hell", "o", "\"_", ",_", "headers_", "=_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "headers_", "._", "get", "\\u", "all_", "(_", ")_", ")_", ",_", "[_", "(_", "'", "User", "-", "Agent", "'_", ",_", "'", "Foo", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "see", "\\u", "other", "\\u", "redirect_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "code_", "in_", "(_", "302_", ",_", "303_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "see", "\\u", "other", "\\u", "post", "\"_", ",_", "method_", "=_", "\"", "POST", "\"_", ",_", "body_", "=_", "\"%", "d", "\"_", "%_", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "200_", ",_", "response_", "._", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "._", "request_", "._", "url_", "._", "endswith_", "(_", "\"/", "see", "\\u", "other", "\\u", "post", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "._", "effective", "\\u", "url_", "._", "endswith_", "(_", "\"/", "see", "\\u", "other", "\\u", "get", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "request", " ", "is", " ", "the", " ", "original", " ", "request", ",", " ", "is", " ", "a", " ", "POST", " ", "still", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\"", "POST", "\"_", ",_", "response_", "._", "request_", "._", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "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_", "@_", "skip", "On", "Tra", "vis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "request", "\\u", "timeout_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "'/", "trigger", "?", "wake", "=", "fal", "se", "'_", ",_", "request", "\\u", "timeout_", "=_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "code_", ",_", "599", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "0.09", "9_", "<_", "response_", "._", "request", "\\u", "time_", "<_", "0.15_", ",_", "response_", "._", "request", "\\u", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "response_", "._", "error_", ")_", ",_", "\"", "HTTP", " ", "599", ":", " ", "Time", "out", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "trigger", " ", "the", " ", "hang", "ing", " ", "request", " ", "to", " ", "let", " ", "it", " ", "clean", " ", "up", " ", "after", " ", "its", "elf_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "triggers_", "._", "popleft_", "(_", ")_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "skip", "If", "No", "IP", "v6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "ipv6_", "(_", "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 ", " _", "[_", "sock_", "]_", "=_", "bind", "\\u", "sockets_", "(_", "None_", ",_", "':", ":", "1", "'_", ",_", "family_", "=_", "socket_", "._", "AF", "\\u", "INE", "T6", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port_", "=_", "sock_", "._", "getsockname", "_", "(_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "http", "\\u", "server_", "._", "add", "\\u", "socket_", "(_", "sock_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "socket_", "._", "gai", "error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "e_", "._", "args_", "[_", "0_", "]_", "==_", "socket_", "._", "EA", "I", "\\u", "ADDR", "FAMILY", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "python", " ", "support", "s", " ", "ipv", "6", ",", " ", "but", " ", "it", "'", "s", " ", "not", " ", "configur", "ed", " ", "on", " ", "the", " ", "network_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "interface", ",", " ", "so", " ", "skip", " ", "this", " ", "test", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "url_", "=_", "'%", "s", "://", "[:", ":", "1", "]:", "%", "d", "/", "hell", "o", "'_", "%_", "(_", "self_", "._", "get", "\\u", "protocol_", "(_", ")_", ",_", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ipv", "6", " ", "is", " ", "currentl", "y", " ", "enable", "d", " ", "by", " ", "default", " ", "but", " ", "can", " ", "be", " ", "disabled_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "http", "\\u", "client_", "._", "fetch_", "(_", "url_", ",_", "self_", "._", "stop_", ",_", "allow", "\\u", "ipv6_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "code_", ",_", "599", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "http", "\\u", "client_", "._", "fetch_", "(_", "url_", ",_", "self_", "._", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "body_", ",_", "b", "\"", "Hell", "o", " ", "world", "!\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "xte", "st", "\\u", "multiple", "\\u", "content", "\\u", "length", "\\u", "accepted_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "content", "\\u", "length", "?", "value", "=", "2", ",", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "body_", ",_", "b", "\"", "ok", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "content", "\\u", "length", "?", "value", "=", "2", ",%", "202", ",", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "body_", ",_", "b", "\"", "ok", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "content", "\\u", "length", "?", "value", "=", "2", ",", "4", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "code_", ",_", "599", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "content", "\\u", "length", "?", "value", "=", "2", ",%", "202", ",", "3", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "code_", ",_", "599", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "head", "\\u", "request_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "head", "\"_", ",_", "method_", "=_", "\"", "HEAD", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "headers_", "[_", "\"", "content", "-", "length", "\"_", "]_", ",_", "\"", "7", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "response_", "._", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "options", "\\u", "request_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "options", "\"_", ",_", "method_", "=_", "\"", "OPTION", "S", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "headers_", "[_", "\"", "content", "-", "length", "\"_", "]_", ",_", "\"", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "headers_", "[_", "\"", "access", "-", "control", "-", "allow", "-", "orig", "in", "\"_", "]_", ",_", "\"*\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "body_", ",_", "b", "\"", "ok", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "no", "\\u", "content_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "no", "\\u", "content", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "code_", ",_", "204_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "204", " ", "status", " ", "doe", "sn", "'", "t", " ", "need", " ", "a", " ", "content", "-", "length", ",", " ", "but", " ", "torn", "ado", " ", "will", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "a", " ", "zero", " ", "content", "-", "length", " ", "anyway", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "test", " ", "with", "out", " ", "a", " ", "content", "-", "length", " ", "header", " ", "is", " ", "include", "d", " ", "below_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "HTTP", "204", "No", "Conten", "t", "Test", "Case", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "headers_", "[_", "\"", "Conten", "t", "-", "length", "\"_", "]_", ",_", "\"", "0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "204", " ", "status", " ", "with", " ", "non", "-", "zero", " ", "content", " ", "length", " ", "is", " ", "mal", "formed", "_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "Expect", "Log_", "(_", "gen", "\\u", "log_", ",_", "\"", "Mal", "formed", " ", "HTTP", " ", "message", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "no", "\\u", "content", "?", "error", "=", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "code_", ",_", "599", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "host", "\\u", "header_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "host", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "b", "\"", "^", "local", "host", ":[", "0", "-", "9", "]+$", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "host", "\\u", "echo", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "host", "\\u", "re_", "._", "match_", "(_", "response_", "._", "body_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "self_", "._", "get", "\\u", "url_", "(_", "\"/", "host", "\\u", "echo", "\"_", ")_", "._", "replace_", "(_", "\"", "http", "://\"_", ",_", "\"", "http", "://", "me", ":", "secret", "@\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "http", "\\u", "client_", "._", "fetch_", "(_", "url_", ",_", "self_", "._", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "host", "\\u", "re_", "._", "match_", "(_", "response_", "._", "body_", ")_", ",_", "response_", "._", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "connecti", "on", "\\u", "refuse", "d_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "server", "\\u", "socket_", ",_", "port_", "=_", "bind", "\\u", "unu", "sed", "\\u", "port_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server", "\\u", "socket_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "Expect", "Log_", "(_", "gen", "\\u", "log_", ",_", "\".*", "\"_", ",_", "required_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "http", "\\u", "client_", "._", "fetch_", "(_", "\"", "http", "://", "local", "host", ":", "%", "d", "/\"_", "%_", "port_", ",_", "self_", "._", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "599", "_", ",_", "response_", "._", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sys_", "._", "platform_", "!=_", "'", "cyg", "win", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "cyg", "win", " ", "return", "s", " ", "EP", "ERM", " ", "inst", "ead", " ", "of", " ", "ECO", "NN", "REF", "USED", " ", "here_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "contain", "s", "\\u", "errno_", "=_", "str_", "(_", "errno_", "._", "ECO", "NN", "REF", "USED", "_", ")_", "in_", "str_", "(_", "response_", "._", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "contain", "s", "\\u", "errno_", "and_", "hasattr_", "(_", "errno_", ",_", "\"", "WS", "AE", "CONN", "REF", "USED", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "contain", "s", "\\u", "errno_", "=_", "str_", "(_", "errno_", "._", "WS", "AE", "CONN", "REF", "USED", "_", ")_", "in_", "str_", "(_", "response_", "._", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "contain", "s", "\\u", "errno_", ",_", "response_", "._", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "usual", "ly", " ", "\"", "Connect", "ion", " ", "refuse", "d", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "On", " ", "windows", ",", " ", "stre", "rror", " ", "is", " ", "broken", " ", "and", " ", "return", "s", " ", "\"", "Un", "know", "n", " ", "error", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "expected", "\\u", "message_", "=_", "os_", "._", "strerror_", "(_", "errno_", "._", "ECO", "NN", "REF", "USED", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "expected", "\\u", "message_", "in_", "str_", "(_", "response_", "._", "error_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "._", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "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_", "test\\u", "queue", "\\u", "timeout_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "closing_", "(_", "self_", "._", "create", "\\u", "client_", "(_", "max", "\\u", "clients_", "=_", "1_", ")_", ")_", "as_", "client_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "._", "fetch_", "(_", "self_", "._", "get", "\\u", "url_", "(_", "'/", "trigger", "'_", ")_", ",_", "self_", "._", "stop_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "request", "\\u", "timeout_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Wait", " ", "for", " ", "the", " ", "trigger", " ", "request", " ", "to", " ", "block", ",", " ", "not", " ", "complete", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "fetch_", "(_", "self_", "._", "get", "\\u", "url_", "(_", "'/", "hell", "o", "'_", ")_", ",_", "self_", "._", "stop_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "connect", "\\u", "timeout_", "=_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "code_", ",_", "599", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "._", "request", "\\u", "time_", "<_", "1_", ",_", "response_", "._", "request", "\\u", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "response_", "._", "error_", ")_", ",_", "\"", "HTTP", " ", "599", ":", " ", "Time", "out", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "triggers_", "._", "popleft_", "(_", ")_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "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_", "test\\u", "no", "\\u", "content", "\\u", "length_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "no", "\\u", "content", "\\u", "length", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "b", "\"", "hell", "o", "\"_", ",_", "response_", "._", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sync", "\\u", "body", "\\u", "producer_", "(_", "self_", ",_", "write_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "write_", "(_", "b", "'", "1234", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write_", "(_", "b", "'", "5678", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "gen_", "._", "coroutine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "async", "\\u", "body", "\\u", "producer_", "(_", "self_", ",_", "write_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "write_", "(_", "b", "'", "1234", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "gen_", "._", "Task_", "(_", "IO", "Loop_", "._", "current_", "(_", ")_", "._", "add", "\\u", "callback_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "write_", "(_", "b", "'", "5678", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sync", "\\u", "body", "\\u", "producer", "\\u", "chunked", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "echo", "\\u", "post", "\"_", ",_", "method_", "=_", "\"", "POST", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "body", "\\u", "producer_", "=_", "self_", "._", "sync", "\\u", "body", "\\u", "producer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "._", "ret", "hro", "w_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "body_", ",_", "b", "\"", "12345678", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sync", "\\u", "body", "\\u", "producer", "\\u", "content", "\\u", "length_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "echo", "\\u", "post", "\"_", ",_", "method_", "=_", "\"", "POST", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "body", "\\u", "producer_", "=_", "self_", "._", "sync", "\\u", "body", "\\u", "producer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "=_", "{_", "'", "Conten", "t", "-", "Length", "'_", ":_", "'", "8", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "._", "ret", "hro", "w_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "body_", ",_", "b", "\"", "12345678", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "async", "\\u", "body", "\\u", "producer", "\\u", "chunked", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "echo", "\\u", "post", "\"_", ",_", "method_", "=_", "\"", "POST", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "body", "\\u", "producer_", "=_", "self_", "._", "async", "\\u", "body", "\\u", "producer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "._", "ret", "hro", "w_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "body_", ",_", "b", "\"", "12345678", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "async", "\\u", "body", "\\u", "producer", "\\u", "content", "\\u", "length_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "echo", "\\u", "post", "\"_", ",_", "method_", "=_", "\"", "POST", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "body", "\\u", "producer_", "=_", "self_", "._", "async", "\\u", "body", "\\u", "producer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "=_", "{_", "'", "Conten", "t", "-", "Length", "'_", ":_", "'", "8", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "._", "ret", "hro", "w_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "body_", ",_", "b", "\"", "12345678", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "100", "\\u", "continue_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "echo", "\\u", "post", "\"_", ",_", "method_", "=_", "\"", "POST", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "body_", "=_", "b", "\"", "1234", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expect", "\\u", "100", "\\u", "continue_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "body_", ",_", "b", "\"", "1234", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "100", "\\u", "continue", "\\u", "ear", "ly", "\\u", "response_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "body", "\\u", "producer_", "(_", "write_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "\"", "shou", "ld", " ", "not", " ", "be", " ", "call", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "=_", "self_", "._", "fetch_", "(_", "\"/", "respond", "\\u", "in", "\\u", "prepar", "e", "\"_", ",_", "method_", "=_", "\"", "POST", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "body", "\\u", "producer_", "=_", "body", "\\u", "producer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expect", "\\u", "100", "\\u", "continue_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "code_", ",_", "403_", ")_", "\\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_", "Simple", "HTTP", "Client", "Test", "Case_", "(_", "Simple", "HTTP", "Client", "Test", "Mixin_", ",_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Case_", "(_", "Simple", "HTTP", "Client", "Test", "Mixin_", ",_", "Async", "HTTP", "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 ", " _", "super_", "(_", "Simple", "HTTP", "Client", "Test", "Case_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "http", "\\u", "client_", "=_", "self_", "._", "create", "\\u", "client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "Client", "Test", "Case_", "(_", "Simple", "HTTP", "Client", "Test", "Mixin_", ",_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "client_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Simple", "Async", "HTTP", "Client_", "(_", "self_", "._", "io", "\\u", "loop_", ",_", "force", "\\u", "instance_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", "\\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_", "Simple", "HTTP", "SC", "lien", "t", "Test", "Case_", "(_", "Simple", "HTTP", "Client", "Test", "Mixin_", ",_", "Async", "HTTP", "ST", "est", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "SC", "lien", "t", "Test", "Case_", "(_", "Simple", "HTTP", "Client", "Test", "Mixin_", ",_", "Async", "HTTP", "ST", "est", "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 ", " _", "super_", "(_", "Simple", "HTTP", "SC", "lien", "t", "Test", "Case_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "http", "\\u", "client_", "=_", "self_", "._", "create", "\\u", "client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "HTTP", "SC", "lien", "t", "Test", "Case_", "(_", "Simple", "HTTP", "Client", "Test", "Mixin_", ",_", "Async", "HTTP", "ST", "est", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "client_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Simple", "Async", "HTTP", "Client_", "(_", "self_", "._", "io", "\\u", "loop_", ",_", "force", "\\u", "instance_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "defaults_", "=_", "dict_", "(_", "validat", "e\\u", "cert_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", "\\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_", "Creat", "e", "Async", "HTTP", "Client", "Test", "Case_", "(_", "Async", "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_", "Creat", "e", "Async", "HTTP", "Client", "Test", "Case_", "(_", "Async", "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 ", " _", "super_", "(_", "Creat", "e", "Async", "HTTP", "Client", "Test", "Case_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "saved_", "=_", "Async", "HTTP", "Client_", "._", "\\u", "save", "\\u", "configuration_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Async", "HTTP", "Client", "Test", "Case_", "(_", "Async", "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 ", " _", "Async", "HTTP", "Client_", "._", "\\u", "restore", "\\u", "configuration_", "(_", "self_", "._", "saved_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Creat", "e", "Async", "HTTP", "Client", "Test", "Case_", ",_", "self_", ")_", "._", "tear", "Down_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Creat", "e", "Async", "HTTP", "Client", "Test", "Case_", "(_", "Async", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "max", "\\u", "clients_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Async", "HTTP", "Client_", "._", "configure_", "(_", "Simple", "Async", "HTTP", "Client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "closing_", "(_", "Async", "HTTP", "Client_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "io", "\\u", "loop_", ",_", "force", "\\u", "instance_", "=_", "True_", ")_", ")_", "as_", "client_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "client_", "._", "max", "\\u", "clients_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "closing_", "(_", "Async", "HTTP", "Client_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "io", "\\u", "loop_", ",_", "max", "\\u", "clients_", "=_", "11_", ",_", "force", "\\u", "instance_", "=_", "True_", ")_", ")_", "as_", "client_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "client_", "._", "max", "\\u", "clients_", ",_", "11_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "configur", "e", " ", "max", "\\u", "clients", " ", "static", "ally", " ", "and", " ", "try", " ", "overrid", "ing", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "each", " ", "way", " ", "max", "\\u", "clients", " ", "can", " ", "be", " ", "passed_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Async", "HTTP", "Client_", "._", "configure_", "(_", "Simple", "Async", "HTTP", "Client_", ",_", "max", "\\u", "clients_", "=_", "12_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "closing_", "(_", "Async", "HTTP", "Client_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "io", "\\u", "loop_", ",_", "force", "\\u", "instance_", "=_", "True_", ")_", ")_", "as_", "client_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "client_", "._", "max", "\\u", "clients_", ",_", "12_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "closing_", "(_", "Async", "HTTP", "Client_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "io", "\\u", "loop_", ",_", "max", "\\u", "clients_", "=_", "13_", ",_", "force", "\\u", "instance_", "=_", "True_", ")_", ")_", "as_", "client_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "client_", "._", "max", "\\u", "clients_", ",_", "13_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "closing_", "(_", "Async", "HTTP", "Client_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "io", "\\u", "loop_", ",_", "max", "\\u", "clients_", "=_", "14_", ",_", "force", "\\u", "instance_", "=_", "True_", ")_", ")_", "as_", "client_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "client_", "._", "max", "\\u", "clients_", ",_", "14_", ")_", "\\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_", "HTTP", "100", "Continu", "e", "Test", "Case_", "(_", "Async", "HTTP", "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_", "[SEP]_", "class_", "HTTP", "100", "Continu", "e", "Test", "Case_", "(_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "respond", "\\u", "100_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "request_", "=_", "request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "request_", "._", "connection_", "._", "stream_", "._", "write_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "b", "\"", "HTTP", "/", "1.1", " ", "100", " ", "CONTINUE", "\\\\", "r", "\\\\", "n", "\\\\", "r", "\\\\", "n", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "respond", "\\u", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "100", "Continu", "e", "Test", "Case_", "(_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "respond", "\\u", "200_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "request_", "._", "connection_", "._", "stream_", "._", "write_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "b", "\"", "HTTP", "/", "1.1", " ", "200", " ", "OK", "\\\\", "r", "\\\\", "n", "Conten", "t", "-", "Length", ":", " ", "1", "\\\\", "r", "\\\\", "n", "\\\\", "r", "\\\\", "n", "A", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "request_", "._", "connection_", "._", "stream_", "._", "close_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "100", "Continu", "e", "Test", "Case_", "(_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "app_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", " ", "a", " ", "full", " ", "Applica", "tion", ",", " ", "but", " ", "works", " ", "as", " ", "an", " ", "HTTP", "Server", " ", "callback_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "respond", "\\u", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "100", "Continu", "e", "Test", "Case_", "(_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "100", "\\u", "continue_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "self_", "._", "fetch_", "(_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "res_", "._", "body_", ",_", "b", "'", "A", "'_", ")_", "\\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_", "HTTP", "204", "No", "Conten", "t", "Test", "Case_", "(_", "Async", "HTTP", "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_", "HTTP", "204", "No", "Conten", "t", "Test", "Case_", "(_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "respond", "\\u", "204_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "204", " ", "response", " ", "neve", "r", " ", "has", " ", "a", " ", "body", ",", " ", "even", " ", "if", " ", "doe", "sn", "'", "t", " ", "have", " ", "a", " ", "content", "-", "length_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "whi", "ch", " ", "wou", "ld", " ", "other", "wis", "e", " ", "mean", " ", "read", "-", "unti", "l", "-", "close", ").", " ", " ", "Tor", "nad", "o", " ", "alw", "ays_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "send", "s", " ", "a", " ", "content", "-", "length", ",", " ", "so", " ", "we", " ", "simulat", "e", " ", "here", " ", "a", " ", "server", " ", "tha", "t", " ", "send", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "no", " ", "content", " ", "length", " ", "and", " ", "doe", "s", " ", "not", " ", "close", " ", "the", " ", "connecti", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", "s", " ", "of", " ", "a", " ", "204", " ", "response", " ", "with", " ", "a", " ", "Conten", "t", "-", "Length", " ", "header", " ", "are", " ", "included_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "Simple", "HTTP", "Client", "Test", "Mix", "in", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "._", "connection_", "._", "stream_", "._", "write_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "b", "\"", "HTTP", "/", "1.1", " ", "204", " ", "No", " ", "content", "\\\\", "r", "\\\\", "n", "\\\\", "r", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "204", "No", "Conten", "t", "Test", "Case_", "(_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "app_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "respond", "\\u", "204_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "204", "No", "Conten", "t", "Test", "Case_", "(_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "204", "\\u", "no", "\\u", "content_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "fetch_", "(_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "code_", ",_", "204_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "body_", ",_", "b", "''_", ")_", "\\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_", "Host", "name", "Map", "ping", "Test", "Case_", "(_", "Async", "HTTP", "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_", "[SEP]_", "class_", "Host", "name", "Map", "ping", "Test", "Case_", "(_", "Async", "HTTP", "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 ", " _", "super_", "(_", "Host", "name", "Map", "ping", "Test", "Case_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "http", "\\u", "client_", "=_", "Simple", "Async", "HTTP", "Client_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "io", "\\u", "loop_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "host", "name", "\\u", "mapping_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "www", ".", "example", ".", "com", "'_", ":_", "'", "127", ".0", ".0", ".1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "foo", ".", "example", ".", "com", "'_", ",_", "8000_", ")_", ":_", "(_", "'", "127", ".0", ".0", ".1", "'_", ",_", "self_", "._", "get", "\\u", "http", "\\u", "port_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Host", "name", "Map", "ping", "Test", "Case_", "(_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "app_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Application_", "(_", "[_", "url_", "(_", "\"/", "hell", "o", "\"_", ",_", "Hell", "o", "Wor", "ld", "Handler_", ")_", ",_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Host", "name", "Map", "ping", "Test", "Case_", "(_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "host", "name", "\\u", "mapping_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "http", "\\u", "client_", "._", "fetch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "http", "://", "www", ".", "example", ".", "com", ":", "%", "d", "/", "hell", "o", "'_", "%_", "self_", "._", "get", "\\u", "http", "\\u", "port_", "(_", ")_", ",_", "self_", "._", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "._", "ret", "hro", "w_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "body_", ",_", "b", "'", "Hell", "o", " ", "world", "!'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Host", "name", "Map", "ping", "Test", "Case_", "(_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "port", "\\u", "mapping_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "http", "\\u", "client_", "._", "fetch_", "(_", "'", "http", "://", "foo", ".", "example", ".", "com", ":", "800", "0", "/", "hell", "o", "'_", ",_", "self_", "._", "stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "._", "ret", "hro", "w_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "body_", ",_", "b", "'", "Hell", "o", " ", "world", "!'_", ")_", "\\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_", "Resolv", "e", "Time", "out", "Test", "Case_", "(_", "Async", "HTTP", "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_", "Resolv", "e", "Time", "out", "Test", "Case_", "(_", "Async", "HTTP", "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_", "#", " ", "Du", "mm", "y", " ", "Resolv", "er", " ", "subclass", " ", "tha", "t", " ", "neve", "r", " ", "invoke", "s", " ", "its", " ", "callback", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Ba", "d", "Resolver_", "(_", "Resolver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "resolve_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", "Resolv", "e", "Time", "out", "Test", "Case_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "http", "\\u", "client_", "=_", "Simple", "Async", "HTTP", "Client_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "io", "\\u", "loop_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "resolver_", "=_", "Ba", "d", "Resolver_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Resolv", "e", "Time", "out", "Test", "Case_", "(_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "app_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Application_", "(_", "[_", "url_", "(_", "\"/", "hell", "o", "\"_", ",_", "Hell", "o", "Wor", "ld", "Handler_", ")_", ",_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Resolv", "e", "Time", "out", "Test", "Case_", "(_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "resolve", "\\u", "timeout_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "'/", "hell", "o", "'_", ",_", "connect", "\\u", "timeout_", "=_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "code_", ",_", "599", "_", ")_", "\\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_", "Max", "Head", "er", "Size", "Test_", "(_", "Async", "HTTP", "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_", "[SEP]_", "class_", "Max", "Head", "er", "Size", "Test_", "(_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "app_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Small", "Headers_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "header_", "(_", "\"", "X", "-", "Fille", "r", "\"_", ",_", "\"", "a", "\"_", "*_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "write_", "(_", "\"", "ok", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Large", "Headers_", "(_", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "header_", "(_", "\"", "X", "-", "Fille", "r", "\"_", ",_", "\"", "a", "\"_", "*_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "write_", "(_", "\"", "ok", "\"_", ")_", "\\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_", "Application_", "(_", "[_", "(_", "'/", "small", "'_", ",_", "Small", "Headers_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'/", "large", "'_", ",_", "Large", "Headers_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Max", "Head", "er", "Size", "Test_", "(_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "http", "\\u", "client_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Simple", "Async", "HTTP", "Client_", "(_", "io", "\\u", "loop_", "=_", "self_", "._", "io", "\\u", "loop_", ",_", "max", "\\u", "header", "\\u", "size_", "=_", "1024_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Max", "Head", "er", "Size", "Test_", "(_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "small", "\\u", "headers_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "'/", "small", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "._", "ret", "hro", "w_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "body_", ",_", "b", "'", "ok", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Max", "Head", "er", "Size", "Test_", "(_", "Async", "HTTP", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "large", "\\u", "headers_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "Expect", "Log_", "(_", "gen", "\\u", "log_", ",_", "\"", "Uns", "ati", "sfi", "able", " ", "read", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "fetch_", "(_", "'/", "large", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "code_", ",_", "599", "_", ")_" ]
[ 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
girishramnani/hacking-tools/file_hasher/_pfish.py
[ { "content": "__author__ = 'girish'\n\nimport argparse\nimport os\nimport _pfish_tools\nimport logging\nimport time\nimport sys\n\nlogging.basicConfig(filemode=\"ghasher.log\",level=logging.DEBUG,format=\"%(asctime)s %(message)s \")\nlogging.info(\"Welcome to ghasher ver 1 New scan started\")\nlogging.info(\"Welcome to ghasher ver 1.0\")\nlogging.info(\"System: \"+sys.platform)\nlogging.info(\"version: \"+sys.version)\n_pfish_tools.parse_command_line()\nstart_time = time.time()\n\n\nfileprocessed = _pfish_tools.Walk_path()\n\n#Record the end time and calculate the duration\nendTime = time.time()\nduration = endTime-start_time\nlogging.info(\"files Processed\"+str(fileprocessed))\nlogging.info(\"Elapsed time: \"+str(duration)+\" seconds\")\nlogging.info(\"Program End\")\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import argparse", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 15 }, { "span": "import os", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u", "author\\u\\u_", "=_", "'", "gir", "ish", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "\\u", "pfi", "sh", "\\u", "tools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "basic", "Config_", "(_", "filem", "ode_", "=_", "\"", "gha", "sher", ".", "log", "\"_", ",_", "level_", "=_", "logging_", "._", "DEBUG_", ",_", "format_", "=_", "\"%", "(", "asc", "time", ")", "s", " ", "%", "(", "message", ")", "s", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "Wel", "come", " ", "to", " ", "gha", "sher", " ", "ver", " ", "1", " ", "New", " ", "scan", " ", "start", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "Wel", "come", " ", "to", " ", "gha", "sher", " ", "ver", " ", "1.0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "System", ":", " ", "\"_", "+_", "sys_", "._", "platform_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "version", ":", " ", "\"_", "+_", "sys_", "._", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "pfi", "sh", "\\u", "tools_", "._", "parse", "\\u", "command", "\\u", "line_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "time_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filep", "rocess", "ed_", "=_", "\\u", "pfi", "sh", "\\u", "tools_", "._", "Walk", "\\u", "path_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Record", " ", "the", " ", "end", " ", "time", " ", "and", " ", "calcul", "ate", " ", "the", " ", "duration_", "\\u\\u\\uNL\\u\\u\\u_", "end", "Time_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "duration_", "=_", "end", "Time_", "-_", "start", "\\u", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "files", " ", "Processe", "d", "\"_", "+_", "str_", "(_", "filep", "rocess", "ed_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "El", "aps", "ed", " ", "time", ":", " ", "\"_", "+_", "str_", "(_", "duration_", ")_", "+_", "\"", " ", "second", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "Program", " ", "End", "\"_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
marcusmoller/pyorpg-server/src/database.py
[ { "content": "def saveAccount(name, password):\n query = database.sendQuery(\"INSERT INTO accounts (username, password) VALUES ('%s', '%s');\" % (name, password))\n database.saveChanges()", "metadata": "root.saveAccount", "header": "['module', '___EOS___']", "index": 239 }, { "content": "def savePlayer(index):\n # check if character/player already exists\n query = database.sendQuery(\"SELECT * FROM characters WHERE name='%s';\" % getPlayerName(index))\n rows = query.fetchone()\n\n if rows == None:\n # character/player doesnt exist, create it\n\n # get account id\n query = database.sendQuery(\"SELECT id FROM accounts WHERE username='%s';\" % getPlayerLogin(index))\n result = query.fetchone()\n accountID = result['id']\n\n # save character\n query = database.sendQuery(\"INSERT INTO characters (account_id, name, class, sprite, level, exp, access, map, x, y, direction, helmet, armor, weapon, shield, stats_strength, stats_defense, stats_speed, stats_magic, vital_hp, vital_mp, vital_sp) \\\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);\", \\\n (accountID, \\\n getPlayerName(index), \\\n getPlayerClass(index), \\\n getPlayerSprite(index), \\\n getPlayerLevel(index), \\\n getPlayerExp(index), \\\n getPlayerAccess(index), \\\n getPlayerMap(index), \\\n getPlayerX(index), \\\n getPlayerY(index), \\\n getPlayerDir(index), \\\n getPlayerEquipmentSlot(index, Equipment.helmet), \\\n getPlayerEquipmentSlot(index, Equipment.armor), \\\n getPlayerEquipmentSlot(index, Equipment.weapon), \\\n getPlayerEquipmentSlot(index, Equipment.shield), \\\n getPlayerStat(index, Stats.strength), \\\n getPlayerStat(index, Stats.defense), \\\n getPlayerStat(index, Stats.speed), \\\n getPlayerStat(index, Stats.magic), \\\n getPlayerVital(index, Vitals.hp), \\\n getPlayerVital(index, Vitals.mp), \\\n getPlayerVital(index, Vitals.sp)))\n\n elif len(rows) > 0:\n # character/player exists, so update the character\n charId = rows['id']\n\n query = database.sendQuery(\"\"\"UPDATE characters SET sprite=?,\n level=?,\n exp=?,\n map=?,\n x=?,\n y=?,\n access=?,\n direction=?,\n helmet=?, armor=?, weapon=?, shield=?,\n stats_strength=?, stats_defense=?, stats_speed=?, stats_magic=?,\n vital_hp=?, vital_mp=?, vital_sp=?\n WHERE name=?;\"\"\", (getPlayerSprite(index), \\\n getPlayerLevel(index), \\\n getPlayerExp(index), \\\n getPlayerMap(index), \\\n getPlayerX(index), \\\n getPlayerY(index), \\\n getPlayerAccess(index), \\\n getPlayerDir(index), \\\n getPlayerEquipmentSlot(index, Equipment.helmet), \\\n getPlayerEquipmentSlot(index, Equipment.armor), \\\n getPlayerEquipmentSlot(index, Equipment.weapon), \\\n getPlayerEquipmentSlot(index, Equipment.shield), \\\n getPlayerStat(index, Stats.strength), \\\n getPlayerStat(index, Stats.defense), \\\n getPlayerStat(index, Stats.speed), \\\n getPlayerStat(index, Stats.magic), \\\n getPlayerVital(index, Vitals.hp), \\\n getPlayerVital(index, Vitals.mp), \\\n getPlayerVital(index, Vitals.sp), \\\n getPlayerName(index)))\n\n # save inventory\n for i in range(MAX_INV):\n if getPlayerInvItemNum(index, i) != None:\n # add item to inventory if its not already there\n itemNum = getPlayerInvItemNum(index, i)\n\n # check if its already there\n invQuery = database.sendQuery(\"SELECT * FROM inventory WHERE (character_id=%i AND item_id=%i);\" % (charId, (itemNum+1)))\n invRows = query.fetchone()\n\n if invRows == None:\n # doesnt exist so add item\n invQuery = database.sendQuery('INSERT INTO inventory (character_id, item_id, value, durability) \\\n VALUES (%i, %i, %i, %i);' \\\n % (charId, \\\n (getPlayerInvItemNum(index, i)+1),\n getPlayerInvItemValue(index, i),\n getPlayerInvItemDur(index, i)))\n\n elif len(invRows) > 0:\n # item has already been added, update value and durability\n # get id\n rowId = invRows['id']\n invQuery = database.sendQuery('UPDATE inventory SET value=%i, durability=%i WHERE id=%i;' % (getPlayerInvItemValue(index, i), getPlayerInvItemDur(index, i), rowId))\n\n for i in range(MAX_PLAYER_SPELLS):\n if getPlayerSpell(index, i) is not None:\n spellNum = getPlayerSpell(index, i)\n\n # check if its already there\n spbQuery = database.sendQuery(\"SELECT * FROM spellbook WHERE (character_id=%i AND spellnum=%i);\" % (charId, (spellNum+1)))\n spbRows = query.fetchone()\n\n if spbRows is None:\n # doesnt exist, so add the spell\n spbQuery = database.sendQuery('INSERT INTO spellbook (character_id, spellnum) \\\n VALUES (?, ?);', \\\n (charId, \\\n spellNum+1))\n\n elif len(spbRows) > 0:\n # item is already there, so do nothing\n continue\n\n database.saveChanges()", "metadata": "root.savePlayer", "header": "['module', '___EOS___']", "index": 243 }, { "content": "def createClasses():\n # not necassary?\n maxClasses = 2", "metadata": "root.createClasses", "header": "['module', '___EOS___']", "index": 453 }, { "content": "def saveItem(itemNum):\n # todo: rework the id part\n\n # check if item already exists\n query = database.sendQuery(\"SELECT * FROM items WHERE id=%i;\" % (itemNum+1))\n rows = query.fetchone()\n\n if rows == None:\n # item doesnt exist, create it\n query = database.sendQuery(\"INSERT INTO items (id, name, pic, type, data1, data2, data3) \\\n VALUES (%i, '%s', %i, %i, %i, %i, %i);\" \\\n % (int(itemNum+1), \\\n Item[itemNum].name, \\\n Item[itemNum].pic, \\\n Item[itemNum].type, \\\n Item[itemNum].data1, \\\n Item[itemNum].data2, \\\n Item[itemNum].data3))\n\n elif len(rows) > 0:\n # item already exists, so update the item\n query = database.sendQuery(\"UPDATE items SET name='%s', \\\n pic=%i, \\\n type=%i, \\\n data1=%i, \\\n data2=%i, \\\n data3=%i \\\n WHERE id=%i;\" % (Item[itemNum].name, \\\n Item[itemNum].pic, \\\n Item[itemNum].type, \\\n Item[itemNum].data1, \\\n Item[itemNum].data2, \\\n Item[itemNum].data3, \\\n int(itemNum+1)))\n\n database.saveChanges()", "metadata": "root.saveItem", "header": "['module', '___EOS___']", "index": 504 }, { "content": "def saveSpell(spellNum):\n # todo: rework the id part\n\n # check if spell already exists\n query = database.sendQuery(\"SELECT * FROM spells WHERE id=%i;\" % (spellNum+1))\n rows = query.fetchone()\n\n if rows == None:\n # spell doesnt exist, create it\n query = database.sendQuery(\"INSERT INTO spells (id, name, pic, type, reqmp, reqclass, reqlevel, data1, data2, data3) \\\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);\", \\\n (int(spellNum+1), \\\n Spell[spellNum].name, \\\n Spell[spellNum].pic, \\\n Spell[spellNum].type, \\\n Spell[spellNum].reqMp, \\\n Spell[spellNum].reqClass, \\\n Spell[spellNum].reqLevel, \\\n Spell[spellNum].data1, \\\n Spell[spellNum].data2, \\\n Spell[spellNum].data3))\n\n elif len(rows) > 0:\n # spell already exists, so update the spell\n query = database.sendQuery(\"UPDATE spells SET name=?, \\\n pic=?, \\\n type=?, \\\n reqmp=?, \\\n reqclass=?, \\\n reqlevel=?, \\\n data1=?, \\\n data2=?, \\\n data3=? \\\n WHERE id=?;\", (Spell[spellNum].name, \\\n Spell[spellNum].pic, \\\n Spell[spellNum].type, \\\n Spell[spellNum].reqMp, \\\n Spell[spellNum].reqClass, \\\n Spell[spellNum].reqLevel, \\\n Spell[spellNum].data1, \\\n Spell[spellNum].data2, \\\n Spell[spellNum].data3, \\\n int(spellNum+1)))\n\n database.saveChanges()", "metadata": "root.saveSpell", "header": "['module', '___EOS___']", "index": 565 }, { "content": "def saveNpc(npcNum):\n # todo: rework the id part\n\n # check if npc already exists\n query = database.sendQuery(\"SELECT * FROM npcs WHERE id=%i;\" % (npcNum+1))\n rows = query.fetchone()\n\n if rows == None:\n # npc doesnt exist, create it\n query = database.sendQuery(\"INSERT INTO npcs (id, name, sprite, attack_say, spawn_secs, behavior, range, drop_chance, drop_item, drop_item_value, stat_strength, stat_defense, stat_magic, stat_speed) \\\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);\", \\\n (int(npcNum+1), \\\n NPC[npcNum].name, \\\n NPC[npcNum].sprite, \\\n NPC[npcNum].attackSay, \\\n NPC[npcNum].spawnSecs, \\\n NPC[npcNum].behaviour, \\\n NPC[npcNum].range, \\\n NPC[npcNum].dropChance, \\\n NPC[npcNum].dropItem, \\\n NPC[npcNum].dropItemValue, \\\n NPC[npcNum].stat[Stats.strength], \\\n NPC[npcNum].stat[Stats.defense], \\\n NPC[npcNum].stat[Stats.magic], \\\n NPC[npcNum].stat[Stats.speed]))\n\n elif len(rows) > 0:\n # npc already exists, so update the npc\n query = database.sendQuery(\"UPDATE npcs SET name=?, \\\n sprite=?, \\\n attack_say=?, \\\n spawn_secs=?, \\\n behavior=?, \\\n range=?, \\\n drop_chance=?, \\\n drop_item=?, \\\n drop_item_value=?, \\\n stat_strength=?, \\\n stat_defense=?, \\\n stat_magic=?, \\\n stat_speed=? \\\n WHERE id=?;\", (NPC[npcNum].name, \\\n NPC[npcNum].sprite, \\\n NPC[npcNum].attackSay, \\\n NPC[npcNum].spawnSecs, \\\n NPC[npcNum].behaviour, \\\n NPC[npcNum].range, \\\n NPC[npcNum].dropChance, \\\n NPC[npcNum].dropItem, \\\n NPC[npcNum].dropItemValue, \\\n NPC[npcNum].stat[Stats.strength], \\\n NPC[npcNum].stat[Stats.defense], \\\n NPC[npcNum].stat[Stats.magic], \\\n NPC[npcNum].stat[Stats.speed], \\\n int(npcNum+1)))\n\n database.saveChanges()", "metadata": "root.saveNpc", "header": "['module', '___EOS___']", "index": 646 } ]
[ { "span": "query ", "start_line": 240, "start_column": 4, "end_line": 240, "end_column": 9 }, { "span": "query ", "start_line": 257, "start_column": 8, "end_line": 257, "end_column": 13 }, { "span": "maxClasses ", "start_line": 455, "start_column": 4, "end_line": 455, "end_column": 14 }, { "span": "query ", "start_line": 513, "start_column": 8, "end_line": 513, "end_column": 13 }, { "span": "query ", "start_line": 525, "start_column": 8, "end_line": 525, "end_column": 13 }, { "span": "query ", "start_line": 574, "start_column": 8, "end_line": 574, "end_column": 13 }, { "span": "query ", "start_line": 589, "start_column": 8, "end_line": 589, "end_column": 13 }, { "span": "query ", "start_line": 655, "start_column": 8, "end_line": 655, "end_column": 13 }, { "span": "query ", "start_line": 674, "start_column": 8, "end_line": 674, "end_column": 13 } ]
[]
1
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_", "def_", "save", "Account_", "(_", "name_", ",_", "password_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "INSERT", " ", "INT", "O", " ", "account", "s", " ", "(", "user", "name", ",", " ", "password", ")", " ", "VALU", "ES", " ", "('", "%", "s", "',", " ", "'%", "s", "');", "\"_", "%_", "(_", "name_", ",_", "password_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "._", "save", "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_", "save", "Player_", "(_", "index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "character", "/", "player", " ", "alr", "ead", "y", " ", "exists_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "SELECT", " ", "*", " ", "FROM", " ", "character", "s", " ", "WHE", "RE", " ", "name", "='", "%", "s", "';", "\"_", "%_", "get", "Player", "Name_", "(_", "index_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows_", "=_", "query_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "rows_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "character", "/", "player", " ", "doesnt", " ", "exist", ",", " ", "create", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "account", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "SELECT", " ", "id", " ", "FROM", " ", "account", "s", " ", "WHE", "RE", " ", "user", "name", "='", "%", "s", "';", "\"_", "%_", "get", "Player", "Login_", "(_", "index_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "query_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "account", "ID_", "=_", "result_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "save", " ", "character_", "\\u\\u\\uNL\\u\\u\\u_", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "INSERT", " ", "INT", "O", " ", "character", "s", " ", "(", "account", "\\u", "id", ",", " ", "name", ",", " ", "class", ",", " ", "spri", "te", ",", " ", "level", ",", " ", "exp", ",", " ", "access", ",", " ", "map", ",", " ", "x", ",", " ", "y", ",", " ", "direction", ",", " ", "helm", "et", ",", " ", "armo", "r", ",", " ", "weapon", ",", " ", "shield", ",", " ", "stats", "\\u", "streng", "th", ",", " ", "stats", "\\u", "defense", ",", " ", "stats", "\\u", "speed", ",", " ", "stats", "\\u", "magic", ",", " ", "vita", "l\\u", "hp", ",", " ", "vita", "l\\u", "mp", ",", " ", "vita", "l\\u", "sp", ")", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", " ", "VALU", "ES", " ", "(?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?)", ";\"_", ",_", "(_", "account", "ID_", ",_", "get", "Player", "Name_", "(_", "index_", ")_", ",_", "get", "Player", "Class_", "(_", "index_", ")_", ",_", "get", "Player", "Sprite_", "(_", "index_", ")_", ",_", "get", "Player", "Level_", "(_", "index_", ")_", ",_", "get", "Player", "Exp_", "(_", "index_", ")_", ",_", "get", "Player", "Access_", "(_", "index_", ")_", ",_", "get", "Player", "Map_", "(_", "index_", ")_", ",_", "get", "Player", "X_", "(_", "index_", ")_", ",_", "get", "Player", "Y_", "(_", "index_", ")_", ",_", "get", "Player", "Dir_", "(_", "index_", ")_", ",_", "get", "Player", "Equip", "ment", "Slot_", "(_", "index_", ",_", "Equip", "ment_", "._", "helm", "et_", ")_", ",_", "get", "Player", "Equip", "ment", "Slot_", "(_", "index_", ",_", "Equip", "ment_", "._", "armor_", ")_", ",_", "get", "Player", "Equip", "ment", "Slot_", "(_", "index_", ",_", "Equip", "ment_", "._", "weapon_", ")_", ",_", "get", "Player", "Equip", "ment", "Slot_", "(_", "index_", ",_", "Equip", "ment_", "._", "shield", "_", ")_", ",_", "get", "Player", "Stat_", "(_", "index_", ",_", "Stats_", "._", "strength_", ")_", ",_", "get", "Player", "Stat_", "(_", "index_", ",_", "Stats_", "._", "defense", "_", ")_", ",_", "get", "Player", "Stat_", "(_", "index_", ",_", "Stats_", "._", "speed_", ")_", ",_", "get", "Player", "Stat_", "(_", "index_", ",_", "Stats_", "._", "magic_", ")_", ",_", "get", "Player", "Vit", "al_", "(_", "index_", ",_", "Vit", "als_", "._", "hp_", ")_", ",_", "get", "Player", "Vit", "al_", "(_", "index_", ",_", "Vit", "als_", "._", "mp_", ")_", ",_", "get", "Player", "Vit", "al_", "(_", "index_", ",_", "Vit", "als_", "._", "sp_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "rows_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "character", "/", "player", " ", "exist", "s", ",", " ", "so", " ", "update", " ", "the", " ", "character_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "char", "Id_", "=_", "rows_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"\"\"", "UPDATE", " ", "character", "s", " ", "SET", " ", "spri", "te", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "level", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "exp", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "map", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "x", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "y", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "access", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "direction", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "helm", "et", "=?", ",", " ", "armo", "r", "=?", ",", " ", "weapon", "=?", ",", " ", "shield", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "stats", "\\u", "streng", "th", "=?", ",", " ", "stats", "\\u", "defense", "=?", ",", " ", "stats", "\\u", "speed", "=?", ",", " ", "stats", "\\u", "magic", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "vita", "l\\u", "hp", "=?", ",", " ", "vita", "l\\u", "mp", "=?", ",", " ", "vita", "l\\u", "sp", "=?", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "name", "=?", ";\"\"\"_", ",_", "(_", "get", "Player", "Sprite_", "(_", "index_", ")_", ",_", "get", "Player", "Level_", "(_", "index_", ")_", ",_", "get", "Player", "Exp_", "(_", "index_", ")_", ",_", "get", "Player", "Map_", "(_", "index_", ")_", ",_", "get", "Player", "X_", "(_", "index_", ")_", ",_", "get", "Player", "Y_", "(_", "index_", ")_", ",_", "get", "Player", "Access_", "(_", "index_", ")_", ",_", "get", "Player", "Dir_", "(_", "index_", ")_", ",_", "get", "Player", "Equip", "ment", "Slot_", "(_", "index_", ",_", "Equip", "ment_", "._", "helm", "et_", ")_", ",_", "get", "Player", "Equip", "ment", "Slot_", "(_", "index_", ",_", "Equip", "ment_", "._", "armor_", ")_", ",_", "get", "Player", "Equip", "ment", "Slot_", "(_", "index_", ",_", "Equip", "ment_", "._", "weapon_", ")_", ",_", "get", "Player", "Equip", "ment", "Slot_", "(_", "index_", ",_", "Equip", "ment_", "._", "shield", "_", ")_", ",_", "get", "Player", "Stat_", "(_", "index_", ",_", "Stats_", "._", "strength_", ")_", ",_", "get", "Player", "Stat_", "(_", "index_", ",_", "Stats_", "._", "defense", "_", ")_", ",_", "get", "Player", "Stat_", "(_", "index_", ",_", "Stats_", "._", "speed_", ")_", ",_", "get", "Player", "Stat_", "(_", "index_", ",_", "Stats_", "._", "magic_", ")_", ",_", "get", "Player", "Vit", "al_", "(_", "index_", ",_", "Vit", "als_", "._", "hp_", ")_", ",_", "get", "Player", "Vit", "al_", "(_", "index_", ",_", "Vit", "als_", "._", "mp_", ")_", ",_", "get", "Player", "Vit", "al_", "(_", "index_", ",_", "Vit", "als_", "._", "sp_", ")_", ",_", "get", "Player", "Name_", "(_", "index_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "save", " ", "inventory_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "MAX", "\\u", "INV", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "get", "Player", "Inv", "Item", "Num_", "(_", "index_", ",_", "i_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "item", " ", "to", " ", "inventor", "y", " ", "if", " ", "its", " ", "not", " ", "alr", "ead", "y", " ", "there", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item", "Num_", "=_", "get", "Player", "Inv", "Item", "Num_", "(_", "index_", ",_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "its", " ", "alr", "ead", "y", " ", "there", "_", "\\u\\u\\uNL\\u\\u\\u_", "inv", "Query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "SELECT", " ", "*", " ", "FROM", " ", "inventor", "y", " ", "WHE", "RE", " ", "(", "character", "\\u", "id", "=", "%", "i", " ", "AND", " ", "item", "\\u", "id", "=", "%", "i", ");\"_", "%_", "(_", "char", "Id_", ",_", "(_", "item", "Num_", "+_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inv", "Rows_", "=_", "query_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "inv", "Rows_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "doesnt", " ", "exist", " ", "so", " ", "add", " ", "item_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "inv", "Query_", "=_", "database_", "._", "send", "Query_", "(_", "'", "INSERT", " ", "INT", "O", " ", "inventor", "y", " ", "(", "character", "\\u", "id", ",", " ", "item", "\\u", "id", ",", " ", "value", ",", " ", "durab", "ilit", "y", ")", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", " ", "VALU", "ES", " ", "(%", "i", ",", " ", "%", "i", ",", " ", "%", "i", ",", " ", "%", "i", ");'_", "%_", "(_", "char", "Id_", ",_", "(_", "get", "Player", "Inv", "Item", "Num_", "(_", "index_", ",_", "i_", ")_", "+_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "get", "Player", "Inv", "Item", "Value_", "(_", "index_", ",_", "i_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "get", "Player", "Inv", "Item", "Dur", "_", "(_", "index_", ",_", "i_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "inv", "Rows_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "item", " ", "has", " ", "alr", "ead", "y", " ", "bee", "n", " ", "adde", "d", ",", " ", "update", " ", "value", " ", "and", " ", "durab", "ility_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "row", "Id_", "=_", "inv", "Rows_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inv", "Query_", "=_", "database_", "._", "send", "Query_", "(_", "'", "UPDATE", " ", "inventor", "y", " ", "SET", " ", "value", "=", "%", "i", ",", " ", "durab", "ilit", "y", "=", "%", "i", " ", "WHE", "RE", " ", "id", "=", "%", "i", ";'_", "%_", "(_", "get", "Player", "Inv", "Item", "Value_", "(_", "index_", ",_", "i_", ")_", ",_", "get", "Player", "Inv", "Item", "Dur", "_", "(_", "index_", ",_", "i_", ")_", ",_", "row", "Id_", ")_", ")_", "\\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_", "for_", "i_", "in_", "range_", "(_", "MAX", "\\u", "PLAYER", "\\u", "SPE", "LL", "S_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "get", "Player", "Spell", "_", "(_", "index_", ",_", "i_", ")_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spell", "Num_", "=_", "get", "Player", "Spell", "_", "(_", "index_", ",_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "its", " ", "alr", "ead", "y", " ", "there", "_", "\\u\\u\\uNL\\u\\u\\u_", "sp", "b", "Query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "SELECT", " ", "*", " ", "FROM", " ", "spell", "book", " ", "WHE", "RE", " ", "(", "character", "\\u", "id", "=", "%", "i", " ", "AND", " ", "spell", "num", "=", "%", "i", ");\"_", "%_", "(_", "char", "Id_", ",_", "(_", "spell", "Num_", "+_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sp", "b", "Rows_", "=_", "query_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sp", "b", "Rows_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "doesnt", " ", "exist", ",", " ", "so", " ", "add", " ", "the", " ", "spell_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sp", "b", "Query_", "=_", "database_", "._", "send", "Query_", "(_", "'", "INSERT", " ", "INT", "O", " ", "spell", "book", " ", "(", "character", "\\u", "id", ",", " ", "spell", "num", ")", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", " ", "VALU", "ES", " ", "(?", ",", " ", "?)", ";'_", ",_", "(_", "char", "Id_", ",_", "spell", "Num_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "sp", "b", "Rows_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "item", " ", "is", " ", "alr", "ead", "y", " ", "there", ",", " ", "so", " ", "do", " ", "nothing_", "\\u\\u\\uNL\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "database_", "._", "save", "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_", "create", "Classes_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "not", " ", "nec", "ass", "ary", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "max", "Classes_", "=_", "2_", "\\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_", "save", "Item_", "(_", "item", "Num_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "todo", ":", " ", "rew", "ork", " ", "the", " ", "id", " ", "part_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "item", " ", "alr", "ead", "y", " ", "exists_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "SELECT", " ", "*", " ", "FROM", " ", "items", " ", "WHE", "RE", " ", "id", "=", "%", "i", ";\"_", "%_", "(_", "item", "Num_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows_", "=_", "query_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "rows_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "item", " ", "doesnt", " ", "exist", ",", " ", "create", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "INSERT", " ", "INT", "O", " ", "items", " ", "(", "id", ",", " ", "name", ",", " ", "pic", ",", " ", "type", ",", " ", "data", "1", ",", " ", "data", "2", ",", " ", "data", "3", ")", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", " ", "VALU", "ES", " ", "(%", "i", ",", " ", "'%", "s", "',", " ", "%", "i", ",", " ", "%", "i", ",", " ", "%", "i", ",", " ", "%", "i", ",", " ", "%", "i", ");\"_", "%_", "(_", "int_", "(_", "item", "Num_", "+_", "1_", ")_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "name_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "pic_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "type_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "data1_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "data2_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "data", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "rows_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "item", " ", "alr", "ead", "y", " ", "exist", "s", ",", " ", "so", " ", "update", " ", "the", " ", "item_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "UPDATE", " ", "items", " ", "SET", " ", "name", "='", "%", "s", "',", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "pic", "=", "%", "i", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "type", "=", "%", "i", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "data", "1", "=", "%", "i", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "data", "2", "=", "%", "i", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "data", "3", "=", "%", "i", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "id", "=", "%", "i", ";\"_", "%_", "(_", "Item_", "[_", "item", "Num_", "]_", "._", "name_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "pic_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "type_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "data1_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "data2_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "data", "3_", ",_", "int_", "(_", "item", "Num_", "+_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "database_", "._", "save", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "Spell", "_", "(_", "spell", "Num_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "todo", ":", " ", "rew", "ork", " ", "the", " ", "id", " ", "part_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "spell", " ", "alr", "ead", "y", " ", "exists_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "SELECT", " ", "*", " ", "FROM", " ", "spell", "s", " ", "WHE", "RE", " ", "id", "=", "%", "i", ";\"_", "%_", "(_", "spell", "Num_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows_", "=_", "query_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "rows_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "spell", " ", "doesnt", " ", "exist", ",", " ", "create", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "INSERT", " ", "INT", "O", " ", "spell", "s", " ", "(", "id", ",", " ", "name", ",", " ", "pic", ",", " ", "type", ",", " ", "req", "mp", ",", " ", "req", "class", ",", " ", "req", "level", ",", " ", "data", "1", ",", " ", "data", "2", ",", " ", "data", "3", ")", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", " ", "VALU", "ES", " ", "(?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?)", ";\"_", ",_", "(_", "int_", "(_", "spell", "Num_", "+_", "1_", ")_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "name_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "pic_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "type_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "req", "Mp", "_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "req", "Class_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "req", "Level_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "data1_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "data2_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "data", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "rows_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "spell", " ", "alr", "ead", "y", " ", "exist", "s", ",", " ", "so", " ", "update", " ", "the", " ", "spell_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "UPDATE", " ", "spell", "s", " ", "SET", " ", "name", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "pic", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "type", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "req", "mp", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "req", "class", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "req", "level", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "data", "1", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "data", "2", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "data", "3", "=?", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "id", "=?", ";\"_", ",_", "(_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "name_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "pic_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "type_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "req", "Mp", "_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "req", "Class_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "req", "Level_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "data1_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "data2_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "data", "3_", ",_", "int_", "(_", "spell", "Num_", "+_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "database_", "._", "save", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "Np", "c_", "(_", "npc", "Num_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "todo", ":", " ", "rew", "ork", " ", "the", " ", "id", " ", "part_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "npc", " ", "alr", "ead", "y", " ", "exists_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "SELECT", " ", "*", " ", "FROM", " ", "npc", "s", " ", "WHE", "RE", " ", "id", "=", "%", "i", ";\"_", "%_", "(_", "npc", "Num_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows_", "=_", "query_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "rows_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "npc", " ", "doesnt", " ", "exist", ",", " ", "create", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "INSERT", " ", "INT", "O", " ", "npc", "s", " ", "(", "id", ",", " ", "name", ",", " ", "spri", "te", ",", " ", "attac", "k", "\\u", "say", ",", " ", "spawn", "\\u", "secs", ",", " ", "behavior", ",", " ", "range", ",", " ", "drop", "\\u", "chan", "ce", ",", " ", "drop", "\\u", "item", ",", " ", "drop", "\\u", "item", "\\u", "value", ",", " ", "stat", "\\u", "streng", "th", ",", " ", "stat", "\\u", "defense", ",", " ", "stat", "\\u", "magic", ",", " ", "stat", "\\u", "speed", ")", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", " ", "VALU", "ES", " ", "(?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?)", ";\"_", ",_", "(_", "int_", "(_", "npc", "Num_", "+_", "1_", ")_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "name_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "sprite_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "attac", "k", "Say", "_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "spawn", "Secs_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "behaviour", "_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "range_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "drop", "Chan", "ce_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "drop", "Item_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "drop", "Item", "Value_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "stat_", "[_", "Stats_", "._", "strength_", "]_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "stat_", "[_", "Stats_", "._", "defense", "_", "]_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "stat_", "[_", "Stats_", "._", "magic_", "]_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "stat_", "[_", "Stats_", "._", "speed_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "rows_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "npc", " ", "alr", "ead", "y", " ", "exist", "s", ",", " ", "so", " ", "update", " ", "the", " ", "npc_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "UPDATE", " ", "npc", "s", " ", "SET", " ", "name", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "spri", "te", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "attac", "k", "\\u", "say", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "spawn", "\\u", "secs", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "behavior", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "range", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "drop", "\\u", "chan", "ce", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "drop", "\\u", "item", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "drop", "\\u", "item", "\\u", "value", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "stat", "\\u", "streng", "th", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "stat", "\\u", "defense", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "stat", "\\u", "magic", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "stat", "\\u", "speed", "=?", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "id", "=?", ";\"_", ",_", "(_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "name_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "sprite_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "attac", "k", "Say", "_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "spawn", "Secs_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "behaviour", "_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "range_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "drop", "Chan", "ce_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "drop", "Item_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "drop", "Item", "Value_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "stat_", "[_", "Stats_", "._", "strength_", "]_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "stat_", "[_", "Stats_", "._", "defense", "_", "]_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "stat_", "[_", "Stats_", "._", "magic_", "]_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "stat_", "[_", "Stats_", "._", "speed_", "]_", ",_", "int_", "(_", "npc", "Num_", "+_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "database_", "._", "save", "Changes_", "(_", ")_", "\\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, 0, 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 ]
Unused import
ericholscher/pony_barn/pony_barn/build-kong.py
[ { "content": "import sys\nfrom base_django import DjangoGitBuild\nfrom pony_barn import client as pony\n\n\nif __name__ == '__main__':\n build = PonyBuild()\n sys.exit(build.execute(sys.argv))\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class PonyBuild(DjangoGitBuild):\n", "metadata": "root.PonyBuild", "header": "['module', '___EOS___']", "index": 4 }, { "content": " def __init__(self):\n super(PonyBuild, self).__init__()\n self.repo_url = \"git://github.com/ericholscher/django-kong\"\n self.name = \"django-kong\"\n self.package_name = 'kong'\n self.required = ['django', 'twill', 'mimeparse']\n self.installed_apps = ['kong']", "metadata": "root.PonyBuild.__init__", "header": "['class', 'PonyBuild', '(', 'DjangoGitBuild', ')', ':', '___EOS___']", "index": 6 } ]
[ { "span": "from pony_barn import client as pony", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 36 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "base", "\\u", "django_", "import_", "Dj", "ang", "o", "Git", "Build_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pon", "y", "\\u", "bar", "n_", "import_", "client_", "as_", "pon", "y_", "\\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_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build_", "=_", "Pon", "y", "Build_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "build_", "._", "execute_", "(_", "sys_", "._", "argv_", ")_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Pon", "y", "Build_", "(_", "Dj", "ang", "o", "Git", "Build_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Pon", "y", "Build_", "(_", "Dj", "ang", "o", "Git", "Build_", ")_", ":_", "\\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_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Pon", "y", "Build_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "repo", "\\u", "url_", "=_", "\"", "git", "://", "git", "hub", ".", "com", "/", "eric", "hol", "sche", "r", "/", "django", "-", "kon", "g", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "=_", "\"", "django", "-", "kon", "g", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "package", "\\u", "name_", "=_", "'", "kon", "g", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "required_", "=_", "[_", "'", "django", "'_", ",_", "'", "twi", "ll", "'_", ",_", "'", "mime", "parse", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "install", "ed", "\\u", "apps_", "=_", "[_", "'", "kon", "g", "'_", "]_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
Unnecessary 'else' clause in loop
goFrendiAsgard/kokoropy/kokoropy/packages/sqlalchemy/ext/horizontal_shard.py
[ { "content": " def get(self, ident, **kwargs):\n if self._shard_id is not None:\n return super(ShardedQuery, self).get(ident)\n else:\n ident = util.to_list(ident)\n for shard_id in self.id_chooser(self, ident):\n o = self.set_shard(shard_id).get(ident, **kwargs)\n if o is not None:\n return o\n else:\n return None", "metadata": "root.ShardedQuery.get", "header": "['class', 'ShardedQuery', '(', 'Query', ')', ':', '___EOS___']", "index": 63 } ]
[ { "span": "for shard_id in self.id_chooser(self, ident):", "start_line": 68, "start_column": 12, "end_line": 68, "end_column": 57 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "'", "else", "'_", "clause_", "in_", "loop_", "[SEP]_", "class_", "Shard", "ed", "Query_", "(_", "Query_", ")_", ":_", "\\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_", "(_", "self_", ",_", "ident_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "shard", "\\u", "id_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "Shard", "ed", "Query_", ",_", "self_", ")_", "._", "get_", "(_", "ident_", ")_", "\\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 ", " _", "ident_", "=_", "util_", "._", "to", "\\u", "list_", "(_", "ident_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "shard", "\\u", "id_", "in_", "self_", "._", "id", "\\u", "chooser_", "(_", "self_", ",_", "ident_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "o_", "=_", "self_", "._", "set\\u", "shard_", "(_", "shard", "\\u", "id_", ")_", "._", "get_", "(_", "ident_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "o_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "o_", "\\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 ", " _", "return_", "None_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
cesium-ml/cesium/cesium/build_model.py
[ { "content": "import os\nimport xarray as xr\nfrom sklearn.ensemble import RandomForestClassifier, RandomForestRegressor\nfrom sklearn.linear_model import LinearRegression, SGDClassifier,\\\n RidgeClassifierCV, ARDRegression, BayesianRidge\nfrom sklearn.externals import joblib\nfrom sklearn import grid_search\n\n\n__all__ = ['MODELS_TYPE_DICT', 'rectangularize_featureset',\n 'fit_model_optimize_hyperparams', 'build_model_from_featureset',\n 'create_and_pickle_model']\n\n\nMODELS_TYPE_DICT = {'RandomForestClassifier': RandomForestClassifier,\n 'RandomForestRegressor': RandomForestRegressor,\n 'LinearSGDClassifier': SGDClassifier,\n 'LinearRegressor': LinearRegression,\n 'RidgeClassifierCV': RidgeClassifierCV,\n 'BayesianARDRegressor': ARDRegression,\n 'BayesianRidgeRegressor': BayesianRidge}\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def rectangularize_featureset(featureset):\n \"\"\"Convert xarray.Dataset into (2d) Pandas.DataFrame for use with sklearn.\"\"\"\n featureset = featureset.drop([coord for coord in ['target', 'class']\n if coord in featureset])\n feature_df = featureset.to_dataframe()\n if 'channel' in featureset:\n feature_df = feature_df.unstack(level='channel')\n if len(featureset.channel) == 1:\n feature_df.columns = [pair[0] for pair in feature_df.columns]\n else:\n feature_df.columns = ['_'.join([str(el) for el in pair])\n for pair in feature_df.columns]\n return feature_df.loc[featureset.name] # preserve original row ordering", "metadata": "root.rectangularize_featureset", "header": "['module', '___EOS___']", "index": 23 }, { "content": "def fit_model_optimize_hyperparams(data, targets, model, params_to_optimize,\n cv=None):\n \"\"\"Optimize estimator hyperparameters.\n\n Perform hyperparamter optimization using\n `sklearn.grid_search.GridSearchCV`.\n\n Parameters\n ----------\n data : Pandas.DataFrame\n Features for training model.\n targets : Pandas.Series\n Targets corresponding to feature vectors in `data`.\n model : sklearn estimator object\n The model/estimator whose hyperparameters are to be optimized.\n params_to_optimize : dict or list of dict\n Dictionary with parameter names as keys and lists of values to try\n as values, or a list of such dictionaries.\n cv : int, cross-validation generator or an iterable, optional\n Number of folds (defaults to 3) or an iterable yielding train/test\n splits. See documentation for `GridSearchCV` for details.\n\n Returns\n -------\n `sklearn.grid_search.GridSearchCV` estimator object\n\n \"\"\"\n optimized_model = grid_search.GridSearchCV(model, params_to_optimize, cv=cv)\n optimized_model.fit(data, targets)\n return optimized_model", "metadata": "root.fit_model_optimize_hyperparams", "header": "['module', '___EOS___']", "index": 38 }, { "content": "def build_model_from_featureset(featureset, model=None, model_type=None,\n model_options={}, params_to_optimize=None,\n cv=None):\n \"\"\"Build model from (non-rectangular) xarray.Dataset of features.\"\"\"\n if model is None:\n if model_type:\n model = MODELS_TYPE_DICT[model_type](**model_options)\n else:\n raise ValueError(\"If model is None, model_type must be specified\")\n feature_df = rectangularize_featureset(featureset)\n if params_to_optimize:\n model = fit_model_optimize_hyperparams(feature_df, featureset['target'],\n model, params_to_optimize, cv)\n else:\n model.fit(feature_df, featureset['target'])\n return model", "metadata": "root.build_model_from_featureset", "header": "['module', '___EOS___']", "index": 70 }, { "content": "def create_and_pickle_model(featureset, model_type, output_path,\n model_options={}, params_to_optimize=None):\n \"\"\"Build a `scikit-learn` model for the given featureset and store in\n serialized joblib format at the specified path.\n\n Parameters\n ----------\n featureset : xarray.Dataset\n Features for training model.\n model_type : str\n Abbreviation of the type of model to be created.\n output_path : str\n Path where output model is saved as in joblib pickle format.\n model_options : dict, optional\n Dictionary specifying `scikit-learn` model parameters to be used.\n params_to_optimize : dict or list of dict, optional\n Dictionary with parameter names as keys and lists of values to try\n as values, or a list of such dictionaries. Defaults to None.\n\n Returns\n -------\n scikit-learn model\n \"\"\"\n model = build_model_from_featureset(featureset, model_type=model_type,\n model_options=model_options,\n params_to_optimize=params_to_optimize)\n joblib.dump(model, output_path, compress=3)\n return model", "metadata": "root.create_and_pickle_model", "header": "['module', '___EOS___']", "index": 88 } ]
[ { "span": "import os", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 9 }, { "span": "import xarray as xr", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 19 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "xarray", "_", "as_", "xr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "ensemble_", "import_", "Random", "Fore", "st", "Classifier_", ",_", "Random", "Fore", "st", "Regressor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "linear", "\\u", "model_", "import_", "Linea", "r", "Regression_", ",_", "SGD", "Classifier_", ",_", "Rid", "ge", "Classif", "ier", "CV_", ",_", "ARD", "Regression_", ",_", "Bayes", "ian", "Rid", "ge_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "externals", "_", "import_", "joblib", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "import_", "grid", "\\u", "search_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "all\\u\\u_", "=_", "[_", "'", "MODEL", "S", "\\u", "TYPE", "\\u", "DICT", "'_", ",_", "'", "rectangular", "ize", "\\u", "features", "et", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fit", "\\u", "model", "\\u", "optimize", "\\u", "hyperparam", "s", "'_", ",_", "'", "build", "\\u", "model", "\\u", "from", "\\u", "features", "et", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "create", "\\u", "and", "\\u", "pickle", "\\u", "model", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "MODEL", "S", "\\u", "TYPE", "\\u", "DICT_", "=_", "{_", "'", "Random", "Fore", "st", "Classif", "ier", "'_", ":_", "Random", "Fore", "st", "Classifier_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Random", "Fore", "st", "Regr", "esso", "r", "'_", ":_", "Random", "Fore", "st", "Regressor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Linea", "r", "SGD", "Classif", "ier", "'_", ":_", "SGD", "Classifier_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Linea", "r", "Regr", "esso", "r", "'_", ":_", "Linea", "r", "Regression_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Rid", "ge", "Classif", "ier", "CV", "'_", ":_", "Rid", "ge", "Classif", "ier", "CV_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Bayes", "ian", "ARD", "Regr", "esso", "r", "'_", ":_", "ARD", "Regression_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Bayes", "ian", "Rid", "ge", "Regr", "esso", "r", "'_", ":_", "Bayes", "ian", "Rid", "ge_", "}_", "\\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_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "rectangular", "ize", "\\u", "features", "et_", "(_", "features", "et_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Convert", " ", "xarray", ".", "Datas", "et", " ", "int", "o", " ", "(", "2d", ")", " ", "Pan", "das", ".", "Data", "Frame", " ", "for", " ", "use", " ", "with", " ", "skl", "earn", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "features", "et_", "=_", "features", "et_", "._", "drop_", "(_", "[_", "coord_", "for_", "coord_", "in_", "[_", "'", "target", "'_", ",_", "'", "class", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "coord_", "in_", "features", "et_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "feature", "\\u", "df_", "=_", "features", "et_", "._", "to", "\\u", "dataframe_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "channel", "'_", "in_", "features", "et_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "feature", "\\u", "df_", "=_", "feature", "\\u", "df_", "._", "unsta", "ck_", "(_", "level_", "=_", "'", "channel", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "features", "et_", "._", "channel_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "feature", "\\u", "df_", "._", "columns_", "=_", "[_", "pair_", "[_", "0_", "]_", "for_", "pair_", "in_", "feature", "\\u", "df_", "._", "columns_", "]_", "\\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 ", " _", "feature", "\\u", "df_", "._", "columns_", "=_", "[_", "'\\u'_", "._", "join_", "(_", "[_", "str_", "(_", "el_", ")_", "for_", "el_", "in_", "pair_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "pair_", "in_", "feature", "\\u", "df_", "._", "columns_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "feature", "\\u", "df_", "._", "loc_", "[_", "features", "et_", "._", "name_", "]_", "#", " ", "preserve", " ", "original", " ", "row", " ", "ordering_", "\\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_", "fit", "\\u", "model", "\\u", "optimize", "\\u", "hyperparam", "s_", "(_", "data_", ",_", "targets_", ",_", "model_", ",_", "params", "\\u", "to", "\\u", "optimize_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cv_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Optimize", " ", "esti", "mat", "or", " ", "hyperparameters", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Perform", " ", "hyperparam", "ter", " ", "optimization", " ", "usi", "ng", "\\", "10", ";", " ", " ", " ", " ", "`", "skl", "earn", ".", "grid", "\\u", "search", ".", "Grid", "Sear", "ch", "CV", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "data", " ", ":", " ", "Pan", "das", ".", "Data", "Frame", "\\", "10", ";", " ", " ", " ", " ", "Feature", "s", " ", "for", " ", "train", "ing", " ", "model", ".", "\\", "10", ";", " ", " ", " ", " ", "target", "s", " ", ":", " ", "Pan", "das", ".", "Serie", "s", "\\", "10", ";", " ", " ", " ", " ", "Target", "s", " ", "correspond", "ing", " ", "to", " ", "feature", " ", "vector", "s", " ", "in", " ", "`", "data", "`.", "\\", "10", ";", " ", " ", " ", " ", "model", " ", ":", " ", "skl", "earn", " ", "esti", "mat", "or", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "model", "/", "esti", "mat", "or", " ", "who", "se", " ", "hyperparameters", " ", "are", " ", "to", " ", "be", " ", "optimize", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "params", "\\u", "to", "\\u", "optimize", " ", ":", " ", "dict", " ", "or", " ", "list", " ", "of", " ", "dict", "\\", "10", ";", " ", " ", " ", " ", "Dict", "ionar", "y", " ", "with", " ", "parameter", " ", "names", " ", "as", " ", "keys", " ", "and", " ", "lists", " ", "of", " ", "values", " ", "to", " ", "try", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "values", ",", " ", "or", " ", "a", " ", "list", " ", "of", " ", "suc", "h", " ", "dictionar", "ies", ".", "\\", "10", ";", " ", " ", " ", " ", "cv", " ", ":", " ", "int", ",", " ", "cross", "-", "validation", " ", "generat", "or", " ", "or", " ", "an", " ", "iterable", ",", " ", "option", "al", "\\", "10", ";", " ", " ", " ", " ", "Number", " ", "of", " ", "fold", "s", " ", "(", "default", "s", " ", "to", " ", "3", ")", " ", "or", " ", "an", " ", "iterable", " ", "yield", "ing", " ", "train", "/", "test", "\\", "10", ";", " ", " ", " ", " ", "split", "s", ".", " ", "See", " ", "documentation", " ", "for", " ", "`", "Grid", "Sear", "ch", "CV", "`", " ", "for", " ", "deta", "il", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "`", "skl", "earn", ".", "grid", "\\u", "search", ".", "Grid", "Sear", "ch", "CV", "`", " ", "esti", "mat", "or", " ", "object", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "optimize", "d\\u", "model_", "=_", "grid", "\\u", "search_", "._", "Grid", "Sear", "ch", "CV_", "(_", "model_", ",_", "params", "\\u", "to", "\\u", "optimize_", ",_", "cv_", "=_", "cv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "optimize", "d\\u", "model_", "._", "fit_", "(_", "data_", ",_", "targets_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "optimize", "d\\u", "model_", "\\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_", "build", "\\u", "model", "\\u", "from", "\\u", "features", "et_", "(_", "features", "et_", ",_", "model_", "=_", "None_", ",_", "model", "\\u", "type_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model", "\\u", "options_", "=_", "{_", "}_", ",_", "params", "\\u", "to", "\\u", "optimize_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cv_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Build", " ", "model", " ", "from", " ", "(", "non", "-", "rectangular", ")", " ", "xarray", ".", "Datas", "et", " ", "of", " ", "features", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "model_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "model", "\\u", "type_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "MODEL", "S", "\\u", "TYPE", "\\u", "DICT_", "[_", "model", "\\u", "type_", "]_", "(_", "**_", "model", "\\u", "options_", ")_", "\\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 ", " _", "raise_", "Value", "Error_", "(_", "\"", "If", " ", "model", " ", "is", " ", "Non", "e", ",", " ", "model", "\\u", "type", " ", "must", " ", "be", " ", "specified", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "feature", "\\u", "df_", "=_", "rectangular", "ize", "\\u", "features", "et_", "(_", "features", "et_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "params", "\\u", "to", "\\u", "optimize_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "fit", "\\u", "model", "\\u", "optimize", "\\u", "hyperparam", "s_", "(_", "feature", "\\u", "df_", ",_", "features", "et_", "[_", "'", "target", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", ",_", "params", "\\u", "to", "\\u", "optimize_", ",_", "cv_", ")_", "\\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 ", " _", "model_", "._", "fit_", "(_", "feature", "\\u", "df_", ",_", "features", "et_", "[_", "'", "target", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "model_", "\\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_", "create", "\\u", "and", "\\u", "pickle", "\\u", "model_", "(_", "features", "et_", ",_", "model", "\\u", "type_", ",_", "output", "\\u", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model", "\\u", "options_", "=_", "{_", "}_", ",_", "params", "\\u", "to", "\\u", "optimize_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Build", " ", "a", " ", "`", "scikit", "-", "learn", "`", " ", "model", " ", "for", " ", "the", " ", "give", "n", " ", "features", "et", " ", "and", " ", "store", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "serialize", "d", " ", "joblib", " ", "format", " ", "at", " ", "the", " ", "specified", " ", "path", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "features", "et", " ", ":", " ", "xarray", ".", "Datas", "et", "\\", "10", ";", " ", " ", " ", " ", "Feature", "s", " ", "for", " ", "train", "ing", " ", "model", ".", "\\", "10", ";", " ", " ", " ", " ", "model", "\\u", "type", " ", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "Abbr", "evi", "ation", " ", "of", " ", "the", " ", "type", " ", "of", " ", "model", " ", "to", " ", "be", " ", "created", ".", "\\", "10", ";", " ", " ", " ", " ", "output", "\\u", "path", " ", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "Path", " ", "where", " ", "output", " ", "model", " ", "is", " ", "saved", " ", "as", " ", "in", " ", "joblib", " ", "pickle", " ", "format", ".", "\\", "10", ";", " ", " ", " ", " ", "model", "\\u", "options", " ", ":", " ", "dict", ",", " ", "option", "al", "\\", "10", ";", " ", " ", " ", " ", "Dict", "ionar", "y", " ", "speci", "fy", "ing", " ", "`", "scikit", "-", "learn", "`", " ", "model", " ", "parameter", "s", " ", "to", " ", "be", " ", "used", ".", "\\", "10", ";", " ", " ", " ", " ", "params", "\\u", "to", "\\u", "optimize", " ", ":", " ", "dict", " ", "or", " ", "list", " ", "of", " ", "dict", ",", " ", "option", "al", "\\", "10", ";", " ", " ", " ", " ", "Dict", "ionar", "y", " ", "with", " ", "parameter", " ", "names", " ", "as", " ", "keys", " ", "and", " ", "lists", " ", "of", " ", "values", " ", "to", " ", "try", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "values", ",", " ", "or", " ", "a", " ", "list", " ", "of", " ", "suc", "h", " ", "dictionar", "ies", ".", " ", "Default", "s", " ", "to", " ", "Non", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "scikit", "-", "learn", " ", "model", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "build", "\\u", "model", "\\u", "from", "\\u", "features", "et_", "(_", "features", "et_", ",_", "model", "\\u", "type_", "=_", "model", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model", "\\u", "options_", "=_", "model", "\\u", "options_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "params", "\\u", "to", "\\u", "optimize_", "=_", "params", "\\u", "to", "\\u", "optimize_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "joblib", "_", "._", "dump_", "(_", "model_", ",_", "output", "\\u", "path_", ",_", "compress_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "model_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
PublicMapping/DistrictBuilder/docs/loadcensus/configureCensus.py
[ { "content": "#!/usr/bin/env python\n# Framework for loading census data\n# Inputs: FIPS state code, list of variables to include as additional subjects\n# Requirements:\n# - external software: DistrictBuilder, R, gdal, wget, unzip\n# TODO -- check for VTD's\n\n\nimport re # regular expressions\nimport sys # arg lists etc\nimport glob # globbing\nimport commands # system commands\nimport os # os commands\nimport stat\nimport subprocess # for external commands\nimport zipfile # unzipping\nimport rpy2.robjects as robjects\nimport shutil\nimport psycopg2 as dbapi2\nimport optparse\nimport string\nimport time\n\n\n### \n### Globals\n###\n\nPUBLICMAPPINGPASS=\"publicmapping\"\n# TODO : build in vote geographies, numbers of districts per state\n#VOTEGEOGRAPHIES={\"county\":\"COUNTYFP10\",\"tract\":\"TRACTCE10\",\"block\":\"BLOCKCE10\"}\n\n\n### clear_publicmapping_db\n###\n### Truncate database\n\n\n### Drop DB\n\n\n\n### Install dependencies\n###\n### This attempts to install dependencies using apt-get\n###\n\n\n###\n### Retrieve data files\n###\n### This retrieves the census files,unzips and reprojects (using ogr2ogr) \n\n\n\n\n###\n### TEMPLATING - SLD's\n###\n\n# general template classes\n\n\n\n###\n### SLD Skeleton Classes\n###\n\n\n\n\n\n# plain fill template\n\n# min-max range template\n\n\n\n\n\n#TODO: generalize to any number of choropleths\n\n\n\n\n\n### Config file generation\n### TODO: has_vtds==1 has not fully implemented \n### paramaterize thresholds?\n\n\n\n\n\n\n###\n### MAIN\n###\n\n#\n# Get Arguments\n#\n\n\nparser=optparse.OptionParser(usage=\"%prog -F[fips_code] -C[num_congressional_districts] -S[num_senate_districts] -H[num_house_districts]\", version=\"%prog 0.1\")\n\n# required arguments\nparser.add_option('-F','--fips', dest='stateFips',help=\"State two digit FIPS code\", type=int, default=0)\nparser.add_option('-C','--congdist', dest='congDis',help=\"number of congressional districts\", type=int, default=0)\nparser.add_option('-H', '--housedist',dest='houseDis',help=\"number of senate districts\", type=int, default=0)\nparser.add_option('-S', '--sendist', dest='senDis',help=\"number of house districts\", type=int,default=0)\n\n# operations to perform\nparser.add_option('-i', '--install', dest=\"do_install\", help=\"Install dependencencies.\", default=False, action='store_true') \nparser.add_option('-g', '--getdata', dest=\"do_getdata\", help=\"Get data.\", default=False, action='store_true') \nparser.add_option('-s', '--gensld', dest=\"do_gensld\", help=\"Generate slds\", default=False, action='store_true') \nparser.add_option('-c', '--genconf', dest=\"do_genconf\", help=\"Generate config file\", default=False, action='store_true') \nparser.add_option('-d', '--dropdb', dest=\"do_dropdb\", help=\"Drop database\", default=False, action='store_true') \nparser.add_option('-r', '--run', dest=\"do_run\", help=\"run setup.py\", default=False, action='store_true') \n\n# configuration options\nparser.add_option('--na_inc', dest=\"conf_na\", help=\"Include Native Americans in stats.\", default=False, action='store_true') \nparser.add_option('--na_targ_c', dest='target_na_congress',help=\"Number of Native American Congressional Districts for target\", type=int, default=0)\nparser.add_option('--na_targ_h', dest='target_na_house',help=\"Number of Native American House Districts for target\", type=int, default=0)\nparser.add_option('--na_targ_s', dest='target_na_senate',help=\"Number of Native American Senate Districts for target\", type=int, default=0)\nparser.add_option('--hisp_targ_c', dest='target_hisp_congress',help=\"Number of Hispanic Congressional Districts for target\", type=int, default=0)\nparser.add_option('--hisp_targ_h', dest='target_hisp_house',help=\"Number of Hispanic House Districts for target\", type=int, default=0)\nparser.add_option('--hisp_targ_s', dest='target_hisp_senate',help=\"Number of Hispanic SenateDistricts for target\", type=int, default=0)\nparser.add_option('--bl_targ_c', dest='target_bl_congress',help=\"Number of Black Congressional districts for target\", type=int, default=0)\nparser.add_option('--bl_targ_h', dest='target_bl_house',help=\"Number of Black House districts for target\", type=int, default=0)\nparser.add_option('--bl_targ_s', dest='target_bl_senate',help=\"Number of Black Senate districts for target\", type=int, default=0)\n\n(parseResults,numargs)=parser.parse_args()\n\n\n# include na if there is a positive target, even if not otherwise specified\nif ((parseResults.target_na_congress+parseResults.target_na_senate+parseResults.target_na_house)>0) :\n\tparseResults.conf_na = True\n\nallops = (not parseResults.do_install) and (not parseResults.do_getdata) and (not parseResults.do_gensld) and (not parseResults.do_genconf) and (not parseResults.do_dropdb) and (not parseResults.do_run)\nif (allops):\n\tparseResults.do_install=True\n\tparseResults.do_getdata=True\n\tparseResults.do_gensld=True\n\tparseResults.do_genconf=True\n\tparseResults.do_dropdb=True\n\tparseResults.do_run=True\n\nif len(numargs) != 0:\n parser.error(\"additional arguments ignored \")\nstateFips = parseResults.stateFips\nhouseDis = parseResults.houseDis\nsenDis= parseResults.senDis\ncongDis= parseResults.congDis\nif (stateFips==0 or houseDis==0 or senDis==0 or congDis==0):\n print \"Must supply all district arguments\"\n raise ValueError\n\n# install dependencies\nif (parseResults.do_install):\n\tprint \"installing dependencies...\"\n\tinstall_dependencies()\n\n# Clear out DB\nif (parseResults.do_dropdb):\n\tprint 'clearing database ...'\n\tdrop_db()\n\n# generate generic sld files\nif (parseResults.do_gensld):\n\tprint 'generating generic sld files ...'\n\tgensld_none(\"county\")\n\tgensld_none(\"tract\")\n\tgensld_none(\"block\")\n\tgensld_boundaries(\"county\")\n\tgensld_boundaries(\"tract\")\n\tgensld_boundaries(\"block\")\n\n# Retrieve data files\n\nif (parseResults.do_getdata):\n\tprint 'retrieving census data ...'\n\tget_census_data(stateFips)\n\t# merge standard variables\n\t# TODO: Refactor entirely in rpy\n\tprint 'merging data...'\n\trobjects.r.source(\"/projects/PublicMapping/DistrictBuilder/docs/loadcensus/mergeCensus.R\")\n\nif ( (parseResults.do_genconf) or (parseResults.do_gensld)) :\n\tprint 'calculating statistics for configs and slds...'\n\trobjects.r.source(\"/projects/PublicMapping/DistrictBuilder/docs/loadcensus/calcStats.R\")\n\tsum_TOTPOP= robjects.r.sum_TOTPOP[0]\n\t# TODO: Refactor entirely in rpy\n\t# NOTE: robject is returning 6-level quantiles, has_election_data, has_vtd, sum_TOTPOP\n\thas_election_data = robjects.r.has_election_data[0]\n\nif ( parseResults.do_genconf) :\n\trobjects.r.source(\"/projects/PublicMapping/DistrictBuilder/docs/loadcensus/contiguityOverride.R\")\n\t# TODO: should work but has embedded string forwarding\t\n\t#contiguityOverrideString = robjects.r.contiguityOverrideString\n\tf = open('/projects/PublicMapping/DistrictBuilder/docs/generated_overrides.xml', 'r')\n\tcontiguityOverrideString = f.read()\n\tf.close()\n\t\n\n# TODO: refactor as matrix of varnames and geographies\nif ( parseResults.do_gensld) :\n\tprint 'generating choropleth slds ...'\n\tgensld_choro(\"block\",\"TOTPOP\",\"Total Population\",robjects.r.q_block_TOTPOP)\n\tgensld_choro_denquint(\"block\",\"TOTPOP_H\",\"Percent Hispanic Population\",robjects.r.q_block_TOTPOP_H)\n\tgensld_choro_denquint(\"block\",\"TOTPOP_B\",\"Percent Black Population\",robjects.r.q_block_TOTPOP_B)\n\tgensld_choro_denquint(\"block\",\"TOTPOP_NA\",\"Percent Native American Population\",robjects.r.q_block_TOTPOP_NA)\n\tgensld_choro(\"block\",\"VAP\",\"Voting Age Population\",robjects.r.q_block_VAP)\n\tgensld_choro_denquint(\"block\",\"VAP_H\",\"Percent Voting Age Hispanic Population\",robjects.r.q_block_VAP_H)\n\tgensld_choro_denquint(\"block\",\"VAP_B\",\"Percent Voting Age Black Population\",robjects.r.q_block_VAP_B)\n\tgensld_choro_denquint(\"block\",\"VAP_NA\",\"Percent Voting Age Native American Population\",robjects.r.q_block_VAP_NA)\n\tgensld_choro(\"tract\",\"TOTPOP\",\"Total Population\",robjects.r.q_tract_TOTPOP)\n\tgensld_choro_denquint(\"tract\",\"TOTPOP_H\",\"Percent Total Hispanic Population\",robjects.r.q_tract_TOTPOP_H)\n\tgensld_choro_denquint(\"tract\",\"TOTPOP_B\",\"Percent Black Population\",robjects.r.q_tract_TOTPOP_B)\n\tgensld_choro_denquint(\"tract\",\"TOTPOP_NA\",\"Percent Native American Population\",robjects.r.q_tract_TOTPOP_NA)\n\tgensld_choro(\"tract\",\"VAP\",\"Voting Age Population\",robjects.r.q_tract_VAP)\n\tgensld_choro_denquint(\"tract\",\"VAP_H\",\"Percent Voting Age Hispanic Population\",robjects.r.q_tract_VAP_H)\n\tgensld_choro_denquint(\"tract\",\"VAP_B\",\"Percent Voting Age Black Population\",robjects.r.q_tract_VAP_B)\n\tgensld_choro_denquint(\"tract\",\"VAP_NA\",\"Percent Voting Age Native American Population\",robjects.r.q_tract_VAP_NA)\n\tgensld_choro(\"county\",\"TOTPOP\",\"Total Population\",robjects.r.q_county_TOTPOP)\n\tgensld_choro_denquint(\"county\",\"TOTPOP_H\",\"Percent Hispanic Population\",robjects.r.q_county_TOTPOP_H)\n\tgensld_choro_denquint(\"county\",\"TOTPOP_B\",\"Percent Black Population\",robjects.r.q_county_TOTPOP_B)\n\tgensld_choro_denquint(\"county\",\"TOTPOP_NA\",\"Percent Native American Population\",robjects.r.q_county_TOTPOP_NA)\n\tgensld_choro(\"county\",\"VAP\",\"Voting Age Population\",robjects.r.q_county_VAP)\n\tgensld_choro_denquint(\"county\",\"VAP_H\",\"Percent Voting Age Hispanic Population\",robjects.r.q_county_VAP_H)\n\tgensld_choro_denquint(\"county\",\"VAP_B\",\"Percent Voting Age Black Population\",robjects.r.q_county_VAP_B)\n\tgensld_choro_denquint(\"county\",\"VAP_NA\",\"Percent Voting Age Native American Population\",robjects.r.q_county_VAP_NA)\n\tif (has_election_data==1) : \n\t\tgensld_choro_denquint(\"block\",\"VOTE_DEM\",\"Percent Predicted Democratic Vote \",robjects.r.q_block_VOTE_DEM)\n\t\tgensld_choro_denquint(\"block\",\"VOTE_REP\",\"Percent Predicted Republican Vote \",robjects.r.q_block_VOTE_REP)\n \tgensld_choro(\"block\",\"VOTE_TOT\",\"Predicted Vote \",robjects.r.q_block_VOTE_TOT)\n \tgensld_choro_denquint(\"tract\",\"VOTE_DEM\",\"Percent Predicted Democratic Vote \",robjects.r.q_tract_VOTE_DEM)\n \tgensld_choro_denquint(\"tract\",\"VOTE_REP\",\"Percent Predicted Republican Vote \",robjects.r.q_tract_VOTE_REP)\n \tgensld_choro(\"tract\",\"VOTE_TOT\",\"Predicted Vote \",robjects.r.q_tract_VOTE_TOT)\n \tgensld_choro_denquint(\"county\",\"VOTE_DEM\",\"Perecent Predicted Democratic Vote \",robjects.r.q_county_VOTE_DEM)\n \tgensld_choro_denquint(\"county\",\"VOTE_REP\",\"Percent Predicted Republican Vote \",robjects.r.q_county_VOTE_REP)\n \tgensld_choro(\"county\",\"VOTE_TOT\",\"Predicted Vote \",robjects.r.q_county_VOTE_TOT)\n\t\tgensld_choro_denquint(\"block\",\"VOTE_DEM_N\",\"Percent Predicted Democratic Vote \",robjects.r.q_block_VOTE_DEM_N)\n\t\tgensld_choro_denquint(\"block\",\"VOTE_REP_N\",\"Percent Predicted Republican Vote \",robjects.r.q_block_VOTE_REP_N)\n \tgensld_choro(\"block\",\"VOTE_TOT_N\",\"Predicted Vote \",robjects.r.q_block_VOTE_TOT_N)\n \tgensld_choro_denquint(\"tract\",\"VOTE_DEM_N\",\"Percent Predicted Democratic Vote \",robjects.r.q_tract_VOTE_DEM_N)\n \tgensld_choro_denquint(\"tract\",\"VOTE_REP_N\",\"Percent Predicted Republican Vote \",robjects.r.q_tract_VOTE_REP_N)\n \tgensld_choro(\"tract\",\"VOTE_TOT_N\",\"Predicted Vote \",robjects.r.q_tract_VOTE_TOT_N)\n \tgensld_choro_denquint(\"county\",\"VOTE_DEM_N\",\"Percent Predicted Democratic Vote \",robjects.r.q_county_VOTE_DEM_N)\n \tgensld_choro_denquint(\"county\",\"VOTE_REP_N\",\"Percent Predicted Republican Vote \",robjects.r.q_county_VOTE_REP_N)\n \tgensld_choro(\"county\",\"VOTE_TOT_N\",\"Predicted Vote \",robjects.r.q_county_VOTE_TOT_N)\n\n\n# generate config file\nif (parseResults.do_genconf):\n\tprint 'generating config file ... '\n\tgen_config(num_districts_congress=congDis,num_districts_senate=senDis,num_districts_house=houseDis,sum_TOTPOP=sum_TOTPOP,has_election_data=has_election_data,has_vtds=0,conf_na=parseResults.conf_na, \ntarget_na_congress=parseResults.target_na_congress, target_hisp_congress = parseResults.target_hisp_congress, target_bl_congress = parseResults.target_bl_congress,\ntarget_na_house=parseResults.target_na_house, target_hisp_house = parseResults.target_hisp_house, target_bl_house = parseResults.target_bl_house,\ntarget_na_senate=parseResults.target_na_senate, target_hisp_senate = parseResults.target_hisp_senate, target_bl_senate = parseResults.target_bl_senate, contiguityOverrideString=contiguityOverrideString) \n\nif (parseResults.do_run):\n\tprint 'running setup-py ... '\n olddir = os.getcwd()\n os.chdir(\"/projects/PublicMapping/DistrictBuilder/django/publicmapping/\")\n subprocess.check_call([\"ls\"])\n #subprocess.check_call([\"setup.py\",\"-v2\",\"/projects/PublicMapping/DistrictBuilder/docs/config.xsd\",\" /projects/PublicMapping/DistrictBuilder/docs/config_census_generated.xml\"])\n subprocess.check_call([\"./setup.py -v2 /projects/PublicMapping/DistrictBuilder/docs/config.xsd /projects/PublicMapping/DistrictBuilder/docs/config_census_generated.xml\"],shell=True)\n os.chdir(olddir)\nelse:\n\tprint '\\n\\n*** Now run: ***\\n\\n'\n\tprint '(cd /projects/PublicMapping/DistrictBuilder/django/publicmapping/; python setup.py -v2 /projects/PublicMapping/DistrictBuilder/docs/config.xsd /projects/PublicMapping/DistrictBuilder/docs/config_census_generated.xml)'\n\n\n\n# workaround celeryd first-time startup problem\nprint 'Starting celeryd ...'\nsubprocess.check_call([\"service\",\"celeryd\",\"start\"])\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def clear_publicmapping_db():\n db = dbapi2.connect (database=\"publicmapping\", user=\"publicmapping\", password=PUBLICMAPPINGPASS)\n cur = db.cursor()\n redtable=[\"redistricting_characteristic\",\"redistricting_computedcharacteristic\",\"redistricting_computeddistrictscore\",\"redistricting_computedplanscore\",\"redistricting_contiguityoverride\",\"redistricting_district\",\"redistricting_geolevel\",\"redistricting_geounit\",\"redistricting_legislativebody\",\"redistricting_legislativedefault\",\"redistricting_legislativelevel\",\"redistricting_plan\",\"redistricting_profile\",\"redistricting_scoreargument\",\"redistricting_scoredisplay\",\"redistricting_scorefunction\",\"redistricting_scorepanel\",\"redistricting_scorepanel_displays\",\"redistricting_scorepanel_score_functions\",\"redistricting_subject\",\"redistricting_target\",\"redistricting_validationcriteria\"]\n for i in redtable:\n cur.execute(\"truncate table %s CASCADE\" % i)\n db.commit()\n db.close()", "metadata": "root.clear_publicmapping_db", "header": "['module', '___EOS___']", "index": 37 }, { "content": "def drop_db():\n olddir = os.getcwd()\n os.chdir(\"/tmp\")\n subprocess.check_call([\"service\",\"tomcat6\",\"stop\"])\n subprocess.check_call([\"service\",\"celeryd\",\"stop\"])\n subprocess.check_call([\"service\",\"apache2\",\"stop\"])\n subprocess.check_call([\"service\",\"apache2\",\"restart\"])\n subprocess.check_call([\"service\",\"postgresql\",\"restart\"])\n subprocess.check_call(['su postgres -c \"dropdb publicmapping\"'],shell=True)\n subprocess.check_call(['cat /projects/PublicMapping/DistrictBuilder/sql/publicmapping_db.sql | su postgres -c \"psql -f - postgres\"'],shell=True)\n subprocess.check_call([\"service\",\"apache2\",\"start\"])\n subprocess.check_call([\"service\",\"tomcat6\",\"start\"])\n\n os.chdir(olddir)", "metadata": "root.drop_db", "header": "['module', '___EOS___']", "index": 48 }, { "content": "def install_dependencies():\n if (os.path.exists(\"/usr/bin/ogrinfo\")==False) :\n \tcmdarg = 'gdal-bin'\n \tsubprocess.check_call([\"apt-get\",\"install\",cmdarg])", "metadata": "root.install_dependencies", "header": "['module', '___EOS___']", "index": 69 }, { "content": "def get_census_data(stateFips): \n\tif (stateFips<10) :\n\t\tstateFips = \"0%s\" % stateFips\n print 'Retrieving census shapefiles...'\n # put all data in publicmapping data directory\n olddir = os.getcwd()\n os.chdir(\"/projects/PublicMapping/data/\")\n # obtain state boundary files from census\n cenBlockFilePrefix = 'tl_2010_%s_tabblock10' % stateFips\n cenTractFilePrefix = 'tl_2010_%s_tract10' % stateFips\n cenCountyFilePrefix= 'tl_2010_%s_county10' % stateFips\n cmdarg = 'ftp://ftp2.census.gov/geo/tiger/TIGER2010/TABBLOCK/2010/%s.zip' % cenBlockFilePrefix \n subprocess.check_call([\"wget\",\"-nc\",cmdarg])\n cmdarg = 'ftp://ftp2.census.gov/geo/tiger/TIGER2010/TRACT/2010/%s.zip' % cenTractFilePrefix\n subprocess.check_call([\"wget\",\"-N\",cmdarg])\n cmdarg = 'ftp://ftp2.census.gov/geo/tiger/TIGER2010/COUNTY/2010/%s.zip' % cenCountyFilePrefix\n subprocess.check_call([\"wget\",\"-N\",cmdarg])\n # get additional data from our S3 bucket\n print 'Retrieving additional data...'\n cmdarg = 'https://s3.amazonaws.com/redistricting_supplement_data/redist/%s_redist_data.zip' % stateFips\n subprocess.check_call([\"wget\",\"-N\",cmdarg])\n cmdarg = 'https://s3.amazonaws.com/redistricting_supplement_data/redist/%s_contiguity_overrides.csv' % stateFips\n subprocess.call([\"wget\",\"-N\",cmdarg])\n print 'Unzipping files ...'\n # unzip data files\n for i in [ cenBlockFilePrefix, cenTractFilePrefix, cenCountyFilePrefix ] :\n\t \tzfile = '%s.zip' % i \n\t\tprint ('Unzipping %s' %zfile)\n myzip = zipfile.ZipFile(zfile, 'r')\n myzip.extractall()\n myzip = zipfile.ZipFile('%s_redist_data.zip' % stateFips, 'r')\n myzip.extractall() # Reproject block data\n print 'Reprojecting block shapefile...'\n if (os.path.exists(\"census_blocks.shp\")) :\n os.remove('census_blocks.shp')\n if (os.path.exists(\"census_tracts.shp\")) :\n os.remove('census_tracts.shp')\n if (os.path.exists(\"census_counties.shp\")) :\n os.remove('census_counties.shp')\n subprocess.check_call([\"ogr2ogr\",'-overwrite','-t_srs','EPSG:3785','census_blocks.shp','%s.shp' % cenBlockFilePrefix ])\n subprocess.check_call([\"ogr2ogr\",'-overwrite','-t_srs','EPSG:3785','census_tracts.shp','%s.shp' % cenTractFilePrefix])\n subprocess.check_call([\"ogr2ogr\",'-overwrite','-t_srs','EPSG:3785','census_counties.shp','%s.shp' % cenCountyFilePrefix])\n # standardize file names\n print 'Copying data files...'\n shutil.copy('%s_redist_data.csv' %stateFips , 'redist_data.csv' )\n if (os.path.exists(\"redist_overrides.csv\")) :\n \tos.remove('redist_overrides.csv')\n if (os.path.exists(\"%s_contiguity_overrides.csv\" % stateFips)) :\n \tshutil.copy(\"%s_contiguity_overrides.csv\" % stateFips,'redist_overrides.csv') \n os.chdir(olddir)", "metadata": "root.get_census_data", "header": "['module', '___EOS___']", "index": 79 }, { "content": "class DictionaryTemplate:", "metadata": "root.DictionaryTemplate", "header": "['module', '___EOS___']", "index": 137 }, { "content": " def __init__(self, dict={}, **keywords):\n self.dict = dict\n self.dict.update(keywords)", "metadata": "root.DictionaryTemplate.__init__", "header": "['class', 'DictionaryTemplate', ':', '___EOS___']", "index": 138 }, { "content": " def __str__(self):\n return self._template % self", "metadata": "root.DictionaryTemplate.__str__", "header": "['class', 'DictionaryTemplate', ':', '___EOS___']", "index": 141 }, { "content": " def __getitem__(self, key):\n return self._process(key.split(\"|\"))", "metadata": "root.DictionaryTemplate.__getitem__", "header": "['class', 'DictionaryTemplate', ':', '___EOS___']", "index": 143 }, { "content": " def _process(self, l):\n arg = l[0]\n if len(l) == 1:\n if arg in self.dict:\n return self.dict[arg]\n elif hasattr(self, arg) and callable(getattr(self, arg)):\n return getattr(self, arg)()\n else:\n raise KeyError(arg)\n else:\n func_name = l[1]\n if func_name in self.dict:\n func = self.dict[func_name]\n else:\n func = getattr(self, func_name)\n return func(self._process([arg]))", "metadata": "root.DictionaryTemplate._process", "header": "['class', 'DictionaryTemplate', ':', '___EOS___']", "index": 145 }, { "content": "class ListTemplate:", "metadata": "root.ListTemplate", "header": "['module', '___EOS___']", "index": 162 }, { "content": " def __init__(self, input_list=[]):\n self.input_list = input_list", "metadata": "root.ListTemplate.__init__", "header": "['class', 'ListTemplate', ':', '___EOS___']", "index": 163 }, { "content": " def __str__(self):\n return \"\\n\".join([self._template % x for x in self.input_list])", "metadata": "root.ListTemplate.__str__", "header": "['class', 'ListTemplate', ':', '___EOS___']", "index": 165 }, { "content": "class Empty_Template(ListTemplate):\n _template = \"\"\" \n\t\"\"\"", "metadata": "root.Empty_Template", "header": "['module', '___EOS___']", "index": 168 }, { "content": "class SldList_Template(DictionaryTemplate):\n _template = \"\"\"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<StyledLayerDescriptor version=\"1.0.0\" xmlns=\"http://www.opengis.net/sld\" xmlns:ogc=\"http://www.opengis.net/ogc\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd\">\n <NamedLayer>\n <Name>%(layername)s</Name>\n <UserStyle>\n <Title>%(layertitle)s</Title>\n <Abstract>%(layerabs)s</Abstract>\n <FeatureTypeStyle>\n %(slst|sli)s\n %(lst|li)s\n %(elst|eli)s\n </FeatureTypeStyle>\n </UserStyle>\n </NamedLayer>\n</StyledLayerDescriptor>\n \"\"\"", "metadata": "root.SldList_Template", "header": "['module', '___EOS___']", "index": 176 }, { "content": "class Sld_Poly_Template(ListTemplate):\n _template = \"\"\"\n <Rule>\n <Title>%(title)s</Title>\n <PolygonSymbolizer>\n <Fill>\n <CssParameter name=\"fill\">%(fill)s</CssParameter>\n <CssParameter name=\"fill-opacity\">%(fillopacity)s</CssParameter> \n\t </Fill>\n </PolygonSymbolizer>\n </Rule>\n \"\"\"", "metadata": "root.Sld_Poly_Template", "header": "['module', '___EOS___']", "index": 194 }, { "content": "class Sld_PolyB_Template(ListTemplate):\n _template = \"\"\"\n <Rule>\n <Title>%(title)s</Title>\n <PolygonSymbolizer>\n <Fill>\n <CssParameter name=\"fill\">%(fill)s</CssParameter>\n <CssParameter name=\"fill-opacity\">%(fillopacity)s</CssParameter>\n </Fill>\n <Stroke>\n <CssParameter name=\"stroke\">%(stroke)s</CssParameter>\n <CssParameter name=\"stroke-width\">%(strokewidth)s</CssParameter>\n <CssParameter name=\"stroke-opacity\">%(strokeopacity)s</CssParameter>\n </Stroke>\n </PolygonSymbolizer>\n </Rule>\n \"\"\"", "metadata": "root.Sld_PolyB_Template", "header": "['module', '___EOS___']", "index": 208 }, { "content": "class Sld_Line_Template(ListTemplate):\n _template = \"\"\"\n <Rule>\n <Title>%(title)s</Title>\n <LineSymbolizer>\n <Stroke>\n <CssParameter name=\"stroke\">%(stroke)s</CssParameter>\n <CssParameter name=\"stroke-width\">%(strokewidth)s</CssParameter>\n <CssParameter name=\"stroke-opacity\">%(strokeopacity)s</CssParameter>\n </Stroke>\n </LineSymbolizer>\n </Rule>\n \"\"\"", "metadata": "root.Sld_Line_Template", "header": "['module', '___EOS___']", "index": 227 }, { "content": "class Sld_Range_Template(ListTemplate):\n _template = \"\"\"\n <Rule>\n <Title>%(bottom)s-%(top)s</Title>\n <ogc:Filter>\n <ogc:And>\n <ogc:PropertyIsLessThan>\n <ogc:PropertyName>%(unit)s</ogc:PropertyName>\n <ogc:Literal>%(top)s</ogc:Literal>\n </ogc:PropertyIsLessThan>\n <ogc:PropertyIsGreaterThanOrEqualTo>\n <ogc:PropertyName>%(unit)s</ogc:PropertyName>\n <ogc:Literal>%(bottom)s</ogc:Literal>\n </ogc:PropertyIsGreaterThanOrEqualTo>\n </ogc:And>\n </ogc:Filter> \n <PolygonSymbolizer>\n <Fill>\n <CssParameter name=\"fill\">%(fill)s</CssParameter>\n <CssParameter name=\"fill-opacity\">%(fillopacity)s</CssParameter>\n </Fill>\n </PolygonSymbolizer>\n </Rule>\n \"\"\"", "metadata": "root.Sld_Range_Template", "header": "['module', '___EOS___']", "index": 242 }, { "content": "class Sld_URange_Template(ListTemplate):\n _template = \"\"\"\n <Rule>\n <Title>%(bottom)s-%(top)s</Title>\n <ogc:Filter>\n <ogc:PropertyIsGreaterThanOrEqualTo>\n <ogc:PropertyName>%(unit)s</ogc:PropertyName>\n <ogc:Literal>%(bottom)s</ogc:Literal>\n </ogc:PropertyIsGreaterThanOrEqualTo>\n </ogc:Filter> \n <PolygonSymbolizer>\n <Fill>\n <CssParameter name=\"fill\">%(fill)s</CssParameter>\n <CssParameter name=\"fill-opacity\">%(fillopacity)s</CssParameter>\n </Fill>\n </PolygonSymbolizer>\n </Rule>\n \"\"\"", "metadata": "root.Sld_URange_Template", "header": "['module', '___EOS___']", "index": 268 }, { "content": "def gensld_none(geoname):\n target_file = '/projects/PublicMapping/DistrictBuilder/sld/pmp:%s_none.sld' % (geoname) \n f = open(target_file,'w')\n f.write ( str(SldList_Template(layername=\"%s No fill\" % (geoname),layertitle=\"%s No Fill\" % (geoname) ,layerabs=\"A style showing the boundaries of a geounit with a transparent fill\", slst=[],sli=Empty_Template, lst=[{\"title\":\"Fill\",\"fill\":\"#FFFFFF\",\"fillopacity\":\"1.0\"}],li=Sld_Poly_Template,elst=[{\"title\":\"Boundary\",\"stroke\":\"#555555\",\"strokewidth\":\"3.00\",\"strokeopacity\":\"1.0\"}],eli=Sld_Line_Template)) )\n\tf.write(\"\\n\")\n f.close()\n os.chmod(target_file,stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH) ", "metadata": "root.gensld_none", "header": "['module', '___EOS___']", "index": 287 }, { "content": "def gensld_boundaries(geoname):\n target_file = '/projects/PublicMapping/DistrictBuilder/sld/pmp:%s_boundaries.sld' % (geoname) \n f = open(target_file,'w')\n f.write ( str(SldList_Template(layername=\"%s Boundaries\" % (geoname) ,layertitle=\"%s Boundaries Only\" %(geoname),layerabs=\"A style showing the boundaries of a geounit\", slst=[] ,sli=Empty_Template, lst=[],li=Empty_Template,elst=[{\"title\":\"County Boundaries\",\"fill\":\"#000000\",\"fillopacity\":\"0.0\",\"stroke\":\"#2255FF\",\"strokewidth\":\"2\",\"strokeopacity\":\"0.35\"}],eli=Sld_PolyB_Template)))\n\tf.write(\"\\n\")\n f.close()\n os.chmod(target_file,stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH) ", "metadata": "root.gensld_boundaries", "header": "['module', '___EOS___']", "index": 295 }, { "content": "def gensld_choro(geoname,varname,vartitle,quantiles):\n\tgensld_choro_internal(geoname,varname,vartitle,quantiles,unit=\"number\")", "metadata": "root.gensld_choro", "header": "['module', '___EOS___']", "index": 304 }, { "content": "def gensld_choro_internal(geoname,varname,vartitle,quantiles,unit=\"number\"):\n\t# WARNING: sld files need to be lower case to be compatible with postgres views\n\tlvarname = string.lower(varname)\n target_file = '/projects/PublicMapping/DistrictBuilder/sld/pmp:%s_%s.sld' % (geoname,lvarname) \n varabs=\"Grayscale choropleth based on quantiles of %s\" % (varname)\n valuelist= [\n {\"top\": str(quantiles[4]),\n \"bottom\": str(quantiles[3]),\n \"fill\": \"#444444\",\n \"fillopacity\":\"1.0\",\n \t \"unit\":unit},\n {\"top\": str(quantiles[3]),\n \"bottom\": str(quantiles[2]),\n \"fill\": \"#777777\",\n \"fillopacity\":\"1.0\",\n \"unit\":unit},\n {\"top\": str(quantiles[2]),\n \"bottom\": str(quantiles[1]),\n \"fill\": \"#AAAAAA\",\n \"fillopacity\":\"1.0\",\n\t \"unit\":unit},\n {\"top\": str(quantiles[1]),\n \"bottom\": str(quantiles[0]),\n \"fill\": \"#EEEEEE\",\n \"fillopacity\":\"1.0\",\n\t \"unit\":unit}]\n\n \tsvaluelist = [{\"top\": str(quantiles[5]),\n \"bottom\": str(quantiles[4]),\n \"fill\": \"#000000\",\n \"fillopacity\":\"1.0\",\n\t \"unit\":unit}]\n\n f = open(target_file,'w')\n f.write(str( SldList_Template(layername=lvarname,layertitle=vartitle,layerabs=varabs,slst=svaluelist,sli=Sld_URange_Template, lst=valuelist,li=Sld_Range_Template,elst=[{\"title\":\"Boundary\",\"stroke\":\"#555555\",\"strokewidth\":\"0.25\",\"strokeopacity\":\"1.0\"}],eli=Sld_Line_Template) ))\n\tf.write(\"\\n\")\n f.close()\n os.chmod(target_file,stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH) ", "metadata": "root.gensld_choro_internal", "header": "['module', '___EOS___']", "index": 307 }, { "content": "def gensld_choro_denquint(geoname,varname,vartitle,dummy):\n\tquantiles=[0,0.2,0.4,0.6,0.8,1]\n\tgensld_choro_internal(geoname,varname,vartitle,quantiles,unit=\"percentage\")", "metadata": "root.gensld_choro_denquint", "header": "['module', '___EOS___']", "index": 347 }, { "content": "class Config_Template(DictionaryTemplate):\n _template = \"\"\"<!-- Define Internal Entities to avoid Repeated Entering of Values -->\n<!DOCTYPE DistrictBuilder [\n <!ENTITY num_districts_congress \"%(num_districts_congress)s\">\n <!ENTITY num_districts_house \"%(num_districts_house)s\">\n <!ENTITY num_districts_senate \"%(num_districts_senate)s\">\n <!ENTITY pop_congress \"%(pop_congress)s\">\n <!ENTITY pop_house \"%(pop_house)s\">\n <!ENTITY pop_senate \"%(pop_senate)s\">\n <!ENTITY pop_congress_min \"%(pop_congress_min)s\">\n <!ENTITY pop_house_min \"%(pop_house_min)s\">\n <!ENTITY pop_senate_min \"%(pop_senate_min)s\">\n <!ENTITY pop_congress_max \"%(pop_congress_max)s\">\n <!ENTITY pop_house_max \"%(pop_house_max)s\">\n <!ENTITY pop_senate_max \"%(pop_senate_max)s\">\n <!ENTITY target_hisp_congress \"%(target_hisp_congress)s\">\n <!ENTITY target_hisp_senate \"%(target_hisp_senate)s\">\n <!ENTITY target_hisp_house \"%(target_hisp_house)s\">\n <!ENTITY target_bl_congress \"%(target_bl_congress)s\">\n <!ENTITY target_bl_senate \"%(target_bl_senate)s\">\n <!ENTITY target_bl_house \"%(target_bl_house)s\">\n <!ENTITY target_na_senate \"%(target_na_senate)s\">\n <!ENTITY target_na_house \"%(target_na_house)s\">\n <!ENTITY target_na_congress \"%(target_na_congress)s\">\n ]>\n\n<DistrictBuilder>\n\n\n <!-- Define legislative bodies referenced in the system. -->\n <LegislativeBodies>\n <!-- A Legislative body has an ID (for referencing in GeoLevel\n definitions later), a name, and a label for plan items \n (\"District\" for Congressional, etc) -->\n <LegislativeBody id=\"congress\" name=\"Congressional\" member=\"District %%s\" maxdistricts=\"&num_districts_congress;\"/>\n <LegislativeBody id=\"house\" name=\"State House\" member=\"District %%s\" maxdistricts=\"&num_districts_house;\" />\n <LegislativeBody id=\"senate\" name=\"State Senate\" member=\"District %%s\" maxdistricts=\"&num_districts_senate;\" />\n </LegislativeBodies>\n <!-- A list of subjects referenced in the system. -->\n <Subjects> \n\t <!-- A Subject is a measurement type, such as \"Total Population\". \n\t The subject is mapped to an attribute during the import phase,\n and contains a long and short display name. Subjects have IDs\n for referencing in GeoLevel definitions later. -->\n <Subject id=\"vap_b\" field=\"VAP_B\" name=\"African-American Voting Age Population\" short_name=\"Black VAP \" displayed=\"true\" sortkey=\"1\" percentage_denominator=\"vap\" />\n <Subject id=\"vap_h\" field=\"VAP_H\" name=\"Hispanic or Latino voting age population\" short_name=\"Hispanic VAP\" displayed=\"true\" sortkey=\"2\" percentage_denominator=\"vap\" />\n <Subject id=\"vap_na\" field=\"VAP_NA\" name=\"Native American Voting Age Population\" short_name=\"Nat Amer VAP\" displayed=\"true\" sortkey=\"4\" percentage_denominator=\"vap\" />\n %(start_elec)s\n <Subject id=\"vote_dem\" field=\"VOTE_DEM\" name=\"num likely Democratic voters\" short_name=\"Democratic voters\" displayed=\"true\" sortkey=\"3\" percentage_denominator=\"vote_tot\" />\n <Subject id=\"vote_rep\" field=\"VOTE_REP\" name=\"num likely Republican voters\" short_name=\"Republican voters\" displayed=\"true\" sortkey=\"5\" percentage_denominator=\"vote_tot\" />\n <Subject id=\"vote_tot\" field=\"VOTE_TOT\" name=\"num likely Rep/Dem voters\" short_name=\"Rep+ Dem vote\" displayed=\"false\" sortkey=\"6\" />\n <Subject id=\"vote_dem_norm\" field=\"VOTE_DEM_N\" name=\"num of likely Democratic voters normalized to 50/50 state baseline\" short_name=\"Normal Dem vote\" displayed=\"true\" sortkey=\"18\" percentage_denominator=\"vote_tot_norm\" />\n <Subject id=\"vote_rep_norm\" field=\"VOTE_REP_N\" name=\"num of likely Republican voters normalized to 50/50 state baseline\" short_name=\"Normal Rep vote\" displayed=\"true\" sortkey=\"19\" percentage_denominator=\"vote_tot_norm\" />\n <Subject id=\"vote_tot_norm\" field=\"VOTE_TOT_N\" name=\"number of likely Republican and Democratic voters normalized to 50/50 state baseline\" short_name=\"Normal 2-party vote\" displayed=\"false\" sortkey=\"20\" />\n %(end_elec)s\n <Subject id=\"vap\" field=\"VAP\" name=\"Voting Age Population\" short_name=\"vap\" displayed=\"true\" sortkey=\"7\" />\n <Subject id=\"totpop_b\" field=\"TOTPOP_B\" name=\"African-American\" short_name=\"Black\" displayed=\"false\" sortkey=\"8\" percentage_denominator=\"totpop\"/> \n\t<Subject id=\"totpop_h\" field=\"TOTPOP_H\" name=\"Hispanic or Latino\" short_name=\"Hispanic\" displayed=\"false\" sortkey=\"9\" percentage_denominator=\"totpop\"/>\n\t<Subject id=\"totpop_na\" field=\"TOTPOP_NA\" name=\"Native American\" short_name=\"Nat Amer\" displayed=\"false\" sortkey=\"10\" percentage_denominator=\"totpop\"/>\n\t<Subject id=\"totpop_a\" field=\"TOTPOP_A\" name=\"Asian Population\" short_name=\"Asian\" displayed=\"false\" sortkey=\"11\" percentage_denominator=\"totpop\"/>\n\t<Subject id=\"totpop_pi\" field=\"TOTPOP_PI\" name=\"Pacific Islander\" short_name=\"Pac Isl\" displayed=\"false\" sortkey=\"12\" percentage_denominator=\"totpop\"/>\n\t<Subject id=\"totpop_wnh\" field=\"TOTPOP_WNH\" name=\"White Non-Hispanic\" short_name=\"White\" displayed=\"false\" sortkey=\"13\" percentage_denominator=\"totpop\"/>\n <Subject id=\"totpop\" field=\"TOTPOP\" name=\"Total Population\" short_name=\"Total Pop.\" displayed=\"true\" sortkey=\"14\"/>\n <Subject id=\"vap_a\" field=\"VAP_A\" name=\"Asian Voting Age Population\" short_name=\"Asian VAP\" displayed=\"true\" sortkey=\"15\" percentage_denominator=\"vap\" />\n <Subject id=\"vap_pi\" field=\"VAP_PI\" name=\"Pacific Islander Voting Age Population\" short_name=\"Pacific VAP\" displayed=\"true\" sortkey=\"16\" percentage_denominator=\"vap\"/>\n <Subject id=\"vap_wnh\" field=\"VAP_WNH\" name=\"White Non-Hispanic Voting Age Population\" short_name=\"White VAP\" displayed=\"true\" sortkey=\"17\" percentage_denominator=\"vap\"/>\n </Subjects>\n\n <Scoring>\n <ScoreFunctions>\n <!-- A district score that returns a literal value -->\n <ScoreFunction id=\"district_poptot\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Total Pop\" user_selectable=\"true\">\n <SubjectArgument name=\"value1\" ref=\"totpop\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_totpop_b\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Black VAP\" user_selectable=\"true\">\n <SubjectArgument name=\"value1\" ref=\"totpop_b\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_totpop_h\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Hispanic VAP\" user_selectable=\"true\">\n <SubjectArgument name=\"value1\" ref=\"totpop_h\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_totpop_a\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Asian VAP\" user_selectable=\"true\">\n <SubjectArgument name=\"value1\" ref=\"totpop_a\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_totpop_na\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Native American VAP\" user_selectable=\"true\">\n <SubjectArgument name=\"value1\" ref=\"totpop_na\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_totpop_pi\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Pacific Islander VAP\" user_selectable=\"true\">\n <SubjectArgument name=\"value1\" ref=\"totpop_pi\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_totpop_wnh\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Pacific Islander VAP\" user_selectable=\"true\">\n <SubjectArgument name=\"value1\" ref=\"totpop_wnh\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_vap\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"VAP\" user_selectable=\"true\">\n <SubjectArgument name=\"value1\" ref=\"vap\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_vap_b\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Black VAP\" user_selectable=\"true\">\n <SubjectArgument name=\"value1\" ref=\"vap_b\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_vap_h\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Hispanic VAP\" user_selectable=\"true\">\n <SubjectArgument name=\"value1\" ref=\"vap_h\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_vap_a\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Asian VAP\" user_selectable=\"true\">\n <SubjectArgument name=\"value1\" ref=\"vap_a\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_vap_na\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Native American VAP\" user_selectable=\"true\">\n <SubjectArgument name=\"value1\" ref=\"vap_na\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_vap_pi\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Pacific Islander VAP\" user_selectable=\"true\">\n <SubjectArgument name=\"value1\" ref=\"vap_pi\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_vap_wnh\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Pacific Islander VAP\" user_selectable=\"true\">\n <SubjectArgument name=\"value1\" ref=\"vap_wnh\" />\n </ScoreFunction>\n\n <!-- A district score that returns a percentage -->\n <ScoreFunction id=\"district_blkvap_percent\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Percent\"\n label=\"Black VAP %%\" user_selectable=\"true\">\n <SubjectArgument name=\"numerator\" ref=\"vap_b\" />\n <SubjectArgument name=\"denominator\" ref=\"vap\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_blkvap_thresh\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Threshold\"\n label=\"Black VAP Threshold\">\n <ScoreArgument name=\"value\" ref=\"district_blkvap_percent\" />\n <Argument name=\"threshold\" value=\"0.5\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_hispvap_percent\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Percent\"\n label=\"Hisp. VAP %%\" user_selectable=\"true\">\n <SubjectArgument name=\"numerator\" ref=\"vap_h\" />\n <SubjectArgument name=\"denominator\" ref=\"vap\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_hispvap_thresh\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Threshold\"\n label=\"Hisp. VAP Threshold\">\n <ScoreArgument name=\"value\" ref=\"district_hispvap_percent\" />\n <Argument name=\"threshold\" value=\"0.5\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_navap_percent\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Percent\"\n label=\"Native American VAP %%\" user_selectable=\"true\">\n <SubjectArgument name=\"numerator\" ref=\"vap_na\" />\n <SubjectArgument name=\"denominator\" ref=\"vap\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_navap_thresh\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Threshold\"\n label=\"Native American VAP Threshold\">\n <ScoreArgument name=\"value\" ref=\"district_navap_percent\" />\n <Argument name=\"threshold\" value=\"0.5\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_avap_percent\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Percent\"\n label=\"Asian VAP %%\" user_selectable=\"true\">\n <SubjectArgument name=\"numerator\" ref=\"vap_a\" />\n <SubjectArgument name=\"denominator\" ref=\"vap\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_avap_thresh\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Threshold\"\n label=\"Asian VAP Threshold\">\n <ScoreArgument name=\"value\" ref=\"district_avap_percent\" />\n <Argument name=\"threshold\" value=\"0.5\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_pivap_percent\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Percent\"\n label=\"Pacific Islander VAP %%\" user_selectable=\"true\">\n <SubjectArgument name=\"numerator\" ref=\"vap_pi\" />\n <SubjectArgument name=\"denominator\" ref=\"vap\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_pivap_thresh\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Threshold\"\n label=\"Pacific Islander VAP Threshold\">\n <ScoreArgument name=\"value\" ref=\"district_pivap_percent\" />\n <Argument name=\"threshold\" value=\"0.5\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_wnhvap_percent\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Percent\"\n label=\"White VAP %%\" user_selectable=\"true\">\n <SubjectArgument name=\"numerator\" ref=\"vap_wnh\" />\n <SubjectArgument name=\"denominator\" ref=\"vap\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_wnhvap_thresh\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Threshold\"\n label=\"White VAP Threshold\">\n <ScoreArgument name=\"value\" ref=\"district_wnhvap_percent\" />\n <Argument name=\"threshold\" value=\"0.5\" />\n </ScoreFunction>\n %(start_elec)s\n <ScoreFunction id=\"district_vote\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Estimated votes\" user_selectable=\"true\">\n <SubjectArgument name=\"value1\" ref=\"vote_tot\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_vote_dem\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Estimated Democratic votes\" user_selectable=\"true\">\n <SubjectArgument name=\"value1\" ref=\"vote_dem\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_vote_rep\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Estimated votes\" user_selectable=\"true\">\n <SubjectArgument name=\"value1\" ref=\"vote_rep\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_vote_dem_percent\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Percent\"\n label=\"Democratic Predicted Vote %%\" user_selectable=\"true\">\n <SubjectArgument name=\"numerator\" ref=\"vote_dem\" />\n <SubjectArgument name=\"denominator\" ref=\"vote_tot\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_vote_dem_thresh\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Threshold\"\n label=\"Democratic Predicted Vote Threshold\">\n <ScoreArgument name=\"value\" ref=\"district_vote_dem_percent\" />\n <Argument name=\"threshold\" value=\"0.5\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_vote_rep_percent\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Percent\"\n label=\"Republican Predicted Vote %%\" user_selectable=\"true\">\n <SubjectArgument name=\"numerator\" ref=\"vote_rep\" />\n <SubjectArgument name=\"denominator\" ref=\"vote_tot\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_vote_rep_thresh\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Threshold\"\n label=\"Republican Predicted Vote Threshold\">\n <ScoreArgument name=\"value\" ref=\"district_vote_rep_percent\" />\n <Argument name=\"threshold\" value=\"0.5\" />\n </ScoreFunction>\n %(end_elec)s\n\n <!-- A district score that generates classes based on a couple\n ranges around a mean value. -->\n <ScoreFunction id=\"district_poptot_uitarget_congress\" type=\"district\" \n calculator=\"publicmapping.redistricting.calculators.Target\">\n <SubjectArgument name=\"value\" ref=\"totpop\" />\n <Argument name=\"target\" value=\"&pop_congress;\" />\n <Argument name=\"range1\" value=\"0.005\"/>\n <Argument name=\"range2\" value=\"0.010\"/>\n </ScoreFunction>\n <ScoreFunction id=\"district_poptot_uitarget_house\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Target\">\n <SubjectArgument name=\"value\" ref=\"totpop\" />\n <Argument name=\"target\" value=\"%(pop_house)s\" />\n <Argument name=\"range1\" value=\"0.05\" />\n <Argument name=\"range2\" value=\"0.10\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_poptot_uitarget_senate\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Target\">\n <SubjectArgument name=\"value\" ref=\"totpop\" />\n <Argument name=\"target\" value=\"%(pop_senate)s\" />\n <Argument name=\"range1\" value=\"0.05\" />\n <Argument name=\"range2\" value=\"0.10\" />\n </ScoreFunction>\n\n <!-- A district score that returns 1(T) if the subject value\n is between the ranges, otherwise returns 0(F). -->\n <ScoreFunction id=\"district_poptot_range\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Range\"\n label=\"Tot Pop Range\">\n <SubjectArgument name=\"value\" ref=\"totpop\" />\n <Argument name=\"min\" value=\"&pop_congress_min;\" />\n <Argument name=\"max\" value=\"&pop_congress_max;\" />\n </ScoreFunction>\n\n <!-- A district score that is threshold dependent, and returns \n T/F; this example uses 2 score functions: 1 to combine a \n set of subjects, and 2 to divide the sum over another \n subject. -->\n <ScoreFunction id=\"district_mintot\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Sum\">\n <SubjectArgument name=\"value1\" ref=\"totpop_b\" />\n <SubjectArgument name=\"value2\" ref=\"totpop_h\" />\n <SubjectArgument name=\"value3\" ref=\"totpop_na\" />\n </ScoreFunction>\n <ScoreFunction id=\"district_majmin\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.DivideAndThreshold\" >\n <ScoreArgument name=\"numerator\" ref=\"district_mintot\" />\n <SubjectArgument name=\"denominator\" ref=\"totpop\" />\n <Argument name=\"threshold\" value=\"0.5\" />\n </ScoreFunction>\n\n <!-- A custom calculator to calculate compactness, and return\n the raw compactness score. -->\n <ScoreFunction id=\"district_schwartzberg\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Schwartzberg\"\n label=\"Compactness\" user_selectable=\"true\">\n </ScoreFunction>\n \n <!-- A custom calculator to do contiguity, and is boolean. -->\n <ScoreFunction id=\"district_contiguous\" type=\"district\"\n calculator=\"publicmapping.redistricting.calculators.Contiguity\"\n label=\"Contiguous\" user_selectable=\"true\">\n </ScoreFunction>\n\n <!-- A plan score that aggregates all literal values -->\n <ScoreFunction id=\"plan_sum_equipop\" type=\"plan\" \n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Equal Population\">\n <ScoreArgument name=\"value1\" ref=\"district_poptot_range\" />\n </ScoreFunction>\n <ScoreFunction id=\"plan_all_equipop\" type=\"plan\" \n calculator=\"publicmapping.redistricting.calculators.Threshold\" >\n <ScoreArgument name=\"value\" ref=\"plan_sum_equipop\" />\n <Argument name=\"threshold\" value=\"0\" />\n </ScoreFunction>\n\n <!-- A plan score that aggregates all districts over a threshold -->\n <ScoreFunction id=\"plan_count_majmin\" type=\"plan\" \n calculator=\"publicmapping.redistricting.calculators.Sum\">\n <ScoreArgument name=\"value1\" ref=\"district_majmin\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"plan_blkvap_thresh\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Majority Black Districts\" user_selectable=\"true\">\n <ScoreArgument name=\"value1\" ref=\"district_blkvap_thresh\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"plan_hispvap_thresh\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Majority Hispanic Districts\" user_selectable=\"true\">\n <ScoreArgument name=\"value1\" ref=\"district_hispvap_thresh\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"plan_navap_thresh\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Majority Asian Districts\" user_selectable=\"true\">\n <ScoreArgument name=\"value1\" ref=\"district_navap_thresh\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"plan_avap_thresh\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Majority Asian Districts\" user_selectable=\"true\">\n <ScoreArgument name=\"value1\" ref=\"district_avap_thresh\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"plan_pivap_thresh\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Sum\">\n <ScoreArgument name=\"value1\" ref=\"district_pivap_thresh\" />\n </ScoreFunction>\n\n <!-- A plan score that evaluates a threshold, and returns T/F.\n This plan score checks that all districts are within the\n population limits. -->\n <ScoreFunction id=\"plan_poptot_inrange\" type=\"plan\" \n calculator=\"publicmapping.redistricting.calculators.Threshold\">\n <ScoreArgument name=\"value\" ref=\"district_poptot_range\" />\n <Argument name=\"threshold\" value=\"0\" />\n </ScoreFunction>\n \n <!-- A plan score that evaluates all districts, and returns\n 1(T) if there is more than 0 districts that have a minority\n majority. -->\n <ScoreFunction id=\"plan_major_minor\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Threshold\"\n label=\"Majority-Minority\">\n <ScoreArgument name=\"value\" ref=\"district_majmin\" />\n <Argument name=\"threshold\" value=\"0\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"plan_contiguous\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Sum\"\n label=\"Contiguous\">\n <ScoreArgument name=\"value1\" ref=\"district_contiguous\"/>\n </ScoreFunction>\n\n <ScoreFunction id=\"b_plan_congress_noncontiguous\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Contiguity\"\n label=\"Contiguous\">\n <Argument name=\"target\" value=\"&num_districts_congress;\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"b_plan_house_noncontiguous\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Contiguity\"\n label=\"Contiguous\">\n <Argument name=\"target\" value=\"&num_districts_house;\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"b_plan_senate_noncontiguous\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Contiguity\"\n label=\"Contiguous\">\n <Argument name=\"target\" value=\"&num_districts_senate;\" />\n </ScoreFunction>\n\n\n <!-- interval score function for population -->\n <ScoreFunction id=\"a_congressional_population\" type=\"district\"\n label=\"Tot Pop Range (Congress)\" user_selectable=\"true\"\n description=\"Population interval calculator for congressional.\"\n calculator=\"publicmapping.redistricting.calculators.Interval\">\n <SubjectArgument name=\"subject\" ref=\"totpop\" />\n <Argument name=\"target\" value=\"&pop_congress;\" />\n <Argument name=\"bound1\" value=\".005\" />\n <Argument name=\"bound2\" value=\".01\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"a_house_population\" type=\"district\"\n label=\"Tot Pop Range (House)\" user_selectable=\"true\"\n description=\"Population interval calculator for house.\"\n calculator=\"publicmapping.redistricting.calculators.Interval\">\n <SubjectArgument name=\"subject\" ref=\"totpop\" />\n <Argument name=\"target\" value=\"%(pop_house)s\" />\n <Argument name=\"bound1\" value=\".005\" />\n <Argument name=\"bound2\" value=\".01\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"a_senate_population\" type=\"district\"\n label=\"Tot Pop Range (Senate)\" user_selectable=\"true\"\n description=\"Population interval calculator for senate.\"\n calculator=\"publicmapping.redistricting.calculators.Interval\">\n <SubjectArgument name=\"subject\" ref=\"totpop\" />\n <Argument name=\"target\" value=\"%(pop_senate)s\" />\n <Argument name=\"bound1\" value=\".005\" />\n <Argument name=\"bound2\" value=\".01\" />\n </ScoreFunction>\n\n <!-- leaderboard functions -->\n <ScoreFunction id=\"a_congress_plan_count_districts\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.CountDistricts\"\n label=\"Count Districts\"\n description=\"The number of districts in a Congressional redistricting plan must be &num_districts_congress;.\">\n <Argument name=\"target\" value=\"&num_districts_congress;\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"a_house_plan_count_districts\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.CountDistricts\"\n label=\"Count Districts\"\n description=\"The number of districts in a House of Delegates redistricting plan must be &num_districts_house;.\">\n <Argument name=\"target\" value=\"&num_districts_house;\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"a_senate_plan_count_districts\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.CountDistricts\"\n label=\"Count Districts\"\n description=\"The number of districts in a State Senate redistricting plan must be &num_districts_senate;.\">\n <Argument name=\"target\" value=\"&num_districts_senate;\" />\n </ScoreFunction>\n\n\n <ScoreFunction id=\"a_congress_plan_equipopulation_validation\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Equipopulation\"\n label=\"Target Pop. &pop_congress;\"\n description=\"The population of each Congressional district must be &pop_congress_min;-&pop_congress_max;\">\n <Argument name=\"min\" value=\"&pop_congress_min;\"/>\n <Argument name=\"max\" value=\"&pop_congress_max;\"/>\n <SubjectArgument name=\"value\" ref=\"totpop\"/>\n <Argument name=\"validation\" value=\"1\"/>\n </ScoreFunction>\n\n <ScoreFunction id=\"a_congress_plan_equipopulation_summary\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Equipopulation\"\n label=\"Target Pop. &pop_congress;\"\n description=\"The population of each Congressional district must be &pop_congress_min;-&pop_congress_max;\">\n <Argument name=\"min\" value=\"&pop_congress_min;\"/>\n <Argument name=\"max\" value=\"&pop_congress_max;\"/>\n <SubjectArgument name=\"value\" ref=\"totpop\"/>\n\t\t<Argument name=\"target\" value=\"&num_districts_congress;\"/>\n </ScoreFunction>\n\n <ScoreFunction id=\"a_senate_plan_equipopulation_validation\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Equipopulation\"\n label=\"Target Pop. %(pop_senate)s\"\n description=\"The population of each Senate district must be &pop_senate_min;-&pop_senate_max;\">\n <Argument name=\"min\" value=\"&pop_senate_min;\"/>\n <Argument name=\"max\" value=\"&pop_senate_max;\"/>\n <SubjectArgument name=\"value\" ref=\"totpop\"/>\n <Argument name=\"validation\" value=\"1\"/>\n </ScoreFunction>\n\n <ScoreFunction id=\"a_senate_plan_equipopulation_summary\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Equipopulation\"\n label=\"Target Pop. %(pop_senate)s\"\n description=\"The population of each Senate district must be &pop_senate_min;-&pop_senate_max;\">\n <Argument name=\"min\" value=\"&pop_senate_min;\"/>\n <Argument name=\"max\" value=\"&pop_senate_max;\"/>\n <SubjectArgument name=\"value\" ref=\"totpop\"/>\n\t\t<Argument name=\"target\" value=\"&num_districts_senate;\"/>\n </ScoreFunction>\n\n <ScoreFunction id=\"a_house_plan_equipopulation_validation\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Equipopulation\"\n label=\"Target Pop. %(pop_house)s\"\n description=\"The population of each House district must be &pop_house_min;-&pop_house_max;\">\n <Argument name=\"min\" value=\"&pop_house_min;\"/>\n <Argument name=\"max\" value=\"&pop_house_max;\"/>\n <SubjectArgument name=\"value\" ref=\"totpop\"/>\n <Argument name=\"validation\" value=\"1\"/>\n </ScoreFunction>\n\n <ScoreFunction id=\"a_house_plan_equipopulation_summary\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Equipopulation\"\n label=\"Target Pop. %(pop_house)s\"\n description=\"The population of each House district must be &pop_house_min;-&pop_house_max;\">\n <Argument name=\"min\" value=\"&pop_house_min;\"/>\n <Argument name=\"max\" value=\"&pop_house_max;\"/>\n <SubjectArgument name=\"value\" ref=\"totpop\"/>\n\t\t<Argument name=\"target\" value=\"&num_districts_house;\"/>\n </ScoreFunction>\n\n <ScoreFunction id=\"plan_all_blocks_assigned\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.AllBlocksAssigned\"\n label=\"All Blocks Assigned\"\n description=\"All blocks in the plan must be assigned.\">\n </ScoreFunction>\n\n\n <ScoreFunction id=\"plan_all_contiguous\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.AllContiguous\"\n label=\"All Contiguous\"\n description=\"Contiguity means that every part of a district must be reachable from every other part without crossing the district&apos;s borders. All districts within a plan must be contiguous. Water contiguity is permitted. &apos;Point contiguity&apos; or &apos;touch-point contiguity&apos; where two sections of a district are connected at a single point is not permitted.\">\n </ScoreFunction>\n %(start_elec)s\n <ScoreFunction id=\"plan_competitiveness\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Competitiveness\"\n label=\"Competitiveness\"\n description=\"Each plan&apos;s overall political competitiveness is determined by averaging each district.s &apos;partisan differential&apos;. The partisan differential of each district is calculated by subtracting the Democratic &apos;partisan index&apos; from the Republican &apos;partisan index&apos;.&lt;br/&gt;&lt;br/&gt;&apos;Heavily&apos; competitive districts are districts with partisan differentials of less than or equal to 5%%. &apos;Generally&apos; competitive districts are districts with partisan differentials of greater than 5%% but less than 10%%.\">\n <SubjectArgument name=\"democratic\" ref=\"vote_dem\" />\n <SubjectArgument name=\"republican\" ref=\"vote_rep\" />\n </ScoreFunction>\n %(end_elec)s\n\n <ScoreFunction id=\"plan_equivalence\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Equivalence\"\n label=\"Equal Population\"\n description=\"The Equipopulation score is the difference between the district with the highest population and the district with the lowest population.\">\n <SubjectArgument name=\"value\" ref=\"totpop\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"plan_majority_minority_blk_congress\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.MajorityMinority\"\n label=\"Black VAP Majority (&gt; 50%%)\"\n description=\"Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.\">\n <SubjectArgument name=\"population\" ref=\"vap\" />\n <SubjectArgument name=\"minority1\" ref=\"vap_b\" />\n <Argument name=\"target\" value=\"&target_bl_congress;\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"plan_majority_minority_blk_house\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.MajorityMinority\"\n label=\"Black VAP Majority (&gt; 50%%)\"\n description=\"Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.\">\n <SubjectArgument name=\"population\" ref=\"vap\" />\n <SubjectArgument name=\"minority1\" ref=\"vap_b\" />\n <Argument name=\"target\" value=\"&target_bl_house;\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"plan_majority_minority_blk_senate\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.MajorityMinority\"\n label=\"Black VAP Majority (&gt; 50%%)\"\n description=\"Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.\">\n <SubjectArgument name=\"population\" ref=\"vap\" />\n <SubjectArgument name=\"minority1\" ref=\"vap_b\" />\n <Argument name=\"target\" value=\"&target_bl_senate;\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"plan_majority_minority_hisp_congress\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.MajorityMinority\"\n label=\"Hisp. VAP Majority (&gt; 50%%)\"\n description=\"Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.\">\n <SubjectArgument name=\"population\" ref=\"vap\" />\n <SubjectArgument name=\"minority1\" ref=\"vap_h\" />\n <Argument name=\"target\" value=\"&target_hisp_congress;\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"plan_majority_minority_hisp_house\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.MajorityMinority\"\n label=\"Hisp. VAP Majority (&gt; 50%%)\"\n description=\"Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.\">\n <SubjectArgument name=\"population\" ref=\"vap\" />\n <SubjectArgument name=\"minority1\" ref=\"vap_h\" />\n <Argument name=\"target\" value=\"&target_hisp_house;\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"plan_majority_minority_hisp_senate\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.MajorityMinority\"\n label=\"Hisp. VAP Majority (&gt; 50%%)\"\n description=\"Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.\">\n <SubjectArgument name=\"population\" ref=\"vap\" />\n <SubjectArgument name=\"minority1\" ref=\"vap_h\" />\n <Argument name=\"target\" value=\"&target_hisp_senate;\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"plan_majority_minority_na_congress\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.MajorityMinority\"\n label=\"Native American Majority (&gt; 50%%)\"\n description=\"Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.\">\n <SubjectArgument name=\"population\" ref=\"vap\" />\n <SubjectArgument name=\"minority1\" ref=\"vap_na\" />\n <Argument name=\"target\" value=\"&target_na_congress;\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"plan_majority_minority_na_house\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.MajorityMinority\"\n label=\"Native American Majority (&gt; 50%%)\"\n description=\"Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.\">\n <SubjectArgument name=\"population\" ref=\"vap\" />\n <SubjectArgument name=\"minority1\" ref=\"vap_na\" />\n <Argument name=\"target\" value=\"&target_na_house;\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"plan_majority_minority_na_senate\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.MajorityMinority\"\n label=\"Native American Majority (&gt; 50%%)\"\n description=\"Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.\">\n <SubjectArgument name=\"population\" ref=\"vap\" />\n <SubjectArgument name=\"minority1\" ref=\"vap_na\" />\n <Argument name=\"target\" value=\"&target_na_senate;\" />\n </ScoreFunction>\n\n <ScoreFunction id=\"plan_majority_minority\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.MajorityMinority\"\n label=\"Majority Minority District\"\n description=\"Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.\">\n <SubjectArgument name=\"population\" ref=\"vap\" />\n <SubjectArgument name=\"minority1\" ref=\"vap_b\" />\n <SubjectArgument name=\"minority2\" ref=\"vap_h\" />\n <SubjectArgument name=\"minority3\" ref=\"vap_na\" />\n <Argument name=\"validation\" value=\"1\" />\n </ScoreFunction>\n\n %(start_elec)s\n <ScoreFunction id=\"plan_repfairness\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.RepresentationalFairness\"\n label=\"Representational Fairness\"\n description=\"Representational fairness is increased when the percentage of districts a party would likely win (based upon the &apos;partisan index&apos; used to determine Competitiveness) closely mirrors that party.s percentage of the statewide vote.\" >\n <Argument name=\"range\" value=\"0.05\" />\n <SubjectArgument name=\"normalized democratic\" ref=\"vote_dem_norm\" />\n <SubjectArgument name=\"normalized republican\" ref=\"vote_rep_norm\" />\n </ScoreFunction>\n %(end_elec)s\n\n <ScoreFunction id=\"plan_schwartzberg\" type=\"plan\"\n calculator=\"publicmapping.redistricting.calculators.Schwartzberg\"\n label=\"Average Compactness\"\n description=\"The competition is using the &apos;Schwartzberg&apos; compactness measure. This measure is a ratio of the perimeter of the district to the circumference of the circle whose area is equal to the area of the district.\" >\n </ScoreFunction>\n\n </ScoreFunctions>\n \n <ScorePanels>\n <ScorePanel id=\"panel_equipop_all\" type=\"plan\" position=\"1\"\n title=\"Equipopulation\" template=\"leaderboard_panel_all.html\">\n <Score ref=\"plan_equivalence\" />\n </ScorePanel>\n <ScorePanel id=\"panel_equipop_mine\" type=\"plan\" position=\"1\"\n title=\"Equipopulation\" template=\"leaderboard_panel_mine.html\">\n <Score ref=\"plan_equivalence\" />\n </ScorePanel>\n <ScorePanel id=\"panel_compact_all\" type=\"plan\" position=\"2\"\n title=\"Schwartzberg\" template=\"leaderboard_panel_all.html\">\n <Score ref=\"plan_schwartzberg\" />\n </ScorePanel>\n <ScorePanel id=\"panel_compact_mine\" type=\"plan\" position=\"2\"\n title=\"Schwartzberg\" template=\"leaderboard_panel_mine.html\">\n <Score ref=\"plan_schwartzberg\" />\n </ScorePanel>\n %(start_elec)s\n <ScorePanel id=\"panel_competitive_all\" type=\"plan\" position=\"3\"\n title=\"Competitiveness\" template=\"leaderboard_panel_all.html\">\n <Score ref=\"plan_competitiveness\" />\n </ScorePanel>\n <ScorePanel id=\"panel_competitive_mine\" type=\"plan\" position=\"3\"\n title=\"Competitiveness\" template=\"leaderboard_panel_mine.html\">\n <Score ref=\"plan_competitiveness\" />\n </ScorePanel>\n <ScorePanel id=\"panel_rf_all\" type=\"plan\" position=\"4\"\n title=\"Representational Fairness\" template=\"leaderboard_panel_all.html\">\n <Score ref=\"plan_repfairness\" />\n </ScorePanel>\n <ScorePanel id=\"panel_rf_mine\" type=\"plan\" position=\"4\"\n title=\"Representational Fairness\" template=\"leaderboard_panel_mine.html\">\n <Score ref=\"plan_repfairness\" />\n </ScorePanel>\n %(end_elec)s\n\n <!-- Summary above all sidebar panels -->\n <ScorePanel id=\"congressional_panel_summary\" type=\"plan_summary\" position=\"1\"\n title=\"Plan Summary\" cssclass=\"plan_summary congressional\" template=\"plan_summary.html\">\n\t <Score ref=\"a_congress_plan_equipopulation_summary\"/>\n <Score ref=\"b_plan_congress_noncontiguous\"/>\n <Score ref=\"plan_majority_minority_blk_congress\" />\n <Score ref=\"plan_majority_minority_hisp_congress\" />\n\t\t%(start_na)s\n <Score ref=\"plan_majority_minority_na_congress\" />\n\t\t%(end_na)s\n </ScorePanel>\n\n <ScorePanel id=\"house_panel_summary\" type=\"plan_summary\" position=\"1\"\n title=\"Plan Summary\" cssclass=\"plan_summary house\" template=\"plan_summary.html\">\n\t <Score ref=\"a_house_plan_equipopulation_summary\"/>\n <Score ref=\"b_plan_house_noncontiguous\"/>\n <Score ref=\"plan_majority_minority_blk_house\" />\n <Score ref=\"plan_majority_minority_hisp_house\" />\n\t\t%(start_na)s\n <Score ref=\"plan_majority_minority_na_house\" />\n\t\t%(end_na)s\n </ScorePanel>\n\n <ScorePanel id=\"senate_panel_summary\" type=\"plan_summary\" position=\"1\"\n title=\"Plan Summary\" cssclass=\"plan_summary senate\" template=\"plan_summary.html\">\n\t <Score ref=\"a_senate_plan_equipopulation_summary\"/>\n <Score ref=\"b_plan_senate_noncontiguous\"/>\n <Score ref=\"a_senate_plan_count_districts\" />\n <Score ref=\"plan_majority_minority_blk_senate\" />\n <Score ref=\"plan_majority_minority_hisp_senate\" />\n\t\t%(start_na)s\n <Score ref=\"plan_majority_minority_na_senate\" />\n\t\t%(end_na)s\n </ScorePanel>\n\n <!-- Basic Information -->\n <ScorePanel id=\"congresional_panel_info\" type=\"district\" position=\"2\"\n title=\"Basic Information\" cssclass=\"district_basic_info congressional\" \n template=\"basic_information.html\">\n <Score ref=\"a_congressional_population\" />\n <Score ref=\"district_contiguous\" />\n <Score ref=\"district_schwartzberg\" />\n </ScorePanel>\n\n <ScorePanel id=\"house_panel_info\" type=\"district\" position=\"2\"\n title=\"Basic Information\" cssclass=\"district_basic_info house\" \n template=\"basic_information.html\">\n <Score ref=\"a_house_population\" />\n <Score ref=\"district_contiguous\" />\n <Score ref=\"district_schwartzberg\" />\n </ScorePanel>\n \n <ScorePanel id=\"senate_panel_info\" type=\"district\" position=\"2\"\n title=\"Basic Information\" cssclass=\"district_basic_info senate\" \n template=\"basic_information.html\">\n <Score ref=\"a_senate_population\" />\n <Score ref=\"district_contiguous\" />\n <Score ref=\"district_schwartzberg\" />\n </ScorePanel>\n \n <!-- Demographics -->\n <ScorePanel id=\"congressional_panel_demo\" type=\"district\" position=\"2\"\n title=\"Demographics\" cssclass=\"district_demographics congressional\" \n template=\"demographics.html\">\n %(start_elec)s\n <Score ref=\"district_vote_dem_percent\" />\n %(end_elec)s\n <Score ref=\"district_blkvap_percent\" />\n <Score ref=\"district_hispvap_percent\" />\n </ScorePanel>\n\n <ScorePanel id=\"house_panel_demo\" type=\"district\" position=\"2\"\n title=\"Demographics\" cssclass=\"district_demographics house\" \n template=\"demographics.html\">\n %(start_elec)s\n <Score ref=\"district_vote_dem_percent\" />\n %(end_elec)s\n <Score ref=\"district_blkvap_percent\" />\n <Score ref=\"district_hispvap_percent\" />\n </ScorePanel>\n\n <ScorePanel id=\"senate_panel_demo\" type=\"district\" position=\"2\"\n title=\"Demographics\" cssclass=\"district_demographics senate\" \n template=\"demographics.html\">\n %(start_elec)s\n <Score ref=\"district_vote_dem_percent\" />\n %(end_elec)s\n <Score ref=\"district_blkvap_percent\" />\n <Score ref=\"district_hispvap_percent\" />\n </ScorePanel>\n\n\t <!-- Needed due to issue https://sourceforge.net/apps/trac/publicmapping/ticket/340 Delete after setup -->\n\t\t<ScorePanel id=\"stats_picker\" type=\"district\" position=\"1\" title=\"Stats Picker\" cssclass=\"hidden\" template=\"demographics.html\">\n\t\t\t<Score ref=\"district_poptot\"/>\n\t\t\t<Score ref=\"district_totpop_b\"/>\n\t\t\t<Score ref=\"district_totpop_h\"/>\n\t\t\t<Score ref=\"district_totpop_a\"/>\n\t\t\t<Score ref=\"district_totpop_na\"/>\n\t\t\t<Score ref=\"district_totpop_pi\"/>\n\t\t\t<Score ref=\"district_totpop_wnh\"/>\n\t\t\t<Score ref=\"district_vap\"/>\n\t\t\t<Score ref=\"district_vap_b\"/>\n\t\t\t<Score ref=\"district_vap_h\"/>\n\t\t\t<Score ref=\"district_vap_a\"/>\n\t\t\t<Score ref=\"district_vap_na\"/>\n\t\t\t<Score ref=\"district_vap_pi\"/>\n\t\t\t<Score ref=\"district_vap_wnh\"/>\n\t\t\t<Score ref=\"district_blkvap_percent\"/>\n\t\t\t<Score ref=\"district_hispvap_percent\"/>\n\t\t\t<Score ref=\"district_avap_percent\"/>\n\t\t\t<Score ref=\"district_navap_percent\"/>\n\t\t\t<Score ref=\"district_pivap_percent\"/>\n\t\t\t<Score ref=\"district_wnhvap_percent\"/>\n \t%(start_elec)s\n\t\t\t<Score ref=\"district_vote\"/>\n\t\t\t<Score ref=\"district_vote_dem\"/>\n\t\t\t<Score ref=\"district_vote_rep\"/>\n\t\t\t<Score ref=\"district_vote_dem_percent\"/>\n\t\t\t<Score ref=\"district_vote_rep_percent\"/>\n \t%(end_elec)s\n\t\t</ScorePanel>\n </ScorePanels>\n \n <ScoreDisplays>\n <ScoreDisplay legislativebodyref=\"congress\" type=\"leaderboard\" \n title=\"Congressional Leaderboard - All\" cssclass=\"leaderboard congress\">\n <ScorePanel ref=\"panel_equipop_all\" />\n <ScorePanel ref=\"panel_compact_all\" />\n %(start_elec)s\n <ScorePanel ref=\"panel_competitive_all\" />\n <ScorePanel ref=\"panel_rf_all\" />\n %(end_elec)s\n </ScoreDisplay>\n <ScoreDisplay legislativebodyref=\"congress\" type=\"leaderboard\" \n title=\"Congressional Leaderboard - Mine\" cssclass=\"leaderboard congress\">\n <ScorePanel ref=\"panel_equipop_mine\" />\n <ScorePanel ref=\"panel_compact_mine\" />\n %(start_elec)s\n <ScorePanel ref=\"panel_competitive_all\" />\n <ScorePanel ref=\"panel_rf_mine\" />\n %(end_elec)s\n </ScoreDisplay>\n <ScoreDisplay legislativebodyref=\"house\" type=\"leaderboard\" \n title=\"State House Leaderboard - All\" cssclass=\"leaderboard house\">\n <ScorePanel ref=\"panel_equipop_all\" />\n <ScorePanel ref=\"panel_compact_all\" />\n %(start_elec)s\n <ScorePanel ref=\"panel_competitive_all\" />\n <ScorePanel ref=\"panel_rf_all\" />\n %(end_elec)s\n </ScoreDisplay>\n <ScoreDisplay legislativebodyref=\"house\" type=\"leaderboard\" \n title=\"State House Leaderboard - Mine\" cssclass=\"leaderboard house\">\n <ScorePanel ref=\"panel_equipop_mine\" />\n <ScorePanel ref=\"panel_compact_mine\" />\n %(start_elec)s\n <ScorePanel ref=\"panel_competitive_mine\" />\n <ScorePanel ref=\"panel_rf_mine\" />\n %(end_elec)s\n </ScoreDisplay>\n <ScoreDisplay legislativebodyref=\"senate\" type=\"leaderboard\" \n title=\"State Senate Leaderboard - All\" cssclass=\"leaderboard senate\">\n <ScorePanel ref=\"panel_equipop_all\" />\n <ScorePanel ref=\"panel_compact_all\" />\n %(start_elec)s\n <ScorePanel ref=\"panel_competitive_all\" />\n <ScorePanel ref=\"panel_rf_all\" />\n %(end_elec)s\n </ScoreDisplay>\n <ScoreDisplay legislativebodyref=\"senate\" type=\"leaderboard\" \n title=\"State Senate Leaderboard - Mine\" cssclass=\"leaderboard senate\">\n <ScorePanel ref=\"panel_equipop_mine\" />\n <ScorePanel ref=\"panel_compact_mine\" />\n %(start_elec)s\n <ScorePanel ref=\"panel_competitive_mine\" />\n <ScorePanel ref=\"panel_rf_mine\" />\n %(end_elec)s\n </ScoreDisplay>\n\n <!-- Sidebar configuration -->\n <ScoreDisplay legislativebodyref=\"congress\" type=\"sidebar\" title=\"Basic Information\" cssclass=\"basic_information\">\n <ScorePanel ref=\"congressional_panel_summary\" />\n <ScorePanel ref=\"congresional_panel_info\" />\n </ScoreDisplay>\n\n <ScoreDisplay legislativebodyref=\"congress\" type=\"sidebar\" title=\"Demographics\" cssclass=\"demographics\">\n <ScorePanel ref=\"congressional_panel_summary\" />\n <ScorePanel ref=\"congressional_panel_demo\" />\n </ScoreDisplay>\n\n <ScoreDisplay legislativebodyref=\"house\" type=\"sidebar\" title=\"Basic Information\" cssclass=\"basic_information\">\n <ScorePanel ref=\"house_panel_summary\" />\n <ScorePanel ref=\"house_panel_info\" />\n </ScoreDisplay>\n\n <ScoreDisplay legislativebodyref=\"house\" type=\"sidebar\" title=\"Demographics\" cssclass=\"demographics\">\n <ScorePanel ref=\"house_panel_summary\" />\n <ScorePanel ref=\"house_panel_demo\" />\n </ScoreDisplay>\n\n <ScoreDisplay legislativebodyref=\"senate\" type=\"sidebar\" title=\"Basic Information\" cssclass=\"basic_information\">\n <ScorePanel ref=\"senate_panel_summary\" />\n <ScorePanel ref=\"senate_panel_info\" />\n </ScoreDisplay>\n\n <ScoreDisplay legislativebodyref=\"senate\" type=\"sidebar\" title=\"Demographics\" cssclass=\"demographics\">\n <ScorePanel ref=\"senate_panel_summary\" />\n <ScorePanel ref=\"senate_panel_demo\" />\n </ScoreDisplay>\n\n<!-- Needed due to issue https://sourceforge.net/apps/trac/publicmapping/ticket/340 Delete after setup -->\n\t<ScoreDisplay legislativebodyref=\"congress\" type=\"sidebar\" title=\"All Stats\" cssclass=\"hidden\"><ScorePanel ref=\"stats_picker\"/></ScoreDisplay>\n </ScoreDisplays>\n </Scoring>\n\n\n <Validation>\n <Criteria legislativebodyref=\"congress\">\n <Criterion name=\"Equipopulation - Congress\" description=\"&lt;p&gt;Your plan does not meet the competition criteria for Equipopulation:&lt;/p&gt;&lt;p&gt; The population of each Congressional district must be &pop_congress_max;-&pop_congress_min;\"> \n <Score ref=\"a_congress_plan_equipopulation_validation\" />\n </Criterion>\n <Criterion name=\"AllContiguous - Congress\" \n description=\"&lt;p&gt;Your plan does not meet the competition criteria for Contiguity&lt;/p&gt;&lt;p&gt;Every part of a district must be reachable from every other part without crossing the district's borders. All districts within a plan must be contiguous. &lt;/p&gt;\">\n <Score ref=\"plan_all_contiguous\" />\n </Criterion>\n <Criterion name=\"MajorityMinority - Congress\" description=\"\">\n <Score ref=\"plan_majority_minority\" />\n </Criterion>\n <Criterion name=\"CountDistricts - Congress\" description=\"\">\n <Score ref=\"a_congress_plan_count_districts\" />\n </Criterion>\n <Criterion name=\"AllBlocksAssigned - Congress\" description=\"\">\n <Score ref=\"plan_all_blocks_assigned\" />\n </Criterion>\n </Criteria>\n <Criteria legislativebodyref=\"house\">\n <Criterion name=\"Equipopulation - House\" description=\"&lt;p&gt;Your plan does not meet the competition criteria for Equipopulation:&lt;/p&gt;&lt;p&gt;The population of each House of Delegates district must be &pop_house_min; - &pop_house_max;\"> \n <Score ref=\"a_house_plan_equipopulation_validation\" />\n </Criterion>\n <Criterion name=\"AllContiguous - House\" \n description=\"&lt;p&gt;Your plan does not meet the competition criteria for Contiguity&lt;/p&gt;&lt;p&gt;Every part of a district must be reachable from every other part without crossing the district's borders. All districts within a plan must be contiguous. &lt;/p&gt;\">\n <Score ref=\"plan_all_contiguous\" />\n </Criterion>\n <Criterion name=\"MajorityMinority - House\" description=\"\">\n <Score ref=\"plan_majority_minority\" />\n </Criterion>\n <Criterion name=\"CountDistricts - House\" description=\"\">\n <Score ref=\"a_house_plan_count_districts\" />\n </Criterion>\n <Criterion name=\"AllBlocksAssigned - House\" description=\"\">\n <Score ref=\"plan_all_blocks_assigned\" />\n </Criterion>\n </Criteria>\n <Criteria legislativebodyref=\"senate\">\n <Criterion name=\"Equipopulation - Senate\" description=\"&lt;p&gt;Your plan does not meet the competition criteria for Equipopulation:&lt;/p&gt;&lt;p&gt;The population of each State Senate district must be &pop_house_min;-&pop_house_max;\">\n <Score ref=\"a_senate_plan_equipopulation_validation\" />\n </Criterion>\n <Criterion name=\"AllContiguous - Senate\" \n description=\"&lt;p&gt;Your plan does not meet the competition criteria for Contiguity&lt;/p&gt;&lt;p&gt;Every part of a district must be reachable from every other part without crossing the district's borders. All districts within a plan must be contiguous. &lt;/p&gt;\">\n <Score ref=\"plan_all_contiguous\" />\n </Criterion>\n <Criterion name=\"MajorityMinority - Senate\" description=\"\">\n <Score ref=\"plan_majority_minority\" />\n </Criterion>\n <Criterion name=\"CountDistricts - Senate\" description=\"\">\n <Score ref=\"a_senate_plan_count_districts\" />\n </Criterion>\n <Criterion name=\"AllBlocksAssigned - Senate\" description=\"\">\n <Score ref=\"plan_all_blocks_assigned\" />\n </Criterion>\n </Criteria>\n </Validation>\n\n <!--\n Optional configuration for geounits that require special contiguity rules.\n 'id' is the portable id of the geounit in which to configure an override.\n 'connect_to' is the portable id of the geounit in which the geounit is\n to be considered contiguous with. Tests for contiguity will apply these overrides\n in order to account for contiguity when physical contiguity is not possible.\n For example, an island may need to be marked contiguous with one or more geounits\n on an adjacent coast (possibly containing harbors). \n <ContiguityOverrides>\n <ContiguityOverride id=\"510030112012077\" connect_to=\"510030102011065\" />\n <ContiguityOverride id=\"510030112012077\" connect_to=\"510030103003037\" />\n </ContiguityOverrides>\n -->\n\n\t<!-- Contiguity Overrides, if Any -->\n\t%(contiguityOverrideString)s\n\n <GeoLevels>\n <GeoLevel id=\"block\" name=\"block\" min_zoom=\"6\" sort_key=\"3\" tolerance=\"2.5\">\n\n <Shapefile path=\"/projects/PublicMapping/data/census_blocks.shp\">\n <Fields>\n\n <Field name=\"NAME10\" type=\"name\"/>\n <Field name=\"GEOID10\" type=\"portable\"/>\n <Field name=\"STATEFP10\" type=\"tree\" pos=\"0\" width=\"2\"/>\n <Field name=\"COUNTYFP10\" type=\"tree\" pos=\"1\" width=\"3\"/>\n <Field name=\"TRACTCE10\" type=\"tree\" pos=\"2\" width=\"6\"/>\n <Field name=\"BLOCKCE10\" type=\"tree\" pos=\"3\" width=\"4\"/>\n </Fields>\n </Shapefile>\n \n <GeoLevelCharacteristics>\n <GeoLevelCharacteristic ref=\"totpop\" />\n <GeoLevelCharacteristic ref=\"vap\" />\n <GeoLevelCharacteristic ref=\"vap_b\" />\n <GeoLevelCharacteristic ref=\"vap_h\" />\n <GeoLevelCharacteristic ref=\"vap_na\" />\n <GeoLevelCharacteristic ref=\"vap_wnh\" />\n <GeoLevelCharacteristic ref=\"vap_pi\" />\n <GeoLevelCharacteristic ref=\"vap_a\" />\n <GeoLevelCharacteristic ref=\"totpop_wnh\" />\n <GeoLevelCharacteristic ref=\"totpop_pi\" />\n <GeoLevelCharacteristic ref=\"totpop_a\" />\n <GeoLevelCharacteristic ref=\"totpop_b\" />\n <GeoLevelCharacteristic ref=\"totpop_h\" />\n <GeoLevelCharacteristic ref=\"totpop_na\" />\n %(start_elec)s\n <GeoLevelCharacteristic ref=\"vote_dem\" />\n <GeoLevelCharacteristic ref=\"vote_rep\" />\n <GeoLevelCharacteristic ref=\"vote_tot\" />\n <GeoLevelCharacteristic ref=\"vote_dem_norm\" />\n <GeoLevelCharacteristic ref=\"vote_rep_norm\" />\n <GeoLevelCharacteristic ref=\"vote_tot_norm\" />\n %(end_elec)s\n </GeoLevelCharacteristics>\n <LegislativeBodies>\n <LegislativeBody ref=\"congress\">\n <LegislativeTargets>\n <LegislativeTarget ref=\"congress_target\" default=\"true\" />\n </LegislativeTargets>\n </LegislativeBody>\n <LegislativeBody ref=\"house\">\n <LegislativeTargets>\n <LegislativeTarget ref=\"house_target\" default=\"true\" />\n </LegislativeTargets>\n </LegislativeBody>\n <LegislativeBody ref=\"senate\">\n <LegislativeTargets>\n <LegislativeTarget ref=\"senate_target\" default=\"true\" />\n </LegislativeTargets>\n </LegislativeBody>\n </LegislativeBodies>\n\n </GeoLevel>\n <GeoLevel id=\"tract\" name=\"tract\" min_zoom=\"3\" sort_key=\"2\" tolerance=\"25\">\n <Files>\n <Geography path=\"/projects/PublicMapping/data/census_tracts.shp\">\n <Fields>\n <Field name=\"NAME10\" type=\"name\" />\n <Field name=\"GEOID10\" type=\"portable\" />\n <Field name=\"STATEFP10\" type=\"tree\" pos=\"0\" width=\"2\"/>\n <Field name=\"COUNTYFP10\" type=\"tree\" pos=\"1\" width=\"3\"/>\n <Field name=\"TRACTCE10\" type=\"tree\" pos=\"2\" width=\"6\"/>\n </Fields>\n </Geography>\n </Files>\n <GeoLevelCharacteristics>\n <GeoLevelCharacteristic ref=\"totpop\" />\n <GeoLevelCharacteristic ref=\"vap\" />\n <GeoLevelCharacteristic ref=\"vap_b\" />\n <GeoLevelCharacteristic ref=\"vap_h\" />\n <GeoLevelCharacteristic ref=\"vap_na\" />\n <GeoLevelCharacteristic ref=\"vap_wnh\" />\n <GeoLevelCharacteristic ref=\"vap_pi\" />\n <GeoLevelCharacteristic ref=\"vap_a\" />\n <GeoLevelCharacteristic ref=\"totpop_wnh\" />\n <GeoLevelCharacteristic ref=\"totpop_pi\" />\n <GeoLevelCharacteristic ref=\"totpop_a\" />\n <GeoLevelCharacteristic ref=\"totpop_b\" />\n <GeoLevelCharacteristic ref=\"totpop_h\" />\n <GeoLevelCharacteristic ref=\"totpop_na\" />\n %(start_elec)s\n <GeoLevelCharacteristic ref=\"vote_dem\" />\n <GeoLevelCharacteristic ref=\"vote_rep\" />\n <GeoLevelCharacteristic ref=\"vote_tot\" />\n <GeoLevelCharacteristic ref=\"vote_dem_norm\" />\n <GeoLevelCharacteristic ref=\"vote_rep_norm\" />\n <GeoLevelCharacteristic ref=\"vote_tot_norm\" />\n %(end_elec)s\n </GeoLevelCharacteristics>\n <LegislativeBodies>\n <LegislativeBody ref=\"congress\">\n <Parent ref=\"block\" />\n <LegislativeTargets>\n <LegislativeTarget ref=\"congress_target\" default=\"true\" />\n </LegislativeTargets>\n </LegislativeBody>\n <LegislativeBody ref=\"house\">\n <Parent ref=\"block\" />\n <LegislativeTargets>\n <LegislativeTarget ref=\"house_target\" default=\"true\" />\n </LegislativeTargets>\n </LegislativeBody>\n <LegislativeBody ref=\"senate\">\n <Parent ref=\"block\" />\n <LegislativeTargets>\n <LegislativeTarget ref=\"senate_target\" default=\"true\" />\n </LegislativeTargets>\n </LegislativeBody>\n </LegislativeBodies>\n\n </GeoLevel>\n\n <GeoLevel id=\"county\" name=\"county\" min_zoom=\"0\" sort_key=\"1\" tolerance=\"250\">\n <Files>\n <Geography path=\"/projects/PublicMapping/data/census_counties.shp\">\n <Fields>\n <Field name=\"NAME10\" type=\"name\"/>\n <Field name=\"GEOID10\" type=\"portable\"/>\n <Field name=\"STATEFP10\" type=\"tree\" pos=\"0\" width=\"2\"/>\n <Field name=\"COUNTYFP10\" type=\"tree\" pos=\"1\" width=\"3\"/>\n </Fields>\n </Geography>\n </Files>\n <GeoLevelCharacteristics>\n <GeoLevelCharacteristic ref=\"totpop\" />\n <GeoLevelCharacteristic ref=\"vap\" />\n <GeoLevelCharacteristic ref=\"vap_b\" />\n <GeoLevelCharacteristic ref=\"vap_h\" />\n <GeoLevelCharacteristic ref=\"vap_na\" />\n <GeoLevelCharacteristic ref=\"vap_wnh\" />\n <GeoLevelCharacteristic ref=\"vap_pi\" />\n <GeoLevelCharacteristic ref=\"vap_a\" />\n <GeoLevelCharacteristic ref=\"totpop_wnh\" />\n <GeoLevelCharacteristic ref=\"totpop_pi\" />\n <GeoLevelCharacteristic ref=\"totpop_a\" />\n <GeoLevelCharacteristic ref=\"totpop_b\" />\n <GeoLevelCharacteristic ref=\"totpop_h\" />\n <GeoLevelCharacteristic ref=\"totpop_na\" />\n %(start_elec)s\n <GeoLevelCharacteristic ref=\"vote_dem\" />\n <GeoLevelCharacteristic ref=\"vote_rep\" />\n <GeoLevelCharacteristic ref=\"vote_tot\" />\n <GeoLevelCharacteristic ref=\"vote_dem_norm\" />\n <GeoLevelCharacteristic ref=\"vote_rep_norm\" />\n <GeoLevelCharacteristic ref=\"vote_tot_norm\" />\n %(end_elec)s\n </GeoLevelCharacteristics>\n <LegislativeBodies>\n <LegislativeBody ref=\"congress\">\n <Parent ref=\"tract\" />\n <LegislativeTargets>\n <LegislativeTarget ref=\"congress_target\" default=\"true\" />\n </LegislativeTargets>\n </LegislativeBody>\n <LegislativeBody ref=\"house\">\n <Parent ref=\"tract\" />\n <LegislativeTargets>\n <LegislativeTarget ref=\"house_target\" default=\"true\" />\n </LegislativeTargets>\n </LegislativeBody>\n <LegislativeBody ref=\"senate\">\n <Parent ref=\"tract\" />\n <LegislativeTargets>\n <LegislativeTarget ref=\"senate_target\" default=\"true\" />\n </LegislativeTargets>\n </LegislativeBody>\n </LegislativeBodies>\n </GeoLevel>\n </GeoLevels>\n\n <Templates>\n <Template name=\"Congressional\">\n <LegislativeBody ref=\"congress\"/>\n <Blockfile path=\"/projects/PublicMapping/data/congress_generated_index.csv\" />\n </Template>\n <Template name=\"State House\">\n <LegislativeBody ref=\"house\"/>\n <Blockfile path=\"/projects/PublicMapping/data/house_generated_index.csv\" />\n </Template>\n <Template name=\"State Senate\">\n <LegislativeBody ref=\"senate\"/>\n <Blockfile path=\"/projects/PublicMapping/data/senate_generated_index.csv\" />\n </Template>\n </Templates>\n\n <Project root=\"/projects/PublicMapping/DistrictBuilder\" sessionquota=\"5\" \n sessiontimeout=\"15\">\n <!-- Database connection information. -->\n <Database name=\"publicmapping\" user=\"publicmapping\" password=\"publicmapping\"/>\n \n <!-- \n \n Administrative user information. This should match the admin\n user created when the django project is created.\n \n -->\n <Admin user=\"admin\" email=\"[email protected]\" password=\"admin\"/>\n \n <!-- Configuration items specific to the 'redistricting' app. -->\n <Redistricting> \n\t <MapServer hostname=\"\" ns=\"pmp\" nshref=\"http://publicmapping.sourceforge.net/\"\n adminuser=\"admin\" adminpass=\"admin\" maxfeatures=\"100\" \n styles=\"/projects/PublicMapping/DistrictBuilder/sld\" />\n <!-- \n \n Use a GoogleAnalytics account to tract the usage of the \n application. This requires an account and domain.\n <GoogleAnalytics account=\"\" domain=\"\"/>\n \n -->\n <!-- Upload file size restrictions. This is in KB -->\n <Upload maxsize=\"2500\"/>\n <!-- Undo restrictions -->\n <MaxUndos duringedit=\"50\" afteredit=\"10\" />\n <!-- Leaderboard configuration -->\n <Leaderboard maxranked=\"10\" />\n </Redistricting>\n <Reporting>\n <BardConfigs>\n \t\t <BardConfig \n id=\"blocks\"\n shape=\"/projects/PublicMapping/data/census_configured.Rdata\" \n temp=\"/projects/PublicMapping/local/reports\"\n transform=\"/projects/PublicMapping/DistrictBuilder/docs/bard_template.xslt\">\n <PopVars>\n <PopVar subjectref=\"totpop\" threshold=\".01\" default=\"true\" />\n <PopVar subjectref=\"vap\" threshold=\".1\" />\n </PopVars>\n <RatioVars>\n <!--\n \n Set up RatioVars for both ethnicity and political \n party.\n \n -->\n <RatioVar id=\"racialComp\" label=\"Majority Minority Districts\" threshold=\".5\">\n <Numerators>\n <Numerator subjectref=\"totpop_b\" />\n <Numerator subjectref=\"totpop_h\" />\n <Numerator subjectref=\"totpop_na\" />\n <Numerator subjectref=\"totpop_a\" />\n <Numerator subjectref=\"totpop_pi\" />\n <Numerator subjectref=\"totpop_wnh\" />\n </Numerators>\n <Denominator subjectref=\"totpop\" />\n </RatioVar>\n <RatioVar id=\"racialCompVap\" label=\"Majority Minority Districts\" threshold=\".5\">\n <Numerators>\n <Numerator subjectref=\"vap_b\" />\n <Numerator subjectref=\"vap_h\" />\n <Numerator subjectref=\"vap_na\" />\n <Numerator subjectref=\"vap_a\" />\n <Numerator subjectref=\"vap_pi\" />\n <Numerator subjectref=\"vap_wnh\" />\n </Numerators>\n <Denominator subjectref=\"vap\" />\n </RatioVar>\n %(start_elec)s\n <RatioVar id=\"partyControl\" label=\"Party-Controlled Districts\" threshold=\".5\">\n <Numerators>\n <Numerator subjectref=\"vote_dem\" />\n <Numerator subjectref=\"vote_rep\" />\n </Numerators>\n <Denominator subjectref=\"vote_tot\" />\n </RatioVar>\n %(end_elec)s\n </RatioVars>\n <SplitVars>\n <!-- \n \n See whether a given district splits a geography.\n This can be any higher level geography: a county,\n VTd, or tract.\n -->\n <SplitVar field=\"COUNTYFP10\" label=\"County\" />\n <SplitVar field=\"TRACTCE10\" label=\"Tract\" />\n </SplitVars>\n </BardConfig>\n </BardConfigs>\n <BardBodyConfigs>\n <!--\n For each legislative body, map the configuration to the\n geography used to generate reports.\n -->\n <BardBodyConfig\n id=\"congress_blocks\"\n legislativebodyref=\"congress\"\n bardconfigref=\"blocks\" />\n <BardBodyConfig\n id=\"house_blocks\"\n legislativebodyref=\"house\"\n bardconfigref=\"blocks\" />\n <BardBodyConfig\n id=\"senate_blocks\"\n legislativebodyref=\"senate\"\n bardconfigref=\"blocks\" />\n </BardBodyConfigs>\n </Reporting>\n \n <!-- Information about the mailer configuration. -->\n <Mailer server=\"localhost\" port=\"25\" username=\"\" password=\"\"/>\n </Project>\n \n</DistrictBuilder>\n\n \"\"\"", "metadata": "root.Config_Template", "header": "['module', '___EOS___']", "index": 356 }, { "content": "def gen_config(num_districts_congress,num_districts_senate,num_districts_house,sum_TOTPOP,has_election_data=0,has_vtds=0, conf_na=False , \ntarget_na_congress=0, target_hisp_congress = 0 , target_bl_congress = 0,\ntarget_na_house=0, target_hisp_house = 0 , target_bl_house = 0,\ntarget_na_senate =0, target_hisp_senate = 0 , target_bl_senate = 0, contiguityOverrideString = \"\"): \n\n start_na=\"<!--\" \n start_elec=\"<!--\" \n\tend_elec=\"-->\"\n\tend_na=\"-->\"\n midlevel=\"tract\"\n\tif (conf_na==True):\n start_na=\"\"\n end_na=\"\"\n midlevel_width=\"6\"\n midlevel_var=\"TRACTCE10\" \n\tif (has_election_data==1):\n start_elec=\"\"\n end_elec=\"\" \n\tif (has_vtds==1) : \n\t\tmidlevel=\"vtds\"\n midlevel_width=\"4\"\n midlevel_var=\"VTDST10\" \n\tpop_congress = int(round((sum_TOTPOP/float(num_districts_congress))))\n\tpop_congress_max = int(round((sum_TOTPOP/float(num_districts_congress)) * 1.005))\n pop_congress_min = int(round((sum_TOTPOP/float(num_districts_congress)) * 0.995))\n\tpop_house = int(round((sum_TOTPOP/float(num_districts_house))))\n\tpop_house_max = int(round((sum_TOTPOP/float(num_districts_house)) * 1.1))\n pop_house_min = int(round((sum_TOTPOP/float(num_districts_house)) * 0.9))\n\tpop_senate = int(round((sum_TOTPOP/float(num_districts_senate))))\n\tpop_senate_max = int(round((sum_TOTPOP/float(num_districts_senate)) * 1.1))\n pop_senate_min = int(round((sum_TOTPOP/float(num_districts_senate)) * 0.9))\n target_file = '/projects/PublicMapping/DistrictBuilder/docs/config_census_generated.xml'\n f = open(target_file,'w')\n f.write(str( Config_Template(start_elec=start_elec,end_elec=end_elec,num_districts_congress=num_districts_congress,num_districts_house=num_districts_house,num_districts_senate=num_districts_senate,pop_congress_max=pop_congress_max,pop_congress_min=pop_congress_min,pop_senate_max=pop_senate_max, pop_senate_min=pop_senate_min,pop_house_max=pop_house_max,pop_house_min=pop_house_min,pop_congress=pop_congress,pop_senate=pop_senate,pop_house=pop_house,start_na=start_na, end_na=end_na, target_na_congress=target_na_congress, target_hisp_congress=target_hisp_congress, target_bl_congress=target_bl_congress, target_na_house=target_na_house, target_hisp_house=target_hisp_house, target_bl_house=target_bl_house, target_na_senate=target_na_senate, target_hisp_senate=target_hisp_senate, target_bl_senate=target_bl_senate,contiguityOverrideString=contiguityOverrideString)))\n\tf.write(\"\\n\")\n f.close()\n os.chmod(target_file,stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH) ", "metadata": "root.gen_config", "header": "['module', '___EOS___']", "index": 1662 } ]
[ { "span": "import re ", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 9 }, { "span": "import sys ", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 10 }, { "span": "import glob ", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 11 }, { "span": "import commands ", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 15 }, { "span": "import time", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Frame", "work", " ", "for", " ", "load", "ing", " ", "census", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Inp", "uts", ":", " ", "FI", "PS", " ", "state", " ", "code", ",", " ", "list", " ", "of", " ", "variab", "les", " ", "to", " ", "include", " ", "as", " ", "addition", "al", " ", "subjects_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Requirements", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "-", " ", "external", " ", "software", ":", " ", "Distr", "ict", "Build", "er", ",", " ", "R", ",", " ", "gdal", ",", " ", "wg", "et", ",", " ", "unzip", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", " ", "--", " ", "check", " ", "for", " ", "VT", "D", "'", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", "#", " ", "regular", " ", "expressions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "#", " ", "arg", " ", "lists", " ", "etc", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "glob_", "#", " ", "glob", "bing", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "commands_", "#", " ", "system", " ", "commands_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "#", " ", "os", " ", "commands_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "stat_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "#", " ", "for", " ", "external", " ", "commands_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "zipfile_", "#", " ", "unzip", "ping_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "rpy", "2_", "._", "robj", "ects_", "as_", "robj", "ects_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "shutil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "psycopg2_", "as_", "dbapi", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "optparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " _", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Globals_", "\\u\\u\\uNL\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PUBLIC", "MAPPING", "PASS_", "=_", "\"", "public", "mapping", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", ":", " ", "build", " ", "in", " ", "vote", " ", "geogr", "aph", "ies", ",", " ", "numbers", " ", "of", " ", "district", "s", " ", "per", " ", "state_", "\\u\\u\\uNL\\u\\u\\u_", "#", "VO", "TE", "GEO", "GRAPHI", "ES", "={", "\"", "county", "\":\"", "COUNT", "YF", "P1", "0", "\",\"", "tract", "\":\"", "TRA", "CTC", "E1", "0", "\",\"", "block", "\":\"", "BLOCK", "CE", "10", "\"}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "clear", "\\u", "public", "mapping", "\\u", "db_", "\\u\\u\\uNL\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Truncate", " ", "database_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Drop", " ", "DB_", "\\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_", "###", " ", "Install", " ", "dependencies_", "\\u\\u\\uNL\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Thi", "s", " ", "atte", "mpt", "s", " ", "to", " ", "install", " ", "dependen", "cies", " ", "usi", "ng", " ", "apt", "-", "get_", "\\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_", "###", " ", "Retrieve", " ", "data", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "Thi", "s", " ", "retrieve", "s", " ", "the", " ", "census", " ", "files", ",", "unzip", "s", " ", "and", " ", "repro", "ject", "s", " ", "(", "usi", "ng", " ", "ogr", "2o", "gr", ")", " _", "\\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_", "###", " ", "TEMPL", "ATI", "NG", " ", " ", "-", " ", "SL", "D", "'", "s_", "\\u\\u\\uNL\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "genera", "l", " ", "template", " ", "classes_", "\\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_", "###", " ", "SL", "D", " ", "Skeleton", " ", "Classes_", "\\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_", "#", " ", "plain", " ", "fill", " ", "template_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "min", "-", "max", " ", "range", " ", "template_", "\\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_", "#", "TOD", "O", ":", " ", "generaliz", "e", " ", "to", " ", "any", " ", "number", " ", "of", " ", "chor", "opl", "eth", "s_", "\\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_", "###", " ", "Config", " ", "file", " ", "generation_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "TOD", "O", ":", " ", "has", "\\u", "vt", "ds", "==", "1", " ", "has", " ", "not", " ", "full", "y", " ", "implemented", " _", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", " ", " ", " ", "param", "ater", "ize", " ", "threshol", "ds", "?", "_", "\\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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "MAIN", "_", "\\u\\u\\uNL\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Get", " ", "Arguments_", "\\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\\uDEDENT\\u\\u\\u_", "parser_", "=_", "optparse_", "._", "Optio", "n", "Parser_", "(_", "usage_", "=_", "\"%", "prog", " ", "-", "F", "[", "fips", "\\u", "code", "]", " ", "-", "C", "[", "num", "\\u", "congr", "ession", "al", "\\u", "district", "s", "]", " ", "-", "S", "[", "num", "\\u", "sena", "te", "\\u", "district", "s", "]", " ", "-", "H", "[", "num", "\\u", "house", "\\u", "district", "s", "]\"_", ",_", "version_", "=_", "\"%", "prog", " ", "0.", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "require", "d", " ", "arguments_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "F", "'_", ",_", "'--", "fips", "'_", ",_", "dest_", "=_", "'", "state", "Fi", "ps", "'_", ",_", "help_", "=_", "\"", "State", " ", "two", " ", "digit", " ", "FI", "PS", " ", "code", "\"_", ",_", "type_", "=_", "int_", ",_", "default_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "C", "'_", ",_", "'--", "cong", "dist", "'_", ",_", "dest_", "=_", "'", "cong", "Dis", "'_", ",_", "help_", "=_", "\"", "number", " ", "of", " ", "congr", "ession", "al", " ", "district", "s", "\"_", ",_", "type_", "=_", "int_", ",_", "default_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "H", "'_", ",_", "'--", "house", "dist", "'_", ",_", "dest_", "=_", "'", "house", "Dis", "'_", ",_", "help_", "=_", "\"", "number", " ", "of", " ", "sena", "te", " ", "district", "s", "\"_", ",_", "type_", "=_", "int_", ",_", "default_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "S", "'_", ",_", "'--", "send", "ist", "'_", ",_", "dest_", "=_", "'", "sen", "Dis", "'_", ",_", "help_", "=_", "\"", "number", " ", "of", " ", "house", " ", "district", "s", "\"_", ",_", "type_", "=_", "int_", ",_", "default_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "operati", "ons", " ", "to", " ", "perform_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "i", "'_", ",_", "'--", "install", "'_", ",_", "dest_", "=_", "\"", "do", "\\u", "install", "\"_", ",_", "help_", "=_", "\"", "Install", " ", "dependen", "cen", "cies", ".\"_", ",_", "default_", "=_", "False_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "g", "'_", ",_", "'--", "getd", "ata", "'_", ",_", "dest_", "=_", "\"", "do", "\\u", "getd", "ata", "\"_", ",_", "help_", "=_", "\"", "Get", " ", "data", ".\"_", ",_", "default_", "=_", "False_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "s", "'_", ",_", "'--", "gens", "ld", "'_", ",_", "dest_", "=_", "\"", "do", "\\u", "gens", "ld", "\"_", ",_", "help_", "=_", "\"", "Generate", " ", "sld", "s", "\"_", ",_", "default_", "=_", "False_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "c", "'_", ",_", "'--", "genc", "onf", "'_", ",_", "dest_", "=_", "\"", "do", "\\u", "genc", "onf", "\"_", ",_", "help_", "=_", "\"", "Generate", " ", "config", " ", "file", "\"_", ",_", "default_", "=_", "False_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "d", "'_", ",_", "'--", "drop", "db", "'_", ",_", "dest_", "=_", "\"", "do", "\\u", "drop", "db", "\"_", ",_", "help_", "=_", "\"", "Drop", " ", "databa", "se", "\"_", ",_", "default_", "=_", "False_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'-", "r", "'_", ",_", "'--", "run", "'_", ",_", "dest_", "=_", "\"", "do", "\\u", "run", "\"_", ",_", "help_", "=_", "\"", "run", " ", "setup", ".", "py", "\"_", ",_", "default_", "=_", "False_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "configura", "tion", " ", "options_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'--", "na", "\\u", "inc", "'_", ",_", "dest_", "=_", "\"", "conf", "\\u", "na", "\"_", ",_", "help_", "=_", "\"", "Include", " ", "Nat", "ive", " ", "Ame", "rica", "ns", " ", "in", " ", "stats", ".\"_", ",_", "default_", "=_", "False_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'--", "na", "\\u", "targ", "\\u", "c", "'_", ",_", "dest_", "=_", "'", "target", "\\u", "na", "\\u", "congr", "ess", "'_", ",_", "help_", "=_", "\"", "Number", " ", "of", " ", "Nat", "ive", " ", "Ame", "rica", "n", " ", "Cong", "ressi", "onal", " ", "Distr", "icts", " ", "for", " ", "target", "\"_", ",_", "type_", "=_", "int_", ",_", "default_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'--", "na", "\\u", "targ", "\\u", "h", "'_", ",_", "dest_", "=_", "'", "target", "\\u", "na", "\\u", "house", "'_", ",_", "help_", "=_", "\"", "Number", " ", "of", " ", "Nat", "ive", " ", "Ame", "rica", "n", " ", "House", " ", "Distr", "icts", " ", "for", " ", "target", "\"_", ",_", "type_", "=_", "int_", ",_", "default_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'--", "na", "\\u", "targ", "\\u", "s", "'_", ",_", "dest_", "=_", "'", "target", "\\u", "na", "\\u", "sena", "te", "'_", ",_", "help_", "=_", "\"", "Number", " ", "of", " ", "Nat", "ive", " ", "Ame", "rica", "n", " ", "Sen", "ate", " ", "Distr", "icts", " ", "for", " ", "target", "\"_", ",_", "type_", "=_", "int_", ",_", "default_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'--", "his", "p", "\\u", "targ", "\\u", "c", "'_", ",_", "dest_", "=_", "'", "target", "\\u", "his", "p", "\\u", "congr", "ess", "'_", ",_", "help_", "=_", "\"", "Number", " ", "of", " ", "Hi", "span", "ic", " ", "Cong", "ressi", "onal", " ", "Distr", "icts", " ", "for", " ", "target", "\"_", ",_", "type_", "=_", "int_", ",_", "default_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'--", "his", "p", "\\u", "targ", "\\u", "h", "'_", ",_", "dest_", "=_", "'", "target", "\\u", "his", "p", "\\u", "house", "'_", ",_", "help_", "=_", "\"", "Number", " ", "of", " ", "Hi", "span", "ic", " ", "House", " ", "Distr", "icts", " ", "for", " ", "target", "\"_", ",_", "type_", "=_", "int_", ",_", "default_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'--", "his", "p", "\\u", "targ", "\\u", "s", "'_", ",_", "dest_", "=_", "'", "target", "\\u", "his", "p", "\\u", "sena", "te", "'_", ",_", "help_", "=_", "\"", "Number", " ", "of", " ", "Hi", "span", "ic", " ", "Sen", "ate", "Distr", "icts", " ", "for", " ", "target", "\"_", ",_", "type_", "=_", "int_", ",_", "default_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'--", "bl", "\\u", "targ", "\\u", "c", "'_", ",_", "dest_", "=_", "'", "target", "\\u", "bl", "\\u", "congr", "ess", "'_", ",_", "help_", "=_", "\"", "Number", " ", "of", " ", "Black", " ", "Cong", "ressi", "onal", " ", "district", "s", " ", "for", " ", "target", "\"_", ",_", "type_", "=_", "int_", ",_", "default_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'--", "bl", "\\u", "targ", "\\u", "h", "'_", ",_", "dest_", "=_", "'", "target", "\\u", "bl", "\\u", "house", "'_", ",_", "help_", "=_", "\"", "Number", " ", "of", " ", "Black", " ", "House", " ", "district", "s", " ", "for", " ", "target", "\"_", ",_", "type_", "=_", "int_", ",_", "default_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "'--", "bl", "\\u", "targ", "\\u", "s", "'_", ",_", "dest_", "=_", "'", "target", "\\u", "bl", "\\u", "sena", "te", "'_", ",_", "help_", "=_", "\"", "Number", " ", "of", " ", "Black", " ", "Sen", "ate", " ", "district", "s", " ", "for", " ", "target", "\"_", ",_", "type_", "=_", "int_", ",_", "default_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "parse", "Results_", ",_", "numa", "rgs_", ")_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "include", " ", "na", " ", "if", " ", "there", " ", "is", " ", "a", " ", "posit", "ive", " ", "target", ",", " ", "even", " ", "if", " ", "not", " ", "other", "wis", "e", " ", "specified", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "(_", "parse", "Results_", "._", "target", "\\u", "na", "\\u", "congr", "ess_", "+_", "parse", "Results_", "._", "target", "\\u", "na", "\\u", "sena", "te_", "+_", "parse", "Results_", "._", "target", "\\u", "na", "\\u", "house_", ")_", ">_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "parse", "Results_", "._", "conf", "\\u", "na_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "allo", "ps_", "=_", "(_", "not_", "parse", "Results_", "._", "do", "\\u", "install_", ")_", "and_", "(_", "not_", "parse", "Results_", "._", "do", "\\u", "getdata_", ")_", "and_", "(_", "not_", "parse", "Results_", "._", "do", "\\u", "gens", "ld_", ")_", "and_", "(_", "not_", "parse", "Results_", "._", "do", "\\u", "genc", "onf_", ")_", "and_", "(_", "not_", "parse", "Results_", "._", "do", "\\u", "drop", "db_", ")_", "and_", "(_", "not_", "parse", "Results_", "._", "do", "\\u", "run_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "allo", "ps_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "parse", "Results_", "._", "do", "\\u", "install_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parse", "Results_", "._", "do", "\\u", "getdata_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parse", "Results_", "._", "do", "\\u", "gens", "ld_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parse", "Results_", "._", "do", "\\u", "genc", "onf_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parse", "Results_", "._", "do", "\\u", "drop", "db_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parse", "Results_", "._", "do", "\\u", "run_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "numa", "rgs_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "error_", "(_", "\"", "addition", "al", " ", "argu", "ment", "s", " ", "ignore", "d", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "state", "Fi", "ps_", "=_", "parse", "Results_", "._", "state", "Fi", "ps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "house", "Dis", "_", "=_", "parse", "Results_", "._", "house", "Dis", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sen", "Dis", "_", "=_", "parse", "Results_", "._", "sen", "Dis", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cong", "Dis", "_", "=_", "parse", "Results_", "._", "cong", "Dis", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "state", "Fi", "ps_", "==_", "0_", "or_", "house", "Dis", "_", "==_", "0_", "or_", "sen", "Dis", "_", "==_", "0_", "or_", "cong", "Dis", "_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Mus", "t", " ", "supply", " ", "all", " ", "district", " ", "argu", "ment", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Value", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "install", " ", "dependencies_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "parse", "Results_", "._", "do", "\\u", "install_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "print_", "\"", "install", "ing", " ", "dependen", "cies", "...\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "install", "\\u", "dependencies_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Clear", " ", "out", " ", "DB_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "parse", "Results_", "._", "do", "\\u", "drop", "db_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "print_", "'", "clear", "ing", " ", "databa", "se", " ", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "drop", "\\u", "db_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "generat", "e", " ", "gener", "ic", " ", "sld", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "parse", "Results_", "._", "do", "\\u", "gens", "ld_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "print_", "'", "generat", "ing", " ", "gener", "ic", " ", "sld", " ", "files", " ", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "none_", "(_", "\"", "county", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "none_", "(_", "\"", "tract", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "none_", "(_", "\"", "block", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "boundaries_", "(_", "\"", "county", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "boundaries_", "(_", "\"", "tract", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "boundaries_", "(_", "\"", "block", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Retrieve", " ", "data", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "parse", "Results_", "._", "do", "\\u", "getdata_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "print_", "'", "retrie", "ving", " ", "census", " ", "data", " ", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "census", "\\u", "data_", "(_", "state", "Fi", "ps_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "merge", " ", "standard", " ", "variables_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Ref", "actor", " ", "entire", "ly", " ", "in", " ", "rpy", "_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "mer", "ging", " ", "data", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "robj", "ects_", "._", "r_", "._", "source_", "(_", "\"/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "docs", "/", "load", "census", "/", "merge", "Cen", "sus", ".", "R", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "(_", "parse", "Results_", "._", "do", "\\u", "genc", "onf_", ")_", "or_", "(_", "parse", "Results_", "._", "do", "\\u", "gens", "ld_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "print_", "'", "calculati", "ng", " ", "statistic", "s", " ", "for", " ", "configs", " ", "and", " ", "sld", "s", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "robj", "ects_", "._", "r_", "._", "source_", "(_", "\"/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "docs", "/", "load", "census", "/", "calc", "Stat", "s", ".", "R", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sum", "\\u", "TO", "TP", "OP_", "=_", "robj", "ects_", "._", "r_", "._", "sum", "\\u", "TO", "TP", "OP_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Ref", "actor", " ", "entire", "ly", " ", "in", " ", "rpy", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NOTE", ":", " ", "robj", "ect", " ", "is", " ", "return", "ing", " ", "6", "-", "level", " ", "quantiles", ",", " ", "has", "\\u", "election", "\\u", "data", ",", " ", "has", "\\u", "vt", "d", ",", " ", "sum", "\\u", "TO", "TP", "OP_", "\\u\\u\\uNL\\u\\u\\u_", "has", "\\u", "election", "\\u", "data_", "=_", "robj", "ects_", "._", "r_", "._", "has", "\\u", "election", "\\u", "data_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "parse", "Results_", "._", "do", "\\u", "genc", "onf_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "robj", "ects_", "._", "r_", "._", "source_", "(_", "\"/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "docs", "/", "load", "census", "/", "conti", "guit", "y", "Override", ".", "R", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "shou", "ld", " ", "work", " ", "but", " ", "has", " ", "embedde", "d", " ", "string", " ", "forward", "ing", "\t_", "\\u\\u\\uNL\\u\\u\\u_", "#", "conti", "guit", "y", "Override", "String", " ", "=", " ", "robj", "ect", "s", ".", "r", ".", "conti", "guit", "y", "Override", "String_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "open_", "(_", "'/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "docs", "/", "generat", "ed", "\\u", "override", "s", ".", "xml", "'_", ",_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conti", "guit", "y", "Override", "String_", "=_", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "refactor", " ", "as", " ", "matrix", " ", "of", " ", "varnames", " ", "and", " ", "geogr", "aph", "ies_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "parse", "Results_", "._", "do", "\\u", "gens", "ld_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "print_", "'", "generat", "ing", " ", "chor", "opl", "eth", " ", "sld", "s", " ", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o_", "(_", "\"", "block", "\"_", ",_", "\"", "TO", "TP", "OP", "\"_", ",_", "\"", "Total", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "block", "\\u", "TO", "TP", "OP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "block", "\"_", ",_", "\"", "TO", "TP", "OP", "\\u", "H", "\"_", ",_", "\"", "Perce", "nt", " ", "Hi", "span", "ic", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "block", "\\u", "TO", "TP", "OP", "\\u", "H_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "block", "\"_", ",_", "\"", "TO", "TP", "OP", "\\u", "B", "\"_", ",_", "\"", "Perce", "nt", " ", "Black", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "block", "\\u", "TO", "TP", "OP", "\\u", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "block", "\"_", ",_", "\"", "TO", "TP", "OP", "\\u", "NA", "\"_", ",_", "\"", "Perce", "nt", " ", "Nat", "ive", " ", "Ame", "rica", "n", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "block", "\\u", "TO", "TP", "OP", "\\u", "NA_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o_", "(_", "\"", "block", "\"_", ",_", "\"", "VA", "P", "\"_", ",_", "\"", "Vo", "ting", " ", "Age", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "block", "\\u", "VA", "P_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "block", "\"_", ",_", "\"", "VA", "P", "\\u", "H", "\"_", ",_", "\"", "Perce", "nt", " ", "Vo", "ting", " ", "Age", " ", "Hi", "span", "ic", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "block", "\\u", "VA", "P", "\\u", "H_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "block", "\"_", ",_", "\"", "VA", "P", "\\u", "B", "\"_", ",_", "\"", "Perce", "nt", " ", "Vo", "ting", " ", "Age", " ", "Black", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "block", "\\u", "VA", "P", "\\u", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "block", "\"_", ",_", "\"", "VA", "P", "\\u", "NA", "\"_", ",_", "\"", "Perce", "nt", " ", "Vo", "ting", " ", "Age", " ", "Nat", "ive", " ", "Ame", "rica", "n", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "block", "\\u", "VA", "P", "\\u", "NA_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o_", "(_", "\"", "tract", "\"_", ",_", "\"", "TO", "TP", "OP", "\"_", ",_", "\"", "Total", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "tract", "\\u", "TO", "TP", "OP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "tract", "\"_", ",_", "\"", "TO", "TP", "OP", "\\u", "H", "\"_", ",_", "\"", "Perce", "nt", " ", "Total", " ", "Hi", "span", "ic", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "tract", "\\u", "TO", "TP", "OP", "\\u", "H_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "tract", "\"_", ",_", "\"", "TO", "TP", "OP", "\\u", "B", "\"_", ",_", "\"", "Perce", "nt", " ", "Black", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "tract", "\\u", "TO", "TP", "OP", "\\u", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "tract", "\"_", ",_", "\"", "TO", "TP", "OP", "\\u", "NA", "\"_", ",_", "\"", "Perce", "nt", " ", "Nat", "ive", " ", "Ame", "rica", "n", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "tract", "\\u", "TO", "TP", "OP", "\\u", "NA_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o_", "(_", "\"", "tract", "\"_", ",_", "\"", "VA", "P", "\"_", ",_", "\"", "Vo", "ting", " ", "Age", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "tract", "\\u", "VA", "P_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "tract", "\"_", ",_", "\"", "VA", "P", "\\u", "H", "\"_", ",_", "\"", "Perce", "nt", " ", "Vo", "ting", " ", "Age", " ", "Hi", "span", "ic", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "tract", "\\u", "VA", "P", "\\u", "H_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "tract", "\"_", ",_", "\"", "VA", "P", "\\u", "B", "\"_", ",_", "\"", "Perce", "nt", " ", "Vo", "ting", " ", "Age", " ", "Black", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "tract", "\\u", "VA", "P", "\\u", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "tract", "\"_", ",_", "\"", "VA", "P", "\\u", "NA", "\"_", ",_", "\"", "Perce", "nt", " ", "Vo", "ting", " ", "Age", " ", "Nat", "ive", " ", "Ame", "rica", "n", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "tract", "\\u", "VA", "P", "\\u", "NA_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o_", "(_", "\"", "county", "\"_", ",_", "\"", "TO", "TP", "OP", "\"_", ",_", "\"", "Total", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "county", "\\u", "TO", "TP", "OP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "county", "\"_", ",_", "\"", "TO", "TP", "OP", "\\u", "H", "\"_", ",_", "\"", "Perce", "nt", " ", "Hi", "span", "ic", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "county", "\\u", "TO", "TP", "OP", "\\u", "H_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "county", "\"_", ",_", "\"", "TO", "TP", "OP", "\\u", "B", "\"_", ",_", "\"", "Perce", "nt", " ", "Black", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "county", "\\u", "TO", "TP", "OP", "\\u", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "county", "\"_", ",_", "\"", "TO", "TP", "OP", "\\u", "NA", "\"_", ",_", "\"", "Perce", "nt", " ", "Nat", "ive", " ", "Ame", "rica", "n", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "county", "\\u", "TO", "TP", "OP", "\\u", "NA_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o_", "(_", "\"", "county", "\"_", ",_", "\"", "VA", "P", "\"_", ",_", "\"", "Vo", "ting", " ", "Age", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "county", "\\u", "VA", "P_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "county", "\"_", ",_", "\"", "VA", "P", "\\u", "H", "\"_", ",_", "\"", "Perce", "nt", " ", "Vo", "ting", " ", "Age", " ", "Hi", "span", "ic", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "county", "\\u", "VA", "P", "\\u", "H_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "county", "\"_", ",_", "\"", "VA", "P", "\\u", "B", "\"_", ",_", "\"", "Perce", "nt", " ", "Vo", "ting", " ", "Age", " ", "Black", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "county", "\\u", "VA", "P", "\\u", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "county", "\"_", ",_", "\"", "VA", "P", "\\u", "NA", "\"_", ",_", "\"", "Perce", "nt", " ", "Vo", "ting", " ", "Age", " ", "Nat", "ive", " ", "Ame", "rica", "n", " ", "Popula", "tion", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "county", "\\u", "VA", "P", "\\u", "NA_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "has", "\\u", "election", "\\u", "data_", "==_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "block", "\"_", ",_", "\"", "VO", "TE", "\\u", "DEM", "\"_", ",_", "\"", "Perce", "nt", " ", "Predicte", "d", " ", "Demo", "cra", "tic", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "block", "\\u", "VO", "TE", "\\u", "DEM", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "block", "\"_", ",_", "\"", "VO", "TE", "\\u", "REP", "\"_", ",_", "\"", "Perce", "nt", " ", "Predicte", "d", " ", "Rep", "ubli", "can", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "block", "\\u", "VO", "TE", "\\u", "REP", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o_", "(_", "\"", "block", "\"_", ",_", "\"", "VO", "TE", "\\u", "TO", "T", "\"_", ",_", "\"", "Predicte", "d", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "block", "\\u", "VO", "TE", "\\u", "TO", "T_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "tract", "\"_", ",_", "\"", "VO", "TE", "\\u", "DEM", "\"_", ",_", "\"", "Perce", "nt", " ", "Predicte", "d", " ", "Demo", "cra", "tic", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "tract", "\\u", "VO", "TE", "\\u", "DEM", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "tract", "\"_", ",_", "\"", "VO", "TE", "\\u", "REP", "\"_", ",_", "\"", "Perce", "nt", " ", "Predicte", "d", " ", "Rep", "ubli", "can", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "tract", "\\u", "VO", "TE", "\\u", "REP", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o_", "(_", "\"", "tract", "\"_", ",_", "\"", "VO", "TE", "\\u", "TO", "T", "\"_", ",_", "\"", "Predicte", "d", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "tract", "\\u", "VO", "TE", "\\u", "TO", "T_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "county", "\"_", ",_", "\"", "VO", "TE", "\\u", "DEM", "\"_", ",_", "\"", "Per", "ece", "nt", " ", "Predicte", "d", " ", "Demo", "cra", "tic", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "county", "\\u", "VO", "TE", "\\u", "DEM", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "county", "\"_", ",_", "\"", "VO", "TE", "\\u", "REP", "\"_", ",_", "\"", "Perce", "nt", " ", "Predicte", "d", " ", "Rep", "ubli", "can", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "county", "\\u", "VO", "TE", "\\u", "REP", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o_", "(_", "\"", "county", "\"_", ",_", "\"", "VO", "TE", "\\u", "TO", "T", "\"_", ",_", "\"", "Predicte", "d", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "county", "\\u", "VO", "TE", "\\u", "TO", "T_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "block", "\"_", ",_", "\"", "VO", "TE", "\\u", "DEM", "\\u", "N", "\"_", ",_", "\"", "Perce", "nt", " ", "Predicte", "d", " ", "Demo", "cra", "tic", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "block", "\\u", "VO", "TE", "\\u", "DEM", "\\u", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "block", "\"_", ",_", "\"", "VO", "TE", "\\u", "REP", "\\u", "N", "\"_", ",_", "\"", "Perce", "nt", " ", "Predicte", "d", " ", "Rep", "ubli", "can", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "block", "\\u", "VO", "TE", "\\u", "REP", "\\u", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o_", "(_", "\"", "block", "\"_", ",_", "\"", "VO", "TE", "\\u", "TO", "T", "\\u", "N", "\"_", ",_", "\"", "Predicte", "d", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "block", "\\u", "VO", "TE", "\\u", "TO", "T", "\\u", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "tract", "\"_", ",_", "\"", "VO", "TE", "\\u", "DEM", "\\u", "N", "\"_", ",_", "\"", "Perce", "nt", " ", "Predicte", "d", " ", "Demo", "cra", "tic", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "tract", "\\u", "VO", "TE", "\\u", "DEM", "\\u", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "tract", "\"_", ",_", "\"", "VO", "TE", "\\u", "REP", "\\u", "N", "\"_", ",_", "\"", "Perce", "nt", " ", "Predicte", "d", " ", "Rep", "ubli", "can", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "tract", "\\u", "VO", "TE", "\\u", "REP", "\\u", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o_", "(_", "\"", "tract", "\"_", ",_", "\"", "VO", "TE", "\\u", "TO", "T", "\\u", "N", "\"_", ",_", "\"", "Predicte", "d", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "tract", "\\u", "VO", "TE", "\\u", "TO", "T", "\\u", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "county", "\"_", ",_", "\"", "VO", "TE", "\\u", "DEM", "\\u", "N", "\"_", ",_", "\"", "Perce", "nt", " ", "Predicte", "d", " ", "Demo", "cra", "tic", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "county", "\\u", "VO", "TE", "\\u", "DEM", "\\u", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "\"", "county", "\"_", ",_", "\"", "VO", "TE", "\\u", "REP", "\\u", "N", "\"_", ",_", "\"", "Perce", "nt", " ", "Predicte", "d", " ", "Rep", "ubli", "can", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "county", "\\u", "VO", "TE", "\\u", "REP", "\\u", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o_", "(_", "\"", "county", "\"_", ",_", "\"", "VO", "TE", "\\u", "TO", "T", "\\u", "N", "\"_", ",_", "\"", "Predicte", "d", " ", "Vote", " ", "\"_", ",_", "robj", "ects_", "._", "r_", "._", "q", "\\u", "county", "\\u", "VO", "TE", "\\u", "TO", "T", "\\u", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "generat", "e", " ", "config", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "parse", "Results_", "._", "do", "\\u", "genc", "onf_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "print_", "'", "generat", "ing", " ", "config", " ", "file", " ", "...", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gen", "\\u", "config_", "(_", "num", "\\u", "district", "s", "\\u", "congr", "ess_", "=_", "cong", "Dis", "_", ",_", "num", "\\u", "district", "s", "\\u", "sena", "te_", "=_", "sen", "Dis", "_", ",_", "num", "\\u", "district", "s", "\\u", "house_", "=_", "house", "Dis", "_", ",_", "sum", "\\u", "TO", "TP", "OP_", "=_", "sum", "\\u", "TO", "TP", "OP_", ",_", "has", "\\u", "election", "\\u", "data_", "=_", "has", "\\u", "election", "\\u", "data_", ",_", "has", "\\u", "vt", "ds_", "=_", "0_", ",_", "conf", "\\u", "na_", "=_", "parse", "Results_", "._", "conf", "\\u", "na_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "\\u", "na", "\\u", "congr", "ess_", "=_", "parse", "Results_", "._", "target", "\\u", "na", "\\u", "congr", "ess_", ",_", "target", "\\u", "his", "p", "\\u", "congr", "ess_", "=_", "parse", "Results_", "._", "target", "\\u", "his", "p", "\\u", "congr", "ess_", ",_", "target", "\\u", "bl", "\\u", "congr", "ess_", "=_", "parse", "Results_", "._", "target", "\\u", "bl", "\\u", "congr", "ess_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "\\u", "na", "\\u", "house_", "=_", "parse", "Results_", "._", "target", "\\u", "na", "\\u", "house_", ",_", "target", "\\u", "his", "p", "\\u", "house_", "=_", "parse", "Results_", "._", "target", "\\u", "his", "p", "\\u", "house_", ",_", "target", "\\u", "bl", "\\u", "house_", "=_", "parse", "Results_", "._", "target", "\\u", "bl", "\\u", "house_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "\\u", "na", "\\u", "sena", "te_", "=_", "parse", "Results_", "._", "target", "\\u", "na", "\\u", "sena", "te_", ",_", "target", "\\u", "his", "p", "\\u", "sena", "te_", "=_", "parse", "Results_", "._", "target", "\\u", "his", "p", "\\u", "sena", "te_", ",_", "target", "\\u", "bl", "\\u", "sena", "te_", "=_", "parse", "Results_", "._", "target", "\\u", "bl", "\\u", "sena", "te_", ",_", "conti", "guit", "y", "Override", "String_", "=_", "conti", "guit", "y", "Override", "String_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "parse", "Results_", "._", "do", "\\u", "run_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "print_", "'", "runn", "ing", " ", "setup", "-", "py", " ", "...", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "dir_", "=_", "os_", "._", "getcwd_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chdir_", "(_", "\"/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "django", "/", "public", "mapping", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"", "ls", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "subproc", "ess", ".", "check", "\\u", "call", "([", "\"", "setup", ".", "py", "\",\"", "-", "v2", "\",\"", "/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "docs", "/", "config", ".", "xsd", "\",\"", " ", "/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "docs", "/", "config", "\\u", "census", "\\u", "generat", "ed", ".", "xml", "\"]", ")_", "\\u\\u\\uNL\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"./", "setup", ".", "py", " ", "-", "v2", " ", "/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "docs", "/", "config", ".", "xsd", " ", "/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "docs", "/", "config", "\\u", "census", "\\u", "generat", "ed", ".", "xml", "\"_", "]_", ",_", "shell_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chdir_", "(_", "old", "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\t", "_", "print_", "'\\\\", "n", "\\\\", "n", "***", " ", "No", "w", " ", "run", ":", " ", "***", "\\\\", "n", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'(", "cd", " ", "/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "django", "/", "public", "mapping", "/", ";", " ", "python", " ", "setup", ".", "py", " ", "-", "v2", " ", "/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "docs", "/", "config", ".", "xsd", " ", "/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "docs", "/", "config", "\\u", "census", "\\u", "generat", "ed", ".", "xml", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "workar", "ound", " ", "celery", "d", " ", "first", "-", "time", " ", "start", "up", " ", "problem_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'", "Start", "ing", " ", "celery", "d", " ", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"", "service", "\"_", ",_", "\"", "celery", "d", "\"_", ",_", "\"", "start", "\"_", "]_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "clear", "\\u", "public", "mapping", "\\u", "db_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "=_", "dbapi", "2_", "._", "connect_", "(_", "database_", "=_", "\"", "public", "mapping", "\"_", ",_", "user_", "=_", "\"", "public", "mapping", "\"_", ",_", "password_", "=_", "PUBLIC", "MAPPING", "PASS_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "=_", "db_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "red", "table_", "=_", "[_", "\"", "redis", "tric", "ting", "\\u", "characteristic", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "compute", "dch", "ara", "cte", "ris", "tic", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "compute", "ddi", "strict", "score", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "compute", "dp", "lan", "score", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "conti", "guit", "yo", "ver", "ride", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "district", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "geo", "level", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "geo", "unit", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "legislat", "ive", "body", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "legislat", "ive", "default", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "legislat", "ive", "level", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "plan", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "profile", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "score", "argu", "ment", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "scored", "isp", "lay", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "score", "function", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "score", "panel", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "score", "panel", "\\u", "display", "s", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "score", "panel", "\\u", "score", "\\u", "function", "s", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "subject", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "target", "\"_", ",_", "\"", "redis", "tric", "ting", "\\u", "validation", "crite", "ria", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "red", "table_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cur_", "._", "execute_", "(_", "\"", "truncat", "e", " ", "table", " ", "%", "s", " ", "CAS", "CA", "DE", "\"_", "%_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "db_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "close_", "(_", ")_", "\\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_", "drop", "\\u", "db_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "dir_", "=_", "os_", "._", "getcwd_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chdir_", "(_", "\"/", "tmp", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"", "service", "\"_", ",_", "\"", "tom", "cat", "6", "\"_", ",_", "\"", "stop", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"", "service", "\"_", ",_", "\"", "celery", "d", "\"_", ",_", "\"", "stop", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"", "service", "\"_", ",_", "\"", "apa", "che", "2", "\"_", ",_", "\"", "stop", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"", "service", "\"_", ",_", "\"", "apa", "che", "2", "\"_", ",_", "\"", "restart", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"", "service", "\"_", ",_", "\"", "postgres", "ql", "\"_", ",_", "\"", "restart", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "'", "su", " ", "postgres", " ", "-", "c", " ", "\"", "drop", "db", " ", "public", "mapping", "\"'_", "]_", ",_", "shell_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "'", "cat", " ", "/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "sql", "/", "public", "mapping", "\\u", "db", ".", "sql", " ", "|", " ", "su", " ", "postgres", " ", "-", "c", " ", "\"", "psql", " ", "-", "f", " ", "-", " ", "postgres", "\"'_", "]_", ",_", "shell_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"", "service", "\"_", ",_", "\"", "apa", "che", "2", "\"_", ",_", "\"", "start", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"", "service", "\"_", ",_", "\"", "tom", "cat", "6", "\"_", ",_", "\"", "start", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "chdir_", "(_", "old", "dir_", ")_", "\\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_", "install", "\\u", "dependencies_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "\"/", "usr", "/", "bin", "/", "ogr", "info", "\"_", ")_", "==_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " \t", "_", "cmd", "arg_", "=_", "'", "gdal", "-", "bin", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"", "apt", "-", "get", "\"_", ",_", "\"", "install", "\"_", ",_", "cmd", "arg_", "]_", ")_", "\\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", "census", "\\u", "data_", "(_", "state", "Fi", "ps_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "(_", "state", "Fi", "ps_", "<_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "state", "Fi", "ps_", "=_", "\"", "0", "%", "s", "\"_", "%_", "state", "Fi", "ps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'", "Retriev", "ing", " ", "census", " ", "shapefile", "s", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "put", " ", "all", " ", "data", " ", "in", " ", "public", "mapping", " ", "data", " ", "directory_", "\\u\\u\\uNL\\u\\u\\u_", "old", "dir_", "=_", "os_", "._", "getcwd_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chdir_", "(_", "\"/", "project", "s", "/", "Public", "Map", "ping", "/", "data", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "obtain", " ", "state", " ", "bound", "ary", " ", "files", " ", "from", " ", "census", "_", "\\u\\u\\uNL\\u\\u\\u_", "cen", "Block", "File", "Prefix_", "=_", "'", "tl", "\\u", "2010", "\\u", "%", "s", "\\u", "tab", "block", "10", "'_", "%_", "state", "Fi", "ps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cen", "Trac", "t", "File", "Prefix_", "=_", "'", "tl", "\\u", "2010", "\\u", "%", "s", "\\u", "tract", "10", "'_", "%_", "state", "Fi", "ps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cen", "Count", "y", "File", "Prefix_", "=_", "'", "tl", "\\u", "2010", "\\u", "%", "s", "\\u", "county", "10", "'_", "%_", "state", "Fi", "ps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd", "arg_", "=_", "'", "ftp", "://", "ftp", "2", ".", "census", ".", "gov", "/", "geo", "/", "tige", "r", "/", "TI", "GER", "2010", "/", "TAB", "BLOCK", "/", "2010", "/", "%", "s", ".", "zip", "'_", "%_", "cen", "Block", "File", "Prefix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"", "wg", "et", "\"_", ",_", "\"-", "nc", "\"_", ",_", "cmd", "arg_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd", "arg_", "=_", "'", "ftp", "://", "ftp", "2", ".", "census", ".", "gov", "/", "geo", "/", "tige", "r", "/", "TI", "GER", "2010", "/", "TRA", "CT", "/", "2010", "/", "%", "s", ".", "zip", "'_", "%_", "cen", "Trac", "t", "File", "Prefix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"", "wg", "et", "\"_", ",_", "\"-", "N", "\"_", ",_", "cmd", "arg_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd", "arg_", "=_", "'", "ftp", "://", "ftp", "2", ".", "census", ".", "gov", "/", "geo", "/", "tige", "r", "/", "TI", "GER", "2010", "/", "COUNT", "Y", "/", "2010", "/", "%", "s", ".", "zip", "'_", "%_", "cen", "Count", "y", "File", "Prefix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"", "wg", "et", "\"_", ",_", "\"-", "N", "\"_", ",_", "cmd", "arg_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "addition", "al", " ", "data", " ", "from", " ", "our", " ", "S", "3", " ", "bucket_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "Retriev", "ing", " ", "addition", "al", " ", "data", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd", "arg_", "=_", "'", "https", "://", "s3", ".", "amaz", "ona", "ws", ".", "com", "/", "redis", "tric", "ting", "\\u", "supplement", "\\u", "data", "/", "redis", "t", "/", "%", "s", "\\u", "redis", "t", "\\u", "data", ".", "zip", "'_", "%_", "state", "Fi", "ps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"", "wg", "et", "\"_", ",_", "\"-", "N", "\"_", ",_", "cmd", "arg_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd", "arg_", "=_", "'", "https", "://", "s3", ".", "amaz", "ona", "ws", ".", "com", "/", "redis", "tric", "ting", "\\u", "supplement", "\\u", "data", "/", "redis", "t", "/", "%", "s", "\\u", "conti", "guit", "y", "\\u", "override", "s", ".", "csv", "'_", "%_", "state", "Fi", "ps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "call_", "(_", "[_", "\"", "wg", "et", "\"_", ",_", "\"-", "N", "\"_", ",_", "cmd", "arg_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Un", "zip", "ping", " ", "files", " ", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "unzip", " ", "data", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "[_", "cen", "Block", "File", "Prefix_", ",_", "cen", "Trac", "t", "File", "Prefix_", ",_", "cen", "Count", "y", "File", "Prefix_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", " ", " \t_", "zfil", "e_", "=_", "'%", "s", ".", "zip", "'_", "%_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Un", "zip", "ping", " ", "%", "s", "'_", "%_", "zfil", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "zip_", "=_", "zipfile_", "._", "Zip", "File_", "(_", "zfil", "e_", ",_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "zip_", "._", "extracta", "ll_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "my", "zip_", "=_", "zipfile_", "._", "Zip", "File_", "(_", "'%", "s", "\\u", "redis", "t", "\\u", "data", ".", "zip", "'_", "%_", "state", "Fi", "ps_", ",_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "zip_", "._", "extracta", "ll_", "(_", ")_", "#", " ", "Repr", "oj", "ect", " ", "block", " ", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Repr", "oj", "ect", "ing", " ", "block", " ", "shapefile", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "\"", "census", "\\u", "blocks", ".", "shp", "\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "remove_", "(_", "'", "census", "\\u", "blocks", ".", "shp", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "\"", "census", "\\u", "tracts", ".", "shp", "\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "remove_", "(_", "'", "census", "\\u", "tracts", ".", "shp", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "\"", "census", "\\u", "counti", "es", ".", "shp", "\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "remove_", "(_", "'", "census", "\\u", "counti", "es", ".", "shp", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"", "ogr", "2o", "gr", "\"_", ",_", "'-", "overwrit", "e", "'_", ",_", "'-", "t", "\\u", "sr", "s", "'_", ",_", "'", "EPS", "G", ":", "378", "5", "'_", ",_", "'", "census", "\\u", "blocks", ".", "shp", "'_", ",_", "'%", "s", ".", "shp", "'_", "%_", "cen", "Block", "File", "Prefix_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"", "ogr", "2o", "gr", "\"_", ",_", "'-", "overwrit", "e", "'_", ",_", "'-", "t", "\\u", "sr", "s", "'_", ",_", "'", "EPS", "G", ":", "378", "5", "'_", ",_", "'", "census", "\\u", "tracts", ".", "shp", "'_", ",_", "'%", "s", ".", "shp", "'_", "%_", "cen", "Trac", "t", "File", "Prefix_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "call_", "(_", "[_", "\"", "ogr", "2o", "gr", "\"_", ",_", "'-", "overwrit", "e", "'_", ",_", "'-", "t", "\\u", "sr", "s", "'_", ",_", "'", "EPS", "G", ":", "378", "5", "'_", ",_", "'", "census", "\\u", "counti", "es", ".", "shp", "'_", ",_", "'%", "s", ".", "shp", "'_", "%_", "cen", "Count", "y", "File", "Prefix_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "standardize", " ", "file", " ", "names_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "Copy", "ing", " ", "data", " ", "files", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shutil_", "._", "copy_", "(_", "'%", "s", "\\u", "redis", "t", "\\u", "data", ".", "csv", "'_", "%_", "state", "Fi", "ps_", ",_", "'", "redis", "t", "\\u", "data", ".", "csv", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "\"", "redis", "t", "\\u", "override", "s", ".", "csv", "\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " \t", "_", "os_", "._", "remove_", "(_", "'", "redis", "t", "\\u", "override", "s", ".", "csv", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "\"%", "s", "\\u", "conti", "guit", "y", "\\u", "override", "s", ".", "csv", "\"_", "%_", "state", "Fi", "ps_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " \t", "_", "shutil_", "._", "copy_", "(_", "\"%", "s", "\\u", "conti", "guit", "y", "\\u", "override", "s", ".", "csv", "\"_", "%_", "state", "Fi", "ps_", ",_", "'", "redis", "t", "\\u", "override", "s", ".", "csv", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "chdir_", "(_", "old", "dir_", ")_", "\\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_", "Dict", "ionar", "y", "Template_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dict", "ionar", "y", "Template_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "dict_", "=_", "{_", "}_", ",_", "**_", "keywords_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "dict_", "=_", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dict_", "._", "update_", "(_", "keywords_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dict", "ionar", "y", "Template_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "template_", "%_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dict", "ionar", "y", "Template_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "getitem\\u\\u_", "(_", "self_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "process_", "(_", "key_", "._", "split_", "(_", "\"|\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dict", "ionar", "y", "Template_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "process_", "(_", "self_", ",_", "l_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arg_", "=_", "l_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "l_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "arg_", "in_", "self_", "._", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "dict_", "[_", "arg_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "hasattr_", "(_", "self_", ",_", "arg_", ")_", "and_", "callable_", "(_", "getattr_", "(_", "self_", ",_", "arg_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "getattr_", "(_", "self_", ",_", "arg_", ")_", "(_", ")_", "\\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 ", " _", "raise_", "Key", "Error_", "(_", "arg_", ")_", "\\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 ", " _", "func", "\\u", "name_", "=_", "l_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "func", "\\u", "name_", "in_", "self_", "._", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "func_", "=_", "self_", "._", "dict_", "[_", "func", "\\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 ", " _", "func_", "=_", "getattr_", "(_", "self_", ",_", "func", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "func_", "(_", "self_", "._", "\\u", "process_", "(_", "[_", "arg_", "]_", ")_", ")_", "\\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_", "List", "Template_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "List", "Template_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "input", "\\u", "list_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "input", "\\u", "list_", "=_", "input", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "List", "Template_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"\\\\", "n", "\"_", "._", "join_", "(_", "[_", "self_", "._", "\\u", "template_", "%_", "x_", "for_", "x_", "in_", "self_", "._", "input", "\\u", "list_", "]_", ")_", "\\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_", "Emp", "ty", "\\u", "Template_", "(_", "List", "Template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "template_", "=_", "\"\"\"", " ", " ", " ", " ", "\\", "10", ";", "\t", "\"\"\"_", "\\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_", "Sl", "d", "List", "\\u", "Template_", "(_", "Dict", "ionar", "y", "Template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "template_", "=_", "\"\"\"", "<", "?", "xml", " ", "version", "=\"", "1.0", "\"", " ", "encoding", "=\"", "ISO", "-", "8859", "-1", "\"?", ">", "\\", "10", ";<", "Style", "d", "Layer", "Descrip", "tor", " ", "version", "=\"", "1.0", ".0", "\"", " ", "xml", "ns", "=\"", "http", "://", "www", ".", "opengis", ".", "net", "/", "sld", "\"", " ", "xml", "ns", ":", "og", "c", "=\"", "http", "://", "www", ".", "opengis", ".", "net", "/", "og", "c", "\"", " ", "xml", "ns", ":", "xli", "nk", "=\"", "http", "://", "www", ".", "w3", ".", "org", "/", "1999", "/", "xli", "nk", "\"", " ", "xml", "ns", ":", "xsi", "=\"", "http", "://", "www", ".", "w3", ".", "org", "/", "200", "1", "/", "XML", "Schema", "-", "instance", "\"", " ", "xsi", ":", "schema", "Locat", "ion", "=\"", "http", "://", "www", ".", "opengis", ".", "net", "/", "sld", " ", "http", "://", "schema", "s", ".", "opengis", ".", "net", "/", "sld", "/", "1.0", ".0", "/", "Style", "d", "Layer", "Descrip", "tor", ".", "xsd", "\">", "\\", "10", ";", " ", " ", "<", "Name", "d", "Layer", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Name", ">", "%", "(", "layer", "name", ")", "s", "</", "Name", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "User", "Style", ">", "\\", "10", ";", " ", " ", "<", "Tit", "le", ">", "%", "(", "layer", "title", ")", "s", "</", "Tit", "le", ">", "\\", "10", ";", " ", " ", "<", "Abstract", ">", "%", "(", "layer", "abs", ")", "s", "</", "Abstract", ">", "\\", "10", ";", " ", " ", "<", "Feature", "Type", "Style", ">", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "sl", "st", "|", "sli", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "lst", "|", "li", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "el", "st", "|", "eli", ")", "s", "\\", "10", ";", " ", " ", "</", "Feature", "Type", "Style", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "User", "Style", ">", "\\", "10", ";", " ", " ", "</", "Name", "d", "Layer", ">", "\\", "10", ";<", "/", "Style", "d", "Layer", "Descrip", "tor", ">", "\\", "10", ";", " ", " ", "\"\"\"_", "\\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_", "Sl", "d\\u", "Poly", "\\u", "Template_", "(_", "List", "Template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "template_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "<", "Rule", ">", "\\", "10", ";", " ", " ", "<", "Tit", "le", ">", "%", "(", "title", ")", "s", "</", "Tit", "le", ">", "\\", "10", ";", " ", " ", "<", "Polygon", "Symboli", "zer", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Fil", "l", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Cs", "s", "Parameter", " ", "name", "=\"", "fill", "\">", "%", "(", "fill", ")", "s", "</", "Cs", "s", "Parameter", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Cs", "s", "Parameter", " ", "name", "=\"", "fill", "-", "opa", "city", "\">", "%", "(", "fill", "opa", "city", ")", "s", "</", "Cs", "s", "Parameter", ">", " ", " ", " ", " ", "\\", "10", ";", "\t ", " ", "</", "Fil", "l", ">", "\\", "10", ";", " ", " ", "</", "Polygon", "Symboli", "zer", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Rule", ">", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\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_", "Sl", "d\\u", "Poly", "B", "\\u", "Template_", "(_", "List", "Template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "template_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "<", "Rule", ">", "\\", "10", ";", " ", " ", "<", "Tit", "le", ">", "%", "(", "title", ")", "s", "</", "Tit", "le", ">", "\\", "10", ";", " ", " ", "<", "Polygon", "Symboli", "zer", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Fil", "l", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Cs", "s", "Parameter", " ", "name", "=\"", "fill", "\">", "%", "(", "fill", ")", "s", "</", "Cs", "s", "Parameter", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Cs", "s", "Parameter", " ", "name", "=\"", "fill", "-", "opa", "city", "\">", "%", "(", "fill", "opa", "city", ")", "s", "</", "Cs", "s", "Parameter", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Fil", "l", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Str", "oke", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Cs", "s", "Parameter", " ", "name", "=\"", "strok", "e", "\">", "%", "(", "strok", "e", ")", "s", "</", "Cs", "s", "Parameter", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Cs", "s", "Parameter", " ", "name", "=\"", "strok", "e-", "widt", "h", "\">", "%", "(", "strok", "ew", "idt", "h", ")", "s", "</", "Cs", "s", "Parameter", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Cs", "s", "Parameter", " ", "name", "=\"", "strok", "e-", "opa", "city", "\">", "%", "(", "strok", "eo", "paci", "ty", ")", "s", "</", "Cs", "s", "Parameter", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Str", "oke", ">", "\\", "10", ";", " ", " ", "</", "Polygon", "Symboli", "zer", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Rule", ">", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\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_", "Sl", "d\\u", "Line", "\\u", "Template_", "(_", "List", "Template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "template_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "<", "Rule", ">", "\\", "10", ";", " ", " ", "<", "Tit", "le", ">", "%", "(", "title", ")", "s", "</", "Tit", "le", ">", "\\", "10", ";", " ", " ", "<", "Line", "Symboli", "zer", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Str", "oke", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Cs", "s", "Parameter", " ", "name", "=\"", "strok", "e", "\">", "%", "(", "strok", "e", ")", "s", "</", "Cs", "s", "Parameter", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Cs", "s", "Parameter", " ", "name", "=\"", "strok", "e-", "widt", "h", "\">", "%", "(", "strok", "ew", "idt", "h", ")", "s", "</", "Cs", "s", "Parameter", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Cs", "s", "Parameter", " ", "name", "=\"", "strok", "e-", "opa", "city", "\">", "%", "(", "strok", "eo", "paci", "ty", ")", "s", "</", "Cs", "s", "Parameter", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Str", "oke", ">", "\\", "10", ";", " ", " ", "</", "Line", "Symboli", "zer", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Rule", ">", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\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_", "Sl", "d\\u", "Range", "\\u", "Template_", "(_", "List", "Template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "template_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "<", "Rule", ">", "\\", "10", ";", " ", " ", "<", "Tit", "le", ">", "%", "(", "bottom", ")", "s", "-%", "(", "top", ")", "s", "</", "Tit", "le", ">", "\\", "10", ";", " ", " ", "<", "og", "c", ":", "Filter", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "og", "c", ":", "And", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "og", "c", ":", "Proper", "ty", "Is", "Less", "Than", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "og", "c", ":", "Proper", "ty", "Name", ">", "%", "(", "unit", ")", "s", "</", "og", "c", ":", "Proper", "ty", "Name", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "og", "c", ":", "Lite", "ral", ">", "%", "(", "top", ")", "s", "</", "og", "c", ":", "Lite", "ral", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "og", "c", ":", "Proper", "ty", "Is", "Less", "Than", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "og", "c", ":", "Proper", "ty", "Is", "Great", "er", "Than", "Or", "Equal", "To", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "og", "c", ":", "Proper", "ty", "Name", ">", "%", "(", "unit", ")", "s", "</", "og", "c", ":", "Proper", "ty", "Name", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "og", "c", ":", "Lite", "ral", ">", "%", "(", "bottom", ")", "s", "</", "og", "c", ":", "Lite", "ral", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "og", "c", ":", "Proper", "ty", "Is", "Great", "er", "Than", "Or", "Equal", "To", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "og", "c", ":", "And", ">", "\\", "10", ";", " ", " ", "</", "og", "c", ":", "Filter", ">", " ", " ", "\\", "10", ";", " ", " ", "<", "Polygon", "Symboli", "zer", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Fil", "l", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Cs", "s", "Parameter", " ", "name", "=\"", "fill", "\">", "%", "(", "fill", ")", "s", "</", "Cs", "s", "Parameter", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Cs", "s", "Parameter", " ", "name", "=\"", "fill", "-", "opa", "city", "\">", "%", "(", "fill", "opa", "city", ")", "s", "</", "Cs", "s", "Parameter", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Fil", "l", ">", "\\", "10", ";", " ", " ", "</", "Polygon", "Symboli", "zer", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Rule", ">", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\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_", "Sl", "d\\u", "UR", "ange", "\\u", "Template_", "(_", "List", "Template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "template_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "<", "Rule", ">", "\\", "10", ";", " ", " ", "<", "Tit", "le", ">", "%", "(", "bottom", ")", "s", "-%", "(", "top", ")", "s", "</", "Tit", "le", ">", "\\", "10", ";", " ", " ", "<", "og", "c", ":", "Filter", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "og", "c", ":", "Proper", "ty", "Is", "Great", "er", "Than", "Or", "Equal", "To", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "og", "c", ":", "Proper", "ty", "Name", ">", "%", "(", "unit", ")", "s", "</", "og", "c", ":", "Proper", "ty", "Name", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "og", "c", ":", "Lite", "ral", ">", "%", "(", "bottom", ")", "s", "</", "og", "c", ":", "Lite", "ral", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "og", "c", ":", "Proper", "ty", "Is", "Great", "er", "Than", "Or", "Equal", "To", ">", "\\", "10", ";", " ", " ", "</", "og", "c", ":", "Filter", ">", " ", " ", "\\", "10", ";", " ", " ", "<", "Polygon", "Symboli", "zer", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Fil", "l", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Cs", "s", "Parameter", " ", "name", "=\"", "fill", "\">", "%", "(", "fill", ")", "s", "</", "Cs", "s", "Parameter", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Cs", "s", "Parameter", " ", "name", "=\"", "fill", "-", "opa", "city", "\">", "%", "(", "fill", "opa", "city", ")", "s", "</", "Cs", "s", "Parameter", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Fil", "l", ">", "\\", "10", ";", " ", " ", "</", "Polygon", "Symboli", "zer", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Rule", ">", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\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_", "gens", "ld", "\\u", "none_", "(_", "geon", "ame_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target", "\\u", "file_", "=_", "'/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "sld", "/", "pm", "p", ":", "%", "s", "\\u", "none", ".", "sld", "'_", "%_", "(_", "geon", "ame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "open_", "(_", "target", "\\u", "file_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "str_", "(_", "Sl", "d", "List", "\\u", "Template_", "(_", "layer", "name_", "=_", "\"%", "s", " ", "No", " ", "fill", "\"_", "%_", "(_", "geon", "ame_", ")_", ",_", "layer", "title_", "=_", "\"%", "s", " ", "No", " ", "Fil", "l", "\"_", "%_", "(_", "geon", "ame_", ")_", ",_", "layer", "abs_", "=_", "\"", "A", " ", "style", " ", "showin", "g", " ", "the", " ", "bound", "aries", " ", "of", " ", "a", " ", "geo", "unit", " ", "with", " ", "a", " ", "transp", "arent", " ", "fill", "\"_", ",_", "sl", "st_", "=_", "[_", "]_", ",_", "sli", "_", "=_", "Emp", "ty", "\\u", "Template_", ",_", "lst_", "=_", "[_", "{_", "\"", "title", "\"_", ":_", "\"", "Fil", "l", "\"_", ",_", "\"", "fill", "\"_", ":_", "\"#", "FFFF", "FF", "\"_", ",_", "\"", "fill", "opa", "city", "\"_", ":_", "\"", "1.0", "\"_", "}_", "]_", ",_", "li_", "=_", "Sl", "d\\u", "Poly", "\\u", "Template_", ",_", "el", "st_", "=_", "[_", "{_", "\"", "title", "\"_", ":_", "\"", "Boundar", "y", "\"_", ",_", "\"", "strok", "e", "\"_", ":_", "\"#", "555555", "\"_", ",_", "\"", "strok", "ew", "idt", "h", "\"_", ":_", "\"", "3.0", "0", "\"_", ",_", "\"", "strok", "eo", "paci", "ty", "\"_", ":_", "\"", "1.0", "\"_", "}_", "]_", ",_", "eli", "_", "=_", "Sl", "d\\u", "Line", "\\u", "Template_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chmod_", "(_", "target", "\\u", "file_", ",_", "stat_", "._", "S", "\\u", "IR", "USR", "_", "|_", "stat_", "._", "S", "\\u", "IR", "GRP", "_", "|_", "stat_", "._", "S", "\\u", "IRO", "TH_", ")_", "\\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_", "gens", "ld", "\\u", "boundaries_", "(_", "geon", "ame_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target", "\\u", "file_", "=_", "'/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "sld", "/", "pm", "p", ":", "%", "s", "\\u", "bound", "aries", ".", "sld", "'_", "%_", "(_", "geon", "ame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "open_", "(_", "target", "\\u", "file_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "str_", "(_", "Sl", "d", "List", "\\u", "Template_", "(_", "layer", "name_", "=_", "\"%", "s", " ", "Boundar", "ies", "\"_", "%_", "(_", "geon", "ame_", ")_", ",_", "layer", "title_", "=_", "\"%", "s", " ", "Boundar", "ies", " ", "On", "ly", "\"_", "%_", "(_", "geon", "ame_", ")_", ",_", "layer", "abs_", "=_", "\"", "A", " ", "style", " ", "showin", "g", " ", "the", " ", "bound", "aries", " ", "of", " ", "a", " ", "geo", "unit", "\"_", ",_", "sl", "st_", "=_", "[_", "]_", ",_", "sli", "_", "=_", "Emp", "ty", "\\u", "Template_", ",_", "lst_", "=_", "[_", "]_", ",_", "li_", "=_", "Emp", "ty", "\\u", "Template_", ",_", "el", "st_", "=_", "[_", "{_", "\"", "title", "\"_", ":_", "\"", "Count", "y", " ", "Boundar", "ies", "\"_", ",_", "\"", "fill", "\"_", ":_", "\"#", "000000", "\"_", ",_", "\"", "fill", "opa", "city", "\"_", ":_", "\"", "0.", "0", "\"_", ",_", "\"", "strok", "e", "\"_", ":_", "\"#", "225", "5", "FF", "\"_", ",_", "\"", "strok", "ew", "idt", "h", "\"_", ":_", "\"", "2", "\"_", ",_", "\"", "strok", "eo", "paci", "ty", "\"_", ":_", "\"", "0.35", "\"_", "}_", "]_", ",_", "eli", "_", "=_", "Sl", "d\\u", "Poly", "B", "\\u", "Template_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chmod_", "(_", "target", "\\u", "file_", ",_", "stat_", "._", "S", "\\u", "IR", "USR", "_", "|_", "stat_", "._", "S", "\\u", "IR", "GRP", "_", "|_", "stat_", "._", "S", "\\u", "IRO", "TH_", ")_", "\\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_", "gens", "ld", "\\u", "chor", "o_", "(_", "geon", "ame_", ",_", "varname_", ",_", "vart", "itle_", ",_", "quantiles", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "gens", "ld", "\\u", "chor", "o", "\\u", "internal_", "(_", "geon", "ame_", ",_", "varname_", ",_", "vart", "itle_", ",_", "quantiles", "_", ",_", "unit_", "=_", "\"", "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_", "def_", "gens", "ld", "\\u", "chor", "o", "\\u", "internal_", "(_", "geon", "ame_", ",_", "varname_", ",_", "vart", "itle_", ",_", "quantiles", "_", ",_", "unit_", "=_", "\"", "number", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "WARN", "ING", ":", " ", "sld", " ", "files", " ", "need", " ", "to", " ", "be", " ", "lower", " ", "case", " ", "to", " ", "be", " ", "compatible", " ", "with", " ", "postgres", " ", "views_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "lv", "arn", "ame_", "=_", "string_", "._", "lower_", "(_", "varname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "\\u", "file_", "=_", "'/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "sld", "/", "pm", "p", ":", "%", "s", "\\u", "%", "s", ".", "sld", "'_", "%_", "(_", "geon", "ame_", ",_", "lv", "arn", "ame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vara", "bs_", "=_", "\"", "Gra", "ysc", "ale", " ", "chor", "opl", "eth", " ", "based", " ", "on", " ", "quantiles", " ", "of", " ", "%", "s", "\"_", "%_", "(_", "varname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "list_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "top", "\"_", ":_", "str_", "(_", "quantiles", "_", "[_", "4_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "bottom", "\"_", ":_", "str_", "(_", "quantiles", "_", "[_", "3_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fill", "\"_", ":_", "\"#", "444444", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fill", "opa", "city", "\"_", ":_", "\"", "1.0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "unit", "\"_", ":_", "unit_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "top", "\"_", ":_", "str_", "(_", "quantiles", "_", "[_", "3_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "bottom", "\"_", ":_", "str_", "(_", "quantiles", "_", "[_", "2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fill", "\"_", ":_", "\"#", "777777", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fill", "opa", "city", "\"_", ":_", "\"", "1.0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "unit", "\"_", ":_", "unit_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "top", "\"_", ":_", "str_", "(_", "quantiles", "_", "[_", "2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "bottom", "\"_", ":_", "str_", "(_", "quantiles", "_", "[_", "1_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fill", "\"_", ":_", "\"#", "AAAAAA", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fill", "opa", "city", "\"_", ":_", "\"", "1.0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "unit", "\"_", ":_", "unit_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "top", "\"_", ":_", "str_", "(_", "quantiles", "_", "[_", "1_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "bottom", "\"_", ":_", "str_", "(_", "quantiles", "_", "[_", "0_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fill", "\"_", ":_", "\"#", "EEE", "EEE", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fill", "opa", "city", "\"_", ":_", "\"", "1.0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "unit", "\"_", ":_", "unit_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sval", "uel", "ist_", "=_", "[_", "{_", "\"", "top", "\"_", ":_", "str_", "(_", "quantiles", "_", "[_", "5_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "bottom", "\"_", ":_", "str_", "(_", "quantiles", "_", "[_", "4_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fill", "\"_", ":_", "\"#", "000000", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fill", "opa", "city", "\"_", ":_", "\"", "1.0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "unit", "\"_", ":_", "unit_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "open_", "(_", "target", "\\u", "file_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "str_", "(_", "Sl", "d", "List", "\\u", "Template_", "(_", "layer", "name_", "=_", "lv", "arn", "ame_", ",_", "layer", "title_", "=_", "vart", "itle_", ",_", "layer", "abs_", "=_", "vara", "bs_", ",_", "sl", "st_", "=_", "sval", "uel", "ist_", ",_", "sli", "_", "=_", "Sl", "d\\u", "UR", "ange", "\\u", "Template_", ",_", "lst_", "=_", "value", "list_", ",_", "li_", "=_", "Sl", "d\\u", "Range", "\\u", "Template_", ",_", "el", "st_", "=_", "[_", "{_", "\"", "title", "\"_", ":_", "\"", "Boundar", "y", "\"_", ",_", "\"", "strok", "e", "\"_", ":_", "\"#", "555555", "\"_", ",_", "\"", "strok", "ew", "idt", "h", "\"_", ":_", "\"", "0.25", "\"_", ",_", "\"", "strok", "eo", "paci", "ty", "\"_", ":_", "\"", "1.0", "\"_", "}_", "]_", ",_", "eli", "_", "=_", "Sl", "d\\u", "Line", "\\u", "Template_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chmod_", "(_", "target", "\\u", "file_", ",_", "stat_", "._", "S", "\\u", "IR", "USR", "_", "|_", "stat_", "._", "S", "\\u", "IR", "GRP", "_", "|_", "stat_", "._", "S", "\\u", "IRO", "TH_", ")_", "\\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_", "gens", "ld", "\\u", "chor", "o", "\\u", "den", "quin", "t_", "(_", "geon", "ame_", ",_", "varname_", ",_", "vart", "itle_", ",_", "dummy_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "quantiles", "_", "=_", "[_", "0_", ",_", "0.2_", ",_", "0.4_", ",_", "0.6_", ",_", "0.8_", ",_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gens", "ld", "\\u", "chor", "o", "\\u", "internal_", "(_", "geon", "ame_", ",_", "varname_", ",_", "vart", "itle_", ",_", "quantiles", "_", ",_", "unit_", "=_", "\"", "percentage", "\"_", ")_", "\\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_", "Config", "\\u", "Template_", "(_", "Dict", "ionar", "y", "Template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "template_", "=_", "\"\"\"", "<!", "--", " ", "Define", " ", "Intern", "al", " ", "Entit", "ies", " ", "to", " ", "avoid", " ", "Repeat", "ed", " ", "Enter", "ing", " ", "of", " ", "Value", "s", " ", "-->", "\\", "10", ";<", "!", "DOC", "TYPE", " ", "Distr", "ict", "Build", "er", " ", "[", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "num", "\\u", "district", "s", "\\u", "congr", "ess", " ", "\"%", "(", "num", "\\u", "district", "s", "\\u", "congr", "ess", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "num", "\\u", "district", "s", "\\u", "house", " ", "\"%", "(", "num", "\\u", "district", "s", "\\u", "house", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "num", "\\u", "district", "s", "\\u", "sena", "te", " ", "\"%", "(", "num", "\\u", "district", "s", "\\u", "sena", "te", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "pop", "\\u", "congr", "ess", " ", "\"%", "(", "pop", "\\u", "congr", "ess", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "pop", "\\u", "house", " ", "\"%", "(", "pop", "\\u", "house", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "pop", "\\u", "sena", "te", " ", "\"%", "(", "pop", "\\u", "sena", "te", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "pop", "\\u", "congr", "ess", "\\u", "min", " ", "\"%", "(", "pop", "\\u", "congr", "ess", "\\u", "min", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "pop", "\\u", "house", "\\u", "min", " ", "\"%", "(", "pop", "\\u", "house", "\\u", "min", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "pop", "\\u", "sena", "te", "\\u", "min", " ", "\"%", "(", "pop", "\\u", "sena", "te", "\\u", "min", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "pop", "\\u", "congr", "ess", "\\u", "max", " ", "\"%", "(", "pop", "\\u", "congr", "ess", "\\u", "max", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "pop", "\\u", "house", "\\u", "max", " ", "\"%", "(", "pop", "\\u", "house", "\\u", "max", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "pop", "\\u", "sena", "te", "\\u", "max", " ", "\"%", "(", "pop", "\\u", "sena", "te", "\\u", "max", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "target", "\\u", "his", "p", "\\u", "congr", "ess", " ", "\"%", "(", "target", "\\u", "his", "p", "\\u", "congr", "ess", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "target", "\\u", "his", "p", "\\u", "sena", "te", " ", "\"%", "(", "target", "\\u", "his", "p", "\\u", "sena", "te", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "target", "\\u", "his", "p", "\\u", "house", " ", "\"%", "(", "target", "\\u", "his", "p", "\\u", "house", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "target", "\\u", "bl", "\\u", "congr", "ess", " ", "\"%", "(", "target", "\\u", "bl", "\\u", "congr", "ess", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "target", "\\u", "bl", "\\u", "sena", "te", " ", "\"%", "(", "target", "\\u", "bl", "\\u", "sena", "te", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "target", "\\u", "bl", "\\u", "house", " ", "\"%", "(", "target", "\\u", "bl", "\\u", "house", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "target", "\\u", "na", "\\u", "sena", "te", " ", "\"%", "(", "target", "\\u", "na", "\\u", "sena", "te", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "target", "\\u", "na", "\\u", "house", " ", "\"%", "(", "target", "\\u", "na", "\\u", "house", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "ENTITY", " ", "target", "\\u", "na", "\\u", "congr", "ess", " ", "\"%", "(", "target", "\\u", "na", "\\u", "congr", "ess", ")", "s", "\">", "\\", "10", ";", " ", "]>", "\\", "10", ";", "\\", "10", ";<", "Distr", "ict", "Build", "er", ">", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "Define", " ", "legislat", "ive", " ", "bodi", "es", " ", "referenced", " ", "in", " ", "the", " ", "system", ".", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "ies", ">", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "A", " ", "Legi", "slat", "ive", " ", "body", " ", "has", " ", "an", " ", "ID", " ", "(", "for", " ", "referenci", "ng", " ", "in", " ", "Geo", "Leve", "l", "\\", "10", ";", " ", " ", " ", " ", "definit", "ion", "s", " ", "late", "r", "),", " ", "a", " ", "name", ",", " ", "and", " ", "a", " ", "label", " ", "for", " ", "plan", " ", "items", " ", "\\", "10", ";", " ", " ", " ", " ", "(\"", "Distr", "ict", "\"", " ", "for", " ", "Cong", "ressi", "onal", ",", " ", "etc", ")", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "y", " ", "id", "=\"", "congr", "ess", "\"", " ", "name", "=\"", "Cong", "ressi", "onal", "\"", " ", "member", "=\"", "Distr", "ict", " ", "%%", "s", "\"", " ", "maxd", "istr", "icts", "=\"", "&", "num", "\\u", "district", "s", "\\u", "congr", "ess", ";", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "y", " ", "id", "=\"", "house", "\"", " ", "name", "=\"", "State", " ", "House", "\"", " ", "member", "=\"", "Distr", "ict", " ", "%%", "s", "\"", " ", "maxd", "istr", "icts", "=\"", "&", "num", "\\u", "district", "s", "\\u", "house", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "y", " ", "id", "=\"", "sena", "te", "\"", " ", "name", "=\"", "State", " ", "Sen", "ate", "\"", " ", "member", "=\"", "Distr", "ict", " ", "%%", "s", "\"", " ", "maxd", "istr", "icts", "=\"", "&", "num", "\\u", "district", "s", "\\u", "sena", "te", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Bod", "ies", ">", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "A", " ", "list", " ", "of", " ", "subject", "s", " ", "referenced", " ", "in", " ", "the", " ", "system", ".", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "s", ">", " ", " ", " ", "\\", "10", ";", "\t", " ", "<!", "--", " ", "A", " ", "Sub", "ject", " ", "is", " ", "a", " ", "measure", "ment", " ", "type", ",", " ", "suc", "h", " ", "as", " ", "\"", "Total", " ", "Popula", "tion", "\".", " ", " ", " ", " ", "\\", "10", ";", "\t", " ", "The", " ", "subject", " ", "is", " ", "mapp", "ed", " ", "to", " ", "an", " ", "attribute", " ", "dur", "ing", " ", "the", " ", "import", " ", "phase", ",", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "contain", "s", " ", "a", " ", "long", " ", "and", " ", "short", " ", "display", " ", "name", ".", " ", "Sub", "ject", "s", " ", "have", " ", "ID", "s", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "referenci", "ng", " ", "in", " ", "Geo", "Leve", "l", " ", "definit", "ion", "s", " ", "late", "r", ".", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", " ", "id", "=\"", "vap", "\\u", "b", "\"", " ", "field", "=\"", "VA", "P", "\\u", "B", "\"", " ", "name", "=\"", "Af", "rica", "n", "-", "Ame", "rica", "n", " ", "Vo", "ting", " ", "Age", " ", "Popula", "tion", "\"", " ", "short", "\\u", "name", "=\"", "Black", " ", "VA", "P", " ", "\"", " ", "displaye", "d", "=\"", "true", "\"", " ", "sort", "key", "=\"", "1", "\"", " ", "percentage", "\\u", "denominator", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", " ", "id", "=\"", "vap", "\\u", "h", "\"", " ", "field", "=\"", "VA", "P", "\\u", "H", "\"", " ", "name", "=\"", "Hi", "span", "ic", " ", "or", " ", "Lat", "ino", " ", "voting", " ", "age", " ", "popul", "ation", "\"", " ", "short", "\\u", "name", "=\"", "Hi", "span", "ic", " ", "VA", "P", "\"", " ", "displaye", "d", "=\"", "true", "\"", " ", "sort", "key", "=\"", "2", "\"", " ", "percentage", "\\u", "denominator", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", " ", "id", "=\"", "vap", "\\u", "na", "\"", " ", "field", "=\"", "VA", "P", "\\u", "NA", "\"", " ", "name", "=\"", "Nat", "ive", " ", "Ame", "rica", "n", " ", "Vo", "ting", " ", "Age", " ", "Popula", "tion", "\"", " ", "short", "\\u", "name", "=\"", "Nat", " ", "Ame", "r", " ", "VA", "P", "\"", " ", "displaye", "d", "=\"", "true", "\"", " ", "sort", "key", "=\"", "4", "\"", " ", "percentage", "\\u", "denominator", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", " ", "id", "=\"", "vote", "\\u", "dem", "\"", " ", "field", "=\"", "VO", "TE", "\\u", "DEM", "\"", " ", "name", "=\"", "num", " ", "like", "ly", " ", "Demo", "cra", "tic", " ", "voter", "s", "\"", " ", "short", "\\u", "name", "=\"", "Demo", "cra", "tic", " ", "voter", "s", "\"", " ", "displaye", "d", "=\"", "true", "\"", " ", "sort", "key", "=\"", "3", "\"", " ", "percentage", "\\u", "denominator", "=\"", "vote", "\\u", "tot", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", " ", "id", "=\"", "vote", "\\u", "rep", "\"", " ", "field", "=\"", "VO", "TE", "\\u", "REP", "\"", " ", "name", "=\"", "num", " ", "like", "ly", " ", "Rep", "ubli", "can", " ", "voter", "s", "\"", " ", "short", "\\u", "name", "=\"", "Rep", "ubli", "can", " ", "voter", "s", "\"", " ", "displaye", "d", "=\"", "true", "\"", " ", "sort", "key", "=\"", "5", "\"", " ", "percentage", "\\u", "denominator", "=\"", "vote", "\\u", "tot", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", " ", "id", "=\"", "vote", "\\u", "tot", "\"", " ", "field", "=\"", "VO", "TE", "\\u", "TO", "T", "\"", " ", "name", "=\"", "num", " ", "like", "ly", " ", "Rep", "/", "Dem", " ", "voter", "s", "\"", " ", "short", "\\u", "name", "=\"", "Rep", "+", " ", "Dem", " ", "vote", "\"", " ", "displaye", "d", "=\"", "fal", "se", "\"", " ", "sort", "key", "=\"", "6", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", " ", "id", "=\"", "vote", "\\u", "dem", "\\u", "norm", "\"", " ", "field", "=\"", "VO", "TE", "\\u", "DEM", "\\u", "N", "\"", " ", "name", "=\"", "num", " ", "of", " ", "like", "ly", " ", "Demo", "cra", "tic", " ", "voter", "s", " ", "normali", "zed", " ", "to", " ", "50", "/", "50", " ", "state", " ", "baseline", "\"", " ", "short", "\\u", "name", "=\"", "Normal", " ", "Dem", " ", "vote", "\"", " ", "displaye", "d", "=\"", "true", "\"", " ", "sort", "key", "=\"", "1", "8", "\"", " ", "percentage", "\\u", "denominator", "=\"", "vote", "\\u", "tot", "\\u", "norm", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", " ", "id", "=\"", "vote", "\\u", "rep", "\\u", "norm", "\"", " ", "field", "=\"", "VO", "TE", "\\u", "REP", "\\u", "N", "\"", " ", "name", "=\"", "num", " ", "of", " ", "like", "ly", " ", "Rep", "ubli", "can", " ", "voter", "s", " ", "normali", "zed", " ", "to", " ", "50", "/", "50", " ", "state", " ", "baseline", "\"", " ", "short", "\\u", "name", "=\"", "Normal", " ", "Rep", " ", "vote", "\"", " ", "displaye", "d", "=\"", "true", "\"", " ", "sort", "key", "=\"", "1", "9", "\"", " ", "percentage", "\\u", "denominator", "=\"", "vote", "\\u", "tot", "\\u", "norm", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", " ", "id", "=\"", "vote", "\\u", "tot", "\\u", "norm", "\"", " ", "field", "=\"", "VO", "TE", "\\u", "TO", "T", "\\u", "N", "\"", " ", "name", "=\"", "number", " ", "of", " ", "like", "ly", " ", "Rep", "ubli", "can", " ", "and", " ", "Demo", "cra", "tic", " ", "voter", "s", " ", "normali", "zed", " ", "to", " ", "50", "/", "50", " ", "state", " ", "baseline", "\"", " ", "short", "\\u", "name", "=\"", "Normal", " ", "2", "-", "part", "y", " ", "vote", "\"", " ", "displaye", "d", "=\"", "fal", "se", "\"", " ", "sort", "key", "=\"", "20", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", " ", "id", "=\"", "vap", "\"", " ", "field", "=\"", "VA", "P", "\"", " ", "name", "=\"", "Vo", "ting", " ", "Age", " ", "Popula", "tion", "\"", " ", "short", "\\u", "name", "=\"", "vap", "\"", " ", "displaye", "d", "=\"", "true", "\"", " ", "sort", "key", "=\"", "7", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", " ", "id", "=\"", "tot", "pop", "\\u", "b", "\"", " ", "field", "=\"", "TO", "TP", "OP", "\\u", "B", "\"", " ", "name", "=\"", "Af", "rica", "n", "-", "Ame", "rica", "n", "\"", " ", "short", "\\u", "name", "=\"", "Black", "\"", " ", "displaye", "d", "=\"", "fal", "se", "\"", " ", "sort", "key", "=\"", "8", "\"", " ", "percentage", "\\u", "denominator", "=\"", "tot", "pop", "\"/>", " ", " ", " ", " ", "\\", "10", ";", "\t", "<", "Sub", "ject", " ", "id", "=\"", "tot", "pop", "\\u", "h", "\"", " ", "field", "=\"", "TO", "TP", "OP", "\\u", "H", "\"", " ", "name", "=\"", "Hi", "span", "ic", " ", "or", " ", "Lat", "ino", "\"", " ", "short", "\\u", "name", "=\"", "Hi", "span", "ic", "\"", " ", "displaye", "d", "=\"", "fal", "se", "\"", " ", "sort", "key", "=\"", "9", "\"", " ", "percentage", "\\u", "denominator", "=\"", "tot", "pop", "\"/>", "\\", "10", ";", "\t", "<", "Sub", "ject", " ", "id", "=\"", "tot", "pop", "\\u", "na", "\"", " ", "field", "=\"", "TO", "TP", "OP", "\\u", "NA", "\"", " ", "name", "=\"", "Nat", "ive", " ", "Ame", "rica", "n", "\"", " ", "short", "\\u", "name", "=\"", "Nat", " ", "Ame", "r", "\"", " ", "displaye", "d", "=\"", "fal", "se", "\"", " ", "sort", "key", "=\"", "10", "\"", " ", "percentage", "\\u", "denominator", "=\"", "tot", "pop", "\"/>", "\\", "10", ";", "\t", "<", "Sub", "ject", " ", "id", "=\"", "tot", "pop", "\\u", "a", "\"", " ", "field", "=\"", "TO", "TP", "OP", "\\u", "A", "\"", " ", "name", "=\"", "Asi", "an", " ", "Popula", "tion", "\"", " ", "short", "\\u", "name", "=\"", "Asi", "an", "\"", " ", "displaye", "d", "=\"", "fal", "se", "\"", " ", "sort", "key", "=\"", "11", "\"", " ", "percentage", "\\u", "denominator", "=\"", "tot", "pop", "\"/>", "\\", "10", ";", "\t", "<", "Sub", "ject", " ", "id", "=\"", "tot", "pop", "\\u", "pi", "\"", " ", "field", "=\"", "TO", "TP", "OP", "\\u", "PI", "\"", " ", "name", "=\"", "Pac", "ifi", "c", " ", "Isl", "ander", "\"", " ", "short", "\\u", "name", "=\"", "Pac", " ", "Isl", "\"", " ", "displaye", "d", "=\"", "fal", "se", "\"", " ", "sort", "key", "=\"", "1", "2", "\"", " ", "percentage", "\\u", "denominator", "=\"", "tot", "pop", "\"/>", "\\", "10", ";", "\t", "<", "Sub", "ject", " ", "id", "=\"", "tot", "pop", "\\u", "wn", "h", "\"", " ", "field", "=\"", "TO", "TP", "OP", "\\u", "WN", "H", "\"", " ", "name", "=\"", "White", " ", "Non", "-", "Hi", "span", "ic", "\"", " ", "short", "\\u", "name", "=\"", "White", "\"", " ", "displaye", "d", "=\"", "fal", "se", "\"", " ", "sort", "key", "=\"", "13", "\"", " ", "percentage", "\\u", "denominator", "=\"", "tot", "pop", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", " ", "id", "=\"", "tot", "pop", "\"", " ", "field", "=\"", "TO", "TP", "OP", "\"", " ", "name", "=\"", "Total", " ", "Popula", "tion", "\"", " ", "short", "\\u", "name", "=\"", "Total", " ", "Pop", ".\"", " ", "displaye", "d", "=\"", "true", "\"", " ", "sort", "key", "=\"", "14", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", " ", "id", "=\"", "vap", "\\u", "a", "\"", " ", "field", "=\"", "VA", "P", "\\u", "A", "\"", " ", "name", "=\"", "Asi", "an", " ", "Vo", "ting", " ", "Age", " ", "Popula", "tion", "\"", " ", "short", "\\u", "name", "=\"", "Asi", "an", " ", "VA", "P", "\"", " ", "displaye", "d", "=\"", "true", "\"", " ", "sort", "key", "=\"", "15", "\"", " ", "percentage", "\\u", "denominator", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", " ", "id", "=\"", "vap", "\\u", "pi", "\"", " ", "field", "=\"", "VA", "P", "\\u", "PI", "\"", " ", "name", "=\"", "Pac", "ifi", "c", " ", "Isl", "ander", " ", "Vo", "ting", " ", "Age", " ", "Popula", "tion", "\"", " ", "short", "\\u", "name", "=\"", "Pac", "ifi", "c", " ", "VA", "P", "\"", " ", "displaye", "d", "=\"", "true", "\"", " ", "sort", "key", "=\"", "16", "\"", " ", "percentage", "\\u", "denominator", "=\"", "vap", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", " ", "id", "=\"", "vap", "\\u", "wn", "h", "\"", " ", "field", "=\"", "VA", "P", "\\u", "WN", "H", "\"", " ", "name", "=\"", "White", " ", "Non", "-", "Hi", "span", "ic", " ", "Vo", "ting", " ", "Age", " ", "Popula", "tion", "\"", " ", "short", "\\u", "name", "=\"", "White", " ", "VA", "P", "\"", " ", "displaye", "d", "=\"", "true", "\"", " ", "sort", "key", "=\"", "1", "7", "\"", " ", "percentage", "\\u", "denominator", "=\"", "vap", "\"/>", "\\", "10", ";", " ", " ", " ", "</", "Sub", "ject", "s", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Sco", "ring", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "A", " ", "district", " ", "score", " ", "tha", "t", " ", "return", "s", " ", "a", " ", "literal", " ", "value", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "popt", "ot", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Total", " ", "Pop", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "tot", "pop", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "tot", "pop", "\\u", "b", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Black", " ", "VA", "P", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "tot", "pop", "\\u", "b", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "tot", "pop", "\\u", "h", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Hi", "span", "ic", " ", "VA", "P", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "tot", "pop", "\\u", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "tot", "pop", "\\u", "a", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Asi", "an", " ", "VA", "P", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "tot", "pop", "\\u", "a", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "tot", "pop", "\\u", "na", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Nat", "ive", " ", "Ame", "rica", "n", " ", "VA", "P", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "tot", "pop", "\\u", "na", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "tot", "pop", "\\u", "pi", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Pac", "ifi", "c", " ", "Isl", "ander", " ", "VA", "P", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "tot", "pop", "\\u", "pi", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "tot", "pop", "\\u", "wn", "h", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Pac", "ifi", "c", " ", "Isl", "ander", " ", "VA", "P", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "tot", "pop", "\\u", "wn", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "vap", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "VA", "P", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "vap", "\\u", "b", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Black", " ", "VA", "P", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "vap", "\\u", "b", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "vap", "\\u", "h", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Hi", "span", "ic", " ", "VA", "P", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "vap", "\\u", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "vap", "\\u", "a", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Asi", "an", " ", "VA", "P", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "vap", "\\u", "a", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "vap", "\\u", "na", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Nat", "ive", " ", "Ame", "rica", "n", " ", "VA", "P", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "vap", "\\u", "na", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "vap", "\\u", "pi", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Pac", "ifi", "c", " ", "Isl", "ander", " ", "VA", "P", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "vap", "\\u", "pi", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "vap", "\\u", "wn", "h", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Pac", "ifi", "c", " ", "Isl", "ander", " ", "VA", "P", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "vap", "\\u", "wn", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "A", " ", "district", " ", "score", " ", "tha", "t", " ", "return", "s", " ", "a", " ", "percentage", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "blk", "vap", "\\u", "percent", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Perce", "nt", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Black", " ", "VA", "P", " ", "%%", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "numerat", "or", "\"", " ", "ref", "=\"", "vap", "\\u", "b", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "denominator", "\"", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "blk", "vap", "\\u", "thresh", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Thresh", "old", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Black", " ", "VA", "P", " ", "Thresh", "old", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "district", "\\u", "blk", "vap", "\\u", "percent", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "threshol", "d", "\"", " ", "value", "=\"", "0.", "5", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "his", "pv", "ap", "\\u", "percent", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Perce", "nt", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Hi", "sp", ".", " ", "VA", "P", " ", "%%", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "numerat", "or", "\"", " ", "ref", "=\"", "vap", "\\u", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "denominator", "\"", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "his", "pv", "ap", "\\u", "thresh", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Thresh", "old", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Hi", "sp", ".", " ", "VA", "P", " ", "Thresh", "old", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "district", "\\u", "his", "pv", "ap", "\\u", "percent", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "threshol", "d", "\"", " ", "value", "=\"", "0.", "5", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "nav", "ap", "\\u", "percent", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Perce", "nt", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Nat", "ive", " ", "Ame", "rica", "n", " ", "VA", "P", " ", "%%", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "numerat", "or", "\"", " ", "ref", "=\"", "vap", "\\u", "na", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "denominator", "\"", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "nav", "ap", "\\u", "thresh", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Thresh", "old", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Nat", "ive", " ", "Ame", "rica", "n", " ", "VA", "P", " ", "Thresh", "old", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "district", "\\u", "nav", "ap", "\\u", "percent", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "threshol", "d", "\"", " ", "value", "=\"", "0.", "5", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "ava", "p", "\\u", "percent", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Perce", "nt", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Asi", "an", " ", "VA", "P", " ", "%%", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "numerat", "or", "\"", " ", "ref", "=\"", "vap", "\\u", "a", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "denominator", "\"", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "ava", "p", "\\u", "thresh", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Thresh", "old", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Asi", "an", " ", "VA", "P", " ", "Thresh", "old", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "district", "\\u", "ava", "p", "\\u", "percent", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "threshol", "d", "\"", " ", "value", "=\"", "0.", "5", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "piv", "ap", "\\u", "percent", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Perce", "nt", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Pac", "ifi", "c", " ", "Isl", "ander", " ", "VA", "P", " ", "%%", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "numerat", "or", "\"", " ", "ref", "=\"", "vap", "\\u", "pi", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "denominator", "\"", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "piv", "ap", "\\u", "thresh", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Thresh", "old", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Pac", "ifi", "c", " ", "Isl", "ander", " ", "VA", "P", " ", "Thresh", "old", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "district", "\\u", "piv", "ap", "\\u", "percent", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "threshol", "d", "\"", " ", "value", "=\"", "0.", "5", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "wn", "hva", "p", "\\u", "percent", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Perce", "nt", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "White", " ", "VA", "P", " ", "%%", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "numerat", "or", "\"", " ", "ref", "=\"", "vap", "\\u", "wn", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "denominator", "\"", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "wn", "hva", "p", "\\u", "thresh", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Thresh", "old", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "White", " ", "VA", "P", " ", "Thresh", "old", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "district", "\\u", "wn", "hva", "p", "\\u", "percent", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "threshol", "d", "\"", " ", "value", "=\"", "0.", "5", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "vote", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Estimated", " ", "vote", "s", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "vote", "\\u", "tot", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "vote", "\\u", "dem", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Estimated", " ", "Demo", "cra", "tic", " ", "vote", "s", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "vote", "\\u", "dem", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "vote", "\\u", "rep", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Estimated", " ", "vote", "s", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "vote", "\\u", "rep", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "vote", "\\u", "dem", "\\u", "percent", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Perce", "nt", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Demo", "cra", "tic", " ", "Predicte", "d", " ", "Vote", " ", "%%", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "numerat", "or", "\"", " ", "ref", "=\"", "vote", "\\u", "dem", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "denominator", "\"", " ", "ref", "=\"", "vote", "\\u", "tot", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "vote", "\\u", "dem", "\\u", "thresh", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Thresh", "old", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Demo", "cra", "tic", " ", "Predicte", "d", " ", "Vote", " ", "Thresh", "old", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "district", "\\u", "vote", "\\u", "dem", "\\u", "percent", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "threshol", "d", "\"", " ", "value", "=\"", "0.", "5", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "vote", "\\u", "rep", "\\u", "percent", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Perce", "nt", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Rep", "ubli", "can", " ", "Predicte", "d", " ", "Vote", " ", "%%", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "numerat", "or", "\"", " ", "ref", "=\"", "vote", "\\u", "rep", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "denominator", "\"", " ", "ref", "=\"", "vote", "\\u", "tot", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "vote", "\\u", "rep", "\\u", "thresh", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Thresh", "old", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Rep", "ubli", "can", " ", "Predicte", "d", " ", "Vote", " ", "Thresh", "old", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "district", "\\u", "vote", "\\u", "rep", "\\u", "percent", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "threshol", "d", "\"", " ", "value", "=\"", "0.", "5", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "A", " ", "district", " ", "score", " ", "tha", "t", " ", "generat", "es", " ", "classe", "s", " ", "based", " ", "on", " ", "a", " ", "couple", "\\", "10", ";", " ", " ", " ", " ", "ranges", " ", "aro", "und", " ", "a", " ", "mean", " ", "value", ".", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "popt", "ot", "\\u", "uit", "arget", "\\u", "congr", "ess", "\"", " ", "type", "=\"", "district", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Target", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "tot", "pop", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "pop", "\\u", "congr", "ess", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "range", "1", "\"", " ", "value", "=\"", "0.005", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "range", "2", "\"", " ", "value", "=\"", "0.010", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "popt", "ot", "\\u", "uit", "arget", "\\u", "house", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Target", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "tot", "pop", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "%", "(", "pop", "\\u", "house", ")", "s", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "range", "1", "\"", " ", "value", "=\"", "0.05", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "range", "2", "\"", " ", "value", "=\"", "0.10", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "popt", "ot", "\\u", "uit", "arget", "\\u", "sena", "te", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Target", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "tot", "pop", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "%", "(", "pop", "\\u", "sena", "te", ")", "s", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "range", "1", "\"", " ", "value", "=\"", "0.05", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "range", "2", "\"", " ", "value", "=\"", "0.10", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "A", " ", "district", " ", "score", " ", "tha", "t", " ", "return", "s", " ", "1", "(", "T", ")", " ", "if", " ", "the", " ", "subject", " ", "value", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "bet", "ween", " ", "the", " ", "ranges", ",", " ", "other", "wis", "e", " ", "return", "s", " ", "0", "(", "F", ").", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "popt", "ot", "\\u", "range", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Range", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Tot", " ", "Pop", " ", "Range", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "tot", "pop", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "min", "\"", " ", "value", "=\"", "&", "pop", "\\u", "congr", "ess", "\\u", "min", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "max", "\"", " ", "value", "=\"", "&", "pop", "\\u", "congr", "ess", "\\u", "max", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "A", " ", "district", " ", "score", " ", "tha", "t", " ", "is", " ", "threshol", "d", " ", "dependent", ",", " ", "and", " ", "return", "s", " ", "\\", "10", ";", " ", " ", " ", " ", "T", "/", "F", ";", " ", "this", " ", "example", " ", "use", "s", " ", "2", " ", "score", " ", "function", "s", ":", " ", "1", " ", "to", " ", "combin", "e", " ", "a", " ", "\\", "10", ";", " ", " ", " ", " ", "set", " ", "of", " ", "subject", "s", ",", " ", "and", " ", "2", " ", "to", " ", "divide", " ", "the", " ", "sum", " ", "over", " ", "anot", "her", " ", "\\", "10", ";", " ", " ", " ", " ", "subject", ".", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "mint", "ot", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "tot", "pop", "\\u", "b", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "2", "\"", " ", "ref", "=\"", "tot", "pop", "\\u", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "3", "\"", " ", "ref", "=\"", "tot", "pop", "\\u", "na", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "maj", "min", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Divide", "And", "Thresh", "old", "\"", " ", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "numerat", "or", "\"", " ", "ref", "=\"", "district", "\\u", "mint", "ot", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "denominator", "\"", " ", "ref", "=\"", "tot", "pop", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "threshol", "d", "\"", " ", "value", "=\"", "0.", "5", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "A", " ", "custom", " ", "calculator", " ", "to", " ", "calcul", "ate", " ", "compact", "ness", ",", " ", "and", " ", "return", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "raw", " ", "compact", "ness", " ", "score", ".", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "sch", "war", "tz", "ber", "g", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sch", "war", "tz", "ber", "g", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Compact", "ness", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "A", " ", "custom", " ", "calculator", " ", "to", " ", "do", " ", "conti", "guit", "y", ",", " ", "and", " ", "is", " ", "boolean", ".", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "district", "\\u", "contiguous", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Conti", "guit", "y", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Conti", "guous", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "A", " ", "plan", " ", "score", " ", "tha", "t", " ", "aggregates", " ", "all", " ", "literal", " ", "values", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "sum", "\\u", "equip", "op", "\"", " ", "type", "=\"", "plan", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Equal", " ", "Popula", "tion", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "district", "\\u", "popt", "ot", "\\u", "range", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "all", "\\u", "equip", "op", "\"", " ", "type", "=\"", "plan", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Thresh", "old", "\"", " ", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "plan", "\\u", "sum", "\\u", "equip", "op", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "threshol", "d", "\"", " ", "value", "=\"", "0", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "A", " ", "plan", " ", "score", " ", "tha", "t", " ", "aggregates", " ", "all", " ", "district", "s", " ", "over", " ", "a", " ", "threshol", "d", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "count", "\\u", "maj", "min", "\"", " ", "type", "=\"", "plan", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "district", "\\u", "maj", "min", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "blk", "vap", "\\u", "thresh", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Maj", "ori", "ty", " ", "Black", " ", "Distr", "icts", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "district", "\\u", "blk", "vap", "\\u", "thresh", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "his", "pv", "ap", "\\u", "thresh", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Maj", "ori", "ty", " ", "Hi", "span", "ic", " ", "Distr", "icts", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "district", "\\u", "his", "pv", "ap", "\\u", "thresh", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "nav", "ap", "\\u", "thresh", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Maj", "ori", "ty", " ", "Asi", "an", " ", "Distr", "icts", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "district", "\\u", "nav", "ap", "\\u", "thresh", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "ava", "p", "\\u", "thresh", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Maj", "ori", "ty", " ", "Asi", "an", " ", "Distr", "icts", "\"", " ", "user", "\\u", "selectable", "=\"", "true", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "district", "\\u", "ava", "p", "\\u", "thresh", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "piv", "ap", "\\u", "thresh", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "district", "\\u", "piv", "ap", "\\u", "thresh", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "A", " ", "plan", " ", "score", " ", "tha", "t", " ", "evaluate", "s", " ", "a", " ", "threshol", "d", ",", " ", "and", " ", "return", "s", " ", "T", "/", "F", ".", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "plan", " ", "score", " ", "checks", " ", "tha", "t", " ", "all", " ", "district", "s", " ", "are", " ", "within", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "popul", "ation", " ", "limit", "s", ".", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "popt", "ot", "\\u", "inr", "ange", "\"", " ", "type", "=\"", "plan", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Thresh", "old", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "district", "\\u", "popt", "ot", "\\u", "range", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "threshol", "d", "\"", " ", "value", "=\"", "0", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "A", " ", "plan", " ", "score", " ", "tha", "t", " ", "evaluate", "s", " ", "all", " ", "district", "s", ",", " ", "and", " ", "return", "s", "\\", "10", ";", " ", " ", " ", " ", "1", "(", "T", ")", " ", "if", " ", "there", " ", "is", " ", "more", " ", "than", " ", "0", " ", "district", "s", " ", "tha", "t", " ", "have", " ", "a", " ", "mino", "rity", "\\", "10", ";", " ", " ", " ", " ", "major", "it", "y", ".", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "major", "\\u", "mino", "r", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Thresh", "old", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Maj", "ori", "ty", "-", "Min", "ori", "ty", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "district", "\\u", "maj", "min", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "threshol", "d", "\"", " ", "value", "=\"", "0", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "contiguous", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sum", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Conti", "guous", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Arg", "ument", " ", "name", "=\"", "value", "1", "\"", " ", "ref", "=\"", "district", "\\u", "contiguous", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "b", "\\u", "plan", "\\u", "congr", "ess", "\\u", "nonc", "onti", "guous", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Conti", "guit", "y", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Conti", "guous", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "num", "\\u", "district", "s", "\\u", "congr", "ess", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "b", "\\u", "plan", "\\u", "house", "\\u", "nonc", "onti", "guous", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Conti", "guit", "y", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Conti", "guous", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "num", "\\u", "district", "s", "\\u", "house", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "b", "\\u", "plan", "\\u", "sena", "te", "\\u", "nonc", "onti", "guous", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Conti", "guit", "y", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Conti", "guous", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "num", "\\u", "district", "s", "\\u", "sena", "te", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "interval", " ", "score", " ", "function", " ", "for", " ", "popul", "ation", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "a", "\\u", "congr", "ession", "al", "\\u", "popul", "ation", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Tot", " ", "Pop", " ", "Range", " ", "(", "Cong", "ress", ")\"", " ", "user", "\\u", "selectable", "=\"", "true", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "Popula", "tion", " ", "interval", " ", "calculator", " ", "for", " ", "congr", "ession", "al", ".\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Interv", "al", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "subject", "\"", " ", "ref", "=\"", "tot", "pop", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "pop", "\\u", "congr", "ess", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "bound", "1", "\"", " ", "value", "=\".", "005", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "bound", "2", "\"", " ", "value", "=\".", "01", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "a", "\\u", "house", "\\u", "popul", "ation", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Tot", " ", "Pop", " ", "Range", " ", "(", "House", ")\"", " ", "user", "\\u", "selectable", "=\"", "true", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "Popula", "tion", " ", "interval", " ", "calculator", " ", "for", " ", "house", ".\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Interv", "al", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "subject", "\"", " ", "ref", "=\"", "tot", "pop", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "%", "(", "pop", "\\u", "house", ")", "s", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "bound", "1", "\"", " ", "value", "=\".", "005", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "bound", "2", "\"", " ", "value", "=\".", "01", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "a", "\\u", "sena", "te", "\\u", "popul", "ation", "\"", " ", "type", "=\"", "district", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Tot", " ", "Pop", " ", "Range", " ", "(", "Sen", "ate", ")\"", " ", "user", "\\u", "selectable", "=\"", "true", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "Popula", "tion", " ", "interval", " ", "calculator", " ", "for", " ", "sena", "te", ".\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Interv", "al", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "subject", "\"", " ", "ref", "=\"", "tot", "pop", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "%", "(", "pop", "\\u", "sena", "te", ")", "s", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "bound", "1", "\"", " ", "value", "=\".", "005", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "bound", "2", "\"", " ", "value", "=\".", "01", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "leader", "board", " ", "function", "s", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "a", "\\u", "congr", "ess", "\\u", "plan", "\\u", "count", "\\u", "district", "s", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Count", "Distr", "icts", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Count", " ", "Distr", "icts", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "The", " ", "number", " ", "of", " ", "district", "s", " ", "in", " ", "a", " ", "Cong", "ressi", "onal", " ", "redis", "tric", "ting", " ", "plan", " ", "must", " ", "be", " ", "&", "num", "\\u", "district", "s", "\\u", "congr", "ess", ";", ".\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "num", "\\u", "district", "s", "\\u", "congr", "ess", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "a", "\\u", "house", "\\u", "plan", "\\u", "count", "\\u", "district", "s", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Count", "Distr", "icts", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Count", " ", "Distr", "icts", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "The", " ", "number", " ", "of", " ", "district", "s", " ", "in", " ", "a", " ", "House", " ", "of", " ", "Delegate", "s", " ", "redis", "tric", "ting", " ", "plan", " ", "must", " ", "be", " ", "&", "num", "\\u", "district", "s", "\\u", "house", ";", ".\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "num", "\\u", "district", "s", "\\u", "house", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "a", "\\u", "sena", "te", "\\u", "plan", "\\u", "count", "\\u", "district", "s", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Count", "Distr", "icts", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Count", " ", "Distr", "icts", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "The", " ", "number", " ", "of", " ", "district", "s", " ", "in", " ", "a", " ", "State", " ", "Sen", "ate", " ", "redis", "tric", "ting", " ", "plan", " ", "must", " ", "be", " ", "&", "num", "\\u", "district", "s", "\\u", "sena", "te", ";", ".\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "num", "\\u", "district", "s", "\\u", "sena", "te", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "a", "\\u", "congr", "ess", "\\u", "plan", "\\u", "equip", "opu", "lation", "\\u", "validation", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Equip", "opu", "lation", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Target", " ", "Pop", ".", " ", "&", "pop", "\\u", "congr", "ess", ";", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "The", " ", "popul", "ation", " ", "of", " ", "each", " ", "Cong", "ressi", "onal", " ", "district", " ", "must", " ", "be", " ", "&", "pop", "\\u", "congr", "ess", "\\u", "min", ";", "-", "&", "pop", "\\u", "congr", "ess", "\\u", "max", ";\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "min", "\"", " ", "value", "=\"", "&", "pop", "\\u", "congr", "ess", "\\u", "min", ";", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "max", "\"", " ", "value", "=\"", "&", "pop", "\\u", "congr", "ess", "\\u", "max", ";", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "tot", "pop", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "validation", "\"", " ", "value", "=\"", "1", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "a", "\\u", "congr", "ess", "\\u", "plan", "\\u", "equip", "opu", "lation", "\\u", "summar", "y", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Equip", "opu", "lation", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Target", " ", "Pop", ".", " ", "&", "pop", "\\u", "congr", "ess", ";", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "The", " ", "popul", "ation", " ", "of", " ", "each", " ", "Cong", "ressi", "onal", " ", "district", " ", "must", " ", "be", " ", "&", "pop", "\\u", "congr", "ess", "\\u", "min", ";", "-", "&", "pop", "\\u", "congr", "ess", "\\u", "max", ";\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "min", "\"", " ", "value", "=\"", "&", "pop", "\\u", "congr", "ess", "\\u", "min", ";", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "max", "\"", " ", "value", "=\"", "&", "pop", "\\u", "congr", "ess", "\\u", "max", ";", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "tot", "pop", "\"/>", "\\", "10", ";", "\t", "\t", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "num", "\\u", "district", "s", "\\u", "congr", "ess", ";", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "a", "\\u", "sena", "te", "\\u", "plan", "\\u", "equip", "opu", "lation", "\\u", "validation", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Equip", "opu", "lation", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Target", " ", "Pop", ".", " ", "%", "(", "pop", "\\u", "sena", "te", ")", "s", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "The", " ", "popul", "ation", " ", "of", " ", "each", " ", "Sen", "ate", " ", "district", " ", "must", " ", "be", " ", "&", "pop", "\\u", "sena", "te", "\\u", "min", ";", "-", "&", "pop", "\\u", "sena", "te", "\\u", "max", ";\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "min", "\"", " ", "value", "=\"", "&", "pop", "\\u", "sena", "te", "\\u", "min", ";", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "max", "\"", " ", "value", "=\"", "&", "pop", "\\u", "sena", "te", "\\u", "max", ";", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "tot", "pop", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "validation", "\"", " ", "value", "=\"", "1", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "a", "\\u", "sena", "te", "\\u", "plan", "\\u", "equip", "opu", "lation", "\\u", "summar", "y", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Equip", "opu", "lation", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Target", " ", "Pop", ".", " ", "%", "(", "pop", "\\u", "sena", "te", ")", "s", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "The", " ", "popul", "ation", " ", "of", " ", "each", " ", "Sen", "ate", " ", "district", " ", "must", " ", "be", " ", "&", "pop", "\\u", "sena", "te", "\\u", "min", ";", "-", "&", "pop", "\\u", "sena", "te", "\\u", "max", ";\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "min", "\"", " ", "value", "=\"", "&", "pop", "\\u", "sena", "te", "\\u", "min", ";", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "max", "\"", " ", "value", "=\"", "&", "pop", "\\u", "sena", "te", "\\u", "max", ";", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "tot", "pop", "\"/>", "\\", "10", ";", "\t", "\t", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "num", "\\u", "district", "s", "\\u", "sena", "te", ";", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "a", "\\u", "house", "\\u", "plan", "\\u", "equip", "opu", "lation", "\\u", "validation", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Equip", "opu", "lation", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Target", " ", "Pop", ".", " ", "%", "(", "pop", "\\u", "house", ")", "s", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "The", " ", "popul", "ation", " ", "of", " ", "each", " ", "House", " ", "district", " ", "must", " ", "be", " ", "&", "pop", "\\u", "house", "\\u", "min", ";", "-", "&", "pop", "\\u", "house", "\\u", "max", ";\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "min", "\"", " ", "value", "=\"", "&", "pop", "\\u", "house", "\\u", "min", ";", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "max", "\"", " ", "value", "=\"", "&", "pop", "\\u", "house", "\\u", "max", ";", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "tot", "pop", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "validation", "\"", " ", "value", "=\"", "1", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "a", "\\u", "house", "\\u", "plan", "\\u", "equip", "opu", "lation", "\\u", "summar", "y", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Equip", "opu", "lation", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Target", " ", "Pop", ".", " ", "%", "(", "pop", "\\u", "house", ")", "s", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "The", " ", "popul", "ation", " ", "of", " ", "each", " ", "House", " ", "district", " ", "must", " ", "be", " ", "&", "pop", "\\u", "house", "\\u", "min", ";", "-", "&", "pop", "\\u", "house", "\\u", "max", ";\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "min", "\"", " ", "value", "=\"", "&", "pop", "\\u", "house", "\\u", "min", ";", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "max", "\"", " ", "value", "=\"", "&", "pop", "\\u", "house", "\\u", "max", ";", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "tot", "pop", "\"/>", "\\", "10", ";", "\t", "\t", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "num", "\\u", "district", "s", "\\u", "house", ";", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "all", "\\u", "blocks", "\\u", "assign", "ed", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "All", "Block", "s", "Assign", "ed", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "All", " ", "Block", "s", " ", "Assign", "ed", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "All", " ", "blocks", " ", "in", " ", "the", " ", "plan", " ", "must", " ", "be", " ", "assign", "ed", ".\"", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "all", "\\u", "contiguous", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "All", "Conti", "guous", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "All", " ", "Conti", "guous", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "Conti", "guit", "y", " ", "means", " ", "tha", "t", " ", "every", " ", "part", " ", "of", " ", "a", " ", "district", " ", "must", " ", "be", " ", "reachable", " ", "from", " ", "every", " ", "other", " ", "part", " ", "with", "out", " ", "crossing", " ", "the", " ", "district", "&", "apos", ";", "s", " ", "border", "s", ".", " ", "All", " ", "district", "s", " ", "within", " ", "a", " ", "plan", " ", "must", " ", "be", " ", "contiguous", ".", " ", "Water", " ", "conti", "guit", "y", " ", "is", " ", "permit", "ted", ".", " ", "&", "apos", ";", "Point", " ", "conti", "guit", "y", "&", "apos", ";", " ", "or", " ", "&", "apos", ";", "touch", "-", "point", " ", "conti", "guit", "y", "&", "apos", ";", " ", "where", " ", "two", " ", "section", "s", " ", "of", " ", "a", " ", "district", " ", "are", " ", "connect", "ed", " ", "at", " ", "a", " ", "single", " ", "point", " ", "is", " ", "not", " ", "permit", "ted", ".\"", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "compet", "iti", "ven", "ess", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Compet", "iti", "ven", "ess", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Compet", "iti", "ven", "ess", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "Ea", "ch", " ", "plan", "&", "apos", ";", "s", " ", "over", "all", " ", "politic", "al", " ", "compet", "iti", "ven", "ess", " ", "is", " ", "dete", "rmin", "ed", " ", "by", " ", "averag", "ing", " ", "each", " ", "district", ".", "s", " ", "&", "apos", ";", "parti", "san", " ", "differential", "&", "apos", ";", ".", " ", " ", "The", " ", "parti", "san", " ", "differential", " ", "of", " ", "each", " ", "district", " ", "is", " ", "calculated", " ", "by", " ", "subtract", "ing", " ", "the", " ", "Demo", "cra", "tic", " ", "&", "apos", ";", "parti", "san", " ", "index", "&", "apos", ";", " ", "from", " ", "the", " ", "Rep", "ubli", "can", " ", "&", "apos", ";", "parti", "san", " ", "index", "&", "apos", ";", ".", "&", "lt", ";", "br", "/", "&", "gt", ";", "&", "lt", ";", "br", "/", "&", "gt", ";", "&", "apos", ";", "Heav", "il", "y", "&", "apos", ";", " ", "compet", "iti", "ve", " ", "district", "s", " ", "are", " ", "district", "s", " ", "with", " ", "parti", "san", " ", "differential", "s", " ", "of", " ", "less", " ", "than", " ", "or", " ", "equal", " ", "to", " ", "5", "%%", ".", " ", "&", "apos", ";", "General", "ly", "&", "apos", ";", " ", "compet", "iti", "ve", " ", "district", "s", " ", "are", " ", "district", "s", " ", "with", " ", "parti", "san", " ", "differential", "s", " ", "of", " ", "great", "er", " ", "than", " ", "5", "%%", " ", "but", " ", "less", " ", "than", " ", "10", "%%", ".\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "demo", "cra", "tic", "\"", " ", "ref", "=\"", "vote", "\\u", "dem", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "repu", "bli", "can", "\"", " ", "ref", "=\"", "vote", "\\u", "rep", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "equivale", "nce", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Equi", "valence", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Equal", " ", "Popula", "tion", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "The", " ", "Equip", "opu", "lation", " ", "score", " ", "is", " ", "the", " ", "difference", " ", "bet", "ween", " ", "the", " ", "district", " ", "with", " ", "the", " ", "high", "est", " ", "popul", "ation", " ", "and", " ", "the", " ", "district", " ", "with", " ", "the", " ", "lowe", "st", " ", "popul", "ation", ".\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "value", "\"", " ", "ref", "=\"", "tot", "pop", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "blk", "\\u", "congr", "ess", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Maj", "ori", "ty", "Min", "ori", "ty", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Black", " ", "VA", "P", " ", "Maj", "ori", "ty", " ", "(", "&", "gt", ";", " ", "50", "%%", ")\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "Compliance", " ", "with", " ", "the", " ", "Vo", "ting", " ", "Rig", "hts", " ", "Act", " ", "will", " ", "be", " ", "assume", "d", " ", "if", " ", "maps", " ", "include", " ", "a", " ", "mino", "rity", "-", "major", "it", "y", " ", "district", " ", "in", " ", "any", " ", "area", " ", "where", " ", "a", " ", "mino", "rity", " ", "group", " ", "is", " ", "(", "as", " ", "descri", "bed", " ", "in", " ", "Tho", "rn", "burg", " ", "V", ".", " ", "Gi", "ngle", "s", ",", " ", "478", " ", "U", ".", "S", ".", " ", "30", ",", " ", "4", "9", " ", "(", "198", "6", "))", " ", "&", "apos", ";", "sufficient", "ly", " ", "large", " ", "and", " ", "geographic", "ally", " ", "compact", " ", "to", " ", "constitu", "te", " ", "a", " ", "major", "it", "y", " ", "in", " ", "a", " ", "single", "-", "member", " ", "district", "&", "apos", ";", ".\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "popul", "ation", "\"", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "mino", "rity", "1", "\"", " ", "ref", "=\"", "vap", "\\u", "b", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "target", "\\u", "bl", "\\u", "congr", "ess", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "blk", "\\u", "house", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Maj", "ori", "ty", "Min", "ori", "ty", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Black", " ", "VA", "P", " ", "Maj", "ori", "ty", " ", "(", "&", "gt", ";", " ", "50", "%%", ")\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "Compliance", " ", "with", " ", "the", " ", "Vo", "ting", " ", "Rig", "hts", " ", "Act", " ", "will", " ", "be", " ", "assume", "d", " ", "if", " ", "maps", " ", "include", " ", "a", " ", "mino", "rity", "-", "major", "it", "y", " ", "district", " ", "in", " ", "any", " ", "area", " ", "where", " ", "a", " ", "mino", "rity", " ", "group", " ", "is", " ", "(", "as", " ", "descri", "bed", " ", "in", " ", "Tho", "rn", "burg", " ", "V", ".", " ", "Gi", "ngle", "s", ",", " ", "478", " ", "U", ".", "S", ".", " ", "30", ",", " ", "4", "9", " ", "(", "198", "6", "))", " ", "&", "apos", ";", "sufficient", "ly", " ", "large", " ", "and", " ", "geographic", "ally", " ", "compact", " ", "to", " ", "constitu", "te", " ", "a", " ", "major", "it", "y", " ", "in", " ", "a", " ", "single", "-", "member", " ", "district", "&", "apos", ";", ".\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "popul", "ation", "\"", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "mino", "rity", "1", "\"", " ", "ref", "=\"", "vap", "\\u", "b", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "target", "\\u", "bl", "\\u", "house", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "blk", "\\u", "sena", "te", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Maj", "ori", "ty", "Min", "ori", "ty", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Black", " ", "VA", "P", " ", "Maj", "ori", "ty", " ", "(", "&", "gt", ";", " ", "50", "%%", ")\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "Compliance", " ", "with", " ", "the", " ", "Vo", "ting", " ", "Rig", "hts", " ", "Act", " ", "will", " ", "be", " ", "assume", "d", " ", "if", " ", "maps", " ", "include", " ", "a", " ", "mino", "rity", "-", "major", "it", "y", " ", "district", " ", "in", " ", "any", " ", "area", " ", "where", " ", "a", " ", "mino", "rity", " ", "group", " ", "is", " ", "(", "as", " ", "descri", "bed", " ", "in", " ", "Tho", "rn", "burg", " ", "V", ".", " ", "Gi", "ngle", "s", ",", " ", "478", " ", "U", ".", "S", ".", " ", "30", ",", " ", "4", "9", " ", "(", "198", "6", "))", " ", "&", "apos", ";", "sufficient", "ly", " ", "large", " ", "and", " ", "geographic", "ally", " ", "compact", " ", "to", " ", "constitu", "te", " ", "a", " ", "major", "it", "y", " ", "in", " ", "a", " ", "single", "-", "member", " ", "district", "&", "apos", ";", ".\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "popul", "ation", "\"", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "mino", "rity", "1", "\"", " ", "ref", "=\"", "vap", "\\u", "b", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "target", "\\u", "bl", "\\u", "sena", "te", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "his", "p", "\\u", "congr", "ess", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Maj", "ori", "ty", "Min", "ori", "ty", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Hi", "sp", ".", " ", "VA", "P", " ", "Maj", "ori", "ty", " ", "(", "&", "gt", ";", " ", "50", "%%", ")\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "Compliance", " ", "with", " ", "the", " ", "Vo", "ting", " ", "Rig", "hts", " ", "Act", " ", "will", " ", "be", " ", "assume", "d", " ", "if", " ", "maps", " ", "include", " ", "a", " ", "mino", "rity", "-", "major", "it", "y", " ", "district", " ", "in", " ", "any", " ", "area", " ", "where", " ", "a", " ", "mino", "rity", " ", "group", " ", "is", " ", "(", "as", " ", "descri", "bed", " ", "in", " ", "Tho", "rn", "burg", " ", "V", ".", " ", "Gi", "ngle", "s", ",", " ", "478", " ", "U", ".", "S", ".", " ", "30", ",", " ", "4", "9", " ", "(", "198", "6", "))", " ", "&", "apos", ";", "sufficient", "ly", " ", "large", " ", "and", " ", "geographic", "ally", " ", "compact", " ", "to", " ", "constitu", "te", " ", "a", " ", "major", "it", "y", " ", "in", " ", "a", " ", "single", "-", "member", " ", "district", "&", "apos", ";", ".\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "popul", "ation", "\"", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "mino", "rity", "1", "\"", " ", "ref", "=\"", "vap", "\\u", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "target", "\\u", "his", "p", "\\u", "congr", "ess", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "his", "p", "\\u", "house", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Maj", "ori", "ty", "Min", "ori", "ty", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Hi", "sp", ".", " ", "VA", "P", " ", "Maj", "ori", "ty", " ", "(", "&", "gt", ";", " ", "50", "%%", ")\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "Compliance", " ", "with", " ", "the", " ", "Vo", "ting", " ", "Rig", "hts", " ", "Act", " ", "will", " ", "be", " ", "assume", "d", " ", "if", " ", "maps", " ", "include", " ", "a", " ", "mino", "rity", "-", "major", "it", "y", " ", "district", " ", "in", " ", "any", " ", "area", " ", "where", " ", "a", " ", "mino", "rity", " ", "group", " ", "is", " ", "(", "as", " ", "descri", "bed", " ", "in", " ", "Tho", "rn", "burg", " ", "V", ".", " ", "Gi", "ngle", "s", ",", " ", "478", " ", "U", ".", "S", ".", " ", "30", ",", " ", "4", "9", " ", "(", "198", "6", "))", " ", "&", "apos", ";", "sufficient", "ly", " ", "large", " ", "and", " ", "geographic", "ally", " ", "compact", " ", "to", " ", "constitu", "te", " ", "a", " ", "major", "it", "y", " ", "in", " ", "a", " ", "single", "-", "member", " ", "district", "&", "apos", ";", ".\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "popul", "ation", "\"", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "mino", "rity", "1", "\"", " ", "ref", "=\"", "vap", "\\u", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "target", "\\u", "his", "p", "\\u", "house", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "his", "p", "\\u", "sena", "te", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Maj", "ori", "ty", "Min", "ori", "ty", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Hi", "sp", ".", " ", "VA", "P", " ", "Maj", "ori", "ty", " ", "(", "&", "gt", ";", " ", "50", "%%", ")\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "Compliance", " ", "with", " ", "the", " ", "Vo", "ting", " ", "Rig", "hts", " ", "Act", " ", "will", " ", "be", " ", "assume", "d", " ", "if", " ", "maps", " ", "include", " ", "a", " ", "mino", "rity", "-", "major", "it", "y", " ", "district", " ", "in", " ", "any", " ", "area", " ", "where", " ", "a", " ", "mino", "rity", " ", "group", " ", "is", " ", "(", "as", " ", "descri", "bed", " ", "in", " ", "Tho", "rn", "burg", " ", "V", ".", " ", "Gi", "ngle", "s", ",", " ", "478", " ", "U", ".", "S", ".", " ", "30", ",", " ", "4", "9", " ", "(", "198", "6", "))", " ", "&", "apos", ";", "sufficient", "ly", " ", "large", " ", "and", " ", "geographic", "ally", " ", "compact", " ", "to", " ", "constitu", "te", " ", "a", " ", "major", "it", "y", " ", "in", " ", "a", " ", "single", "-", "member", " ", "district", "&", "apos", ";", ".\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "popul", "ation", "\"", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "mino", "rity", "1", "\"", " ", "ref", "=\"", "vap", "\\u", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "target", "\\u", "his", "p", "\\u", "sena", "te", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "na", "\\u", "congr", "ess", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Maj", "ori", "ty", "Min", "ori", "ty", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Nat", "ive", " ", "Ame", "rica", "n", " ", "Maj", "ori", "ty", " ", "(", "&", "gt", ";", " ", "50", "%%", ")\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "Compliance", " ", "with", " ", "the", " ", "Vo", "ting", " ", "Rig", "hts", " ", "Act", " ", "will", " ", "be", " ", "assume", "d", " ", "if", " ", "maps", " ", "include", " ", "a", " ", "mino", "rity", "-", "major", "it", "y", " ", "district", " ", "in", " ", "any", " ", "area", " ", "where", " ", "a", " ", "mino", "rity", " ", "group", " ", "is", " ", "(", "as", " ", "descri", "bed", " ", "in", " ", "Tho", "rn", "burg", " ", "V", ".", " ", "Gi", "ngle", "s", ",", " ", "478", " ", "U", ".", "S", ".", " ", "30", ",", " ", "4", "9", " ", "(", "198", "6", "))", " ", "&", "apos", ";", "sufficient", "ly", " ", "large", " ", "and", " ", "geographic", "ally", " ", "compact", " ", "to", " ", "constitu", "te", " ", "a", " ", "major", "it", "y", " ", "in", " ", "a", " ", "single", "-", "member", " ", "district", "&", "apos", ";", ".\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "popul", "ation", "\"", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "mino", "rity", "1", "\"", " ", "ref", "=\"", "vap", "\\u", "na", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "target", "\\u", "na", "\\u", "congr", "ess", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "na", "\\u", "house", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Maj", "ori", "ty", "Min", "ori", "ty", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Nat", "ive", " ", "Ame", "rica", "n", " ", "Maj", "ori", "ty", " ", "(", "&", "gt", ";", " ", "50", "%%", ")\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "Compliance", " ", "with", " ", "the", " ", "Vo", "ting", " ", "Rig", "hts", " ", "Act", " ", "will", " ", "be", " ", "assume", "d", " ", "if", " ", "maps", " ", "include", " ", "a", " ", "mino", "rity", "-", "major", "it", "y", " ", "district", " ", "in", " ", "any", " ", "area", " ", "where", " ", "a", " ", "mino", "rity", " ", "group", " ", "is", " ", "(", "as", " ", "descri", "bed", " ", "in", " ", "Tho", "rn", "burg", " ", "V", ".", " ", "Gi", "ngle", "s", ",", " ", "478", " ", "U", ".", "S", ".", " ", "30", ",", " ", "4", "9", " ", "(", "198", "6", "))", " ", "&", "apos", ";", "sufficient", "ly", " ", "large", " ", "and", " ", "geographic", "ally", " ", "compact", " ", "to", " ", "constitu", "te", " ", "a", " ", "major", "it", "y", " ", "in", " ", "a", " ", "single", "-", "member", " ", "district", "&", "apos", ";", ".\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "popul", "ation", "\"", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "mino", "rity", "1", "\"", " ", "ref", "=\"", "vap", "\\u", "na", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "target", "\\u", "na", "\\u", "house", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "na", "\\u", "sena", "te", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Maj", "ori", "ty", "Min", "ori", "ty", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Nat", "ive", " ", "Ame", "rica", "n", " ", "Maj", "ori", "ty", " ", "(", "&", "gt", ";", " ", "50", "%%", ")\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "Compliance", " ", "with", " ", "the", " ", "Vo", "ting", " ", "Rig", "hts", " ", "Act", " ", "will", " ", "be", " ", "assume", "d", " ", "if", " ", "maps", " ", "include", " ", "a", " ", "mino", "rity", "-", "major", "it", "y", " ", "district", " ", "in", " ", "any", " ", "area", " ", "where", " ", "a", " ", "mino", "rity", " ", "group", " ", "is", " ", "(", "as", " ", "descri", "bed", " ", "in", " ", "Tho", "rn", "burg", " ", "V", ".", " ", "Gi", "ngle", "s", ",", " ", "478", " ", "U", ".", "S", ".", " ", "30", ",", " ", "4", "9", " ", "(", "198", "6", "))", " ", "&", "apos", ";", "sufficient", "ly", " ", "large", " ", "and", " ", "geographic", "ally", " ", "compact", " ", "to", " ", "constitu", "te", " ", "a", " ", "major", "it", "y", " ", "in", " ", "a", " ", "single", "-", "member", " ", "district", "&", "apos", ";", ".\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "popul", "ation", "\"", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "mino", "rity", "1", "\"", " ", "ref", "=\"", "vap", "\\u", "na", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "target", "\"", " ", "value", "=\"", "&", "target", "\\u", "na", "\\u", "sena", "te", ";", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Maj", "ori", "ty", "Min", "ori", "ty", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Maj", "ori", "ty", " ", "Min", "ori", "ty", " ", "Distr", "ict", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "Compliance", " ", "with", " ", "the", " ", "Vo", "ting", " ", "Rig", "hts", " ", "Act", " ", "will", " ", "be", " ", "assume", "d", " ", "if", " ", "maps", " ", "include", " ", "a", " ", "mino", "rity", "-", "major", "it", "y", " ", "district", " ", "in", " ", "any", " ", "area", " ", "where", " ", "a", " ", "mino", "rity", " ", "group", " ", "is", " ", "(", "as", " ", "descri", "bed", " ", "in", " ", "Tho", "rn", "burg", " ", "V", ".", " ", "Gi", "ngle", "s", ",", " ", "478", " ", "U", ".", "S", ".", " ", "30", ",", " ", "4", "9", " ", "(", "198", "6", "))", " ", "&", "apos", ";", "sufficient", "ly", " ", "large", " ", "and", " ", "geographic", "ally", " ", "compact", " ", "to", " ", "constitu", "te", " ", "a", " ", "major", "it", "y", " ", "in", " ", "a", " ", "single", "-", "member", " ", "district", "&", "apos", ";", ".\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "popul", "ation", "\"", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "mino", "rity", "1", "\"", " ", "ref", "=\"", "vap", "\\u", "b", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "mino", "rity", "2", "\"", " ", "ref", "=\"", "vap", "\\u", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "mino", "rity", "3", "\"", " ", "ref", "=\"", "vap", "\\u", "na", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "validation", "\"", " ", "value", "=\"", "1", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "rep", "fair", "ness", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Representation", "al", "Fai", "rne", "ss", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Representation", "al", " ", "Fai", "rne", "ss", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "Representation", "al", " ", "fair", "ness", " ", "is", " ", "increase", "d", " ", "whe", "n", " ", "the", " ", "percentage", " ", "of", " ", "district", "s", " ", "a", " ", "part", "y", " ", "wou", "ld", " ", "like", "ly", " ", "win", " ", "(", "based", " ", "upo", "n", " ", "the", " ", "&", "apos", ";", "parti", "san", " ", "index", "&", "apos", ";", " ", "used", " ", "to", " ", "dete", "rmin", "e", " ", "Compet", "iti", "ven", "ess", ")", " ", "close", "ly", " ", "mirrors", " ", "tha", "t", " ", "part", "y", ".", "s", " ", "percentage", " ", "of", " ", "the", " ", "state", "wide", " ", "vote", ".\"", " ", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Arg", "ument", " ", "name", "=\"", "range", "\"", " ", "value", "=\"", "0.05", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "normali", "zed", " ", "demo", "cra", "tic", "\"", " ", "ref", "=\"", "vote", "\\u", "dem", "\\u", "norm", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Sub", "ject", "Arg", "ument", " ", "name", "=\"", "normali", "zed", " ", "repu", "bli", "can", "\"", " ", "ref", "=\"", "vote", "\\u", "rep", "\\u", "norm", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Function", " ", "id", "=\"", "plan", "\\u", "sch", "war", "tz", "ber", "g", "\"", " ", "type", "=\"", "plan", "\"", "\\", "10", ";", " ", " ", " ", " ", "calculator", "=\"", "public", "mapping", ".", "redis", "tric", "ting", ".", "calculator", "s", ".", "Sch", "war", "tz", "ber", "g", "\"", "\\", "10", ";", " ", " ", " ", " ", "label", "=\"", "Average", " ", "Compact", "ness", "\"", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "The", " ", "competition", " ", "is", " ", "usi", "ng", " ", "the", " ", "&", "apos", ";", "Sch", "war", "tz", "ber", "g", "&", "apos", ";", " ", "compact", "ness", " ", "measure", ".", " ", "Thi", "s", " ", "measure", " ", "is", " ", "a", " ", "ratio", " ", "of", " ", "the", " ", "perimeter", " ", "of", " ", "the", " ", "district", " ", "to", " ", "the", " ", "circum", "ference", " ", "of", " ", "the", " ", "circle", " ", "who", "se", " ", "area", " ", "is", " ", "equal", " ", "to", " ", "the", " ", "area", " ", "of", " ", "the", " ", "district", ".\"", " ", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Function", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "ls", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "id", "=\"", "panel", "\\u", "equip", "op", "\\u", "all", "\"", " ", "type", "=\"", "plan", "\"", " ", "position", "=\"", "1", "\"", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Equip", "opu", "lation", "\"", " ", "template", "=\"", "leader", "board", "\\u", "panel", "\\u", "all", ".", "html", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "equivale", "nce", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "l", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "id", "=\"", "panel", "\\u", "equip", "op", "\\u", "mine", "\"", " ", "type", "=\"", "plan", "\"", " ", "position", "=\"", "1", "\"", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Equip", "opu", "lation", "\"", " ", "template", "=\"", "leader", "board", "\\u", "panel", "\\u", "mine", ".", "html", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "equivale", "nce", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "l", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "id", "=\"", "panel", "\\u", "compact", "\\u", "all", "\"", " ", "type", "=\"", "plan", "\"", " ", "position", "=\"", "2", "\"", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Sch", "war", "tz", "ber", "g", "\"", " ", "template", "=\"", "leader", "board", "\\u", "panel", "\\u", "all", ".", "html", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "sch", "war", "tz", "ber", "g", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "l", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "id", "=\"", "panel", "\\u", "compact", "\\u", "mine", "\"", " ", "type", "=\"", "plan", "\"", " ", "position", "=\"", "2", "\"", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Sch", "war", "tz", "ber", "g", "\"", " ", "template", "=\"", "leader", "board", "\\u", "panel", "\\u", "mine", ".", "html", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "sch", "war", "tz", "ber", "g", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "l", ">", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "id", "=\"", "panel", "\\u", "compet", "iti", "ve", "\\u", "all", "\"", " ", "type", "=\"", "plan", "\"", " ", "position", "=\"", "3", "\"", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Compet", "iti", "ven", "ess", "\"", " ", "template", "=\"", "leader", "board", "\\u", "panel", "\\u", "all", ".", "html", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "compet", "iti", "ven", "ess", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "l", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "id", "=\"", "panel", "\\u", "compet", "iti", "ve", "\\u", "mine", "\"", " ", "type", "=\"", "plan", "\"", " ", "position", "=\"", "3", "\"", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Compet", "iti", "ven", "ess", "\"", " ", "template", "=\"", "leader", "board", "\\u", "panel", "\\u", "mine", ".", "html", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "compet", "iti", "ven", "ess", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "l", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "id", "=\"", "panel", "\\u", "rf", "\\u", "all", "\"", " ", "type", "=\"", "plan", "\"", " ", "position", "=\"", "4", "\"", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Representation", "al", " ", "Fai", "rne", "ss", "\"", " ", "template", "=\"", "leader", "board", "\\u", "panel", "\\u", "all", ".", "html", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "rep", "fair", "ness", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "l", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "id", "=\"", "panel", "\\u", "rf", "\\u", "mine", "\"", " ", "type", "=\"", "plan", "\"", " ", "position", "=\"", "4", "\"", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Representation", "al", " ", "Fai", "rne", "ss", "\"", " ", "template", "=\"", "leader", "board", "\\u", "panel", "\\u", "mine", ".", "html", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "rep", "fair", "ness", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "l", ">", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "Summ", "ary", " ", "above", " ", "all", " ", "sidebar", " ", "panel", "s", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "id", "=\"", "congr", "ession", "al", "\\u", "panel", "\\u", "summar", "y", "\"", " ", "type", "=\"", "plan", "\\u", "summar", "y", "\"", " ", "position", "=\"", "1", "\"", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Plan", " ", "Summ", "ary", "\"", " ", "css", "class", "=\"", "plan", "\\u", "summar", "y", " ", "congr", "ession", "al", "\"", " ", "template", "=\"", "plan", "\\u", "summar", "y", ".", "html", "\">", "\\", "10", ";", "\t ", " ", "<", "Score", " ", "ref", "=\"", "a", "\\u", "congr", "ess", "\\u", "plan", "\\u", "equip", "opu", "lation", "\\u", "summar", "y", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "b", "\\u", "plan", "\\u", "congr", "ess", "\\u", "nonc", "onti", "guous", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "blk", "\\u", "congr", "ess", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "his", "p", "\\u", "congr", "ess", "\"", " ", "/>", "\\", "10", ";", "\t", "\t", "%", "(", "start", "\\u", "na", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "na", "\\u", "congr", "ess", "\"", " ", "/>", "\\", "10", ";", "\t", "\t", "%", "(", "end", "\\u", "na", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "l", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "id", "=\"", "house", "\\u", "panel", "\\u", "summar", "y", "\"", " ", "type", "=\"", "plan", "\\u", "summar", "y", "\"", " ", "position", "=\"", "1", "\"", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Plan", " ", "Summ", "ary", "\"", " ", "css", "class", "=\"", "plan", "\\u", "summar", "y", " ", "house", "\"", " ", "template", "=\"", "plan", "\\u", "summar", "y", ".", "html", "\">", "\\", "10", ";", "\t ", " ", "<", "Score", " ", "ref", "=\"", "a", "\\u", "house", "\\u", "plan", "\\u", "equip", "opu", "lation", "\\u", "summar", "y", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "b", "\\u", "plan", "\\u", "house", "\\u", "nonc", "onti", "guous", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "blk", "\\u", "house", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "his", "p", "\\u", "house", "\"", " ", "/>", "\\", "10", ";", "\t", "\t", "%", "(", "start", "\\u", "na", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "na", "\\u", "house", "\"", " ", "/>", "\\", "10", ";", "\t", "\t", "%", "(", "end", "\\u", "na", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "l", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "id", "=\"", "sena", "te", "\\u", "panel", "\\u", "summar", "y", "\"", " ", "type", "=\"", "plan", "\\u", "summar", "y", "\"", " ", "position", "=\"", "1", "\"", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Plan", " ", "Summ", "ary", "\"", " ", "css", "class", "=\"", "plan", "\\u", "summar", "y", " ", "sena", "te", "\"", " ", "template", "=\"", "plan", "\\u", "summar", "y", ".", "html", "\">", "\\", "10", ";", "\t ", " ", "<", "Score", " ", "ref", "=\"", "a", "\\u", "sena", "te", "\\u", "plan", "\\u", "equip", "opu", "lation", "\\u", "summar", "y", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "b", "\\u", "plan", "\\u", "sena", "te", "\\u", "nonc", "onti", "guous", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "a", "\\u", "sena", "te", "\\u", "plan", "\\u", "count", "\\u", "district", "s", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "blk", "\\u", "sena", "te", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "his", "p", "\\u", "sena", "te", "\"", " ", "/>", "\\", "10", ";", "\t", "\t", "%", "(", "start", "\\u", "na", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\\u", "na", "\\u", "sena", "te", "\"", " ", "/>", "\\", "10", ";", "\t", "\t", "%", "(", "end", "\\u", "na", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "l", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "Basic", " ", "Information", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "id", "=\"", "congr", "esi", "onal", "\\u", "panel", "\\u", "info", "\"", " ", "type", "=\"", "district", "\"", " ", "position", "=\"", "2", "\"", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Basic", " ", "Information", "\"", " ", "css", "class", "=\"", "district", "\\u", "basic", "\\u", "info", " ", "congr", "ession", "al", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "template", "=\"", "basic", "\\u", "informati", "on", ".", "html", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "a", "\\u", "congr", "ession", "al", "\\u", "popul", "ation", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "district", "\\u", "contiguous", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "district", "\\u", "sch", "war", "tz", "ber", "g", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "l", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "id", "=\"", "house", "\\u", "panel", "\\u", "info", "\"", " ", "type", "=\"", "district", "\"", " ", "position", "=\"", "2", "\"", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Basic", " ", "Information", "\"", " ", "css", "class", "=\"", "district", "\\u", "basic", "\\u", "info", " ", "house", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "template", "=\"", "basic", "\\u", "informati", "on", ".", "html", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "a", "\\u", "house", "\\u", "popul", "ation", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "district", "\\u", "contiguous", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "district", "\\u", "sch", "war", "tz", "ber", "g", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "l", ">", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "id", "=\"", "sena", "te", "\\u", "panel", "\\u", "info", "\"", " ", "type", "=\"", "district", "\"", " ", "position", "=\"", "2", "\"", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Basic", " ", "Information", "\"", " ", "css", "class", "=\"", "district", "\\u", "basic", "\\u", "info", " ", "sena", "te", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "template", "=\"", "basic", "\\u", "informati", "on", ".", "html", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "a", "\\u", "sena", "te", "\\u", "popul", "ation", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "district", "\\u", "contiguous", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "district", "\\u", "sch", "war", "tz", "ber", "g", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "l", ">", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "Demo", "graphic", "s", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "id", "=\"", "congr", "ession", "al", "\\u", "panel", "\\u", "demo", "\"", " ", "type", "=\"", "district", "\"", " ", "position", "=\"", "2", "\"", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Demo", "graphic", "s", "\"", " ", "css", "class", "=\"", "district", "\\u", "demo", "graphic", "s", " ", "congr", "ession", "al", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "template", "=\"", "demo", "graphic", "s", ".", "html", "\">", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "district", "\\u", "vote", "\\u", "dem", "\\u", "percent", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "district", "\\u", "blk", "vap", "\\u", "percent", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "district", "\\u", "his", "pv", "ap", "\\u", "percent", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "l", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "id", "=\"", "house", "\\u", "panel", "\\u", "demo", "\"", " ", "type", "=\"", "district", "\"", " ", "position", "=\"", "2", "\"", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Demo", "graphic", "s", "\"", " ", "css", "class", "=\"", "district", "\\u", "demo", "graphic", "s", " ", "house", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "template", "=\"", "demo", "graphic", "s", ".", "html", "\">", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "district", "\\u", "vote", "\\u", "dem", "\\u", "percent", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "district", "\\u", "blk", "vap", "\\u", "percent", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "district", "\\u", "his", "pv", "ap", "\\u", "percent", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "l", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "id", "=\"", "sena", "te", "\\u", "panel", "\\u", "demo", "\"", " ", "type", "=\"", "district", "\"", " ", "position", "=\"", "2", "\"", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Demo", "graphic", "s", "\"", " ", "css", "class", "=\"", "district", "\\u", "demo", "graphic", "s", " ", "sena", "te", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "template", "=\"", "demo", "graphic", "s", ".", "html", "\">", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "district", "\\u", "vote", "\\u", "dem", "\\u", "percent", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "district", "\\u", "blk", "vap", "\\u", "percent", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "district", "\\u", "his", "pv", "ap", "\\u", "percent", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "l", ">", "\\", "10", ";", "\\", "10", ";", "\t ", " ", " ", "<!", "--", " ", "Needed", " ", "due", " ", "to", " ", "issue", " ", "https", "://", "sourcef", "org", "e", ".", "net", "/", "apps", "/", "trac", "/", "public", "mapping", "/", "tick", "et", "/", "340", " ", "Delete", " ", "after", " ", "setup", " ", "-->", "\\", "10", ";", "\t", "\t", "<", "Score", "Pane", "l", " ", "id", "=\"", "stats", "\\u", "picker", "\"", " ", "type", "=\"", "district", "\"", " ", "position", "=\"", "1", "\"", " ", "title", "=\"", "Stat", "s", " ", "Picke", "r", "\"", " ", "css", "class", "=\"", "hidden", "\"", " ", "template", "=\"", "demo", "graphic", "s", ".", "html", "\">", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "popt", "ot", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "tot", "pop", "\\u", "b", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "tot", "pop", "\\u", "h", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "tot", "pop", "\\u", "a", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "tot", "pop", "\\u", "na", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "tot", "pop", "\\u", "pi", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "tot", "pop", "\\u", "wn", "h", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "vap", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "vap", "\\u", "b", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "vap", "\\u", "h", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "vap", "\\u", "a", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "vap", "\\u", "na", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "vap", "\\u", "pi", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "vap", "\\u", "wn", "h", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "blk", "vap", "\\u", "percent", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "his", "pv", "ap", "\\u", "percent", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "ava", "p", "\\u", "percent", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "nav", "ap", "\\u", "percent", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "piv", "ap", "\\u", "percent", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "wn", "hva", "p", "\\u", "percent", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "\t", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "vote", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "vote", "\\u", "dem", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "vote", "\\u", "rep", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "vote", "\\u", "dem", "\\u", "percent", "\"/>", "\\", "10", ";", "\t\t\t", "<", "Score", " ", "ref", "=\"", "district", "\\u", "vote", "\\u", "rep", "\\u", "percent", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "\t", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", "\t", "\t", "</", "Score", "Pane", "l", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Pane", "ls", ">", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Display", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Display", " ", "legislat", "ive", "body", "ref", "=\"", "congr", "ess", "\"", " ", "type", "=\"", "leader", "board", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Cong", "ressi", "onal", " ", "Leader", "board", " ", "-", " ", "All", "\"", " ", "css", "class", "=\"", "leader", "board", " ", "congr", "ess", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "equip", "op", "\\u", "all", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "compact", "\\u", "all", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "compet", "iti", "ve", "\\u", "all", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "rf", "\\u", "all", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Display", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Display", " ", "legislat", "ive", "body", "ref", "=\"", "congr", "ess", "\"", " ", "type", "=\"", "leader", "board", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "Cong", "ressi", "onal", " ", "Leader", "board", " ", "-", " ", "Mine", "\"", " ", "css", "class", "=\"", "leader", "board", " ", "congr", "ess", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "equip", "op", "\\u", "mine", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "compact", "\\u", "mine", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "compet", "iti", "ve", "\\u", "all", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "rf", "\\u", "mine", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Display", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Display", " ", "legislat", "ive", "body", "ref", "=\"", "house", "\"", " ", "type", "=\"", "leader", "board", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "State", " ", "House", " ", "Leader", "board", " ", "-", " ", "All", "\"", " ", "css", "class", "=\"", "leader", "board", " ", "house", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "equip", "op", "\\u", "all", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "compact", "\\u", "all", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "compet", "iti", "ve", "\\u", "all", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "rf", "\\u", "all", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Display", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Display", " ", "legislat", "ive", "body", "ref", "=\"", "house", "\"", " ", "type", "=\"", "leader", "board", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "State", " ", "House", " ", "Leader", "board", " ", "-", " ", "Mine", "\"", " ", "css", "class", "=\"", "leader", "board", " ", "house", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "equip", "op", "\\u", "mine", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "compact", "\\u", "mine", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "compet", "iti", "ve", "\\u", "mine", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "rf", "\\u", "mine", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Display", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Display", " ", "legislat", "ive", "body", "ref", "=\"", "sena", "te", "\"", " ", "type", "=\"", "leader", "board", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "State", " ", "Sen", "ate", " ", "Leader", "board", " ", "-", " ", "All", "\"", " ", "css", "class", "=\"", "leader", "board", " ", "sena", "te", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "equip", "op", "\\u", "all", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "compact", "\\u", "all", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "compet", "iti", "ve", "\\u", "all", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "rf", "\\u", "all", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Display", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Display", " ", "legislat", "ive", "body", "ref", "=\"", "sena", "te", "\"", " ", "type", "=\"", "leader", "board", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "title", "=\"", "State", " ", "Sen", "ate", " ", "Leader", "board", " ", "-", " ", "Mine", "\"", " ", "css", "class", "=\"", "leader", "board", " ", "sena", "te", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "equip", "op", "\\u", "mine", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "compact", "\\u", "mine", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "compet", "iti", "ve", "\\u", "mine", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "panel", "\\u", "rf", "\\u", "mine", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Display", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", "<!", "--", " ", "Side", "bar", " ", "configura", "tion", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Display", " ", "legislat", "ive", "body", "ref", "=\"", "congr", "ess", "\"", " ", "type", "=\"", "sidebar", "\"", " ", "title", "=\"", "Basic", " ", "Information", "\"", " ", "css", "class", "=\"", "basic", "\\u", "informati", "on", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "congr", "ession", "al", "\\u", "panel", "\\u", "summar", "y", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "congr", "esi", "onal", "\\u", "panel", "\\u", "info", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Display", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Display", " ", "legislat", "ive", "body", "ref", "=\"", "congr", "ess", "\"", " ", "type", "=\"", "sidebar", "\"", " ", "title", "=\"", "Demo", "graphic", "s", "\"", " ", "css", "class", "=\"", "demo", "graphic", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "congr", "ession", "al", "\\u", "panel", "\\u", "summar", "y", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "congr", "ession", "al", "\\u", "panel", "\\u", "demo", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Display", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Display", " ", "legislat", "ive", "body", "ref", "=\"", "house", "\"", " ", "type", "=\"", "sidebar", "\"", " ", "title", "=\"", "Basic", " ", "Information", "\"", " ", "css", "class", "=\"", "basic", "\\u", "informati", "on", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "house", "\\u", "panel", "\\u", "summar", "y", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "house", "\\u", "panel", "\\u", "info", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Display", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Display", " ", "legislat", "ive", "body", "ref", "=\"", "house", "\"", " ", "type", "=\"", "sidebar", "\"", " ", "title", "=\"", "Demo", "graphic", "s", "\"", " ", "css", "class", "=\"", "demo", "graphic", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "house", "\\u", "panel", "\\u", "summar", "y", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "house", "\\u", "panel", "\\u", "demo", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Display", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Display", " ", "legislat", "ive", "body", "ref", "=\"", "sena", "te", "\"", " ", "type", "=\"", "sidebar", "\"", " ", "title", "=\"", "Basic", " ", "Information", "\"", " ", "css", "class", "=\"", "basic", "\\u", "informati", "on", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "sena", "te", "\\u", "panel", "\\u", "summar", "y", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "sena", "te", "\\u", "panel", "\\u", "info", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Display", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Display", " ", "legislat", "ive", "body", "ref", "=\"", "sena", "te", "\"", " ", "type", "=\"", "sidebar", "\"", " ", "title", "=\"", "Demo", "graphic", "s", "\"", " ", "css", "class", "=\"", "demo", "graphic", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "sena", "te", "\\u", "panel", "\\u", "summar", "y", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", "Pane", "l", " ", "ref", "=\"", "sena", "te", "\\u", "panel", "\\u", "demo", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Display", ">", "\\", "10", ";", "\\", "10", ";<", "!-", "-", " ", "Needed", " ", "due", " ", "to", " ", "issue", " ", "https", "://", "sourcef", "org", "e", ".", "net", "/", "apps", "/", "trac", "/", "public", "mapping", "/", "tick", "et", "/", "340", " ", "Delete", " ", "after", " ", "setup", " ", "-->", "\\", "10", ";", "\t", "<", "Score", "Display", " ", "legislat", "ive", "body", "ref", "=\"", "congr", "ess", "\"", " ", "type", "=\"", "sidebar", "\"", " ", "title", "=\"", "All", " ", "Stat", "s", "\"", " ", "css", "class", "=\"", "hidden", "\">", "<", "Score", "Pane", "l", " ", "ref", "=\"", "stats", "\\u", "picker", "\"/><", "/", "Score", "Display", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Score", "Display", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Sco", "ring", ">", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Validat", "ion", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criteria", " ", "legislat", "ive", "body", "ref", "=\"", "congr", "ess", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criterion", " ", "name", "=\"", "Equip", "opu", "lation", " ", "-", " ", "Cong", "ress", "\"", " ", "description", "=\"", "&", "lt", ";", "p", "&", "gt", ";", "You", "r", " ", "plan", " ", "doe", "s", " ", "not", " ", "meet", " ", "the", " ", "competition", " ", "crite", "ria", " ", "for", " ", "Equip", "opu", "lation", ":", "&", "lt", ";", "/", "p", "&", "gt", ";", "&", "lt", ";", "p", "&", "gt", ";", " ", "The", " ", "popul", "ation", " ", "of", " ", "each", " ", "Cong", "ressi", "onal", " ", "district", " ", "must", " ", "be", " ", "&", "pop", "\\u", "congr", "ess", "\\u", "max", ";", "-", "&", "pop", "\\u", "congr", "ess", "\\u", "min", ";\">", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "a", "\\u", "congr", "ess", "\\u", "plan", "\\u", "equip", "opu", "lation", "\\u", "validation", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Criterion", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criterion", " ", "name", "=\"", "All", "Conti", "guous", " ", "-", " ", "Cong", "ress", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "&", "lt", ";", "p", "&", "gt", ";", "You", "r", " ", "plan", " ", "doe", "s", " ", "not", " ", "meet", " ", "the", " ", "competition", " ", "crite", "ria", " ", "for", " ", "Conti", "guit", "y", "&", "lt", ";", "/", "p", "&", "gt", ";", "&", "lt", ";", "p", "&", "gt", ";", "Every", " ", "part", " ", "of", " ", "a", " ", "district", " ", "must", " ", "be", " ", "reachable", " ", "from", " ", "every", " ", "other", " ", "part", " ", "with", "out", " ", "crossing", " ", "the", " ", "district", "'", "s", " ", "border", "s", ".", " ", "All", " ", "district", "s", " ", "within", " ", "a", " ", "plan", " ", "must", " ", "be", " ", "contiguous", ".", " ", "&", "lt", ";", "/", "p", "&", "gt", ";\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "all", "\\u", "contiguous", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Criterion", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criterion", " ", "name", "=\"", "Maj", "ori", "ty", "Min", "ori", "ty", " ", "-", " ", "Cong", "ress", "\"", " ", "description", "=\"\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Criterion", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criterion", " ", "name", "=\"", "Count", "Distr", "icts", " ", "-", " ", "Cong", "ress", "\"", " ", "description", "=\"\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "a", "\\u", "congr", "ess", "\\u", "plan", "\\u", "count", "\\u", "district", "s", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Criterion", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criterion", " ", "name", "=\"", "All", "Block", "s", "Assign", "ed", " ", "-", " ", "Cong", "ress", "\"", " ", "description", "=\"\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "all", "\\u", "blocks", "\\u", "assign", "ed", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Criterion", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Criteria", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criteria", " ", "legislat", "ive", "body", "ref", "=\"", "house", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criterion", " ", "name", "=\"", "Equip", "opu", "lation", " ", "-", " ", "House", "\"", " ", "description", "=\"", "&", "lt", ";", "p", "&", "gt", ";", "You", "r", " ", "plan", " ", "doe", "s", " ", "not", " ", "meet", " ", "the", " ", "competition", " ", "crite", "ria", " ", "for", " ", "Equip", "opu", "lation", ":", "&", "lt", ";", "/", "p", "&", "gt", ";", "&", "lt", ";", "p", "&", "gt", ";", "The", " ", "popul", "ation", " ", "of", " ", "each", " ", "House", " ", "of", " ", "Delegate", "s", " ", "district", " ", "must", " ", "be", " ", "&", "pop", "\\u", "house", "\\u", "min", ";", " ", "-", " ", "&", "pop", "\\u", "house", "\\u", "max", ";\">", " ", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "a", "\\u", "house", "\\u", "plan", "\\u", "equip", "opu", "lation", "\\u", "validation", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Criterion", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criterion", " ", "name", "=\"", "All", "Conti", "guous", " ", "-", " ", "House", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "&", "lt", ";", "p", "&", "gt", ";", "You", "r", " ", "plan", " ", "doe", "s", " ", "not", " ", "meet", " ", "the", " ", "competition", " ", "crite", "ria", " ", "for", " ", "Conti", "guit", "y", "&", "lt", ";", "/", "p", "&", "gt", ";", "&", "lt", ";", "p", "&", "gt", ";", "Every", " ", "part", " ", "of", " ", "a", " ", "district", " ", "must", " ", "be", " ", "reachable", " ", "from", " ", "every", " ", "other", " ", "part", " ", "with", "out", " ", "crossing", " ", "the", " ", "district", "'", "s", " ", "border", "s", ".", " ", "All", " ", "district", "s", " ", "within", " ", "a", " ", "plan", " ", "must", " ", "be", " ", "contiguous", ".", " ", "&", "lt", ";", "/", "p", "&", "gt", ";\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "all", "\\u", "contiguous", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Criterion", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criterion", " ", "name", "=\"", "Maj", "ori", "ty", "Min", "ori", "ty", " ", "-", " ", "House", "\"", " ", "description", "=\"\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Criterion", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criterion", " ", "name", "=\"", "Count", "Distr", "icts", " ", "-", " ", "House", "\"", " ", "description", "=\"\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "a", "\\u", "house", "\\u", "plan", "\\u", "count", "\\u", "district", "s", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Criterion", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criterion", " ", "name", "=\"", "All", "Block", "s", "Assign", "ed", " ", "-", " ", "House", "\"", " ", "description", "=\"\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "all", "\\u", "blocks", "\\u", "assign", "ed", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Criterion", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Criteria", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criteria", " ", "legislat", "ive", "body", "ref", "=\"", "sena", "te", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criterion", " ", "name", "=\"", "Equip", "opu", "lation", " ", "-", " ", "Sen", "ate", "\"", " ", "description", "=\"", "&", "lt", ";", "p", "&", "gt", ";", "You", "r", " ", "plan", " ", "doe", "s", " ", "not", " ", "meet", " ", "the", " ", "competition", " ", "crite", "ria", " ", "for", " ", "Equip", "opu", "lation", ":", "&", "lt", ";", "/", "p", "&", "gt", ";", "&", "lt", ";", "p", "&", "gt", ";", "The", " ", "popul", "ation", " ", "of", " ", "each", " ", "State", " ", "Sen", "ate", " ", "district", " ", "must", " ", "be", " ", "&", "pop", "\\u", "house", "\\u", "min", ";", "-", "&", "pop", "\\u", "house", "\\u", "max", ";\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "a", "\\u", "sena", "te", "\\u", "plan", "\\u", "equip", "opu", "lation", "\\u", "validation", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Criterion", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criterion", " ", "name", "=\"", "All", "Conti", "guous", " ", "-", " ", "Sen", "ate", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "description", "=\"", "&", "lt", ";", "p", "&", "gt", ";", "You", "r", " ", "plan", " ", "doe", "s", " ", "not", " ", "meet", " ", "the", " ", "competition", " ", "crite", "ria", " ", "for", " ", "Conti", "guit", "y", "&", "lt", ";", "/", "p", "&", "gt", ";", "&", "lt", ";", "p", "&", "gt", ";", "Every", " ", "part", " ", "of", " ", "a", " ", "district", " ", "must", " ", "be", " ", "reachable", " ", "from", " ", "every", " ", "other", " ", "part", " ", "with", "out", " ", "crossing", " ", "the", " ", "district", "'", "s", " ", "border", "s", ".", " ", "All", " ", "district", "s", " ", "within", " ", "a", " ", "plan", " ", "must", " ", "be", " ", "contiguous", ".", " ", "&", "lt", ";", "/", "p", "&", "gt", ";\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "all", "\\u", "contiguous", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Criterion", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criterion", " ", "name", "=\"", "Maj", "ori", "ty", "Min", "ori", "ty", " ", "-", " ", "Sen", "ate", "\"", " ", "description", "=\"\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "major", "it", "y", "\\u", "mino", "rity", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Criterion", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criterion", " ", "name", "=\"", "Count", "Distr", "icts", " ", "-", " ", "Sen", "ate", "\"", " ", "description", "=\"\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "a", "\\u", "sena", "te", "\\u", "plan", "\\u", "count", "\\u", "district", "s", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Criterion", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Criterion", " ", "name", "=\"", "All", "Block", "s", "Assign", "ed", " ", "-", " ", "Sen", "ate", "\"", " ", "description", "=\"\"", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Score", " ", "ref", "=\"", "plan", "\\u", "all", "\\u", "blocks", "\\u", "assign", "ed", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Criterion", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Criteria", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Validat", "ion", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", "\\", "10", ";", " ", " ", " ", " ", "Optio", "nal", " ", "configura", "tion", " ", "for", " ", "geo", "unit", "s", " ", "tha", "t", " ", "require", " ", "special", " ", "conti", "guit", "y", " ", "rule", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "'", "id", "'", " ", "is", " ", "the", " ", "portab", "le", " ", "id", " ", "of", " ", "the", " ", "geo", "unit", " ", "in", " ", "whi", "ch", " ", "to", " ", "configur", "e", " ", "an", " ", "override", ".", "\\", "10", ";", " ", " ", " ", " ", "'", "connect", "\\u", "to", "'", " ", "is", " ", "the", " ", "portab", "le", " ", "id", " ", "of", " ", "the", " ", "geo", "unit", " ", "in", " ", "whi", "ch", " ", "the", " ", "geo", "unit", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "be", " ", "consider", "ed", " ", "contiguous", " ", "with", ".", " ", "Test", "s", " ", "for", " ", "conti", "guit", "y", " ", "will", " ", "appl", "y", " ", "these", " ", "override", "s", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "order", " ", "to", " ", "account", " ", "for", " ", "conti", "guit", "y", " ", "whe", "n", " ", "physical", " ", "conti", "guit", "y", " ", "is", " ", "not", " ", "possib", "le", ".", "\\", "10", ";", " ", " ", " ", " ", "For", " ", "example", ",", " ", "an", " ", "island", " ", "may", " ", "need", " ", "to", " ", "be", " ", "marked", " ", "contiguous", " ", "with", " ", "one", " ", "or", " ", "more", " ", "geo", "unit", "s", "\\", "10", ";", " ", " ", " ", " ", "on", " ", "an", " ", "adjacent", " ", "coast", " ", "(", "possib", "ly", " ", "contain", "ing", " ", "har", "bor", "s", ").", " ", "\\", "10", ";", " ", " ", " ", " ", "<", "Conti", "guit", "y", "Override", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Conti", "guit", "y", "Override", " ", "id", "=\"", "510", "030", "112", "0120", "7", "7", "\"", " ", "connect", "\\u", "to", "=\"", "510", "030", "1020", "110", "6", "5", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Conti", "guit", "y", "Override", " ", "id", "=\"", "510", "030", "112", "0120", "7", "7", "\"", " ", "connect", "\\u", "to", "=\"", "510", "030", "1030", "030", "3", "7", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Conti", "guit", "y", "Override", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "-->", "\\", "10", ";", "\\", "10", ";", "\t", "<!", "--", " ", "Conti", "guit", "y", " ", "Override", "s", ",", " ", "if", " ", "Any", " ", "-->", "\\", "10", ";", "\t", "%", "(", "conti", "guit", "y", "Override", "String", ")", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Geo", "Levels", ">", "\\", "10", ";", " ", " ", "<", "Geo", "Leve", "l", " ", "id", "=\"", "block", "\"", " ", "name", "=\"", "block", "\"", " ", "min", "\\u", "zoom", "=\"", "6", "\"", " ", "sort", "\\u", "key", "=\"", "3", "\"", " ", "tolera", "nce", "=\"", "2.5", "\">", "\\", "10", ";", "\\", "10", ";", " ", " ", "<", "Shape", "file", " ", "path", "=\"", "/", "project", "s", "/", "Public", "Map", "ping", "/", "data", "/", "census", "\\u", "blocks", ".", "shp", "\">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Field", "s", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Field", " ", "name", "=\"", "NAME", "10", "\"", " ", "type", "=\"", "name", "\"/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Field", " ", "name", "=\"", "GEO", "ID", "10", "\"", " ", "type", "=\"", "portab", "le", "\"/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Field", " ", "name", "=\"", "STATE", "FP", "10", "\"", " ", "type", "=\"", "tree", "\"", " ", "pos", "=\"", "0", "\"", " ", "widt", "h", "=\"", "2", "\"/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Field", " ", "name", "=\"", "COUNT", "YF", "P1", "0", "\"", " ", "type", "=\"", "tree", "\"", " ", "pos", "=\"", "1", "\"", " ", "widt", "h", "=\"", "3", "\"/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Field", " ", "name", "=\"", "TRA", "CTC", "E1", "0", "\"", " ", "type", "=\"", "tree", "\"", " ", "pos", "=\"", "2", "\"", " ", "widt", "h", "=\"", "6", "\"/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Field", " ", "name", "=\"", "BLOCK", "CE", "10", "\"", " ", "type", "=\"", "tree", "\"", " ", "pos", "=\"", "3", "\"", " ", "widt", "h", "=\"", "4", "\"/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Field", "s", ">", "\\", "10", ";", " ", " ", "</", "Shape", "file", ">", "\\", "10", ";", " ", " ", "\\", "10", ";", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "b", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "na", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "wn", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "pi", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "a", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "wn", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "pi", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "a", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "b", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "na", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "dem", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "rep", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "tot", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "dem", "\\u", "norm", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "rep", "\\u", "norm", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "tot", "\\u", "norm", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", "</", "Geo", "Leve", "l", "Characteristic", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "ies", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "y", " ", "ref", "=\"", "congr", "ess", "\">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", " ", "ref", "=\"", "congr", "ess", "\\u", "target", "\"", " ", "default", "=\"", "true", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Bod", "y", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "y", " ", "ref", "=\"", "house", "\">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", " ", "ref", "=\"", "house", "\\u", "target", "\"", " ", "default", "=\"", "true", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Bod", "y", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "y", " ", "ref", "=\"", "sena", "te", "\">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", " ", "ref", "=\"", "sena", "te", "\\u", "target", "\"", " ", "default", "=\"", "true", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Bod", "y", ">", "\\", "10", ";", " ", " ", "</", "Legi", "slat", "ive", "Bod", "ies", ">", "\\", "10", ";", "\\", "10", ";", " ", "</", "Geo", "Leve", "l", ">", "\\", "10", ";", " ", " ", "<", "Geo", "Leve", "l", " ", "id", "=\"", "tract", "\"", " ", "name", "=\"", "tract", "\"", " ", "min", "\\u", "zoom", "=\"", "3", "\"", " ", "sort", "\\u", "key", "=\"", "2", "\"", " ", "tolera", "nce", "=\"", "25", "\">", "\\", "10", ";", " ", " ", " ", " ", " ", "<", "Files", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "graph", "y", " ", "path", "=\"", "/", "project", "s", "/", "Public", "Map", "ping", "/", "data", "/", "census", "\\u", "tracts", ".", "shp", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Field", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Field", " ", "name", "=\"", "NAME", "10", "\"", " ", "type", "=\"", "name", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Field", " ", "name", "=\"", "GEO", "ID", "10", "\"", " ", "type", "=\"", "portab", "le", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Field", " ", "name", "=\"", "STATE", "FP", "10", "\"", " ", "type", "=\"", "tree", "\"", " ", "pos", "=\"", "0", "\"", " ", "widt", "h", "=\"", "2", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Field", " ", "name", "=\"", "COUNT", "YF", "P1", "0", "\"", " ", "type", "=\"", "tree", "\"", " ", "pos", "=\"", "1", "\"", " ", "widt", "h", "=\"", "3", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Field", " ", "name", "=\"", "TRA", "CTC", "E1", "0", "\"", " ", "type", "=\"", "tree", "\"", " ", "pos", "=\"", "2", "\"", " ", "widt", "h", "=\"", "6", "\"/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Field", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Geo", "graph", "y", ">", "\\", "10", ";", " ", " ", "</", "Files", ">", "\\", "10", ";", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "b", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "na", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "wn", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "pi", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "a", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "wn", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "pi", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "a", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "b", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "na", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "dem", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "rep", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "tot", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "dem", "\\u", "norm", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "rep", "\\u", "norm", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "tot", "\\u", "norm", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", "</", "Geo", "Leve", "l", "Characteristic", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "ies", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "y", " ", "ref", "=\"", "congr", "ess", "\">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Parent", " ", "ref", "=\"", "block", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", " ", "ref", "=\"", "congr", "ess", "\\u", "target", "\"", " ", "default", "=\"", "true", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Bod", "y", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "y", " ", "ref", "=\"", "house", "\">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Parent", " ", "ref", "=\"", "block", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", " ", "ref", "=\"", "house", "\\u", "target", "\"", " ", "default", "=\"", "true", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Bod", "y", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "y", " ", "ref", "=\"", "sena", "te", "\">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Parent", " ", "ref", "=\"", "block", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", " ", "ref", "=\"", "sena", "te", "\\u", "target", "\"", " ", "default", "=\"", "true", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Bod", "y", ">", "\\", "10", ";", " ", " ", "</", "Legi", "slat", "ive", "Bod", "ies", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", "</", "Geo", "Leve", "l", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", "<", "Geo", "Leve", "l", " ", "id", "=\"", "county", "\"", " ", "name", "=\"", "county", "\"", " ", "min", "\\u", "zoom", "=\"", "0", "\"", " ", "sort", "\\u", "key", "=\"", "1", "\"", " ", "tolera", "nce", "=\"", "250", "\">", "\\", "10", ";", " ", " ", "<", "Files", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "graph", "y", " ", "path", "=\"", "/", "project", "s", "/", "Public", "Map", "ping", "/", "data", "/", "census", "\\u", "counti", "es", ".", "shp", "\">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Field", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Field", " ", "name", "=\"", "NAME", "10", "\"", " ", "type", "=\"", "name", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Field", " ", "name", "=\"", "GEO", "ID", "10", "\"", " ", "type", "=\"", "portab", "le", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Field", " ", "name", "=\"", "STATE", "FP", "10", "\"", " ", "type", "=\"", "tree", "\"", " ", "pos", "=\"", "0", "\"", " ", "widt", "h", "=\"", "2", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Field", " ", "name", "=\"", "COUNT", "YF", "P1", "0", "\"", " ", "type", "=\"", "tree", "\"", " ", "pos", "=\"", "1", "\"", " ", "widt", "h", "=\"", "3", "\"/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Field", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Geo", "graph", "y", ">", "\\", "10", ";", " ", " ", "</", "Files", ">", "\\", "10", ";", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "b", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "na", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "wn", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "pi", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vap", "\\u", "a", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "wn", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "pi", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "a", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "b", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "tot", "pop", "\\u", "na", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "dem", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "rep", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "tot", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "dem", "\\u", "norm", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "rep", "\\u", "norm", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Geo", "Leve", "l", "Characteristic", " ", "ref", "=\"", "vote", "\\u", "tot", "\\u", "norm", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", "</", "Geo", "Leve", "l", "Characteristic", "s", ">", "\\", "10", ";", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "ies", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "y", " ", "ref", "=\"", "congr", "ess", "\">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Parent", " ", "ref", "=\"", "tract", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", " ", "ref", "=\"", "congr", "ess", "\\u", "target", "\"", " ", "default", "=\"", "true", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Bod", "y", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "y", " ", "ref", "=\"", "house", "\">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Parent", " ", "ref", "=\"", "tract", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", " ", "ref", "=\"", "house", "\\u", "target", "\"", " ", "default", "=\"", "true", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Bod", "y", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "y", " ", "ref", "=\"", "sena", "te", "\">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Parent", " ", "ref", "=\"", "tract", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Target", " ", "ref", "=\"", "sena", "te", "\\u", "target", "\"", " ", "default", "=\"", "true", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Target", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Legi", "slat", "ive", "Bod", "y", ">", "\\", "10", ";", " ", " ", "</", "Legi", "slat", "ive", "Bod", "ies", ">", "\\", "10", ";", " ", " ", "</", "Geo", "Leve", "l", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Geo", "Levels", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Templa", "tes", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Templa", "te", " ", "name", "=\"", "Cong", "ressi", "onal", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "y", " ", "ref", "=\"", "congr", "ess", "\"/>", "\\", "10", ";", " ", " ", " ", " ", " ", "<", "Block", "file", " ", "path", "=\"", "/", "project", "s", "/", "Public", "Map", "ping", "/", "data", "/", "congr", "ess", "\\u", "generat", "ed", "\\u", "index", ".", "csv", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Templa", "te", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Templa", "te", " ", "name", "=\"", "State", " ", "House", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "y", " ", "ref", "=\"", "house", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Block", "file", " ", "path", "=\"", "/", "project", "s", "/", "Public", "Map", "ping", "/", "data", "/", "house", "\\u", "generat", "ed", "\\u", "index", ".", "csv", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Templa", "te", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Templa", "te", " ", "name", "=\"", "State", " ", "Sen", "ate", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Legi", "slat", "ive", "Bod", "y", " ", "ref", "=\"", "sena", "te", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Block", "file", " ", "path", "=\"", "/", "project", "s", "/", "Public", "Map", "ping", "/", "data", "/", "sena", "te", "\\u", "generat", "ed", "\\u", "index", ".", "csv", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Templa", "te", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Templa", "tes", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "Project", " ", "root", "=\"", "/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "\"", " ", "session", "quot", "a", "=\"", "5", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", " ", "session", "timeo", "ut", "=\"", "15", "\">", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "Databa", "se", " ", "connecti", "on", " ", "informati", "on", ".", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Databa", "se", " ", "name", "=\"", "public", "mapping", "\"", " ", "user", "=\"", "public", "mapping", "\"", " ", "password", "=\"", "public", "mapping", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Administrati", "ve", " ", "user", " ", "informati", "on", ".", " ", "Thi", "s", " ", "shou", "ld", " ", "match", " ", "the", " ", "admin", "\\", "10", ";", " ", " ", " ", " ", "user", " ", "created", " ", "whe", "n", " ", "the", " ", "django", " ", "project", " ", "is", " ", "created", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Admi", "n", " ", "user", "=\"", "admin", "\"", " ", "email", "=\"", "support", "@", "public", "mapping", ".", "org", "\"", " ", "password", "=\"", "admin", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "Configura", "tion", " ", "items", " ", "specific", " ", "to", " ", "the", " ", "'", "redis", "tric", "ting", "'", " ", "app", ".", " ", "-->", "\\", "10", ";", " ", " ", " ", "<", "Red", "istr", "ict", "ing", ">", " ", " ", "\\", "10", ";", "\t ", "<", "Map", "Server", " ", "host", "name", "=\"\"", " ", "ns", "=\"", "pm", "p", "\"", " ", "nsh", "ref", "=\"", "http", "://", "public", "mapping", ".", "sourcef", "org", "e", ".", "net", "/\"", "\\", "10", ";", " ", " ", " ", " ", "admin", "user", "=\"", "admin", "\"", " ", "admin", "pass", "=\"", "admin", "\"", " ", "maxf", "eature", "s", "=\"", "100", "\"", " ", "\\", "10", ";", " ", " ", " ", " ", "style", "s", "=\"", "/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "sld", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "a", " ", "Goo", "gle", "Analy", "tic", "s", " ", "account", " ", "to", " ", "tract", " ", "the", " ", "usage", " ", "of", " ", "the", " ", "\\", "10", ";", " ", " ", " ", " ", "applica", "tion", ".", " ", "Thi", "s", " ", "require", "s", " ", "an", " ", "account", " ", "and", " ", "domain", ".", "\\", "10", ";", " ", " ", " ", " ", "<", "Goo", "gle", "Analy", "tic", "s", " ", "account", "=\"\"", " ", "domain", "=\"\"", "/>", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "Upload", " ", "file", " ", "size", " ", "restriction", "s", ".", " ", "Thi", "s", " ", "is", " ", "in", " ", "KB", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Upload", " ", "maxs", "ize", "=\"", "2500", "\"/>", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "Und", "o", " ", "restriction", "s", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Max", "Und", "os", " ", "dur", "inge", "dit", "=\"", "50", "\"", " ", "after", "edit", "=\"", "10", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "Leader", "board", " ", "configura", "tion", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Leader", "board", " ", "maxr", "ank", "ed", "=\"", "10", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", "</", "Red", "istr", "ict", "ing", ">", "\\", "10", ";", " ", " ", " ", "<", "Report", "ing", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Bar", "d", "Configs", ">", "\\", "10", ";", " ", " \t\t", " ", "<", "Bar", "d", "Config", " ", "\\", "10", ";", " ", " ", "id", "=\"", "blocks", "\"", "\\", "10", ";", " ", " ", "shape", "=\"", "/", "project", "s", "/", "Public", "Map", "ping", "/", "data", "/", "census", "\\u", "configur", "ed", ".", "Rd", "ata", "\"", " ", "\\", "10", ";", " ", " ", "temp", "=\"", "/", "project", "s", "/", "Public", "Map", "ping", "/", "local", "/", "report", "s", "\"", "\\", "10", ";", " ", " ", "transform", "=\"", "/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "docs", "/", "bar", "d\\u", "template", ".", "xsl", "t", "\">", "\\", "10", ";", " ", " ", "<", "Pop", "Var", "s", ">", "\\", "10", ";", " ", " ", "<", "Pop", "Var", " ", "subject", "ref", "=\"", "tot", "pop", "\"", " ", "threshol", "d", "=\".", "01", "\"", " ", "default", "=\"", "true", "\"", " ", "/>", "\\", "10", ";", " ", " ", "<", "Pop", "Var", " ", "subject", "ref", "=\"", "vap", "\"", " ", "threshol", "d", "=\".", "1", "\"", " ", "/>", "\\", "10", ";", " ", " ", "</", "Pop", "Var", "s", ">", "\\", "10", ";", " ", " ", "<", "Rati", "o", "Var", "s", ">", "\\", "10", ";", " ", " ", "<!", "--", "\\", "10", ";", " ", " ", "\\", "10", ";", " ", " ", "Set", " ", "up", " ", "Rati", "o", "Var", "s", " ", "for", " ", "bot", "h", " ", "eth", "nic", "it", "y", " ", "and", " ", "politic", "al", " ", "\\", "10", ";", " ", " ", "part", "y", ".", "\\", "10", ";", " ", " ", "\\", "10", ";", " ", " ", "-->", "\\", "10", ";", " ", " ", "<", "Rati", "o", "Var", " ", "id", "=\"", "raci", "al", "Comp", "\"", " ", "label", "=\"", "Maj", "ori", "ty", " ", "Min", "ori", "ty", " ", "Distr", "icts", "\"", " ", "threshol", "d", "=\".", "5", "\">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Numer", "ator", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Numer", "ator", " ", "subject", "ref", "=\"", "tot", "pop", "\\u", "b", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Numer", "ator", " ", "subject", "ref", "=\"", "tot", "pop", "\\u", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Numer", "ator", " ", "subject", "ref", "=\"", "tot", "pop", "\\u", "na", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Numer", "ator", " ", "subject", "ref", "=\"", "tot", "pop", "\\u", "a", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Numer", "ator", " ", "subject", "ref", "=\"", "tot", "pop", "\\u", "pi", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Numer", "ator", " ", "subject", "ref", "=\"", "tot", "pop", "\\u", "wn", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Numer", "ator", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Den", "omin", "ator", " ", "subject", "ref", "=\"", "tot", "pop", "\"", " ", "/>", "\\", "10", ";", " ", " ", "</", "Rati", "o", "Var", ">", "\\", "10", ";", " ", " ", "<", "Rati", "o", "Var", " ", "id", "=\"", "raci", "al", "Comp", "Va", "p", "\"", " ", "label", "=\"", "Maj", "ori", "ty", " ", "Min", "ori", "ty", " ", "Distr", "icts", "\"", " ", "threshol", "d", "=\".", "5", "\">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Numer", "ator", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Numer", "ator", " ", "subject", "ref", "=\"", "vap", "\\u", "b", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Numer", "ator", " ", "subject", "ref", "=\"", "vap", "\\u", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Numer", "ator", " ", "subject", "ref", "=\"", "vap", "\\u", "na", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Numer", "ator", " ", "subject", "ref", "=\"", "vap", "\\u", "a", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Numer", "ator", " ", "subject", "ref", "=\"", "vap", "\\u", "pi", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Numer", "ator", " ", "subject", "ref", "=\"", "vap", "\\u", "wn", "h", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Numer", "ator", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Den", "omin", "ator", " ", "subject", "ref", "=\"", "vap", "\"", " ", "/>", "\\", "10", ";", " ", " ", "</", "Rati", "o", "Var", ">", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "start", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", "<", "Rati", "o", "Var", " ", "id", "=\"", "part", "y", "Control", "\"", " ", "label", "=\"", "Part", "y", "-", "Controlle", "d", " ", "Distr", "icts", "\"", " ", "threshol", "d", "=\".", "5", "\">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Numer", "ator", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Numer", "ator", " ", "subject", "ref", "=\"", "vote", "\\u", "dem", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Numer", "ator", " ", "subject", "ref", "=\"", "vote", "\\u", "rep", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "</", "Numer", "ator", "s", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Den", "omin", "ator", " ", "subject", "ref", "=\"", "vote", "\\u", "tot", "\"", " ", "/>", "\\", "10", ";", " ", " ", "</", "Rati", "o", "Var", ">", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "end", "\\u", "elec", ")", "s", "\\", "10", ";", " ", " ", "</", "Rati", "o", "Var", "s", ">", "\\", "10", ";", " ", " ", "<", "Split", "Var", "s", ">", "\\", "10", ";", " ", " ", "<!", "--", " ", "\\", "10", ";", " ", " ", "\\", "10", ";", " ", " ", "See", " ", "whe", "ther", " ", "a", " ", "give", "n", " ", "district", " ", "split", "s", " ", "a", " ", "geogr", "aph", "y", ".", "\\", "10", ";", " ", " ", "Thi", "s", " ", "can", " ", "be", " ", "any", " ", "higher", " ", "level", " ", "geogr", "aph", "y", ":", " ", "a", " ", "county", ",", "\\", "10", ";", " ", " ", "VT", "d", ",", " ", "or", " ", "tract", ".", "\\", "10", ";", " ", " ", "-->", "\\", "10", ";", " ", " ", "<", "Split", "Var", " ", "field", "=\"", "COUNT", "YF", "P1", "0", "\"", " ", "label", "=\"", "Count", "y", "\"", " ", "/>", "\\", "10", ";", " ", " ", "<", "Split", "Var", " ", "field", "=\"", "TRA", "CTC", "E1", "0", "\"", " ", "label", "=\"", "Trac", "t", "\"", " ", "/>", "\\", "10", ";", " ", " ", "</", "Split", "Var", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Bar", "d", "Config", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Bar", "d", "Configs", ">", "\\", "10", ";", " ", " ", " ", "<", "Bar", "d", "Bod", "y", "Configs", ">", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", "\\", "10", ";", " ", " ", " ", " ", "For", " ", "each", " ", "legislat", "ive", " ", "body", ",", " ", "map", " ", "the", " ", "configura", "tion", " ", "to", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "geogr", "aph", "y", " ", "used", " ", "to", " ", "generat", "e", " ", "report", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Bar", "d", "Bod", "y", "Config", "\\", "10", ";", " ", " ", "id", "=\"", "congr", "ess", "\\u", "blocks", "\"", "\\", "10", ";", " ", " ", "legislat", "ive", "body", "ref", "=\"", "congr", "ess", "\"", "\\", "10", ";", " ", " ", "bar", "dco", "nfig", "ref", "=\"", "blocks", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Bar", "d", "Bod", "y", "Config", "\\", "10", ";", " ", " ", "id", "=\"", "house", "\\u", "blocks", "\"", "\\", "10", ";", " ", " ", "legislat", "ive", "body", "ref", "=\"", "house", "\"", "\\", "10", ";", " ", " ", "bar", "dco", "nfig", "ref", "=\"", "blocks", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "Bar", "d", "Bod", "y", "Config", "\\", "10", ";", " ", " ", "id", "=\"", "sena", "te", "\\u", "blocks", "\"", "\\", "10", ";", " ", " ", "legislat", "ive", "body", "ref", "=\"", "sena", "te", "\"", "\\", "10", ";", " ", " ", "bar", "dco", "nfig", "ref", "=\"", "blocks", "\"", " ", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Bar", "d", "Bod", "y", "Configs", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Report", "ing", ">", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "<!", "--", " ", "Information", " ", "abo", "ut", " ", "the", " ", "mailer", " ", "configura", "tion", ".", " ", "-->", "\\", "10", ";", " ", " ", " ", " ", "<", "Mail", "er", " ", "server", "=\"", "local", "host", "\"", " ", "port", "=\"", "25", "\"", " ", "user", "name", "=\"\"", " ", "password", "=\"\"", "/>", "\\", "10", ";", " ", " ", " ", " ", "</", "Project", ">", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";<", "/", "Distr", "ict", "Build", "er", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", "\"\"\"_", "\\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_", "gen", "\\u", "config_", "(_", "num", "\\u", "district", "s", "\\u", "congr", "ess_", ",_", "num", "\\u", "district", "s", "\\u", "sena", "te_", ",_", "num", "\\u", "district", "s", "\\u", "house_", ",_", "sum", "\\u", "TO", "TP", "OP_", ",_", "has", "\\u", "election", "\\u", "data_", "=_", "0_", ",_", "has", "\\u", "vt", "ds_", "=_", "0_", ",_", "conf", "\\u", "na_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "\\u", "na", "\\u", "congr", "ess_", "=_", "0_", ",_", "target", "\\u", "his", "p", "\\u", "congr", "ess_", "=_", "0_", ",_", "target", "\\u", "bl", "\\u", "congr", "ess_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "\\u", "na", "\\u", "house_", "=_", "0_", ",_", "target", "\\u", "his", "p", "\\u", "house_", "=_", "0_", ",_", "target", "\\u", "bl", "\\u", "house_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "\\u", "na", "\\u", "sena", "te_", "=_", "0_", ",_", "target", "\\u", "his", "p", "\\u", "sena", "te_", "=_", "0_", ",_", "target", "\\u", "bl", "\\u", "sena", "te_", "=_", "0_", ",_", "conti", "guit", "y", "Override", "String_", "=_", "\"\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "na_", "=_", "\"<", "!-", "-\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "elec", "_", "=_", "\"<", "!-", "-\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "elec", "_", "=_", "\"--", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "na_", "=_", "\"--", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mid", "level_", "=_", "\"", "tract", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "conf", "\\u", "na_", "==_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "na_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "na_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mid", "level", "\\u", "width_", "=_", "\"", "6", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mid", "level", "\\u", "var_", "=_", "\"", "TRA", "CTC", "E1", "0", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "has", "\\u", "election", "\\u", "data_", "==_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "elec", "_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "elec", "_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "has", "\\u", "vt", "ds_", "==_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "mid", "level_", "=_", "\"", "vt", "ds", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mid", "level", "\\u", "width_", "=_", "\"", "4", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mid", "level", "\\u", "var_", "=_", "\"", "VT", "DST", "10", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pop", "\\u", "congr", "ess_", "=_", "int_", "(_", "round_", "(_", "(_", "sum", "\\u", "TO", "TP", "OP_", "/_", "float_", "(_", "num", "\\u", "district", "s", "\\u", "congr", "ess_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pop", "\\u", "congr", "ess", "\\u", "max_", "=_", "int_", "(_", "round_", "(_", "(_", "sum", "\\u", "TO", "TP", "OP_", "/_", "float_", "(_", "num", "\\u", "district", "s", "\\u", "congr", "ess_", ")_", ")_", "*_", "1.00", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pop", "\\u", "congr", "ess", "\\u", "min_", "=_", "int_", "(_", "round_", "(_", "(_", "sum", "\\u", "TO", "TP", "OP_", "/_", "float_", "(_", "num", "\\u", "district", "s", "\\u", "congr", "ess_", ")_", ")_", "*_", "0.99", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pop", "\\u", "house_", "=_", "int_", "(_", "round_", "(_", "(_", "sum", "\\u", "TO", "TP", "OP_", "/_", "float_", "(_", "num", "\\u", "district", "s", "\\u", "house_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pop", "\\u", "house", "\\u", "max_", "=_", "int_", "(_", "round_", "(_", "(_", "sum", "\\u", "TO", "TP", "OP_", "/_", "float_", "(_", "num", "\\u", "district", "s", "\\u", "house_", ")_", ")_", "*_", "1.1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pop", "\\u", "house", "\\u", "min_", "=_", "int_", "(_", "round_", "(_", "(_", "sum", "\\u", "TO", "TP", "OP_", "/_", "float_", "(_", "num", "\\u", "district", "s", "\\u", "house_", ")_", ")_", "*_", "0.9_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pop", "\\u", "sena", "te_", "=_", "int_", "(_", "round_", "(_", "(_", "sum", "\\u", "TO", "TP", "OP_", "/_", "float_", "(_", "num", "\\u", "district", "s", "\\u", "sena", "te_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pop", "\\u", "sena", "te", "\\u", "max_", "=_", "int_", "(_", "round_", "(_", "(_", "sum", "\\u", "TO", "TP", "OP_", "/_", "float_", "(_", "num", "\\u", "district", "s", "\\u", "sena", "te_", ")_", ")_", "*_", "1.1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pop", "\\u", "sena", "te", "\\u", "min_", "=_", "int_", "(_", "round_", "(_", "(_", "sum", "\\u", "TO", "TP", "OP_", "/_", "float_", "(_", "num", "\\u", "district", "s", "\\u", "sena", "te_", ")_", ")_", "*_", "0.9_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "\\u", "file_", "=_", "'/", "project", "s", "/", "Public", "Map", "ping", "/", "Distr", "ict", "Build", "er", "/", "docs", "/", "config", "\\u", "census", "\\u", "generat", "ed", ".", "xml", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "open_", "(_", "target", "\\u", "file_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "str_", "(_", "Config", "\\u", "Template_", "(_", "start", "\\u", "elec", "_", "=_", "start", "\\u", "elec", "_", ",_", "end", "\\u", "elec", "_", "=_", "end", "\\u", "elec", "_", ",_", "num", "\\u", "district", "s", "\\u", "congr", "ess_", "=_", "num", "\\u", "district", "s", "\\u", "congr", "ess_", ",_", "num", "\\u", "district", "s", "\\u", "house_", "=_", "num", "\\u", "district", "s", "\\u", "house_", ",_", "num", "\\u", "district", "s", "\\u", "sena", "te_", "=_", "num", "\\u", "district", "s", "\\u", "sena", "te_", ",_", "pop", "\\u", "congr", "ess", "\\u", "max_", "=_", "pop", "\\u", "congr", "ess", "\\u", "max_", ",_", "pop", "\\u", "congr", "ess", "\\u", "min_", "=_", "pop", "\\u", "congr", "ess", "\\u", "min_", ",_", "pop", "\\u", "sena", "te", "\\u", "max_", "=_", "pop", "\\u", "sena", "te", "\\u", "max_", ",_", "pop", "\\u", "sena", "te", "\\u", "min_", "=_", "pop", "\\u", "sena", "te", "\\u", "min_", ",_", "pop", "\\u", "house", "\\u", "max_", "=_", "pop", "\\u", "house", "\\u", "max_", ",_", "pop", "\\u", "house", "\\u", "min_", "=_", "pop", "\\u", "house", "\\u", "min_", ",_", "pop", "\\u", "congr", "ess_", "=_", "pop", "\\u", "congr", "ess_", ",_", "pop", "\\u", "sena", "te_", "=_", "pop", "\\u", "sena", "te_", ",_", "pop", "\\u", "house_", "=_", "pop", "\\u", "house_", ",_", "start", "\\u", "na_", "=_", "start", "\\u", "na_", ",_", "end", "\\u", "na_", "=_", "end", "\\u", "na_", ",_", "target", "\\u", "na", "\\u", "congr", "ess_", "=_", "target", "\\u", "na", "\\u", "congr", "ess_", ",_", "target", "\\u", "his", "p", "\\u", "congr", "ess_", "=_", "target", "\\u", "his", "p", "\\u", "congr", "ess_", ",_", "target", "\\u", "bl", "\\u", "congr", "ess_", "=_", "target", "\\u", "bl", "\\u", "congr", "ess_", ",_", "target", "\\u", "na", "\\u", "house_", "=_", "target", "\\u", "na", "\\u", "house_", ",_", "target", "\\u", "his", "p", "\\u", "house_", "=_", "target", "\\u", "his", "p", "\\u", "house_", ",_", "target", "\\u", "bl", "\\u", "house_", "=_", "target", "\\u", "bl", "\\u", "house_", ",_", "target", "\\u", "na", "\\u", "sena", "te_", "=_", "target", "\\u", "na", "\\u", "sena", "te_", ",_", "target", "\\u", "his", "p", "\\u", "sena", "te_", "=_", "target", "\\u", "his", "p", "\\u", "sena", "te_", ",_", "target", "\\u", "bl", "\\u", "sena", "te_", "=_", "target", "\\u", "bl", "\\u", "sena", "te_", ",_", "conti", "guit", "y", "Override", "String_", "=_", "conti", "guit", "y", "Override", "String_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chmod_", "(_", "target", "\\u", "file_", ",_", "stat_", "._", "S", "\\u", "IR", "USR", "_", "|_", "stat_", "._", "S", "\\u", "IR", "GRP", "_", "|_", "stat_", "._", "S", "\\u", "IRO", "TH_", ")_", "\\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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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 ]
Unused local variable
foundit/Piped/contrib/zookeeper/piped_zookeeper/test/test_providers.py
[ { "content": " def test_exceptions_should_not_be_cached(self):\n client = providers.PipedZookeeperClient(\n servers='localhost:2181/foo,localhost:2182/foo'\n )\n\n pending, cacheable = self._create_cacheable()\n\n cached_call = client._cached(cacheable)\n foo = cached_call(foo=True)\n foo_2 = cached_call(foo=True)\n self.assertEquals(len(pending), 1)\n\n # both foo and foo_2 should be errbacked\n exception = Exception('42')\n pending.pop()[0].errback(exception)\n\n foo.addCallback(self.fail)\n foo_2.addCallback(self.fail)\n \n foo.addErrback(lambda reason: self.assertEquals(reason.value, exception))\n foo_2.addErrback(lambda reason: self.assertEquals(reason.value, exception))\n\n self.assertEquals(len(pending), 0)\n # since it errbacked, we shouldn't have cached this value\n foo_3 = cached_call(foo=True)\n self.assertEquals(len(pending), 1)", "metadata": "root.TestClient.test_exceptions_should_not_be_cached", "header": "['class', 'TestClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 152 }, { "content": " def test_cache_cleared_when_watch_fired(self):\n client = providers.PipedZookeeperClient(\n servers='localhost:2181/foo,localhost:2182/foo'\n )\n\n pending, cacheable = self._create_cacheable()\n cached_call = client._cached(cacheable)\n\n foo = cached_call(foo=True)\n self.assertEquals(len(pending), 1)\n\n d, kwargs, watcher = pending.pop()\n d.callback(42)\n self.assertEquals(foo.result, 42)\n\n # the value should be cached:\n foo_2 = cached_call(foo=True)\n self.assertEquals(len(pending), 0)\n self.assertEquals(foo_2.result, 42)\n\n # callbacking the watcher should clear the cache:\n watcher.callback(None)\n foo_3 = cached_call(foo=True)\n self.assertEquals(len(pending), 1)", "metadata": "root.TestClient.test_cache_cleared_when_watch_fired", "header": "['class', 'TestClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 179 }, { "content": " def test_cache_cleared_when_client_disconnects(self):\n client = providers.PipedZookeeperClient(\n servers='localhost:2181/foo,localhost:2182/foo'\n )\n\n pending, cacheable = self._create_cacheable()\n cached_call = client._cached(cacheable)\n\n foo = cached_call(foo=True)\n self.assertEquals(len(pending), 1)\n\n d, kwargs, watcher = pending.pop()\n d.callback(42)\n self.assertEquals(foo.result, 42)\n\n # the value should be cached:\n foo_2 = cached_call(foo=True)\n self.assertEquals(len(pending), 0)\n self.assertEquals(foo_2.result, 42)\n\n # a client disconnect should clear the cache\n client.on_disconnected('test disconnect')\n foo_3 = cached_call(foo=True)\n self.assertEquals(len(pending), 1)", "metadata": "root.TestClient.test_cache_cleared_when_client_disconnects", "header": "['class', 'TestClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 204 }, { "content": " def test_parse_servers(self):\n client = providers.PipedZookeeperClient(servers='foo,bar,baz/v1')\n self.assertEqual(client.servers, ['foo', 'bar', 'baz'])\n self.assertEqual(client.chroot, '/v1')\n\n client = providers.PipedZookeeperClient(servers='foo/v1,bar/v1,baz/v1')\n self.assertEqual(client.servers, ['foo', 'bar', 'baz'])\n self.assertEqual(client.chroot, '/v1')\n\n client = providers.PipedZookeeperClient(servers='foo/v1,bar,baz')\n self.assertEqual(client.servers, ['foo', 'bar', 'baz'])\n self.assertEqual(client.chroot, '/v1')\n\n try:\n client = providers.PipedZookeeperClient(servers='foo/v1,bar,baz/v2')\n self.fail('Expected ConfigurationError to be raised')\n except exceptions.ConfigurationError as ce:\n self.assertIn(ce.message, 'Multiple differing chroots defined')\n self.assertIn(ce.message, 'v1')\n self.assertIn(ce.message, 'v2')", "metadata": "root.TestClient.test_parse_servers", "header": "['class', 'TestClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 290 } ]
[ { "span": "foo_3 ", "start_line": 176, "start_column": 8, "end_line": 176, "end_column": 13 }, { "span": "foo_3 ", "start_line": 201, "start_column": 8, "end_line": 201, "end_column": 13 }, { "span": "foo_3 ", "start_line": 226, "start_column": 8, "end_line": 226, "end_column": 13 }, { "span": "client ", "start_line": 304, "start_column": 12, "end_line": 304, "end_column": 18 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "exception", "s", "\\u", "shou", "ld", "\\u", "not", "\\u", "be", "\\u", "cached_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "providers_", "._", "Pipe", "d", "Zoo", "keeper", "Client_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "servers_", "=_", "'", "local", "host", ":", "218", "1", "/", "foo", ",", "local", "host", ":", "218", "2", "/", "foo", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pending_", ",_", "cache", "able_", "=_", "self_", "._", "\\u", "create", "\\u", "cache", "able_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cache", "d\\u", "call_", "=_", "client_", "._", "\\u", "cached_", "(_", "cache", "able_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foo_", "=_", "cache", "d\\u", "call_", "(_", "foo_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foo", "\\u", "2_", "=_", "cache", "d\\u", "call_", "(_", "foo_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "pending_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bot", "h", " ", "foo", " ", "and", " ", "foo", "\\u", "2", " ", "shou", "ld", " ", "be", " ", "errback", "ed_", "\\u\\u\\uNL\\u\\u\\u_", "exception_", "=_", "Exception_", "(_", "'", "4", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pending_", "._", "pop_", "(_", ")_", "[_", "0_", "]_", "._", "errback", "_", "(_", "exception_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "foo_", "._", "add", "Callback_", "(_", "self_", "._", "fail_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foo", "\\u", "2_", "._", "add", "Callback_", "(_", "self_", "._", "fail_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "foo_", "._", "add", "Errback_", "(_", "lambda_", "reason_", ":_", "self_", "._", "assert", "Equals_", "(_", "reason_", "._", "value_", ",_", "exception_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foo", "\\u", "2_", "._", "add", "Errback_", "(_", "lambda_", "reason_", ":_", "self_", "._", "assert", "Equals_", "(_", "reason_", "._", "value_", ",_", "exception_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "pending_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "sinc", "e", " ", "it", " ", "errback", "ed", ",", " ", "we", " ", "shou", "ld", "n", "'", "t", " ", "have", " ", "cache", "d", " ", "this", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "foo", "\\u", "3_", "=_", "cache", "d\\u", "call_", "(_", "foo_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "pending_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cache", "\\u", "clear", "ed", "\\u", "whe", "n", "\\u", "watch", "\\u", "fired", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "providers_", "._", "Pipe", "d", "Zoo", "keeper", "Client_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "servers_", "=_", "'", "local", "host", ":", "218", "1", "/", "foo", ",", "local", "host", ":", "218", "2", "/", "foo", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pending_", ",_", "cache", "able_", "=_", "self_", "._", "\\u", "create", "\\u", "cache", "able_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache", "d\\u", "call_", "=_", "client_", "._", "\\u", "cached_", "(_", "cache", "able_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "foo_", "=_", "cache", "d\\u", "call_", "(_", "foo_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "pending_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", ",_", "kwargs_", ",_", "watcher_", "=_", "pending_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "callback_", "(_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "foo_", "._", "result_", ",_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "value", " ", "shou", "ld", " ", "be", " ", "cache", "d", ":_", "\\u\\u\\uNL\\u\\u\\u_", "foo", "\\u", "2_", "=_", "cache", "d\\u", "call_", "(_", "foo_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "pending_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "foo", "\\u", "2_", "._", "result_", ",_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "callback", "ing", " ", "the", " ", "watcher", " ", "shou", "ld", " ", "clear", " ", "the", " ", "cache", ":_", "\\u\\u\\uNL\\u\\u\\u_", "watcher_", "._", "callback_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foo", "\\u", "3_", "=_", "cache", "d\\u", "call_", "(_", "foo_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "pending_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cache", "\\u", "clear", "ed", "\\u", "whe", "n", "\\u", "client", "\\u", "discon", "nect", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "providers_", "._", "Pipe", "d", "Zoo", "keeper", "Client_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "servers_", "=_", "'", "local", "host", ":", "218", "1", "/", "foo", ",", "local", "host", ":", "218", "2", "/", "foo", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pending_", ",_", "cache", "able_", "=_", "self_", "._", "\\u", "create", "\\u", "cache", "able_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache", "d\\u", "call_", "=_", "client_", "._", "\\u", "cached_", "(_", "cache", "able_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "foo_", "=_", "cache", "d\\u", "call_", "(_", "foo_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "pending_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", ",_", "kwargs_", ",_", "watcher_", "=_", "pending_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "callback_", "(_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "foo_", "._", "result_", ",_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "value", " ", "shou", "ld", " ", "be", " ", "cache", "d", ":_", "\\u\\u\\uNL\\u\\u\\u_", "foo", "\\u", "2_", "=_", "cache", "d\\u", "call_", "(_", "foo_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "pending_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "foo", "\\u", "2_", "._", "result_", ",_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "client", " ", "discon", "nect", " ", "shou", "ld", " ", "clear", " ", "the", " ", "cache_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "on", "\\u", "disconnected", "_", "(_", "'", "test", " ", "discon", "nect", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foo", "\\u", "3_", "=_", "cache", "d\\u", "call_", "(_", "foo_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "pending_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "unittest_", "._", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "parse", "\\u", "servers_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "providers_", "._", "Pipe", "d", "Zoo", "keeper", "Client_", "(_", "servers_", "=_", "'", "foo", ",", "bar", ",", "ba", "z", "/", "v1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "client_", "._", "servers_", ",_", "[_", "'", "foo", "'_", ",_", "'", "bar", "'_", ",_", "'", "ba", "z", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "client_", "._", "chroot", "_", ",_", "'/", "v1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "=_", "providers_", "._", "Pipe", "d", "Zoo", "keeper", "Client_", "(_", "servers_", "=_", "'", "foo", "/", "v1", ",", "bar", "/", "v1", ",", "ba", "z", "/", "v1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "client_", "._", "servers_", ",_", "[_", "'", "foo", "'_", ",_", "'", "bar", "'_", ",_", "'", "ba", "z", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "client_", "._", "chroot", "_", ",_", "'/", "v1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "=_", "providers_", "._", "Pipe", "d", "Zoo", "keeper", "Client_", "(_", "servers_", "=_", "'", "foo", "/", "v1", ",", "bar", ",", "ba", "z", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "client_", "._", "servers_", ",_", "[_", "'", "foo", "'_", ",_", "'", "bar", "'_", ",_", "'", "ba", "z", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "client_", "._", "chroot", "_", ",_", "'/", "v1", "'_", ")_", "\\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 ", " _", "client_", "=_", "providers_", "._", "Pipe", "d", "Zoo", "keeper", "Client_", "(_", "servers_", "=_", "'", "foo", "/", "v1", ",", "bar", ",", "ba", "z", "/", "v2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", "'", "Expect", "ed", " ", "Configura", "tion", "Error", " ", "to", " ", "be", " ", "raise", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "exceptions_", "._", "Configura", "tion", "Error_", "as_", "ce_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "In_", "(_", "ce_", "._", "message_", ",_", "'", "Multipl", "e", " ", "differ", "ing", " ", "chroot", "s", " ", "defin", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "ce_", "._", "message_", ",_", "'", "v1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "ce_", "._", "message_", ",_", "'", "v2", "'_", ")_" ]
[ 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,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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 ]
Unused import
HewlettPackard/python-hpOneView/examples/scripts/define-san-storage-list.py
[ { "content": "#!/usr/bin/env python\n###\n# (C) Copyright (2012-2015) Hewlett Packard Enterprise Development LP\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###\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom builtins import range\nfrom future import standard_library\nstandard_library.install_aliases()\nimport sys\n\nPYTHON_VERSION = sys.version_info[:3]\nPY2 = (PYTHON_VERSION[0] == 2)\nif PY2:\n if PYTHON_VERSION < (2, 7, 9):\n raise Exception('Must use Python 2.7.9 or later')\nelif PYTHON_VERSION < (3, 4):\n raise Exception('Must use Python 3.4 or later')\n\nimport hpOneView as hpov\nfrom pprint import pprint\nimport json\n\n\nHOST_OS = {'CitrixXen': 'Citrix Xen Server 5.x/6.x',\n 'AIX': 'AIX',\n 'IBMVIO': 'IBM VIO Server',\n 'RHEL4': 'RHE Linux (Pre RHEL 5)',\n 'RHEL3': 'RHE Linux (Pre RHEL 5)',\n 'RHEL': 'RHE Linux (5.x, 6.x)',\n 'RHEV': 'RHE Virtualization (5.x, 6.x)',\n 'VMware': 'ESX 4.x/5.x',\n 'Win2k3': 'Windows 2003',\n 'Win2k8': 'Windows 2008/2008 R2',\n 'Win2k12': 'Windows 2012 / WS2012 R2',\n 'OpenVMS': 'OpenVMS',\n 'Egenera': 'Egenera',\n 'Exanet': 'Exanet',\n 'Solaris9': 'Solaris 9/10',\n 'Solaris10': 'Solaris 9/10',\n 'Solaris11': 'Solaris 11',\n 'ONTAP': 'NetApp/ONTAP',\n 'OEL': 'OE Linux UEK (5.x, 6.x)',\n 'HPUX11iv1': 'HP-UX (11i v1, 11i v2)',\n 'HPUX11iv2': 'HP-UX (11i v1, 11i v2)',\n 'HPUX11iv3': 'HP-UX (11i v3)',\n 'SUSE': 'SuSE (10.x, 11.x)',\n 'SUSE9': 'SuSE Linux (Pre SLES 10)',\n 'Inform': 'InForm'}\n\n\n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n import sys\n import argparse\n sys.exit(main())\n\n# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def acceptEULA(con):\n # See if we need to accept the EULA before we try to log in\n con.get_eula_status()\n try:\n if con.get_eula_status() is True:\n print('EULA display needed')\n con.set_eula('no')\n except Exception as e:\n print('EXCEPTION:')\n print(e)", "metadata": "root.acceptEULA", "header": "['module', '___EOS___']", "index": 71 }, { "content": "def login(con, credential):\n # Login with givin credentials\n try:\n con.login(credential)\n except:\n print('Login failed')", "metadata": "root.login", "header": "['module', '___EOS___']", "index": 83 }, { "content": "def define_san(sto, name, san_list, conn_list, append, hostos, lun, del_vol):\n\n volumes = sto.get_attachable_volumes()\n vol = None\n for volume in volumes['members']:\n if volume['name'] == name:\n vol = volume\n\n if not vol:\n print('Error, could not locate attachable volume:', name)\n sys.exit(2)\n\n if lun:\n lun_type = 'Manual'\n else:\n lun_type = 'Auto'\n\n net_ids = []\n conn = json.loads(open(conn_list).read())\n for item in conn:\n if item['functionType'] == 'FibreChannel':\n net_ids.append(item['id'])\n\n if not net_ids:\n print('Error, cound not locate FibreChannel connections to attach'\n ' volumes')\n sys.exit()\n\n paths = []\n for nid in net_ids:\n paths.append(hpov.common.make_StoragePathV2(storageTargetType='Auto',\n storageTargets=[],\n connectionId=nid,\n isEnabled=True))\n\n vols = hpov.common.make_VolumeAttachmentV2(lun=None,\n lunType=lun_type,\n volumeUri=vol['uri'],\n volumeStoragePoolUri=vol['storagePoolUri'],\n volumeStorageSystemUri=vol['storageSystemUri'],\n storagePaths=paths)\n\n san_storage = hpov.common.make_SanStorageV3(HOST_OS[hostos], True, vols)\n\n if append:\n data = json.loads(open(san_list).read())\n if 'volumeAttachments' not in data:\n print('Error, can not locate exsisting volumeAttachments to '\n 'append')\n sys.exit(3)\n vol_attach = data['volumeAttachments']\n vol_attach.append(vols)\n else:\n data = san_storage\n f = open(san_list, 'w')\n out = json.dumps(data, indent=4)\n f.write(out)\n f.close()", "metadata": "root.define_san", "header": "['module', '___EOS___']", "index": 91 }, { "content": "def main():\n parser = argparse.ArgumentParser(add_help=True,\n formatter_class=argparse.RawTextHelpFormatter,\n description='''\n Define a OneView SAN Storage connection list for use with defining a\n server profile with managed SAN storage connections.\n\n Usage: ''')\n parser.add_argument('-a', dest='host', required=True,\n help='''\n HP OneView Appliance hostname or IP address''')\n parser.add_argument('-u', dest='user', required=False,\n default='Administrator',\n help='''\n HP OneView Username''')\n parser.add_argument('-p', dest='passwd', required=True,\n help='''\n HP OneView Password''')\n parser.add_argument('-c', dest='cert', required=False,\n help='''\n Trusted SSL Certificate Bundle in PEM (Base64 Encoded DER) Format''')\n parser.add_argument('-y', dest='proxy', required=False,\n help='''\n Proxy (host:port format''')\n parser.add_argument('-j', dest='domain', required=False,\n default='Local',\n help='''\n HP OneView Authorized Login Domain''')\n parser.add_argument('-sl', dest='san_list',\n required=True,\n help='''\n Name of file for SAN storage list''')\n parser.add_argument('-cl', dest='conn_list',\n required=True,\n help='''\n Name of server profile connection list file to import''')\n parser.add_argument('-app', dest='append',\n required=False,\n action='store_true',\n help='''\n Causes SAN list to be appended to the file''')\n parser.add_argument('-o', dest='hostos',\n required=True,\n choices=['CitrixXen', 'AIX', 'IBMVIO', 'RHEL4',\n 'RHEL3', 'RHEL', 'RHEV', 'VMware', 'Win2k3',\n 'Win2k8', 'Win2k12', 'OpenVMS', 'Egenera',\n 'Exanet', 'Solaris9', 'Solaris10',\n 'Solaris11', 'ONTAP', 'OEL', 'HPUX11iv1',\n 'HPUX11iv2', 'HPUX11iv3', 'SUSE', 'SUSE9',\n 'Inform'],\n help='''\n Specify the Host OS type, which will set the Host OS value when HP OneView\n created the Host object on the Storage System. Accepted values:\n\n . CitrixXen = \"Citrix Xen Server 5.x/6.x\"\n . AIX = \"AIX\"\n . IBMVIO = \"IBM VIO Server\"\n . RHEL4 = \"RHE Linux (Pre RHEL 5)\"\n . RHEL3 = \"RHE Linux (Pre RHEL 5)\"\n . RHEL = \"RHE Linux (5.x, 6.x)\"\n . RHEV = \"RHE Virtualization (5.x, 6.x)\"\n . VMware = \"ESX 4.x/5.x\"\n . Win2k3 = \"Windows 2003\"\n . Win2k8 = \"Windows 2008/2008 R2\"\n . Win2k12 = \"Windows 2012 / WS2012 R2\"\n . OpenVMS = \"OpenVMS\"\n . Egenera = \"Egenera\"\n . Exanet = \"Exanet\"\n . Solaris9 = \"Solaris 9/10\"\n . Solaris10 = \"Solaris 9/10\"\n . Solaris11 = \"Solaris 11\"\n . ONTAP = \"NetApp/ONTAP\"\n . OEL = \"OE Linux UEK (5.x, 6.x)\"\n . HPUX11iv1 = \"HP-UX (11i v1, 11i v2)\"\n . HPUX11iv2 = \"HP-UX (11i v1, 11i v2)\"\n . HPUX11iv3 = \"HP-UX (11i v3)\"\n . SUSE = \"SuSE (10.x, 11.x)\"\n . SUSE9 = \"SuSE Linux (Pre SLES 10)\"\n . Inform = \"InForm\"\n\n ''')\n parser.add_argument('-n', dest='name', required=True,\n help='''\n Name of the exsisting storage volume to attach''')\n parser.add_argument('-l', dest='lun_id', required=False,\n type=int,\n help='''\n Manual entry for the LUN number. Auto, will be used if this\n value is not specified.''')\n parser.add_argument('-del', dest='del_vol', required=False,\n action='store_false',\n help='''\n Indicates that the volume will be deleted when the profile is deleted.''')\n\n args = parser.parse_args()\n credential = {'authLoginDomain': args.domain.upper(), 'userName': args.user, 'password': args.passwd}\n\n con = hpov.connection(args.host)\n sto = hpov.storage(con)\n\n if args.proxy:\n con.set_proxy(args.proxy.split(':')[0], args.proxy.split(':')[1])\n if args.cert:\n con.set_trusted_ssl_bundle(args.cert)\n\n login(con, credential)\n acceptEULA(con)\n\n if args.lun_id:\n if args.lun_id < 0 or args.lun_id > 255:\n print('Error: boot lun value must be between 0 and 255')\n sys.exit(1)\n\n define_san(sto, args.name, args.san_list, args.conn_list, args.append,\n args.hostos, args.lun_id, args.del_vol)", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 151 } ]
[ { "span": "from builtins import range", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 26 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "C", ")", " ", "Copy", "right", " ", "(", "2012", "-", "201", "5", ")", " ", "He", "wle", "tt", " ", "Packa", "rd", " ", "Enter", "pris", "e", " ", "Dev", "elo", "pme", "nt", " ", "LP", "_", "\\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_", "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_", "from_", "\\u\\u", "future\\u\\u_", "import_", "division_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "builtins_", "import_", "range_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "future_", "import_", "standard", "\\u", "library_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "standard", "\\u", "library_", "._", "install", "\\u", "aliases_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PYTHON", "\\u", "VERSION_", "=_", "sys_", "._", "version", "\\u", "info_", "[_", ":_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PY", "2_", "=_", "(_", "PYTHON", "\\u", "VERSION_", "[_", "0_", "]_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "PY", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "PYTHON", "\\u", "VERSION_", "<_", "(_", "2_", ",_", "7_", ",_", "9_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "Mus", "t", " ", "use", " ", "Pyth", "on", " ", "2.7", ".9", " ", "or", " ", "late", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "PYTHON", "\\u", "VERSION_", "<_", "(_", "3_", ",_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "Mus", "t", " ", "use", " ", "Pyth", "on", " ", "3.4", " ", "or", " ", "late", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "hp", "One", "View_", "as_", "hp", "ov_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pprint_", "import_", "pprint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "HOST", "\\u", "OS_", "=_", "{_", "'", "Cit", "rix", "Xen", "'_", ":_", "'", "Cit", "rix", " ", "Xen", " ", "Server", " ", "5", ".", "x", "/", "6", ".", "x", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "AI", "X", "'_", ":_", "'", "AI", "X", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "IB", "MV", "IO", "'_", ":_", "'", "IB", "M", " ", "VIO", " ", "Server", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "RHE", "L4", "'_", ":_", "'", "RHE", " ", "Lin", "ux", " ", "(", "Pre", " ", "RHE", "L", " ", "5", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "RHE", "L3", "'_", ":_", "'", "RHE", " ", "Lin", "ux", " ", "(", "Pre", " ", "RHE", "L", " ", "5", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "RHE", "L", "'_", ":_", "'", "RHE", " ", "Lin", "ux", " ", "(", "5", ".", "x", ",", " ", "6", ".", "x", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "RHE", "V", "'_", ":_", "'", "RHE", " ", "Virt", "uali", "zatio", "n", " ", "(", "5", ".", "x", ",", " ", "6", ".", "x", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "VM", "ware", "'_", ":_", "'", "ES", "X", " ", "4", ".", "x", "/", "5", ".", "x", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Win", "2", "k3", "'_", ":_", "'", "Window", "s", " ", "2003", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Win", "2", "k", "8", "'_", ":_", "'", "Window", "s", " ", "2008", "/", "2008", " ", "R2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Win", "2", "k", "1", "2", "'_", ":_", "'", "Window", "s", " ", "2012", " ", "/", " ", "WS", "2012", " ", "R2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Open", "VM", "S", "'_", ":_", "'", "Open", "VM", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Eg", "enera", "'_", ":_", "'", "Eg", "enera", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Exa", "net", "'_", ":_", "'", "Exa", "net", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Sol", "aris", "9", "'_", ":_", "'", "Sol", "aris", " ", "9", "/", "10", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Sol", "aris", "10", "'_", ":_", "'", "Sol", "aris", " ", "9", "/", "10", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Sol", "aris", "11", "'_", ":_", "'", "Sol", "aris", " ", "11", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ONT", "AP", "'_", ":_", "'", "Net", "App", "/", "ONT", "AP", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "OE", "L", "'_", ":_", "'", "OE", " ", "Lin", "ux", " ", "UE", "K", " ", "(", "5", ".", "x", ",", " ", "6", ".", "x", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "HP", "UX", "11", "iv", "1", "'_", ":_", "'", "HP", "-", "UX", " ", "(", "11", "i", " ", "v1", ",", " ", "11", "i", " ", "v2", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "HP", "UX", "11", "iv", "2", "'_", ":_", "'", "HP", "-", "UX", " ", "(", "11", "i", " ", "v1", ",", " ", "11", "i", " ", "v2", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "HP", "UX", "11", "iv", "3", "'_", ":_", "'", "HP", "-", "UX", " ", "(", "11", "i", " ", "v", "3", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SUS", "E", "'_", ":_", "'", "Su", "SE", " ", "(", "10.", "x", ",", " ", "11.", "x", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SUS", "E", "9", "'_", ":_", "'", "Su", "SE", " ", "Lin", "ux", " ", "(", "Pre", " ", "SL", "ES", " ", "10", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Infor", "m", "'_", ":_", "'", "In", "Form", "'_", "}_", "\\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_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "main_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "vim", ":", "set", " ", "shift", "widt", "h", "=", "4", " ", "tabs", "top", "=", "4", " ", "expand", "tab", " ", "text", "widt", "h", "=", "7", "9", ":_", "\\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_", "accept", "EU", "LA_", "(_", "con_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "See", " ", "if", " ", "we", " ", "need", " ", "to", " ", "accept", " ", "the", " ", "EU", "LA", " ", "bef", "ore", " ", "we", " ", "try", " ", "to", " ", "log", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "con_", "._", "get", "\\u", "eu", "la", "\\u", "status_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "con_", "._", "get", "\\u", "eu", "la", "\\u", "status_", "(_", ")_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "EU", "LA", " ", "display", " ", "need", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "con_", "._", "set\\u", "eu", "la_", "(_", "'", "no", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "EXCEPTION", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "e_", ")_", "\\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_", "login_", "(_", "con_", ",_", "credential_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Logi", "n", " ", "with", " ", "gi", "vin", " ", "credentials_", "\\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 ", " _", "con_", "._", "login_", "(_", "credential_", ")_", "\\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 ", " _", "print_", "(_", "'", "Logi", "n", " ", "fail", "ed", "'_", ")_", "\\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_", "defin", "e\\u", "san", "_", "(_", "sto", "_", ",_", "name_", ",_", "san", "\\u", "list_", ",_", "conn", "\\u", "list_", ",_", "append_", ",_", "host", "os_", ",_", "lun_", ",_", "del", "\\u", "vol_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "volumes_", "=_", "sto", "_", "._", "get", "\\u", "attach", "able", "\\u", "volumes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vol_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "volume_", "in_", "volumes_", "[_", "'", "member", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "volume_", "[_", "'", "name", "'_", "]_", "==_", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vol_", "=_", "volume_", "\\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_", "not_", "vol_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Error", ",", " ", "coul", "d", " ", "not", " ", "locat", "e", " ", "attach", "able", " ", "volume", ":'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "lun_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lun", "\\u", "type_", "=_", "'", "Manu", "al", "'_", "\\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 ", " _", "lun", "\\u", "type_", "=_", "'", "Auto", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "net", "\\u", "ids_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "=_", "json_", "._", "loads_", "(_", "open_", "(_", "conn", "\\u", "list_", ")_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "conn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "item_", "[_", "'", "function", "Type", "'_", "]_", "==_", "'", "Fib", "re", "Chan", "nel", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "net", "\\u", "ids_", "._", "append_", "(_", "item_", "[_", "'", "id", "'_", "]_", ")_", "\\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_", "not_", "net", "\\u", "ids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Error", ",", " ", "cou", "nd", " ", "not", " ", "locat", "e", " ", "Fib", "re", "Chan", "nel", " ", "connections", " ", "to", " ", "attach", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", " ", "volume", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "paths_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "nid_", "in_", "net", "\\u", "ids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "paths_", "._", "append_", "(_", "hp", "ov_", "._", "common_", "._", "make", "\\u", "Stor", "age", "Path", "V2_", "(_", "storage", "Target", "Type_", "=_", "'", "Auto", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "storage", "Targets_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "connecti", "on", "Id_", "=_", "nid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "Enabled_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "vols_", "=_", "hp", "ov_", "._", "common_", "._", "make", "\\u", "Volume", "Attach", "ment", "V2_", "(_", "lun_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lun", "Type_", "=_", "lun", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "volume", "Uri_", "=_", "vol_", "[_", "'", "uri", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "volume", "Stor", "age", "Poo", "l", "Uri_", "=_", "vol_", "[_", "'", "storage", "Poo", "l", "Ur", "i", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "volume", "Stor", "age", "System", "Uri_", "=_", "vol_", "[_", "'", "storage", "System", "Ur", "i", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "storage", "Paths_", "=_", "paths_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "san", "\\u", "storage_", "=_", "hp", "ov_", "._", "common_", "._", "make", "\\u", "San", "Stor", "age", "V3_", "(_", "HOST", "\\u", "OS_", "[_", "host", "os_", "]_", ",_", "True_", ",_", "vols_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "append_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "json_", "._", "loads_", "(_", "open_", "(_", "san", "\\u", "list_", ")_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "volume", "Attach", "ment", "s", "'_", "not_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Error", ",", " ", "can", " ", "not", " ", "locat", "e", " ", "ex", "sis", "ting", " ", "volume", "Attach", "ment", "s", " ", "to", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "append", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "vol", "\\u", "attach_", "=_", "data_", "[_", "'", "volume", "Attach", "ment", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vol", "\\u", "attach_", "._", "append_", "(_", "vols_", ")_", "\\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_", "=_", "san", "\\u", "storage_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f_", "=_", "open_", "(_", "san", "\\u", "list_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "=_", "json_", "._", "dumps_", "(_", "data_", ",_", "indent_", "=_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\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_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "add", "\\u", "help_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "formatter", "\\u", "class_", "=_", "argparse_", "._", "Ra", "w", "Text", "Help", "Formatter_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "'''", "\\", "10", ";", " ", " ", " ", " ", "Define", " ", "a", " ", "One", "View", " ", "SAN", " ", "Stor", "age", " ", "connecti", "on", " ", "list", " ", "for", " ", "use", " ", "with", " ", "defini", "ng", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "server", " ", "profile", " ", "with", " ", "manage", "d", " ", "SAN", " ", "storage", " ", "connections", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Us", "age", ":", " ", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "a", "'_", ",_", "dest_", "=_", "'", "host", "'_", ",_", "required_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'''", "\\", "10", ";", " ", " ", " ", " ", "HP", " ", "One", "View", " ", "Appliance", " ", "host", "name", " ", "or", " ", "IP", " ", "address", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "u", "'_", ",_", "dest_", "=_", "'", "user", "'_", ",_", "required_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "'", "Administra", "tor", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'''", "\\", "10", ";", " ", " ", " ", " ", "HP", " ", "One", "View", " ", "User", "name", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "p", "'_", ",_", "dest_", "=_", "'", "passw", "d", "'_", ",_", "required_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'''", "\\", "10", ";", " ", " ", " ", " ", "HP", " ", "One", "View", " ", "Passw", "ord", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "c", "'_", ",_", "dest_", "=_", "'", "cert", "'_", ",_", "required_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'''", "\\", "10", ";", " ", " ", " ", " ", "Trust", "ed", " ", "SS", "L", " ", "Certificat", "e", " ", "Bun", "dle", " ", "in", " ", "PEM", " ", "(", "Base", "64", " ", "Encode", "d", " ", "DER", ")", " ", "Format", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "y", "'_", ",_", "dest_", "=_", "'", "proxy", "'_", ",_", "required_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'''", "\\", "10", ";", " ", " ", " ", " ", "Pro", "xy", " ", "(", "host", ":", "port", " ", "format", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "j", "'_", ",_", "dest_", "=_", "'", "domain", "'_", ",_", "required_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "'", "Local", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'''", "\\", "10", ";", " ", " ", " ", " ", "HP", " ", "One", "View", " ", "Authorized", " ", "Logi", "n", " ", "Doma", "in", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "sl", "'_", ",_", "dest_", "=_", "'", "san", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "required_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'''", "\\", "10", ";", " ", " ", " ", " ", "Name", " ", "of", " ", "file", " ", "for", " ", "SAN", " ", "storage", " ", "list", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "cl", "'_", ",_", "dest_", "=_", "'", "conn", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "required_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'''", "\\", "10", ";", " ", " ", " ", " ", "Name", " ", "of", " ", "server", " ", "profile", " ", "connecti", "on", " ", "list", " ", "file", " ", "to", " ", "import", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "app", "'_", ",_", "dest_", "=_", "'", "append", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "required_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'''", "\\", "10", ";", " ", " ", " ", " ", "Cause", "s", " ", "SAN", " ", "list", " ", "to", " ", "be", " ", "append", "ed", " ", "to", " ", "the", " ", "file", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "o", "'_", ",_", "dest_", "=_", "'", "host", "os", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "required_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "choices_", "=_", "[_", "'", "Cit", "rix", "Xen", "'_", ",_", "'", "AI", "X", "'_", ",_", "'", "IB", "MV", "IO", "'_", ",_", "'", "RHE", "L4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "RHE", "L3", "'_", ",_", "'", "RHE", "L", "'_", ",_", "'", "RHE", "V", "'_", ",_", "'", "VM", "ware", "'_", ",_", "'", "Win", "2", "k3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Win", "2", "k", "8", "'_", ",_", "'", "Win", "2", "k", "1", "2", "'_", ",_", "'", "Open", "VM", "S", "'_", ",_", "'", "Eg", "enera", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Exa", "net", "'_", ",_", "'", "Sol", "aris", "9", "'_", ",_", "'", "Sol", "aris", "10", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Sol", "aris", "11", "'_", ",_", "'", "ONT", "AP", "'_", ",_", "'", "OE", "L", "'_", ",_", "'", "HP", "UX", "11", "iv", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "HP", "UX", "11", "iv", "2", "'_", ",_", "'", "HP", "UX", "11", "iv", "3", "'_", ",_", "'", "SUS", "E", "'_", ",_", "'", "SUS", "E", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Infor", "m", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'''", "\\", "10", ";", " ", " ", " ", " ", "Speci", "fy", " ", "the", " ", "Host", " ", "OS", " ", "type", ",", " ", "whi", "ch", " ", "will", " ", "set", " ", "the", " ", "Host", " ", "OS", " ", "value", " ", "whe", "n", " ", "HP", " ", "One", "View", "\\", "10", ";", " ", " ", " ", " ", "created", " ", "the", " ", "Host", " ", "object", " ", "on", " ", "the", " ", "Stor", "age", " ", "System", ".", " ", "Accept", "ed", " ", "values", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "Cit", "rix", "Xen", " ", "=", " ", "\"", "Cit", "rix", " ", "Xen", " ", "Server", " ", "5", ".", "x", "/", "6", ".", "x", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "AI", "X", " ", " ", " ", "=", " ", "\"", "AI", "X", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "IB", "MV", "IO", " ", " ", " ", " ", "=", " ", "\"", "IB", "M", " ", "VIO", " ", "Server", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "RHE", "L4", " ", "=", " ", "\"", "RHE", " ", "Lin", "ux", " ", "(", "Pre", " ", "RHE", "L", " ", "5", ")\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "RHE", "L3", " ", "=", " ", "\"", "RHE", " ", "Lin", "ux", " ", "(", "Pre", " ", "RHE", "L", " ", "5", ")\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "RHE", "L", " ", " ", "=", " ", "\"", "RHE", " ", "Lin", "ux", " ", "(", "5", ".", "x", ",", " ", "6", ".", "x", ")\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "RHE", "V", " ", " ", "=", " ", "\"", "RHE", " ", "Virt", "uali", "zatio", "n", " ", "(", "5", ".", "x", ",", " ", "6", ".", "x", ")\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "VM", "ware", " ", " ", " ", " ", "=", " ", "\"", "ES", "X", " ", "4", ".", "x", "/", "5", ".", "x", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "Win", "2", "k3", " ", " ", " ", " ", "=", " ", "\"", "Window", "s", " ", "2003", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "Win", "2", "k", "8", " ", " ", " ", " ", "=", " ", "\"", "Window", "s", " ", "2008", "/", "2008", " ", "R2", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "Win", "2", "k", "1", "2", " ", " ", " ", "=", " ", "\"", "Window", "s", " ", "2012", " ", "/", " ", "WS", "2012", " ", "R2", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "Open", "VM", "S", " ", " ", " ", "=", " ", "\"", "Open", "VM", "S", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "Eg", "enera", " ", " ", " ", "=", " ", "\"", "Eg", "enera", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "Exa", "net", " ", " ", " ", " ", "=", " ", "\"", "Exa", "net", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "Sol", "aris", "9", " ", " ", "=", " ", "\"", "Sol", "aris", " ", "9", "/", "10", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "Sol", "aris", "10", " ", "=", " ", "\"", "Sol", "aris", " ", "9", "/", "10", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "Sol", "aris", "11", " ", "=", " ", "\"", "Sol", "aris", " ", "11", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "ONT", "AP", " ", "=", " ", "\"", "Net", "App", "/", "ONT", "AP", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "OE", "L", " ", " ", " ", "=", " ", "\"", "OE", " ", "Lin", "ux", " ", "UE", "K", " ", "(", "5", ".", "x", ",", " ", "6", ".", "x", ")\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "HP", "UX", "11", "iv", "1", " ", "=", " ", "\"", "HP", "-", "UX", " ", "(", "11", "i", " ", "v1", ",", " ", "11", "i", " ", "v2", ")\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "HP", "UX", "11", "iv", "2", " ", "=", " ", "\"", "HP", "-", "UX", " ", "(", "11", "i", " ", "v1", ",", " ", "11", "i", " ", "v2", ")\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "HP", "UX", "11", "iv", "3", " ", "=", " ", "\"", "HP", "-", "UX", " ", "(", "11", "i", " ", "v", "3", ")\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "SUS", "E", " ", " ", "=", " ", "\"", "Su", "SE", " ", "(", "10.", "x", ",", " ", "11.", "x", ")\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "SUS", "E", "9", " ", "=", " ", "\"", "Su", "SE", " ", "Lin", "ux", " ", "(", "Pre", " ", "SL", "ES", " ", "10", ")\"", "\\", "10", ";", " ", " ", " ", " ", " ", ".", " ", "Infor", "m", " ", " ", " ", " ", "=", " ", "\"", "In", "Form", "\"", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "n", "'_", ",_", "dest_", "=_", "'", "name", "'_", ",_", "required_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'''", "\\", "10", ";", " ", " ", " ", " ", "Name", " ", "of", " ", "the", " ", "ex", "sis", "ting", " ", "storage", " ", "volume", " ", "to", " ", "attach", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "l", "'_", ",_", "dest_", "=_", "'", "lun", "\\u", "id", "'_", ",_", "required_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type_", "=_", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'''", "\\", "10", ";", " ", " ", " ", " ", "Manu", "al", " ", "entry", " ", "for", " ", "the", " ", "LUN", " ", "number", ".", " ", "Auto", ",", " ", "will", " ", "be", " ", "used", " ", "if", " ", "this", "\\", "10", ";", " ", " ", " ", " ", "value", " ", "is", " ", "not", " ", "specified", ".'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "del", "'_", ",_", "dest_", "=_", "'", "del", "\\u", "vol", "'_", ",_", "required_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "'", "store", "\\u", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'''", "\\", "10", ";", " ", " ", " ", " ", "Indicat", "es", " ", "tha", "t", " ", "the", " ", "volume", " ", "will", " ", "be", " ", "delete", "d", " ", "whe", "n", " ", "the", " ", "profile", " ", "is", " ", "delete", "d", ".'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "credential_", "=_", "{_", "'", "auth", "Logi", "n", "Doma", "in", "'_", ":_", "args_", "._", "domain_", "._", "upper_", "(_", ")_", ",_", "'", "user", "Name", "'_", ":_", "args_", "._", "user_", ",_", "'", "password", "'_", ":_", "args_", "._", "passwd_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "con_", "=_", "hp", "ov_", "._", "connection_", "(_", "args_", "._", "host_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sto", "_", "=_", "hp", "ov_", "._", "storage_", "(_", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "args_", "._", "proxy_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "con_", "._", "set\\u", "proxy_", "(_", "args_", "._", "proxy_", "._", "split_", "(_", "':'_", ")_", "[_", "0_", "]_", ",_", "args_", "._", "proxy_", "._", "split_", "(_", "':'_", ")_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "cert_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "con_", "._", "set\\u", "trusted", "\\u", "ssl", "\\u", "bundle_", "(_", "args_", "._", "cert_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "login_", "(_", "con_", ",_", "credential_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "accept", "EU", "LA_", "(_", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "args_", "._", "lun", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "args_", "._", "lun", "\\u", "id_", "<_", "0_", "or_", "args_", "._", "lun", "\\u", "id_", ">_", "255_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Error", ":", " ", "boot", " ", "lun", " ", "value", " ", "must", " ", "be", " ", "bet", "ween", " ", "0", " ", "and", " ", "255", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "defin", "e\\u", "san", "_", "(_", "sto", "_", ",_", "args_", "._", "name_", ",_", "args_", "._", "san", "\\u", "list_", ",_", "args_", "._", "conn", "\\u", "list_", ",_", "args_", "._", "append_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "._", "host", "os_", ",_", "args_", "._", "lun", "\\u", "id_", ",_", "args_", "._", "del", "\\u", "vol_", ")_", "\\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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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 ]
Unused import
cloudera/hue/desktop/core/ext-py/lxml-3.3.6/src/lxml/html/tests/transform_feedparser_data.py
[ { "content": "\"\"\"\nThis takes the feedparser tests from here:\n\n http://feedparser.org/tests/wellformed/sanitize/\n\nand rewrites them to be easier to handle (not using the internal model\nof feedparser). The input format is::\n\n <!--\n Description: {description}\n Expect: {expression}\n -->\n ...\n <content ...>{content}</content>\n ...\n\nThe Expect expression is checked for\n``entries[0]['content'][0]['value'] == {data}``.\n\nThe output format is::\n\n Description: {description}\n Expect: {expression} (if data couldn't be parsed)\n Options: \n\n {content, unescaped}\n ----------\n {data, unescaped, if found}\n\n\"\"\"\n\nimport re\nimport os\nimport traceback\n\n_desc_re = re.compile(r'\\s*Description:\\s*(.*)')\n_expect_re = re.compile(r'\\s*Expect:\\s*(.*)')\n_data_expect_re = re.compile(r\"entries\\[0\\]\\['[^']+'\\](?:\\[0\\]\\['value'\\])?\\s*==\\s*(.*)\")\n_feed_data_expect_re = re.compile(r\"feed\\['[^']+'\\]\\s*==\\s*(.*)\")\n\n\n\n\n \nif __name__ == '__main__':\n import sys\n translate_all(os.path.join(os.path.dirname(__file__), 'feedparser-data'))\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def parse_content(content):\n match = _desc_re.search(content)\n desc = match.group(1)\n match = _expect_re.search(content)\n expect = match.group(1)\n data = None\n for regex in [_data_expect_re, _feed_data_expect_re]:\n match = regex.search(expect)\n if match:\n # Icky, but I'll trust it\n data = eval(match.group(1).strip())\n break\n c = None\n for tag in ['content', 'summary', 'title', 'copyright', 'tagline', 'info', 'subtitle', 'fullitem', 'body', 'description', 'content:encoded']:\n regex = re.compile(r\"<%s.*?>(.*)</%s>\" % (tag, tag), re.S)\n match = regex.search(content)\n if match:\n c = match.group(1)\n break\n assert c is not None\n # Seems like body isn't quoted\n if tag != 'body':\n c = c.replace('&lt;', '<')\n c = c.replace('&amp;', '&')\n # FIXME: I should really do more unescaping...\n return {\n 'Description': desc,\n 'Expect': expect,\n 'data': data,\n 'content': c}", "metadata": "root.parse_content", "header": "['module', '___EOS___']", "index": 40 }, { "content": "def serialize_content(d):\n s = '''\\\nDescription: %(Description)s\nExpect: %(Expect)s\nOptions: \n\n%(content)s\n''' % d\n if d.get('data') is not None:\n s += '----------\\n%s' % d['data']\n return s", "metadata": "root.serialize_content", "header": "['module', '___EOS___']", "index": 71 }, { "content": "def translate_file(filename):\n f = open(filename, 'rb')\n c = f.read()\n f.close()\n try:\n output = serialize_content(parse_content(c))\n except:\n print('Bad data in %s:' % filename)\n print(c)\n traceback.print_exc()\n print('-'*60)\n return\n new = os.path.splitext(filename)[0] + '.data'\n f = open(new, 'wb')\n f.write(output)\n f.close()", "metadata": "root.translate_file", "header": "['module', '___EOS___']", "index": 83 }, { "content": "def translate_all(dir):\n for fn in os.listdir(dir):\n fn = os.path.join(dir, fn)\n if fn.endswith('.xml'):\n translate_file(fn)", "metadata": "root.translate_all", "header": "['module', '___EOS___']", "index": 100 } ]
[ { "span": "import sys", "start_line": 107, "start_column": 4, "end_line": 107, "end_column": 14 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Thi", "s", " ", "take", "s", " ", "the", " ", "feed", "parser", " ", "tests", " ", "from", " ", "here", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", "http", "://", "feed", "parser", ".", "org", "/", "tests", "/", "well", "formed", "/", "sanitize", "/", "\\", "10", ";", "\\", "10", ";", "and", " ", "rewrite", "s", " ", "them", " ", "to", " ", "be", " ", "easi", "er", " ", "to", " ", "handle", " ", "(", "not", " ", "usi", "ng", " ", "the", " ", "internal", " ", "model", "\\", "10", ";", "of", " ", "feed", "parser", ").", " ", " ", "The", " ", "input", " ", "format", " ", "is", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", "<!", "--", "\\", "10", ";", " ", " ", "Descripti", "on", ":", " ", "{", "description", "}", "\\", "10", ";", " ", " ", "Expect", ":", " ", "{", "express", "ion", "}", "\\", "10", ";", " ", " ", "-->", "\\", "10", ";", " ", " ", "...", "\\", "10", ";", " ", " ", "<", "content", " ", "...", ">", "{", "content", "}", "</", "content", ">", "\\", "10", ";", " ", " ", "...", "\\", "10", ";", "\\", "10", ";", "The", " ", "Expect", " ", "express", "ion", " ", "is", " ", "checke", "d", " ", "for", "\\", "10", ";", "``", "entri", "es", "[", "0", "]['", "content", "']", "[", "0", "]['", "value", "']", " ", "==", " ", "{", "data", "}`", "`.", "\\", "10", ";", "\\", "10", ";", "The", " ", "output", " ", "format", " ", "is", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", "Descripti", "on", ":", " ", "{", "description", "}", "\\", "10", ";", " ", " ", "Expect", ":", " ", "{", "express", "ion", "}", " ", "(", "if", " ", "data", " ", "coul", "dn", "'", "t", " ", "be", " ", "parsed", ")", "\\", "10", ";", " ", " ", "Optio", "ns", ":", " ", "\\", "10", ";", "\\", "10", ";", " ", " ", "{", "content", ",", " ", "unescape", "d", "}", "\\", "10", ";", " ", " ", "----------", "\\", "10", ";", " ", " ", "{", "data", ",", " ", "unescape", "d", ",", " ", "if", " ", "found", "}", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "desc", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "r", "'\\\\", "s", "*", "Descripti", "on", ":\\\\", "s", "*(.", "*)'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "expect", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "r", "'\\\\", "s", "*", "Expect", ":\\\\", "s", "*(.", "*)'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "data\\u", "expect", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "r", "\"", "entri", "es", "\\\\[", "0", "\\\\]", "\\\\[", "'[", "^", "']", "+'", "\\\\]", "(?:\\\\", "[", "0", "\\\\]", "\\\\[", "'", "value", "'\\\\", "])", "?\\\\", "s", "*=", "=\\\\", "s", "*(.", "*)\"", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "feed", "\\u", "data\\u", "expect", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "r", "\"", "feed", "\\\\[", "'[", "^", "']", "+'", "\\\\]", "\\\\", "s", "*=", "=\\\\", "s", "*(.", "*)\"", "_", ")_", "\\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_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "translat", "e\\u", "all_", "(_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ",_", "'", "feed", "parser", "-", "data", "'_", ")_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "parse", "\\u", "content_", "(_", "content_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match_", "=_", "\\u", "desc", "\\u", "re_", "._", "search_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "desc_", "=_", "match_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match_", "=_", "\\u", "expect", "\\u", "re_", "._", "search_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expect_", "=_", "match_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "regex_", "in_", "[_", "\\u", "data\\u", "expect", "\\u", "re_", ",_", "\\u", "feed", "\\u", "data\\u", "expect", "\\u", "re_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match_", "=_", "regex_", "._", "search_", "(_", "expect_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ic", "ky", ",", " ", "but", " ", "I", "'", "ll", " ", "trust", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "eval_", "(_", "match_", "._", "group_", "(_", "1_", ")_", "._", "strip_", "(_", ")_", ")_", "\\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_", "c_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "tag_", "in_", "[_", "'", "content", "'_", ",_", "'", "summar", "y", "'_", ",_", "'", "title", "'_", ",_", "'", "copyr", "ight", "'_", ",_", "'", "tagli", "ne", "'_", ",_", "'", "info", "'_", ",_", "'", "subtit", "le", "'_", ",_", "'", "full", "item", "'_", ",_", "'", "body", "'_", ",_", "'", "description", "'_", ",_", "'", "content", ":", "encode", "d", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "regex_", "=_", "re_", "._", "compile_", "(_", "r", "\"<", "%", "s", ".*?", ">(.", "*)", "</", "%", "s", ">\"_", "%_", "(_", "tag_", ",_", "tag_", ")_", ",_", "re_", "._", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match_", "=_", "regex_", "._", "search_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "match_", "._", "group_", "(_", "1_", ")_", "\\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_", "assert_", "c_", "is_", "not_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "See", "ms", " ", "like", " ", "body", " ", "isn", "'", "t", " ", "quoted", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "tag_", "!=_", "'", "body", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "c_", "._", "replace_", "(_", "'&", "lt", ";'_", ",_", "'<'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "c_", "._", "replace_", "(_", "'&", "amp", ";'_", ",_", "'&'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "FIX", "ME", ":", " ", "I", " ", "shou", "ld", " ", "reall", "y", " ", "do", " ", "more", " ", "une", "scap", "ing", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Descripti", "on", "'_", ":_", "desc_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Expect", "'_", ":_", "expect_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "data", "'_", ":_", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "'_", ":_", "c_", "}_", "\\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_", "serialize", "\\u", "content_", "(_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "'''", "\\\\", "\\", "10", ";", "Descripti", "on", ":", " ", "%", "(", "Descripti", "on", ")", "s", "\\", "10", ";", "Expect", ":", " ", "%", "(", "Expect", ")", "s", "\\", "10", ";", "Optio", "ns", ":", " ", "\\", "10", ";", "\\", "10", ";", "%", "(", "content", ")", "s", "\\", "10", ";'", "''_", "%_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "d_", "._", "get_", "(_", "'", "data", "'_", ")_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "+=_", "'-------", "---", "\\\\", "n", "%", "s", "'_", "%_", "d_", "[_", "'", "data", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "s_", "\\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_", "translat", "e\\u", "file_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "open_", "(_", "filename_", ",_", "'", "rb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output_", "=_", "serialize", "\\u", "content_", "(_", "parse", "\\u", "content_", "(_", "c_", ")_", ")_", "\\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 ", " _", "print_", "(_", "'", "Ba", "d", " ", "data", " ", "in", " ", "%", "s", ":'_", "%_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "traceback_", "._", "print", "\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'-'_", "*_", "60_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new_", "=_", "os_", "._", "path_", "._", "splitext_", "(_", "filename_", ")_", "[_", "0_", "]_", "+_", "'.", "data", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "open_", "(_", "new_", ",_", "'", "wb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\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_", "translat", "e\\u", "all_", "(_", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "fn_", "in_", "os_", "._", "listdir_", "(_", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fn_", "=_", "os_", "._", "path_", "._", "join_", "(_", "dir_", ",_", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fn_", "._", "endswith_", "(_", "'.", "xml", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "translat", "e\\u", "file_", "(_", "fn_", ")_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 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 ]
Unused import
mollyproject/mollyproject/molly/apps/places/providers/atcocif.py
[ { "content": "import random\nimport sys\nfrom collections import namedtuple, defaultdict\nfrom datetime import datetime, date, time, timedelta\nfrom logging import getLogger\nfrom operator import itemgetter\nfrom StringIO import StringIO\nfrom urllib2 import urlopen\nfrom zipfile import ZipFile\n\nfrom django.http import Http404\nfrom django.db import transaction, reset_queries\n\nfrom molly.apps.places import EntityCache\nfrom molly.apps.places.models import (Entity, Route, StopOnRoute, Source,\n Journey, ScheduledStop)\nfrom molly.apps.places.providers import BaseMapsProvider, NaptanMapsProvider\nfrom molly.conf.provider import task\nfrom molly.utils.i18n import set_name_in_language\n\nlogger = getLogger(__name__)\n\nweekbool = namedtuple('weekbool', 'mon tue wed thu fri sat sun')\n\n\n\nif __name__ == '__main__':\n AtcoCifTimetableProvider('http://store.datagm.org.uk/sets/TfGM/GMPTE_CIF.zip').import_data({})\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class AtcoCifTimetableProvider(BaseMapsProvider):\n \"\"\"\n This provider loads ATCO-CIF dumps and parses them to extract timetable\n data. This only handles a subset of the ATCO-CIF standard, in particular,\n it deals with the TfGM released data (the only released data atm)\n \"\"\"\n \n \n \n \n \n \n \n ", "metadata": "root.AtcoCifTimetableProvider", "header": "['module', '___EOS___']", "index": 24 }, { "content": " def __init__(self, url):\n \"\"\"\n URL to an ATCO-CIF zip to be used\n \"\"\"\n self._url = url\n self._cache = EntityCache()\n self._entity_type = NaptanMapsProvider(None)._get_entity_types()['BCT'][0]", "metadata": "root.AtcoCifTimetableProvider.__init__", "header": "['class', 'AtcoCifTimetableProvider', '(', 'BaseMapsProvider', ')', ':', '___EOS___']", "index": 31 }, { "content": " @task(run_every=timedelta(days=7))\n def import_data(self, **metadata):\n \n deleted_routes = set(Route.objects.filter(external_ref__startswith=self._url).values_list('external_ref'))\n archive = ZipFile(StringIO(urlopen(self._url).read()))\n for file in archive.namelist():\n logger.info(file)\n routes = self._import_cif(archive.open(file))\n logger.info(': %d routes in file\\n' % len(routes))\n self._import_routes(routes)\n deleted_routes -= set(self._url + route['id'] for route in routes)\n archive.close()\n \n for route in deleted_routes:\n Route.objects.filter(external_ref=route).delete()", "metadata": "root.AtcoCifTimetableProvider.import_data", "header": "['class', 'AtcoCifTimetableProvider', '(', 'BaseMapsProvider', ')', ':', '___EOS___']", "index": 39 }, { "content": " def _parse_cif_date(self, datestring):\n return date(int(datestring[0:4]), int(datestring[4:6]),\n int(datestring[6:8]))", "metadata": "root.AtcoCifTimetableProvider._parse_cif_date", "header": "['class', 'AtcoCifTimetableProvider', '(', 'BaseMapsProvider', ')', ':', '___EOS___']", "index": 55 }, { "content": " def _parse_cif_time(self, timestring):\n return time(int(timestring[0:2]) % 24, int(timestring[2:4]))", "metadata": "root.AtcoCifTimetableProvider._parse_cif_time", "header": "['class', 'AtcoCifTimetableProvider', '(', 'BaseMapsProvider', ')', ':', '___EOS___']", "index": 59 }, { "content": " @transaction.commit_on_success\n def _import_cif(self, cif):\n \"\"\"\n Parse a CIF file\n \"\"\"\n \n # Clear cache once per file - avoid high memory usage\n self._cache = EntityCache()\n \n # Also reset SQL queries log\n reset_queries()\n \n routes = []\n \n this_journey = None\n \n for line in cif:\n \n if line[:2] == 'QS':\n # Journey header\n if this_journey is not None:\n routes[-1]['journies'].append(this_journey)\n if line[2] == 'D':\n this_journey = None\n continue\n this_journey = {\n 'operator-code': line[3:7],\n 'id': line[7:13],\n 'start-date': self._parse_cif_date(line[13:21]),\n 'end-date': self._parse_cif_date(line[21:29]),\n 'days': weekbool(\n line[29] == '1', # Monday\n line[30] == '1', # Tuesday\n line[31] == '1', # Wednesday\n line[32] == '1', # Thursday\n line[33] == '1', # Friday\n line[34] == '1', # Saturday\n line[35] == '1', # Sunday\n ),\n 'school-holidays': {\n 'S': 'term-time',\n 'H': 'holidays'\n }.get(line[36], 'all'),\n 'bank-holidays': {\n 'A': 'additional',\n 'B': 'holidays',\n 'X': 'non-holidays'\n }.get(line[37], 'all'),\n 'route': line[38:42],\n 'vehicle': line[48:56].strip(),\n 'direction': line[64],\n 'notes': [],\n 'stops': [],\n }\n \n elif line[:2] in ('QN', 'ZN'):\n # Notes\n this_journey['notes'].append(line[7:])\n \n elif line[:2] == 'QO':\n # Journey start\n try:\n this_journey['stops'].append({\n 'entity': self._cache['atco:%s' % line[2:14].strip()],\n 'sta': None,\n 'std': self._parse_cif_time(line[14:18]),\n 'activity': 'O',\n 'estimated': line[22] == '0',\n 'fare-stage': line[24] == '1'\n })\n except Http404:\n pass\n \n elif line[:2] == 'QI':\n # Journey intermediate stop\n try:\n this_journey['stops'].append({\n 'entity': self._cache['atco:%s' % line[2:14].strip()],\n 'sta': self._parse_cif_time(line[14:18]),\n 'std': self._parse_cif_time(line[18:22]),\n 'activity': line[22],\n 'estimated': line[27] == '0',\n 'fare-stage': line[29] == '1'\n })\n except Http404:\n pass\n \n elif line[:2] == 'QT':\n # Journey complete\n try:\n this_journey['stops'].append({\n 'entity': self._cache['atco:%s' % line[2:14].strip()],\n 'sta': self._parse_cif_time(line[14:18]),\n 'std': None,\n 'activity': 'F',\n 'estimated': line[22] == '0',\n 'fare-stage': line[24] == '1'\n })\n except Http404:\n pass\n \n elif line[:2] == 'ZL':\n # Route ID\n route_id = line[2:]\n \n elif line[:2] == 'ZD':\n # Days route ID\n route_id += line[18:-1]\n \n elif line[:2] == 'ZS':\n # Route\n \n if this_journey is not None:\n routes[-1]['journies'].append(this_journey)\n \n routes.append({\n 'id': route_id,\n 'number': line[10:14].strip(),\n 'description': line[14:-1],\n 'stops': [],\n 'journies': []\n })\n \n elif line[:2] == 'ZA':\n \n stop_code = line[3:15].strip()\n \n try:\n entity = self._cache['atco:%s' % stop_code]\n if entity.source == self._get_source():\n # Raise Http404 if this is a bus stop we came up with,\n # so any name changes, etc, get processed\n raise Http404()\n except Http404:\n # Out of zone bus stops with NaPTAN codes\n try:\n entity = Entity.objects.get(source=self._get_source(),\n _identifiers__scheme='atco',\n _identifiers__value=stop_code)\n except Entity.DoesNotExist:\n entity = Entity(source=self._get_source())\n identifiers = { 'atco': stop_code }\n entity_type = self._entity_type\n entity.primary_type = entity_type\n entity.save(identifiers=identifiers)\n set_name_in_language(entity, 'en', title=line[15:63].strip())\n entity.all_types = (entity_type,)\n entity.update_all_types_completion()\n entity.save()\n routes[-1]['stops'].append(entity)\n \n if this_journey is not None:\n routes[-1]['journies'].append(this_journey)\n \n return routes", "metadata": "root.AtcoCifTimetableProvider._import_cif", "header": "['class', 'AtcoCifTimetableProvider', '(', 'BaseMapsProvider', ')', ':', '___EOS___']", "index": 62 }, { "content": " def _import_routes(self, routes):\n for r in routes:\n route, created = Route.objects.get_or_create(\n external_ref=self._url + r['id'],\n defaults={\n 'service_id': r['number'],\n 'service_name': r['description'],\n }\n )\n if not created:\n route.service_id = r['number']\n route.service_name = r['description']\n route.save()\n route.stops.clear()\n for i, stop in enumerate(r['stops']):\n StopOnRoute.objects.create(route=route, entity=stop, order=i)\n \n route.journey_set.all().delete()\n for journey in r['journies']:\n self._add_journey(route, journey)", "metadata": "root.AtcoCifTimetableProvider._import_routes", "header": "['class', 'AtcoCifTimetableProvider', '(', 'BaseMapsProvider', ')', ':', '___EOS___']", "index": 218 }, { "content": " def _add_journey(self, route, journey):\n j = Journey.objects.create(\n route=route,\n external_ref=self._url + journey['id'],\n notes='\\n'.join(journey['notes']),\n runs_on_monday=journey['days'].mon,\n runs_on_tuesday=journey['days'].tue,\n runs_on_wednesday=journey['days'].wed,\n runs_on_thursday=journey['days'].thu,\n runs_on_friday=journey['days'].fri,\n runs_on_saturday=journey['days'].sat,\n runs_on_sunday=journey['days'].sun,\n runs_in_termtime=journey['school-holidays'] in ('all', 'term-time'),\n runs_in_school_holidays=journey['school-holidays'] in ('all', 'holidays'),\n runs_on_bank_holidays=journey['bank-holidays'] in ('all', 'holidays', 'additional'),\n runs_on_non_bank_holidays=journey['bank-holidays'] in ('all', 'non-holidays'),\n runs_from=journey['start-date'],\n runs_until=journey['end-date'],\n vehicle=journey['vehicle'])\n \n for i, stop in enumerate(journey['stops']):\n ScheduledStop.objects.create(\n journey=j,\n entity=stop['entity'],\n order=i,\n sta=stop['sta'],\n std=stop['std'],\n times_estimated=stop['estimated'],\n fare_stage=stop['fare-stage'],\n activity=stop['activity']\n )", "metadata": "root.AtcoCifTimetableProvider._add_journey", "header": "['class', 'AtcoCifTimetableProvider', '(', 'BaseMapsProvider', ')', ':', '___EOS___']", "index": 239 }, { "content": " def _get_source(self):\n source, created = Source.objects.get_or_create(module_name=__name__,\n name='ATCO-CIF Importer')\n return source", "metadata": "root.AtcoCifTimetableProvider._get_source", "header": "['class', 'AtcoCifTimetableProvider', '(', 'BaseMapsProvider', ')', ':', '___EOS___']", "index": 271 } ]
[ { "span": "import random", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 13 }, { "span": "import sys", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 10 }, { "span": "from collections import namedtuple, defaultdict", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 47 }, { "span": "from operator import itemgetter", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 31 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "namedtuple_", ",_", "defaultdict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "datetime_", "import_", "datetime_", ",_", "date_", ",_", "time_", ",_", "timedelta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "logging_", "import_", "get", "Logger_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "operator_", "import_", "itemgetter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "String", "IO_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urllib2_", "import_", "urlopen_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "zipfile_", "import_", "Zip", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "transaction_", ",_", "reset", "\\u", "queries_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "mol", "ly_", "._", "apps_", "._", "places_", "import_", "Entit", "y", "Cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mol", "ly_", "._", "apps_", "._", "places_", "._", "models_", "import_", "(_", "Entity_", ",_", "Route_", ",_", "Sto", "p", "On", "Route_", ",_", "Source_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Journ", "ey_", ",_", "Schedule", "d", "Stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mol", "ly_", "._", "apps_", "._", "places_", "._", "providers_", "import_", "Base", "Map", "s", "Provider_", ",_", "Na", "pta", "n", "Map", "s", "Provider_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mol", "ly_", "._", "conf_", "._", "provider_", "import_", "task_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mol", "ly_", "._", "utils_", "._", "i18n_", "import_", "set\\u", "name", "\\u", "in", "\\u", "language_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "=_", "get", "Logger_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "week", "bool_", "=_", "namedtuple_", "(_", "'", "week", "bool", "'_", ",_", "'", "mon", " ", "tu", "e", " ", "wed", " ", "thu", " ", "fri", " ", "sat", " ", "sun", "'_", ")_", "\\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\\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 ", " _", "At", "co", "Ci", "f", "Time", "table", "Provider_", "(_", "'", "http", "://", "store", ".", "data", "gm", ".", "org", ".", "uk", "/", "sets", "/", "Tf", "GM", "/", "GM", "PTE", "\\u", "CIF", ".", "zip", "'_", ")_", "._", "import", "\\u", "data_", "(_", "{_", "}_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "At", "co", "Ci", "f", "Time", "table", "Provider_", "(_", "Base", "Map", "s", "Provider_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "provide", "r", " ", "load", "s", " ", "ATC", "O", "-", "CIF", " ", "dump", "s", " ", "and", " ", "parse", "s", " ", "them", " ", "to", " ", "extract", " ", "timetable", "\\", "10", ";", " ", " ", " ", " ", "data", ".", " ", "Thi", "s", " ", "only", " ", "handle", "s", " ", "a", " ", "subse", "t", " ", "of", " ", "the", " ", "ATC", "O", "-", "CIF", " ", "standard", ",", " ", "in", " ", "partic", "ular", ",", "\\", "10", ";", " ", " ", " ", " ", "it", " ", "deal", "s", " ", "with", " ", "the", " ", "Tf", "GM", " ", "released", " ", "data", " ", "(", "the", " ", "only", " ", "released", " ", "data", " ", "atm", ")", "\\", "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_", "At", "co", "Ci", "f", "Time", "table", "Provider_", "(_", "Base", "Map", "s", "Provider_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "URL", " ", "to", " ", "an", " ", "ATC", "O", "-", "CIF", " ", "zip", " ", "to", " ", "be", " ", "used", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "url_", "=_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "cache_", "=_", "Entit", "y", "Cache_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "entity", "\\u", "type_", "=_", "Na", "pta", "n", "Map", "s", "Provider_", "(_", "None_", ")_", "._", "\\u", "get", "\\u", "entity", "\\u", "types_", "(_", ")_", "[_", "'", "BC", "T", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "At", "co", "Ci", "f", "Time", "table", "Provider_", "(_", "Base", "Map", "s", "Provider_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "task_", "(_", "run", "\\u", "every_", "=_", "timedelta_", "(_", "days_", "=_", "7_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "import", "\\u", "data_", "(_", "self_", ",_", "**_", "metadata_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "delete", "d\\u", "routes_", "=_", "set_", "(_", "Route_", "._", "objects_", "._", "filter_", "(_", "external", "\\u", "ref", "\\u\\u", "startswith_", "=_", "self_", "._", "\\u", "url_", ")_", "._", "values", "\\u", "list_", "(_", "'", "external", "\\u", "ref", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "archive_", "=_", "Zip", "File_", "(_", "String", "IO_", "(_", "urlopen_", "(_", "self_", "._", "\\u", "url_", ")_", "._", "read_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "file_", "in_", "archive_", "._", "namelist_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "routes_", "=_", "self_", "._", "\\u", "import", "\\u", "cif", "_", "(_", "archive_", "._", "open_", "(_", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "info_", "(_", "':", " ", "%", "d", " ", "route", "s", " ", "in", " ", "file", "\\\\", "n", "'_", "%_", "len_", "(_", "routes_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "import", "\\u", "routes_", "(_", "routes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delete", "d\\u", "routes_", "-=_", "set_", "(_", "self_", "._", "\\u", "url_", "+_", "route_", "[_", "'", "id", "'_", "]_", "for_", "route_", "in_", "routes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "archive_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "route_", "in_", "delete", "d\\u", "routes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Route_", "._", "objects_", "._", "filter_", "(_", "external", "\\u", "ref_", "=_", "route_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "At", "co", "Ci", "f", "Time", "table", "Provider_", "(_", "Base", "Map", "s", "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", "parse", "\\u", "cif", "\\u", "date_", "(_", "self_", ",_", "datestr", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "date_", "(_", "int_", "(_", "datestr", "ing_", "[_", "0_", ":_", "4_", "]_", ")_", ",_", "int_", "(_", "datestr", "ing_", "[_", "4_", ":_", "6_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "int_", "(_", "datestr", "ing_", "[_", "6_", ":_", "8_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "At", "co", "Ci", "f", "Time", "table", "Provider_", "(_", "Base", "Map", "s", "Provider_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "parse", "\\u", "cif", "\\u", "time_", "(_", "self_", ",_", "timestr", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "time_", "(_", "int_", "(_", "timestr", "ing_", "[_", "0_", ":_", "2_", "]_", ")_", "%_", "24_", ",_", "int_", "(_", "timestr", "ing_", "[_", "2_", ":_", "4_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "At", "co", "Ci", "f", "Time", "table", "Provider_", "(_", "Base", "Map", "s", "Provider_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transaction_", "._", "commit", "\\u", "on", "\\u", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "import", "\\u", "cif", "_", "(_", "self_", ",_", "cif", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Pars", "e", " ", "a", " ", "CIF", " ", "file", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Clear", " ", "cache", " ", "onc", "e", " ", "per", " ", "file", " ", "-", " ", "avoid", " ", "high", " ", "memory", " ", "usage_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "cache_", "=_", "Entit", "y", "Cache_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Al", "so", " ", "reset", " ", "SQL", " ", "querie", "s", " ", "log_", "\\u\\u\\uNL\\u\\u\\u_", "reset", "\\u", "queries_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "routes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "this", "\\u", "journ", "ey_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "line_", "in_", "cif", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "line_", "[_", ":_", "2_", "]_", "==_", "'", "QS", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Journ", "ey", " ", "header_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "this", "\\u", "journ", "ey_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "routes_", "[_", "-_", "1_", "]_", "[_", "'", "journ", "ies", "'_", "]_", "._", "append_", "(_", "this", "\\u", "journ", "ey_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "line_", "[_", "2_", "]_", "==_", "'", "D", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "this", "\\u", "journ", "ey_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "this", "\\u", "journ", "ey_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "opera", "tor", "-", "code", "'_", ":_", "line_", "[_", "3_", ":_", "7_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "line_", "[_", "7_", ":_", "13_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "-", "date", "'_", ":_", "self_", "._", "\\u", "parse", "\\u", "cif", "\\u", "date_", "(_", "line_", "[_", "13_", ":_", "21_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "end", "-", "date", "'_", ":_", "self_", "._", "\\u", "parse", "\\u", "cif", "\\u", "date_", "(_", "line_", "[_", "21_", ":_", "29_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "day", "s", "'_", ":_", "week", "bool_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "[_", "29_", "]_", "==_", "'", "1", "'_", ",_", "#", " ", "Mon", "day_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "[_", "30_", "]_", "==_", "'", "1", "'_", ",_", "#", " ", "Tu", "esd", "ay_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "[_", "31_", "]_", "==_", "'", "1", "'_", ",_", "#", " ", "We", "dnes", "day_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "[_", "32_", "]_", "==_", "'", "1", "'_", ",_", "#", " ", "Thu", "rsd", "ay_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "[_", "33_", "]_", "==_", "'", "1", "'_", ",_", "#", " ", "Fri", "day_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "[_", "34_", "]_", "==_", "'", "1", "'_", ",_", "#", " ", "Satur", "day_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "[_", "35_", "]_", "==_", "'", "1", "'_", ",_", "#", " ", "Sun", "day_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "school", "-", "holiday", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "S", "'_", ":_", "'", "term", "-", "time", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "H", "'_", ":_", "'", "holiday", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "._", "get_", "(_", "line_", "[_", "36_", "]_", ",_", "'", "all", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bank", "-", "holiday", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "A", "'_", ":_", "'", "addition", "al", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "B", "'_", ":_", "'", "holiday", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "X", "'_", ":_", "'", "non", "-", "holiday", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "._", "get_", "(_", "line_", "[_", "37_", "]_", ",_", "'", "all", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "route", "'_", ":_", "line_", "[_", "38_", ":_", "42_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vehic", "le", "'_", ":_", "line_", "[_", "48_", ":_", "56_", "]_", "._", "strip_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "direction", "'_", ":_", "line_", "[_", "64_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "note", "s", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "stop", "s", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "[_", ":_", "2_", "]_", "in_", "(_", "'", "QN", "'_", ",_", "'", "ZN", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Notes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "this", "\\u", "journ", "ey_", "[_", "'", "note", "s", "'_", "]_", "._", "append_", "(_", "line_", "[_", "7_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "[_", ":_", "2_", "]_", "==_", "'", "QO", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Journ", "ey", " ", "start_", "\\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 ", " ", "_", "this", "\\u", "journ", "ey_", "[_", "'", "stop", "s", "'_", "]_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "entity", "'_", ":_", "self_", "._", "\\u", "cache_", "[_", "'", "atc", "o", ":", "%", "s", "'_", "%_", "line_", "[_", "2_", ":_", "14_", "]_", "._", "strip_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sta", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "std", "'_", ":_", "self_", "._", "\\u", "parse", "\\u", "cif", "\\u", "time_", "(_", "line_", "[_", "14_", ":_", "18_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "activit", "y", "'_", ":_", "'", "O", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "estimate", "d", "'_", ":_", "line_", "[_", "22_", "]_", "==_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fare", "-", "stage", "'_", ":_", "line_", "[_", "24_", "]_", "==_", "'", "1", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Http404_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "[_", ":_", "2_", "]_", "==_", "'", "QI", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Journ", "ey", " ", "intermediate", " ", "stop_", "\\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 ", " ", "_", "this", "\\u", "journ", "ey_", "[_", "'", "stop", "s", "'_", "]_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "entity", "'_", ":_", "self_", "._", "\\u", "cache_", "[_", "'", "atc", "o", ":", "%", "s", "'_", "%_", "line_", "[_", "2_", ":_", "14_", "]_", "._", "strip_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sta", "'_", ":_", "self_", "._", "\\u", "parse", "\\u", "cif", "\\u", "time_", "(_", "line_", "[_", "14_", ":_", "18_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "std", "'_", ":_", "self_", "._", "\\u", "parse", "\\u", "cif", "\\u", "time_", "(_", "line_", "[_", "18_", ":_", "22_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "activit", "y", "'_", ":_", "line_", "[_", "22_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "estimate", "d", "'_", ":_", "line_", "[_", "27_", "]_", "==_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fare", "-", "stage", "'_", ":_", "line_", "[_", "29_", "]_", "==_", "'", "1", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Http404_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "[_", ":_", "2_", "]_", "==_", "'", "QT", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Journ", "ey", " ", "complete_", "\\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 ", " ", "_", "this", "\\u", "journ", "ey_", "[_", "'", "stop", "s", "'_", "]_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "entity", "'_", ":_", "self_", "._", "\\u", "cache_", "[_", "'", "atc", "o", ":", "%", "s", "'_", "%_", "line_", "[_", "2_", ":_", "14_", "]_", "._", "strip_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sta", "'_", ":_", "self_", "._", "\\u", "parse", "\\u", "cif", "\\u", "time_", "(_", "line_", "[_", "14_", ":_", "18_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "std", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "activit", "y", "'_", ":_", "'", "F", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "estimate", "d", "'_", ":_", "line_", "[_", "22_", "]_", "==_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fare", "-", "stage", "'_", ":_", "line_", "[_", "24_", "]_", "==_", "'", "1", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Http404_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "[_", ":_", "2_", "]_", "==_", "'", "ZL", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Route", " ", "ID_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "route", "\\u", "id_", "=_", "line_", "[_", "2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "[_", ":_", "2_", "]_", "==_", "'", "ZD", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Day", "s", " ", "route", " ", "ID_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "route", "\\u", "id_", "+=_", "line_", "[_", "18_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "[_", ":_", "2_", "]_", "==_", "'", "ZS", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Route_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "this", "\\u", "journ", "ey_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "routes_", "[_", "-_", "1_", "]_", "[_", "'", "journ", "ies", "'_", "]_", "._", "append_", "(_", "this", "\\u", "journ", "ey_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "routes_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "route", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "'_", ":_", "line_", "[_", "10_", ":_", "14_", "]_", "._", "strip_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "line_", "[_", "14_", ":_", "-_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "stop", "s", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "journ", "ies", "'_", ":_", "[_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "[_", ":_", "2_", "]_", "==_", "'", "ZA", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stop", "\\u", "code_", "=_", "line_", "[_", "3_", ":_", "15_", "]_", "._", "strip_", "(_", ")_", "\\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 ", " ", "_", "entity_", "=_", "self_", "._", "\\u", "cache_", "[_", "'", "atc", "o", ":", "%", "s", "'_", "%_", "stop", "\\u", "code_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "entity_", "._", "source_", "==_", "self_", "._", "\\u", "get", "\\u", "source_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Rai", "se", " ", "Http", "404", " ", "if", " ", "this", " ", "is", " ", "a", " ", "bus", " ", "stop", " ", "we", " ", "came", " ", "up", " ", "with", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "any", " ", "name", " ", "change", "s", ",", " ", "etc", ",", " ", "get", " ", "processed_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "Http404_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Http404_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Out", " ", "of", " ", "zone", " ", "bus", " ", "stop", "s", " ", "with", " ", "Na", "PT", "AN", " ", "codes_", "\\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 ", " ", " _", "entity_", "=_", "Entity_", "._", "objects_", "._", "get_", "(_", "source_", "=_", "self_", "._", "\\u", "get", "\\u", "source_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "identifi", "ers", "\\u\\u", "scheme_", "=_", "'", "atc", "o", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "identifi", "ers", "\\u\\u", "value_", "=_", "stop", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Entity_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "entity_", "=_", "Entity_", "(_", "source_", "=_", "self_", "._", "\\u", "get", "\\u", "source_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "identifiers_", "=_", "{_", "'", "atc", "o", "'_", ":_", "stop", "\\u", "code_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity", "\\u", "type_", "=_", "self_", "._", "\\u", "entity", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity_", "._", "primary", "\\u", "type_", "=_", "entity", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity_", "._", "save_", "(_", "identifiers_", "=_", "identifiers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "name", "\\u", "in", "\\u", "language_", "(_", "entity_", ",_", "'", "en", "'_", ",_", "title_", "=_", "line_", "[_", "15_", ":_", "63_", "]_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity_", "._", "all", "\\u", "types_", "=_", "(_", "entity", "\\u", "type_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity_", "._", "update", "\\u", "all", "\\u", "types", "\\u", "completion_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entity_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "routes_", "[_", "-_", "1_", "]_", "[_", "'", "stop", "s", "'_", "]_", "._", "append_", "(_", "entity_", ")_", "\\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_", "this", "\\u", "journ", "ey_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "routes_", "[_", "-_", "1_", "]_", "[_", "'", "journ", "ies", "'_", "]_", "._", "append_", "(_", "this", "\\u", "journ", "ey_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "routes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "At", "co", "Ci", "f", "Time", "table", "Provider_", "(_", "Base", "Map", "s", "Provider_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "import", "\\u", "routes_", "(_", "self_", ",_", "routes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "r_", "in_", "routes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "route_", ",_", "created_", "=_", "Route_", "._", "objects_", "._", "get", "\\u", "or", "\\u", "create_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "external", "\\u", "ref_", "=_", "self_", "._", "\\u", "url_", "+_", "r_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "defaults_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "service", "\\u", "id", "'_", ":_", "r_", "[_", "'", "number", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "service", "\\u", "name", "'_", ":_", "r_", "[_", "'", "description", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "created_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "route_", "._", "service", "\\u", "id_", "=_", "r_", "[_", "'", "number", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "route_", "._", "service", "\\u", "name_", "=_", "r_", "[_", "'", "description", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "route_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "route_", "._", "stops_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "stop_", "in_", "enumerate_", "(_", "r_", "[_", "'", "stop", "s", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Sto", "p", "On", "Route_", "._", "objects_", "._", "create_", "(_", "route_", "=_", "route_", ",_", "entity_", "=_", "stop_", ",_", "order_", "=_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "route_", "._", "journ", "ey", "\\u", "set_", "._", "all_", "(_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "journ", "ey_", "in_", "r_", "[_", "'", "journ", "ies", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "add", "\\u", "journ", "ey_", "(_", "route_", ",_", "journ", "ey_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "At", "co", "Ci", "f", "Time", "table", "Provider_", "(_", "Base", "Map", "s", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "add", "\\u", "journ", "ey_", "(_", "self_", ",_", "route_", ",_", "journ", "ey_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "j_", "=_", "Journ", "ey_", "._", "objects_", "._", "create_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "route_", "=_", "route_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "external", "\\u", "ref_", "=_", "self_", "._", "\\u", "url_", "+_", "journ", "ey_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "notes_", "=_", "'\\\\", "n", "'_", "._", "join_", "(_", "journ", "ey_", "[_", "'", "note", "s", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "runs", "\\u", "on", "\\u", "mond", "ay_", "=_", "journ", "ey_", "[_", "'", "day", "s", "'_", "]_", "._", "mon_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "runs", "\\u", "on", "\\u", "tu", "esd", "ay_", "=_", "journ", "ey_", "[_", "'", "day", "s", "'_", "]_", "._", "tu", "e_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "runs", "\\u", "on", "\\u", "wed", "nes", "day_", "=_", "journ", "ey_", "[_", "'", "day", "s", "'_", "]_", "._", "wed", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "runs", "\\u", "on", "\\u", "thu", "rsd", "ay_", "=_", "journ", "ey_", "[_", "'", "day", "s", "'_", "]_", "._", "thu", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "runs", "\\u", "on", "\\u", "fri", "day_", "=_", "journ", "ey_", "[_", "'", "day", "s", "'_", "]_", "._", "fri", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "runs", "\\u", "on", "\\u", "satur", "day_", "=_", "journ", "ey_", "[_", "'", "day", "s", "'_", "]_", "._", "sat_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "runs", "\\u", "on", "\\u", "sund", "ay_", "=_", "journ", "ey_", "[_", "'", "day", "s", "'_", "]_", "._", "sun_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "runs", "\\u", "in", "\\u", "term", "time_", "=_", "journ", "ey_", "[_", "'", "school", "-", "holiday", "s", "'_", "]_", "in_", "(_", "'", "all", "'_", ",_", "'", "term", "-", "time", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "runs", "\\u", "in", "\\u", "school", "\\u", "holidays_", "=_", "journ", "ey_", "[_", "'", "school", "-", "holiday", "s", "'_", "]_", "in_", "(_", "'", "all", "'_", ",_", "'", "holiday", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "runs", "\\u", "on", "\\u", "bank", "\\u", "holidays_", "=_", "journ", "ey_", "[_", "'", "bank", "-", "holiday", "s", "'_", "]_", "in_", "(_", "'", "all", "'_", ",_", "'", "holiday", "s", "'_", ",_", "'", "addition", "al", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "runs", "\\u", "on", "\\u", "non", "\\u", "bank", "\\u", "holidays_", "=_", "journ", "ey_", "[_", "'", "bank", "-", "holiday", "s", "'_", "]_", "in_", "(_", "'", "all", "'_", ",_", "'", "non", "-", "holiday", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "runs", "\\u", "from_", "=_", "journ", "ey_", "[_", "'", "start", "-", "date", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "runs", "\\u", "until_", "=_", "journ", "ey_", "[_", "'", "end", "-", "date", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vehicle_", "=_", "journ", "ey_", "[_", "'", "vehic", "le", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", ",_", "stop_", "in_", "enumerate_", "(_", "journ", "ey_", "[_", "'", "stop", "s", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Schedule", "d", "Stop_", "._", "objects_", "._", "create_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "journ", "ey_", "=_", "j_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "entity_", "=_", "stop_", "[_", "'", "entity", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "order_", "=_", "i_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sta_", "=_", "stop_", "[_", "'", "sta", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "std_", "=_", "stop_", "[_", "'", "std", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "times", "\\u", "estimate", "d_", "=_", "stop_", "[_", "'", "estimate", "d", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fare", "\\u", "stage_", "=_", "stop_", "[_", "'", "fare", "-", "stage", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "activity_", "=_", "stop_", "[_", "'", "activit", "y", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "At", "co", "Ci", "f", "Time", "table", "Provider_", "(_", "Base", "Map", "s", "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", "source_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source_", ",_", "created_", "=_", "Source_", "._", "objects_", "._", "get", "\\u", "or", "\\u", "create_", "(_", "module", "\\u", "name_", "=_", "\\u\\u", "name\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "ATC", "O", "-", "CIF", " ", "Import", "er", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 0, 1, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
Unused import
CouchPotato/CouchPotatoV1/library/mako/ext/pygmentplugin.py
[ { "content": "import re\ntry:\n set\nexcept NameError:\n from sets import Set as set\n\nfrom pygments.lexers.web import \\\n HtmlLexer, XmlLexer, JavascriptLexer, CssLexer\nfrom pygments.lexers.agile import PythonLexer\nfrom pygments.lexer import Lexer, DelegatingLexer, RegexLexer, bygroups, \\\n include, using, this\nfrom pygments.token import Error, Punctuation, \\\n Text, Comment, Operator, Keyword, Name, String, Number, Other, Literal\nfrom pygments.util import html_doctype_matches, looks_like_xml\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class MakoLexer(RegexLexer):\n name = 'Mako'\n aliases = ['mako']\n filenames = ['*.mao']\n\n tokens = {\n 'root': [\n (r'(\\s*)(\\%)(\\s*end(?:\\w+))(\\n|\\Z)',\n bygroups(Text, Comment.Preproc, Keyword, Other)),\n (r'(\\s*)(\\%(?!%))([^\\n]*)(\\n|\\Z)',\n bygroups(Text, Comment.Preproc, using(PythonLexer), Other)),\n (r'(\\s*)(##[^\\n]*)(\\n|\\Z)',\n bygroups(Text, Comment.Preproc, Other)),\n (r'''(?s)<%doc>.*?</%doc>''', Comment.Preproc),\n (r'(<%)([\\w\\.\\:]+)', bygroups(Comment.Preproc, Name.Builtin), 'tag'),\n (r'(</%)([\\w\\.\\:]+)(>)', bygroups(Comment.Preproc, Name.Builtin, Comment.Preproc)),\n (r'<%(?=([\\w\\.\\:]+))', Comment.Preproc, 'ondeftags'),\n (r'(<%(?:!?))(.*?)(%>)(?s)', bygroups(Comment.Preproc, using(PythonLexer), Comment.Preproc)),\n (r'(\\$\\{)(.*?)(\\})',\n bygroups(Comment.Preproc, using(PythonLexer), Comment.Preproc)),\n (r'''(?sx)\n (.+?) # anything, followed by:\n (?:\n (?<=\\n)(?=%(?!%)|\\#\\#) | # an eval or comment line\n (?=\\#\\*) | # multiline comment\n (?=</?%) | # a python block\n # call start or end\n (?=\\$\\{) | # a substitution\n (?<=\\n)(?=\\s*%) |\n # - don't consume\n (\\\\\\n) | # an escaped newline\n \\Z # end of string\n )\n ''', bygroups(Other, Operator)),\n (r'\\s+', Text),\n ],\n 'ondeftags': [\n (r'<%', Comment.Preproc),\n (r'(?<=<%)(include|inherit|namespace|page)', Name.Builtin),\n include('tag'),\n ],\n 'tag': [\n (r'((?:\\w+)\\s*=)\\s*(\".*?\")',\n bygroups(Name.Attribute, String)),\n (r'/?\\s*>', Comment.Preproc, '#pop'),\n (r'\\s+', Text),\n ],\n 'attr': [\n ('\".*?\"', String, '#pop'),\n (\"'.*?'\", String, '#pop'),\n (r'[^\\s>]+', String, '#pop'),\n ],\n }", "metadata": "root.MakoLexer", "header": "['module', '___EOS___']", "index": 15 }, { "content": "class MakoHtmlLexer(DelegatingLexer):\n name = 'HTML+Mako'\n aliases = ['html+mako']\n", "metadata": "root.MakoHtmlLexer", "header": "['module', '___EOS___']", "index": 70 }, { "content": " def __init__(self, **options):\n super(MakoHtmlLexer, self).__init__(HtmlLexer, MakoLexer,\n **options)", "metadata": "root.MakoHtmlLexer.__init__", "header": "['class', 'MakoHtmlLexer', '(', 'DelegatingLexer', ')', ':', '___EOS___']", "index": 74 }, { "content": "class MakoXmlLexer(DelegatingLexer):\n name = 'XML+Mako'\n aliases = ['xml+mako']\n", "metadata": "root.MakoXmlLexer", "header": "['module', '___EOS___']", "index": 78 }, { "content": " def __init__(self, **options):\n super(MakoXmlLexer, self).__init__(XmlLexer, MakoLexer,\n **options)", "metadata": "root.MakoXmlLexer.__init__", "header": "['class', 'MakoXmlLexer', '(', 'DelegatingLexer', ')', ':', '___EOS___']", "index": 82 }, { "content": "class MakoJavascriptLexer(DelegatingLexer):\n name = 'JavaScript+Mako'\n aliases = ['js+mako', 'javascript+mako']\n", "metadata": "root.MakoJavascriptLexer", "header": "['module', '___EOS___']", "index": 86 }, { "content": " def __init__(self, **options):\n super(MakoJavascriptLexer, self).__init__(JavascriptLexer,\n MakoLexer, **options)", "metadata": "root.MakoJavascriptLexer.__init__", "header": "['class', 'MakoJavascriptLexer', '(', 'DelegatingLexer', ')', ':', '___EOS___']", "index": 90 }, { "content": "class MakoCssLexer(DelegatingLexer):\n name = 'CSS+Mako'\n aliases = ['css+mako']\n", "metadata": "root.MakoCssLexer", "header": "['module', '___EOS___']", "index": 94 }, { "content": " def __init__(self, **options):\n super(MakoCssLexer, self).__init__(CssLexer, MakoLexer,\n **options)", "metadata": "root.MakoCssLexer.__init__", "header": "['class', 'MakoCssLexer', '(', 'DelegatingLexer', ')', ':', '___EOS___']", "index": 98 } ]
[ { "span": "import re", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 9 }, { "span": "from pygments.lexer import Lexer, DelegatingLexer, RegexLexer, bygroups, \\\n include, using, this", "start_line": 9, "start_column": 0, "end_line": 10, "end_column": 25 }, { "span": "from pygments.token import Error, Punctuation, \\\n Text, Comment, Operator, Keyword, Name, String, Number, Other, Literal", "start_line": 11, "start_column": 0, "end_line": 12, "end_column": 75 }, { "span": "from pygments.util import html_doctype_matches, looks_like_xml", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 62 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "set_", "\\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 ", " _", "from_", "sets_", "import_", "Set_", "as_", "set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "pygments_", "._", "lexer", "s_", "._", "web_", "import_", "Ht", "ml", "Lexer_", ",_", "Xm", "l", "Lexer_", ",_", "Javascript", "Lexer_", ",_", "Cs", "s", "Lexer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pygments_", "._", "lexer", "s_", "._", "agi", "le_", "import_", "Pyth", "on", "Lexer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pygments_", "._", "lexer_", "import_", "Lexer_", ",_", "Del", "egat", "ing", "Lexer_", ",_", "Rege", "x", "Lexer_", ",_", "bygroups_", ",_", "include_", ",_", "using_", ",_", "this_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pygments_", "._", "token_", "import_", "Error_", ",_", "Punctuation_", ",_", "Text_", ",_", "Comment_", ",_", "Operator_", ",_", "Keyword_", ",_", "Name_", ",_", "String_", ",_", "Number_", ",_", "Other_", ",_", "Literal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pygments_", "._", "util_", "import_", "html", "\\u", "doct", "ype", "\\u", "matches_", ",_", "look", "s", "\\u", "like", "\\u", "xml_", "\\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\\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_", "Ma", "ko", "Lexer_", "(_", "Rege", "x", "Lexer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "'", "Ma", "ko", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aliases_", "=_", "[_", "'", "mak", "o", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filenames_", "=_", "[_", "'*", ".", "ma", "o", "'_", "]_", "\\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", "'(\\\\", "s", "*)(", "\\\\", "%)", "(\\\\", "s", "*", "end", "(?:\\\\", "w", "+))", "(\\\\", "n", "|\\\\", "Z", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bygroups_", "(_", "Text_", ",_", "Comment_", "._", "Prep", "roc_", ",_", "Keyword_", ",_", "Other_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "r", "'(\\\\", "s", "*)(", "\\\\", "%", "(?!", "%)", ")(", "[", "^", "\\\\", "n", "]*)", "(\\\\", "n", "|\\\\", "Z", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bygroups_", "(_", "Text_", ",_", "Comment_", "._", "Prep", "roc_", ",_", "using_", "(_", "Pyth", "on", "Lexer_", ")_", ",_", "Other_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "r", "'(\\\\", "s", "*)(", "##", "[", "^", "\\\\", "n", "]*)", "(\\\\", "n", "|\\\\", "Z", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bygroups_", "(_", "Text_", ",_", "Comment_", "._", "Prep", "roc_", ",_", "Other_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "r", "'''(", "?", "s", ")<", "%", "doc", ">.*?", "</", "%", "doc", ">'''_", ",_", "Comment_", "._", "Prep", "roc_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "r", "'(", "<", "%)", "([\\\\", "w", "\\\\.\\\\", ":]", "+)'_", ",_", "bygroups_", "(_", "Comment_", "._", "Prep", "roc_", ",_", "Name_", "._", "Builtin_", ")_", ",_", "'", "tag", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "r", "'(", "</", "%)", "([\\\\", "w", "\\\\.\\\\", ":]", "+)(", ">)", "'_", ",_", "bygroups_", "(_", "Comment_", "._", "Prep", "roc_", ",_", "Name_", "._", "Builtin_", ",_", "Comment_", "._", "Prep", "roc_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "r", "'<", "%", "(?=", "([\\\\", "w", "\\\\.\\\\", ":]", "+))", "'_", ",_", "Comment_", "._", "Prep", "roc_", ",_", "'", "onde", "fta", "gs", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "r", "'(", "<", "%", "(?:", "!", "?)", ")(", ".*?)", "(%", ">)", "(?", "s", ")'_", ",_", "bygroups_", "(_", "Comment_", "._", "Prep", "roc_", ",_", "using_", "(_", "Pyth", "on", "Lexer_", ")_", ",_", "Comment_", "._", "Prep", "roc_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "r", "'(\\\\", "$", "\\\\{", ")(", ".*?)", "(\\\\", "})'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bygroups_", "(_", "Comment_", "._", "Prep", "roc_", ",_", "using_", "(_", "Pyth", "on", "Lexer_", ")_", ",_", "Comment_", "._", "Prep", "roc_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "r", "'''(", "?", "sx", ")", "\\", "10", ";", " ", " ", " ", " ", "(.+?)", " ", " ", " ", "#", " ", "anyt", "hing", ",", " ", "followe", "d", " ", "by", ":", "\\", "10", ";", " ", " ", " ", " ", "(?:", "\\", "10", ";", " ", " ", " ", " ", " ", "(?", "<=", "\\\\", "n", ")(?", "=", "%", "(?!", "%)", "|\\\\", "#", "\\\\", "#)", " ", "|", " ", " ", "#", " ", "an", " ", "eval", " ", "or", " ", "comment", " ", "line", "\\", "10", ";", " ", " ", " ", " ", " ", "(?=", "\\\\", "#", "\\\\*", ")", " ", "|", " ", " ", "#", " ", "multiline", " ", "comment", "\\", "10", ";", " ", " ", " ", " ", " ", "(?=", "</", "?", "%)", " ", "|", " ", " ", " ", " ", " ", "#", " ", "a", " ", "python", " ", "block", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "#", " ", "call", " ", "start", " ", "or", " ", "end", "\\", "10", ";", " ", " ", " ", " ", " ", "(?=", "\\\\$", "\\\\{", ")", " ", "|", " ", " ", " ", " ", " ", "#", " ", "a", " ", "substitution", "\\", "10", ";", " ", " ", " ", " ", " ", "(?", "<=", "\\\\", "n", ")(?", "=\\\\", "s", "*", "%)", " ", "|", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "#", " ", "-", " ", "don", "'", "t", " ", "consume", "\\", "10", ";", " ", " ", " ", " ", " ", "(\\\\\\\\", "\\\\", "n", ")", " ", "|", " ", " ", " ", "#", " ", "an", " ", "escaped", " ", "newline", "\\", "10", ";", " ", " ", " ", " ", " ", "\\\\", "Z", " ", " ", " ", " ", " ", "#", " ", "end", " ", "of", " ", "string", "\\", "10", ";", " ", " ", " ", " ", ")", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "bygroups_", "(_", "Other_", ",_", "Operator_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "r", "'\\\\", "s", "+'_", ",_", "Text_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "onde", "fta", "gs", "'_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "r", "'<", "%'_", ",_", "Comment_", "._", "Prep", "roc_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "r", "'(?<", "=", "<", "%)", "(", "include", "|", "inherit", "|", "namespace", "|", "page", ")'_", ",_", "Name_", "._", "Builtin_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "include_", "(_", "'", "tag", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tag", "'_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "r", "'((", "?:\\\\", "w", "+)\\\\", "s", "*=", ")\\\\", "s", "*(", "\".*", "?\"", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bygroups_", "(_", "Name_", "._", "Attribute_", ",_", "String_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "r", "'/", "?\\\\", "s", "*>", "'_", ",_", "Comment_", "._", "Prep", "roc_", ",_", "'#", "pop", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "r", "'\\\\", "s", "+'_", ",_", "Text_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attr", "'_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\"", ".*?", "\"'_", ",_", "String_", ",_", "'#", "pop", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"'", ".*?", "'\"_", ",_", "String_", ",_", "'#", "pop", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "r", "'[", "^", "\\\\", "s", ">]", "+'_", ",_", "String_", ",_", "'#", "pop", "'_", ")_", ",_", "\\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_", "Ma", "ko", "Ht", "ml", "Lexer_", "(_", "Del", "egat", "ing", "Lexer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "'", "HTM", "L", "+", "Ma", "ko", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aliases_", "=_", "[_", "'", "html", "+", "mak", "o", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Ma", "ko", "Ht", "ml", "Lexer_", "(_", "Del", "egat", "ing", "Lexer_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Ma", "ko", "Ht", "ml", "Lexer_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "Ht", "ml", "Lexer_", ",_", "Ma", "ko", "Lexer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "options_", ")_", "\\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_", "Ma", "ko", "Xm", "l", "Lexer_", "(_", "Del", "egat", "ing", "Lexer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "'", "XML", "+", "Ma", "ko", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aliases_", "=_", "[_", "'", "xml", "+", "mak", "o", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Ma", "ko", "Xm", "l", "Lexer_", "(_", "Del", "egat", "ing", "Lexer_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Ma", "ko", "Xm", "l", "Lexer_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "Xm", "l", "Lexer_", ",_", "Ma", "ko", "Lexer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "options_", ")_", "\\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_", "Ma", "ko", "Javascript", "Lexer_", "(_", "Del", "egat", "ing", "Lexer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "'", "Ja", "va", "Script", "+", "Ma", "ko", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aliases_", "=_", "[_", "'", "js", "+", "mak", "o", "'_", ",_", "'", "javascript", "+", "mak", "o", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Ma", "ko", "Javascript", "Lexer_", "(_", "Del", "egat", "ing", "Lexer_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Ma", "ko", "Javascript", "Lexer_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "Javascript", "Lexer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Ma", "ko", "Lexer_", ",_", "**_", "options_", ")_", "\\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_", "Ma", "ko", "Cs", "s", "Lexer_", "(_", "Del", "egat", "ing", "Lexer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "'", "CS", "S", "+", "Ma", "ko", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aliases_", "=_", "[_", "'", "css", "+", "mak", "o", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Ma", "ko", "Cs", "s", "Lexer_", "(_", "Del", "egat", "ing", "Lexer_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Ma", "ko", "Cs", "s", "Lexer_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "Cs", "s", "Lexer_", ",_", "Ma", "ko", "Lexer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "options_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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,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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, 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, 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 ]
Unused local variable
emccode/heliosburn/heliosburn/django/hbproject/api/tests.py
[ { "content": " def test_crud(self):\n \"\"\"\n Tests CRUD for traffic model.\n \"\"\"\n from models import snippet_generator\n\n def create():\n pass\n\n def read():\n self.login(admin_username, admin_password)\n response = self.client.get(path=api_url + \"/traffic/\",\n HTTP_X_AUTH_TOKEN=self.x_auth_token)\n self.assertEqual(response.status_code, 200)\n\n def update():\n pass\n\n def delete():\n pass\n\n print(\"Generating test traffic in Redis\")\n snippet_generator.generate_traffic()\n\n print(\"Testing READ in %s\" % self.__class__)\n read()", "metadata": "root.TrafficViewTestCase.test_crud", "header": "['class', 'TrafficViewTestCase', '(', 'APITestCase', ')', ':', '___EOS___']", "index": 374 }, { "content": " def test_log_get(self):\n self.login(admin_username, admin_password)\n response = self.client.get(path=api_url + \"/log/\",\n HTTP_X_AUTH_TOKEN=self.x_auth_token)\n pass", "metadata": "root.LogTestCase.test_log_get", "header": "['class', 'LogTestCase', '(', 'APITestCase', ')', ':', '___EOS___']", "index": 876 } ]
[ { "span": "create(", "start_line": 380, "start_column": 12, "end_line": 380, "end_column": 18 }, { "span": "update(", "start_line": 389, "start_column": 12, "end_line": 389, "end_column": 18 }, { "span": "delete(", "start_line": 392, "start_column": 12, "end_line": 392, "end_column": 18 }, { "span": "response ", "start_line": 878, "start_column": 8, "end_line": 878, "end_column": 16 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Tra", "ffic", "View", "Test", "Case_", "(_", "API", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "crud", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", "s", " ", "CRUD", " ", "for", " ", "traffic", " ", "model", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "models_", "import_", "snippet", "\\u", "generator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "create_", "(_", ")_", ":_", "\\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_", "def_", "read_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "login_", "(_", "admin", "\\u", "username_", ",_", "admin", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "path_", "=_", "api", "\\u", "url_", "+_", "\"/", "traffic", "/\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "HTTP", "\\u", "X", "\\u", "AUTH", "\\u", "TOKEN_", "=_", "self_", "._", "x", "\\u", "auth", "\\u", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update_", "(_", ")_", ":_", "\\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_", "def_", "delete_", "(_", ")_", ":_", "\\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_", "print_", "(_", "\"", "Generat", "ing", " ", "test", " ", "traffic", " ", "in", " ", "Red", "is", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "snippet", "\\u", "generator_", "._", "generat", "e\\u", "traffic", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "Test", "ing", " ", "READ", " ", "in", " ", "%", "s", "\"_", "%_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "Test", "Case_", "(_", "API", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "log", "\\u", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "login_", "(_", "admin", "\\u", "username_", ",_", "admin", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "path_", "=_", "api", "\\u", "url_", "+_", "\"/", "log", "/\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "HTTP", "\\u", "X", "\\u", "AUTH", "\\u", "TOKEN_", "=_", "self_", "._", "x", "\\u", "auth", "\\u", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_" ]
[ 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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Wrong number of arguments in a class instantiation
QuantSoftware/QuantSoftwareToolkit/QSTK/qstklearn/fastknn.py
[ { "content": "class FastKNN:\n\t\"\"\"\n\tA class which implements the KNN learning algorithm with sped up\n\tquery times.\n\n\tThis class follows the conventions of other classes in the qstklearn\n\tmodule, with a constructor that initializes basic parameters and\n\tbookkeeping variables, an 'addEvidence' method for adding labeled\n\ttraining data individually or as a batch, and a 'query' method\n\tthat returns an estimated class for an unlabled point. Training\n\tand testing data are in the form of numpy arrays, and classes are\n\tdiscrete.\n\t\n\tIn order to speed up query times, this class keeps a number of lists which\n\tsort the training data by distance to 'anchor' points. The lists aren't\n\tsorted until the first call to the 'query' method, after which, the lists\n\tare kept in sorted order. Initial sort is done using pythons 'sort'\n\t(samplesort), and sorted insertions with 'insort' from the bisect module.\n\t\"\"\"\n\t\n\t\t\t\t\n\t\n\t", "metadata": "root.FastKNN", "header": "['module', '___EOS___']", "index": 20 }, { "content": "\tdef __init__(self, num_anchors, k):\n\t\t\"\"\"\n\t\tCreates a new FastKNN object that will use the given number of \n\t\tanchors.\n\t\t\"\"\"\n\t\tself.num_anchors = num_anchors\n\t\tself.training_data = list()\n\t\tself.anchors = list()\n\t\tself.data_by_anchors = dict()\n\t\tself.data_classes = dict()\n\t\tself.is_sorted = False\n\t\t#self.distfun = scipy.spatial.distance.euclidean\n\t\tself.distfun = adistfun\n\t\tself.num_checks = 0\n\t\tself.kdt = None\n\t\tself.k = k", "metadata": "root.FastKNN.__init__", "header": "['class', 'FastKNN', ':', '___EOS___']", "index": 39 }, { "content": "\tdef resetAnchors(self,selection_type='random'):\n\t\t\"\"\"\n\t\tPicks a new set of anchors. The anchor lists will be re-sorted upon\n\t\tthe next call to 'query'.\n\t\t\n\t\tselection_type - the method to use when selecting new anchor points.\n\t\t'random' performs a random permutation of the training points and\n\t\tpicks the first 'num_anchors' as new anchors.\n\t\t\"\"\"\n\t\tif selection_type == 'random':\n\t\t\tself.anchors = range(len(self.training_data))\n\t\t\trandom.shuffle(self.anchors)\n\t\t\tself.anchors = self.anchors[0:self.num_anchors]\n\t\t\tself.kdt = scipy.spatial.kdtree.KDTree(numpy.array(self.training_data)[self.anchors,:])\n\t\tself.is_sorted = False", "metadata": "root.FastKNN.resetAnchors", "header": "['class', 'FastKNN', ':', '___EOS___']", "index": 56 }, { "content": "\tdef addEvidence(self,data,label):\n\t\t\"\"\"\n\t\tAdds to the set of training data. If the anchor lists were sorted\n\t\tbefore the call to this method, the new data will be inserted into\n\t\tthe anchor lists using 'bisect.insort'\n\t\t\n\t\tdata - a numpy array, either a single point (1D) or a set of\n\t\tpoints (2D)\n\t\t\n\t\tlabel - the label for data. A single value, or a list of values\n\t\tin the same order as the points in data.\n\t\t\"\"\"\n\t\tif len(data.shape)==1:\n\t\t\tnew_idx = len(self.training_data)\n\t\t\tself.training_data.append(data)\n\t\t\tself.data_classes[new_idx] = label\n\t\t\tif self.is_sorted:\n\t\t\t\tfor a in self.anchors:\n\t\t\t\t\tdist = self.distfun(data,self.training_data[a])\n\t\t\t\t\tbisect.insort(self.data_by_anchors[a],(dist,new_idx))\n\t\telif len(data.shape)>1:\n\t\t\tfor i in xrange(len(data)):\n\t\t\t\tthing = data[i]\n\t\t\t\tnew_idx = len(self.training_data)\n\t\t\t\tself.training_data.append(thing)\n\t\t\t\tself.data_classes[new_idx] = label[i]\n\t\t\t\tif self.is_sorted:\n\t\t\t\t\tfor a in self.anchors:\n\t\t\t\t\t\tdist = self.distfun(thing,self.training_data[a])\n\t\t\t\t\t\tbisect.insort(self.data_by_anchors[a],(dist,new_idx))", "metadata": "root.FastKNN.addEvidence", "header": "['class', 'FastKNN', ':', '___EOS___']", "index": 73 }, { "content": "\tdef query(self,point,k=None,method='mode',slow=False,dumdumcheck=False):\n\t\t\"\"\"\n\t\tReturns class value for an unlabled point by examining its k nearest\n\t\tneighbors. 'method' determines how the class of the unlabled point is\n\t\tdetermined.\n\t\t\"\"\"\n\t\tif k is None:\n\t\t\tk = self.k\n\t\t#stime = time.time()\n\t\tif len(self.anchors) < self.num_anchors:\n\t\t\tself.resetAnchors()\n\t\tif not self.is_sorted:\n\t\t\tfor a in self.anchors:\n\t\t\t\tself.data_by_anchors[a] = [ ( self.distfun(self.training_data[datai],self.training_data[a]), datai) for datai in range(len(self.training_data))]\n\t\t\t\tself.data_by_anchors[a].sort(key=lambda pnt: pnt[0])\n\t\t#select the anchor to search from\n\t\t#right now pick the anchor closest to the query point\n\t\t\n\t\t#anchor = self.anchors[0]\n\t\t#anchor_dist = self.distfun(point,self.training_data[anchor]) \n\t\t#for i in xrange(1,len(self.anchors)):\n\t\t#\tnew_anchor = self.anchors[i]\n\t\t#\tnew_anchor_dist = self.distfun(point,self.training_data[new_anchor])\n\t\t#\tif new_anchor_dist < anchor_dist:\n\t\t#\t\tanchor = new_anchor\n\t\t#\t\tanchor_dist = new_anchor_dist\n\t\tres = self.kdt.query(numpy.array([point,]))\n\t\tanchor = self.anchors[res[1][0]]\n\t\tanchor_dist = res[0][0]\n\t\t#print \"Found the anchor\",anchor,anchor_dist\n\t\t\n\t\t#now search through the list\n\t\tanchor_list = self.data_by_anchors[anchor]\n\t\tneighbors = list()\n\t\tmaxd = None\n\t\tmaxd_idx = 0\n\t\tfor i in xrange(0,len(anchor_list)):\n\t\t\tnextpnt_dist = self.distfun(point,self.training_data[anchor_list[i][1]])\n\t\t\tself.num_checks += 1\n\t\t\tnextthing = (nextpnt_dist,anchor_list[i][1])\n\t\t\t\n\t\t\t#ins_idx = bisect.bisect(neighbors,nextthing)\n\t\t\t#if ins_idx <= k:\n\t\t\t#\tneighbors.insert(ins_idx,nextthing)\n\t\t\t#\tneighbors = neighbors[:k]\n\t\t\t#if not(slow) and len(neighbors) >= k:\n\t\t\t#\tif anchor_dist + neighbors[k-1][0] < anchor_list[i][0]:\n\t\t\t#\t\tbreak\n\t\t\t\n\t\t\tif len(neighbors)<k:\n\t\t\t\tif (maxd is None) or (maxd < nextpnt_dist):\n\t\t\t\t\tmaxd = nextpnt_dist\n\t\t\t\t\tmaxd_idx = len(neighbors)\n\t\t\t\tneighbors.append(nextthing)\n\t\t\telif nextpnt_dist < maxd:\n\t\t\t\tneighbors[maxd_idx] = nextthing\n\t\t\t\tmaxthing = max(neighbors)\n\t\t\t\tmaxd_idx = neighbors.index(maxthing)\n\t\t\t\tmaxd = maxthing[0]\n\t\t\tif not(slow) and len(neighbors) >= k:\n\t\t\t\tif anchor_dist + maxd < anchor_list[i][0]:\n\t\t\t\t\tbreak\n\n\t\t#we have the k neighbors, report the class\n\t\t#of the query point via method\n\t\tif method == 'mode':\n\t\t\tclass_count = dict()\n\t\t\tfor n in neighbors:\n\t\t\t\tnid = n[1]\n\t\t\t\tclss = self.data_classes[nid]\n\t\t\t\tif clss in class_count:\n\t\t\t\t\ttmp = class_count[clss]\n\t\t\t\telse:\n\t\t\t\t\ttmp = 0\n\t\t\t\tclass_count[clss] = tmp+1\n\t\t\tbleh = max(class_count.iteritems(),key=lambda item:item[1])\n\t\t\tif dumdumcheck and bleh[1] == 1:\n\t\t\t\tprint \"aHAH!\"\n\t\t\t\tprint point\n\t\t\trv = bleh[0]\n\t\telif method == 'mean':\n\t\t\treturn sum([self.data_classes[n[1]] for n in neighbors])/float(k)\n\t\t#etime = time.time()\n\t\t#print \"Query time:\", etime-stime\n\t\treturn rv", "metadata": "root.FastKNN.query", "header": "['class', 'FastKNN', ':', '___EOS___']", "index": 104 }, { "content": "def testwine():\n\twqred = dataifywine('wine/winequality-red.csv') + dataifywine('wine/winequality-white.csv')\n\tleftoutperc = 0.1\n\tleftout = int(len(wqred)*leftoutperc)\n\ttesting = wqred[:leftout]\n\ttraining = wqred[leftout:]\n\tprint \"Training:\",len(training)\n\tprint \"Testing:\",len(testing)\n\tfoo = FastKNN(10)\n\tfoo.addEvidence(numpy.array([thing[:-1] for thing in training]), [thing[-1] for thing in training])\n\tknn.addEvidence(numpy.array(training))\n\ttotal = 0\n\tcorrect = 0\n\tfor x in xrange(len(testing)):\n\t\tthing = testing[x]\n\t\tguess = foo.query(numpy.array(thing[:-1]),3)\n\t\t#realknn = knn.query(numpy.array([thing[:-1],]),3,method='mean')\n\t\t#guess = realknn[0]\n\t\t#print realknn\n\t\t#print guess, thing[-1]\n\t\tif guess == thing[-1]:\n\t\t\tcorrect += 1\n\t\ttotal += 1\n\t\tif total % 50 == 0:\n\t\t\tprint total,'/',len(testing)\n\tprint correct,\"/\",total,\":\",float(correct)/float(total)\n\tprint \"Average checks per query:\", float(foo.num_checks)/float(total)", "metadata": "root.testwine", "header": "['module', '___EOS___']", "index": 199 }, { "content": "def testspiral():\n\tfor leftout in xrange(1,11):\n\t\tprint \"Fold\",leftout\n\t\tfoo = FastKNN(10)\n\t\tfor x in xrange(1,11):\n\t\t\tif x != leftout:\n\t\t\t\tsomedata = open(\"spiral/spiralfold%d.txt\" % x)\n\t\t\t\tpnts = list()\n\t\t\t\tclss = list()\n\t\t\t\tfor line in somedata:\n\t\t\t\t\tpbbbt,x,y = line.split()\n\t\t\t\t\tx,y = float(x),float(y)\n\t\t\t\t\tpnts.append((x,y))\n\t\t\t\t\tclss.append(line.split()[0])\n\t\t\t\tsomedata.close()\n\t\t\t\tpnts = numpy.array(pnts)\n\t\t\t\tfoo.addEvidence(pnts,clss)\n\t\tsomedata = open(\"spiral/spiralfold%d.txt\" % leftout)\n\t\tcorrect = total = 0\n\t\tfor line in somedata:\n\t\t\tpbbbt,x,y = line.split()\n\t\t\tx,y = float(x),float(y)\n\t\t\tguess=foo.query((x,y),10)\n\t\t\t#guess2 = foo.query((x,y),10,slow=True)\n\t\t\t#if guess != guess2:\n\t\t\t#\tprint \"Crap!\"\n\t\t\t#\tprint guess,guess2,(x,y,pbbbt)\n\t\t\t#print guess, pbbbt\n\t\t\tif guess == pbbbt:\n\t\t\t\tcorrect += 1\n\t\t\ttotal += 1\n\t\tprint correct,\"/\",total,\":\",float(correct)/float(total)\n\t\tprint \"Average number of checks per query:\", \n\t\tprint float(foo.num_checks)/float(total)", "metadata": "root.testspiral", "header": "['module', '___EOS___']", "index": 227 } ]
[ { "span": "FastKNN(10)", "start_line": 207, "start_column": 7, "end_line": 207, "end_column": 18 }, { "span": "FastKNN(10)", "start_line": 230, "start_column": 8, "end_line": 230, "end_column": 19 } ]
[ { "span": "def __init__(self, num_anchors, k):", "start_line": 39, "start_column": 1, "end_line": 39, "end_column": 36 } ]
1
false
[ "[CLS]_", "Wro", "ng_", "number_", "of_", "arguments_", "in_", "a_", "class_", "instantiation", "_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Fast", "KN", "N_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\"\"\"", "\\", "10", ";", "\t", "A", " ", "class", " ", "whi", "ch", " ", "implement", "s", " ", "the", " ", "KN", "N", " ", "learn", "ing", " ", "algo", "rit", "hm", " ", "with", " ", "spe", "d", " ", "up", "\\", "10", ";", "\t", "query", " ", "times", ".", "\\", "10", ";", "\\", "10", ";", "\t", "Thi", "s", " ", "class", " ", "follow", "s", " ", "the", " ", "convention", "s", " ", "of", " ", "other", " ", "classe", "s", " ", "in", " ", "the", " ", "qst", "kle", "arn", "\\", "10", ";", "\t", "module", ",", " ", "with", " ", "a", " ", "construct", "or", " ", "tha", "t", " ", "initialize", "s", " ", "basic", " ", "parameter", "s", " ", "and", "\\", "10", ";", "\t", "book", "keep", "ing", " ", "variab", "les", ",", " ", "an", " ", "'", "add", "Evi", "denc", "e", "'", " ", "method", " ", "for", " ", "addin", "g", " ", "label", "ed", "\\", "10", ";", "\t", "train", "ing", " ", "data", " ", "individual", "ly", " ", "or", " ", "as", " ", "a", " ", "batch", ",", " ", "and", " ", "a", " ", "'", "query", "'", " ", "method", "\\", "10", ";", "\t", "tha", "t", " ", "return", "s", " ", "an", " ", "estimate", "d", " ", "class", " ", "for", " ", "an", " ", "unla", "ble", "d", " ", "point", ".", " ", " ", "Train", "ing", "\\", "10", ";", "\t", "and", " ", "testi", "ng", " ", "data", " ", "are", " ", "in", " ", "the", " ", "form", " ", "of", " ", "nump", "y", " ", "arrays", ",", " ", "and", " ", "classe", "s", " ", "are", "\\", "10", ";", "\t", "discrete", ".", "\\", "10", ";", "\t", "\\", "10", ";", "\t", "In", " ", "order", " ", "to", " ", "speed", " ", "up", " ", "query", " ", "times", ",", " ", "this", " ", "class", " ", "keep", "s", " ", "a", " ", "number", " ", "of", " ", "lists", " ", "whi", "ch", "\\", "10", ";", "\t", "sort", " ", "the", " ", "train", "ing", " ", "data", " ", "by", " ", "distance", " ", "to", " ", "'", "anchor", "'", " ", "points", ".", " ", " ", "The", " ", "lists", " ", "are", "n", "'", "t", "\\", "10", ";", "\t", "sorte", "d", " ", "unti", "l", " ", "the", " ", "first", " ", "call", " ", "to", " ", "the", " ", "'", "query", "'", " ", "method", ",", " ", "after", " ", "whi", "ch", ",", " ", "the", " ", "lists", "\\", "10", ";", "\t", "are", " ", "kep", "t", " ", "in", " ", "sorte", "d", " ", "order", ".", " ", "Initial", " ", "sort", " ", "is", " ", "don", "e", " ", "usi", "ng", " ", "python", "s", " ", "'", "sort", "'", "\\", "10", ";", "\t", "(", "samples", "ort", "),", " ", "and", " ", "sorte", "d", " ", "insertion", "s", " ", "with", " ", "'", "ins", "ort", "'", " ", "from", " ", "the", " ", "bisect", " ", "module", ".", "\\", "10", ";", "\t", "\"\"\"_", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Fast", "KN", "N_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "num", "\\u", "anchors_", ",_", "k_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "\\", "10", ";", "\t", "\t", "Creat", "es", " ", "a", " ", "new", " ", "Fast", "KN", "N", " ", "object", " ", "tha", "t", " ", "will", " ", "use", " ", "the", " ", "give", "n", " ", "number", " ", "of", " ", "\\", "10", ";", "\t", "\t", "anchors", ".", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "num", "\\u", "anchors_", "=_", "num", "\\u", "anchors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "train", "ing", "\\u", "data_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "anchors_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data\\u", "by", "\\u", "anchors_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data\\u", "classes_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "\\u", "sorted_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "dist", "fun", " ", "=", " ", "sci", "py", ".", "spat", "ial", ".", "distance", ".", "euclidean", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dist", "fun_", "=_", "adi", "stf", "un_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "num", "\\u", "checks_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "kd", "t_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "k_", "=_", "k_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fast", "KN", "N_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "reset", "Anc", "hor", "s_", "(_", "self_", ",_", "selection", "\\u", "type_", "=_", "'", "random", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "\\", "10", ";", "\t", "\t", "Pick", "s", " ", "a", " ", "new", " ", "set", " ", "of", " ", "anchors", ".", " ", " ", "The", " ", "anchor", " ", "lists", " ", "will", " ", "be", " ", "re", "-", "sorte", "d", " ", "upo", "n", "\\", "10", ";", "\t", "\t", "the", " ", "next", " ", "call", " ", "to", " ", "'", "query", "'.", "\\", "10", ";", "\t", "\t", "\\", "10", ";", "\t", "\t", "selection", "\\u", "type", " ", "-", " ", "the", " ", "method", " ", "to", " ", "use", " ", "whe", "n", " ", "selecti", "ng", " ", "new", " ", "anchor", " ", "points", ".", "\\", "10", ";", "\t", "\t", "'", "random", "'", " ", "perform", "s", " ", "a", " ", "random", " ", "permutation", " ", "of", " ", "the", " ", "train", "ing", " ", "points", " ", "and", "\\", "10", ";", "\t", "\t", "picks", " ", "the", " ", "first", " ", "'", "num", "\\u", "anchors", "'", " ", "as", " ", "new", " ", "anchors", ".", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "selection", "\\u", "type_", "==_", "'", "random", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "anchors_", "=_", "range_", "(_", "len_", "(_", "self_", "._", "train", "ing", "\\u", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "random_", "._", "shuffle_", "(_", "self_", "._", "anchors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "anchors_", "=_", "self_", "._", "anchors_", "[_", "0_", ":_", "self_", "._", "num", "\\u", "anchors_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "kd", "t_", "=_", "scipy_", "._", "spatial_", "._", "kd", "tree_", "._", "KD", "Tree_", "(_", "numpy_", "._", "array_", "(_", "self_", "._", "train", "ing", "\\u", "data_", ")_", "[_", "self_", "._", "anchors_", ",_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "is", "\\u", "sorted_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fast", "KN", "N_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Evi", "denc", "e_", "(_", "self_", ",_", "data_", ",_", "label_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "\\", "10", ";", "\t", "\t", "Add", "s", " ", "to", " ", "the", " ", "set", " ", "of", " ", "train", "ing", " ", "data", ".", " ", "If", " ", "the", " ", "anchor", " ", "lists", " ", "wer", "e", " ", "sorte", "d", "\\", "10", ";", "\t", "\t", "bef", "ore", " ", "the", " ", "call", " ", "to", " ", "this", " ", "method", ",", " ", "the", " ", "new", " ", "data", " ", "will", " ", "be", " ", "inserted", " ", "int", "o", "\\", "10", ";", "\t", "\t", "the", " ", "anchor", " ", "lists", " ", "usi", "ng", " ", "'", "bisect", ".", "ins", "ort", "'", "\\", "10", ";", "\t", "\t", "\\", "10", ";", "\t", "\t", "data", " ", "-", " ", "a", " ", "nump", "y", " ", "array", ",", " ", "eit", "her", " ", "a", " ", "single", " ", "point", " ", "(", "1", "D", ")", " ", "or", " ", "a", " ", "set", " ", "of", "\\", "10", ";", "\t", "\t", "points", " ", "(", "2", "D", ")", "\\", "10", ";", "\t", "\t", "\\", "10", ";", "\t", "\t", "label", " ", "-", " ", "the", " ", "label", " ", "for", " ", "data", ".", " ", "A", " ", "single", " ", "value", ",", " ", "or", " ", "a", " ", "list", " ", "of", " ", "values", "\\", "10", ";", "\t", "\t", "in", " ", "the", " ", "same", " ", "order", " ", "as", " ", "the", " ", "points", " ", "in", " ", "data", ".", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "data_", "._", "shape_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "new", "\\u", "idx_", "=_", "len_", "(_", "self_", "._", "train", "ing", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "train", "ing", "\\u", "data_", "._", "append_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data\\u", "classes_", "[_", "new", "\\u", "idx_", "]_", "=_", "label_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "sorted_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "for_", "a_", "in_", "self_", "._", "anchors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "dist_", "=_", "self_", "._", "dist", "fun_", "(_", "data_", ",_", "self_", "._", "train", "ing", "\\u", "data_", "[_", "a_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bisect_", "._", "ins", "ort_", "(_", "self_", "._", "data\\u", "by", "\\u", "anchors_", "[_", "a_", "]_", ",_", "(_", "dist_", ",_", "new", "\\u", "idx_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "data_", "._", "shape_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "for_", "i_", "in_", "xrange_", "(_", "len_", "(_", "data_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "thing_", "=_", "data_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "idx_", "=_", "len_", "(_", "self_", "._", "train", "ing", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "train", "ing", "\\u", "data_", "._", "append_", "(_", "thing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data\\u", "classes_", "[_", "new", "\\u", "idx_", "]_", "=_", "label_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "sorted_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "for_", "a_", "in_", "self_", "._", "anchors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t_", "dist_", "=_", "self_", "._", "dist", "fun_", "(_", "thing_", ",_", "self_", "._", "train", "ing", "\\u", "data_", "[_", "a_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bisect_", "._", "ins", "ort_", "(_", "self_", "._", "data\\u", "by", "\\u", "anchors_", "[_", "a_", "]_", ",_", "(_", "dist_", ",_", "new", "\\u", "idx_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fast", "KN", "N_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "query_", "(_", "self_", ",_", "point_", ",_", "k_", "=_", "None_", ",_", "method_", "=_", "'", "mode", "'_", ",_", "slow_", "=_", "False_", ",_", "dum", "dum", "check_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "\\", "10", ";", "\t", "\t", "Return", "s", " ", "class", " ", "value", " ", "for", " ", "an", " ", "unla", "ble", "d", " ", "point", " ", "by", " ", "exam", "inin", "g", " ", "its", " ", "k", " ", "near", "est", "\\", "10", ";", "\t", "\t", "neighbor", "s", ".", " ", "'", "method", "'", " ", "dete", "rmin", "es", " ", "how", " ", "the", " ", "class", " ", "of", " ", "the", " ", "unla", "ble", "d", " ", "point", " ", "is", "\\", "10", ";", "\t", "\t", "dete", "rmin", "ed", ".", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "k_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "k_", "=_", "self_", "._", "k_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "stime", " ", "=", " ", "time", ".", "time", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "self_", "._", "anchors_", ")_", "<_", "self_", "._", "num", "\\u", "anchors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "reset", "Anc", "hor", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "._", "is", "\\u", "sorted_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "for_", "a_", "in_", "self_", "._", "anchors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "self_", "._", "data\\u", "by", "\\u", "anchors_", "[_", "a_", "]_", "=_", "[_", "(_", "self_", "._", "dist", "fun_", "(_", "self_", "._", "train", "ing", "\\u", "data_", "[_", "datai", "_", "]_", ",_", "self_", "._", "train", "ing", "\\u", "data_", "[_", "a_", "]_", ")_", ",_", "datai", "_", ")_", "for_", "datai", "_", "in_", "range_", "(_", "len_", "(_", "self_", "._", "train", "ing", "\\u", "data_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data\\u", "by", "\\u", "anchors_", "[_", "a_", "]_", "._", "sort_", "(_", "key_", "=_", "lambda_", "pnt", "_", ":_", "pnt", "_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "select", " ", "the", " ", "anchor", " ", "to", " ", "search", " ", "from_", "\\u\\u\\uNL\\u\\u\\u_", "#", "right", " ", "now", " ", "pick", " ", "the", " ", "anchor", " ", "closest", " ", "to", " ", "the", " ", "query", " ", "point_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "anchor", " ", "=", " ", "self", ".", "anchors", "[", "0", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", "anchor", "\\u", "dist", " ", "=", " ", "self", ".", "dist", "fun", "(", "point", ",", "self", ".", "train", "ing", "\\u", "data", "[", "anchor", "])", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "for", " ", "i", " ", "in", " ", "xran", "ge", "(", "1", ",", "len", "(", "self", ".", "anchors", "))", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "new", "\\u", "anchor", " ", "=", " ", "self", ".", "anchors", "[", "i", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "new", "\\u", "anchor", "\\u", "dist", " ", "=", " ", "self", ".", "dist", "fun", "(", "point", ",", "self", ".", "train", "ing", "\\u", "data", "[", "new", "\\u", "anchor", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "if", " ", "new", "\\u", "anchor", "\\u", "dist", " ", "<", " ", "anchor", "\\u", "dist", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "anchor", " ", "=", " ", "new", "\\u", "anchor_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "anchor", "\\u", "dist", " ", "=", " ", "new", "\\u", "anchor", "\\u", "dist_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "self_", "._", "kd", "t_", "._", "query_", "(_", "numpy_", "._", "array_", "(_", "[_", "point_", ",_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "anchor_", "=_", "self_", "._", "anchors_", "[_", "res_", "[_", "1_", "]_", "[_", "0_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "anchor", "\\u", "dist_", "=_", "res_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "Foun", "d", " ", "the", " ", "anchor", "\",", "anchor", ",", "anchor", "\\u", "dist_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "now", " ", "search", " ", "through", " ", "the", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "anchor", "\\u", "list_", "=_", "self_", "._", "data\\u", "by", "\\u", "anchors_", "[_", "anchor_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "neighbors_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxd", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxd", "\\u", "idx_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "len_", "(_", "anchor", "\\u", "list_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "nextp", "nt", "\\u", "dist_", "=_", "self_", "._", "dist", "fun_", "(_", "point_", ",_", "self_", "._", "train", "ing", "\\u", "data_", "[_", "anchor", "\\u", "list_", "[_", "i_", "]_", "[_", "1_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "num", "\\u", "checks_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "thing_", "=_", "(_", "nextp", "nt", "\\u", "dist_", ",_", "anchor", "\\u", "list_", "[_", "i_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "ins", "\\u", "idx", " ", "=", " ", "bisect", ".", "bisect", "(", "neighbor", "s", ",", "next", "thing", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "ins", "\\u", "idx", " ", "<=", " ", "k", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "neighbor", "s", ".", "insert", "(", "ins", "\\u", "idx", ",", "next", "thing", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "neighbor", "s", " ", "=", " ", "neighbor", "s", "[:", "k", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "not", "(", "slow", ")", " ", "and", " ", "len", "(", "neighbor", "s", ")", " ", ">=", " ", "k", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "if", " ", "anchor", "\\u", "dist", " ", "+", " ", "neighbor", "s", "[", "k", "-1", "][", "0", "]", " ", "<", " ", "anchor", "\\u", "list", "[", "i", "][", "0", "]:", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "break_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "neighbors_", ")_", "<_", "k_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "(_", "maxd", "_", "is_", "None_", ")_", "or_", "(_", "maxd", "_", "<_", "nextp", "nt", "\\u", "dist_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "maxd", "_", "=_", "nextp", "nt", "\\u", "dist_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxd", "\\u", "idx_", "=_", "len_", "(_", "neighbors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "neighbors_", "._", "append_", "(_", "next", "thing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "nextp", "nt", "\\u", "dist_", "<_", "maxd", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "neighbors_", "[_", "maxd", "\\u", "idx_", "]_", "=_", "next", "thing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxt", "hing_", "=_", "max_", "(_", "neighbors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxd", "\\u", "idx_", "=_", "neighbors_", "._", "index_", "(_", "maxt", "hing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxd", "_", "=_", "maxt", "hing_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "(_", "slow_", ")_", "and_", "len_", "(_", "neighbors_", ")_", ">=_", "k_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "anchor", "\\u", "dist_", "+_", "maxd", "_", "<_", "anchor", "\\u", "list_", "[_", "i_", "]_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "we", " ", "have", " ", "the", " ", "k", " ", "neighbor", "s", ",", " ", "report", " ", "the", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "#", "of", " ", "the", " ", "query", " ", "point", " ", "via", " ", "method_", "\\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_", "method_", "==_", "'", "mode", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "class", "\\u", "count_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "n_", "in_", "neighbors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "nid_", "=_", "n_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls", "s_", "=_", "self_", "._", "data\\u", "classes_", "[_", "nid_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cls", "s_", "in_", "class", "\\u", "count_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "tmp_", "=_", "class", "\\u", "count_", "[_", "cls", "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\t", "\t\t\t\t_", "tmp_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class", "\\u", "count_", "[_", "cls", "s_", "]_", "=_", "tmp_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ble", "h_", "=_", "max_", "(_", "class", "\\u", "count_", "._", "iteritems_", "(_", ")_", ",_", "key_", "=_", "lambda_", "item_", ":_", "item_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "dum", "dum", "check_", "and_", "ble", "h_", "[_", "1_", "]_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "print_", "\"", "a", "HA", "H", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "point_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rv_", "=_", "ble", "h_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "method_", "==_", "'", "mean", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "sum_", "(_", "[_", "self_", "._", "data\\u", "classes_", "[_", "n_", "[_", "1_", "]_", "]_", "for_", "n_", "in_", "neighbors_", "]_", ")_", "/_", "float_", "(_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "etime", " ", "=", " ", "time", ".", "time", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "Query", " ", "time", ":\"", ",", " ", "etime", "-", "stime", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "rv_", "\\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", "wine", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "wq", "red_", "=_", "datai", "fy", "wine", "_", "(_", "'", "wine", "/", "wine", "quali", "ty", "-", "red", ".", "csv", "'_", ")_", "+_", "datai", "fy", "wine", "_", "(_", "'", "wine", "/", "wine", "quali", "ty", "-", "white", ".", "csv", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lefto", "ut", "perc_", "=_", "0.1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lefto", "ut_", "=_", "int_", "(_", "len_", "(_", "wq", "red_", ")_", "*_", "lefto", "ut", "perc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testing_", "=_", "wq", "red_", "[_", ":_", "lefto", "ut_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "training_", "=_", "wq", "red_", "[_", "lefto", "ut_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Train", "ing", ":\"_", ",_", "len_", "(_", "training_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Test", "ing", ":\"_", ",_", "len_", "(_", "testing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foo_", "=_", "Fast", "KN", "N_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foo_", "._", "add", "Evi", "denc", "e_", "(_", "numpy_", "._", "array_", "(_", "[_", "thing_", "[_", ":_", "-_", "1_", "]_", "for_", "thing_", "in_", "training_", "]_", ")_", ",_", "[_", "thing_", "[_", "-_", "1_", "]_", "for_", "thing_", "in_", "training_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "knn", "_", "._", "add", "Evi", "denc", "e_", "(_", "numpy_", "._", "array_", "(_", "training_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "correct_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "xrange_", "(_", "len_", "(_", "testing_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "thing_", "=_", "testing_", "[_", "x_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "guess_", "=_", "foo_", "._", "query_", "(_", "numpy_", "._", "array_", "(_", "thing_", "[_", ":_", "-_", "1_", "]_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "real", "knn", " ", "=", " ", "knn", ".", "query", "(", "nump", "y", ".", "array", "([", "thing", "[:", "-1", "],", "])", ",", "3", ",", "method", "='", "mean", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "guess", " ", "=", " ", "real", "knn", "[", "0", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "real", "knn", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "guess", ",", " ", "thing", "[-", "1", "]_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "guess_", "==_", "thing_", "[_", "-_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "correct_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "total_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "total_", "%_", "50_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "print_", "total_", ",_", "'/'_", ",_", "len_", "(_", "testing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "correct_", ",_", "\"/\"_", ",_", "total_", ",_", "\":\"_", ",_", "float_", "(_", "correct_", ")_", "/_", "float_", "(_", "total_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Average", " ", "checks", " ", "per", " ", "query", ":\"_", ",_", "float_", "(_", "foo_", "._", "num", "\\u", "checks_", ")_", "/_", "float_", "(_", "total_", ")_", "\\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_", "tests", "pir", "al_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "for_", "lefto", "ut_", "in_", "xrange_", "(_", "1_", ",_", "11_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "print_", "\"", "Fold", "\"_", ",_", "lefto", "ut_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foo_", "=_", "Fast", "KN", "N_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "xrange_", "(_", "1_", ",_", "11_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "x_", "!=_", "lefto", "ut_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "some", "data_", "=_", "open_", "(_", "\"", "spir", "al", "/", "spir", "alf", "old", "%", "d", ".", "txt", "\"_", "%_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pnt", "s_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls", "s_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "some", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "pb", "bb", "t_", ",_", "x_", ",_", "y_", "=_", "line_", "._", "split_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", ",_", "y_", "=_", "float_", "(_", "x_", ")_", ",_", "float_", "(_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pnt", "s_", "._", "append_", "(_", "(_", "x_", ",_", "y_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls", "s_", "._", "append_", "(_", "line_", "._", "split_", "(_", ")_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "some", "data_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pnt", "s_", "=_", "numpy_", "._", "array_", "(_", "pnt", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foo_", "._", "add", "Evi", "denc", "e_", "(_", "pnt", "s_", ",_", "cls", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "some", "data_", "=_", "open_", "(_", "\"", "spir", "al", "/", "spir", "alf", "old", "%", "d", ".", "txt", "\"_", "%_", "lefto", "ut_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "correct_", "=_", "total_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "some", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "pb", "bb", "t_", ",_", "x_", ",_", "y_", "=_", "line_", "._", "split_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", ",_", "y_", "=_", "float_", "(_", "x_", ")_", ",_", "float_", "(_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "guess_", "=_", "foo_", "._", "query_", "(_", "(_", "x_", ",_", "y_", ")_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "guess", "2", " ", "=", " ", "foo", ".", "query", "((", "x", ",", "y", "),", "10", ",", "slow", "=", "Tru", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "guess", " ", "!=", " ", "guess", "2", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "print", " ", "\"", "Cra", "p", "!\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "print", " ", "guess", ",", "guess", "2", ",(", "x", ",", "y", ",", "pb", "bb", "t", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "guess", ",", " ", "pb", "bb", "t_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "guess_", "==_", "pb", "bb", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "correct_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "total_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "correct_", ",_", "\"/\"_", ",_", "total_", ",_", "\":\"_", ",_", "float_", "(_", "correct_", ")_", "/_", "float_", "(_", "total_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Average", " ", "number", " ", "of", " ", "checks", " ", "per", " ", "query", ":\"_", ",_", "\\u\\u\\uNEWLINE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n# -*- coding: utf-8 -*-\n# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab\n\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\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,\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\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport unittest\n\nfrom pycopia import aid\nfrom pycopia import dictlib\nfrom pycopia import UserFile\nfrom pycopia import getopt\nfrom pycopia import gzip\nfrom pycopia import socket\nfrom pycopia import timelib\nfrom pycopia import tty\nfrom pycopia import urlparse\nfrom pycopia import textutils\nfrom pycopia import timespec\n\n\n\n\nif __name__ == '__main__':\n unittest.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class MyBaseClass(object):\n pass", "metadata": "root.MyBaseClass", "header": "['module', '___EOS___']", "index": 34 }, { "content": "class AidTests(unittest.TestCase):\n\n\n\n\n\n\n\n", "metadata": "root.AidTests", "header": "['module', '___EOS___']", "index": 37 }, { "content": " def setUp(self):\n pass", "metadata": "root.AidTests.setUp", "header": "['class', 'AidTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 38 }, { "content": " def test_mapstr(self):\n TEST = aid.mapstr(\"some%(one)s one\\nsome%(two)s three\\nsome%(three)s four\")\n print(TEST.attributes)\n try:\n print(TEST)\n except ValueError:\n print(\"got correct error from %r\" % TEST)\n TEST.one = \"one\"\n TEST.two = \"thing\"\n TEST.three = \"where\"\n print(TEST)\n s = str(TEST) # makes new, substituted, string\n assert s == \"someone one\\nsomething three\\nsomewhere four\"\n print(TEST.three)", "metadata": "root.AidTests.test_mapstr", "header": "['class', 'AidTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 41 }, { "content": " def test_formatstr(self):\n src = \"one {one} {{notaone}} two {two}\"\n fmt = aid.formatstr(src)\n assert src.format(one=\"ONE\", two=\"TWO\") == fmt(one=\"ONE\", two=\"TWO\")\n assert fmt.attributes == [\"two\", \"one\"]", "metadata": "root.AidTests.test_formatstr", "header": "['class', 'AidTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 56 }, { "content": " def test_newclass(self):\n New = aid.newclass(\"New\", MyBaseClass)\n print(New())", "metadata": "root.AidTests.test_newclass", "header": "['class', 'AidTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 62 }, { "content": " def test_AttrDictWrapper(self):\n ld = {\"one\":1, \"two\":2, \"three\":3}\n gd = {\"gbone\":1, \"gbtwo\":2, \"gbthree\":3}\n lw = dictlib.AttrDictWrapper(ld)\n lw.four = gd\n print(lw.one)\n print(lw.two)\n print(lw.four.gbone)\n print(lw.four[\"gbtwo\"])", "metadata": "root.AidTests.test_AttrDictWrapper", "header": "['class', 'AidTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 66 }, { "content": " def test_AttrDict(self):\n d = dictlib.AttrDict()\n d.one = \"one\"\n print(d)\n print(d.get)\n print(d.one)\n print(d[\"one\"])\n d[\"two\"] = 2\n print(d.two)\n print(d[\"two\"])", "metadata": "root.AidTests.test_AttrDict", "header": "['class', 'AidTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 76 }, { "content": " def test_UserFile(self):\n fd = UserFile.UserFile(\"/etc/hosts\", \"rb\")\n while 1:\n d = fd.read(1024)\n if not d:\n break\n fd.close()", "metadata": "root.AidTests.test_UserFile", "header": "['class', 'AidTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 87 }, { "content": " def test_timelib(self):\n mt = timelib.localtime_mutable()\n print(mt)\n mt.add_seconds(3600)\n print(mt)\n print(timelib.strftime(\"%Y-%m-%d\", timelib.weekof(timelib.time())))\n\n t = timelib.now()\n for d in range(1, 60):\n week = timelib.weekof(t+(d*60*60*24))\n print(timelib.MutableTime(week))\n\n print(\"Local time:\")\n print(timelib.localtimestamp())\n\n p = timespec.TimespecParser()\n for spec, secs in [\n (\"0s\", 0.0),\n (\"3m\", 180.0),\n (\"3.0m\", 180.0),\n (\"3minute+2secs\", 182.0),\n (\"2h 3minute+2.2secs\", 7382.2),\n (\"-3m\", -180.0),\n (\"-3.0m\", -180.0),\n (\"1h3m\", 3780.0),\n (\"1h-3m\", 3420.0),\n (\"1d 3m\", 86580.0)]:\n p.parse(spec)\n self.assert_(p.seconds == secs)\n\n self.assertRaises(ValueError, p.parse, \"12m -m\")", "metadata": "root.AidTests.test_timelib", "header": "['class', 'AidTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 95 }, { "content": " def XXXtest_tty_SerialPort(self):\n # just call some setup methods. This really needs some serial\n # loopback to fully test.\n sp = tty.SerialPort(\"/dev/ttyS0\")\n sp.set_serial(\"9600 8N1\")\n sp.stty(\"-parenb\", \"-parodd\", \"cs8\", \"hupcl\", \"-cstopb\", \"cread\",\n \"clocal\", \"-crtscts\", \"ignbrk\", \"-brkint\", \"ignpar\", \"-parmrk\",\n \"-inpck\", \"-istrip\", \"-inlcr\", \"-igncr\", \"-icrnl\", \"-ixon\",\n \"-ixoff\", \"-iuclc\", \"-ixany\", \"-imaxbel\", \"-opost\", \"-olcuc\",\n \"-ocrnl\", \"onlcr\", \"-onocr\", \"-onlret\", \"-ofill\", \"-ofdel\", \"nl0\",\n \"cr0\", \"tab0\", \"bs0\", \"vt0\", \"ff0\", \"-isig\", \"-icanon\", \"-iexten\",\n \"-echo\", \"echoe\", \"echok\", \"-echonl\", \"-noflsh\", \"-xcase\",\n \"-tostop\", \"-echoprt\", \"echoctl\", \"echoke\")", "metadata": "root.AidTests.XXXtest_tty_SerialPort", "header": "['class', 'AidTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 127 } ]
[ { "span": "from pycopia import getopt", "start_line": 25, "start_column": 0, "end_line": 25, "end_column": 26 }, { "span": "from pycopia import gzip", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 24 }, { "span": "from pycopia import socket", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 26 }, { "span": "from pycopia import urlparse", "start_line": 30, "start_column": 0, "end_line": 30, "end_column": 28 }, { "span": "from pycopia import textutils", "start_line": 31, "start_column": 0, "end_line": 31, "end_column": 29 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python", "2.7", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "vim", ":", "ts", "=", "4", ":", "sw", "=", "4", ":", "soft", "tabs", "top", "=", "4", ":", "smart", "tab", ":", "expand", "tab_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "\\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", ",_", "\\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_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", "\\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_", "division_", "\\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_", "pycopia_", "import_", "aid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "import_", "dict", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "import_", "User", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "import_", "getopt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "import_", "gzip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "import_", "timeli", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "import_", "tty_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "import_", "urlparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "import_", "textu", "tils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "import_", "times", "pec_", "\\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\\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_", "My", "Base", "Class_", "(_", "object_", ")_", ":_", "\\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_", "Aid", "Tests_", "(_", "unittest_", "._", "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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Aid", "Tests_", "(_", "unittest_", "._", "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 ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Aid", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "maps", "tr_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "TEST_", "=_", "aid_", "._", "maps", "tr_", "(_", "\"", "some", "%", "(", "one", ")", "s", " ", "one", "\\\\", "nso", "me", "%", "(", "two", ")", "s", " ", "three", "\\\\", "nso", "me", "%", "(", "three", ")", "s", " ", "four", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "TEST_", "._", "attributes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "TEST_", ")_", "\\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 ", " _", "print_", "(_", "\"", "got", " ", "correct", " ", "error", " ", "from", " ", "%", "r", "\"_", "%_", "TEST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "TEST_", "._", "one_", "=_", "\"", "one", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TEST_", "._", "two_", "=_", "\"", "thing", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TEST_", "._", "three_", "=_", "\"", "where", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "TEST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "str_", "(_", "TEST_", ")_", "#", " ", "make", "s", " ", "new", ",", " ", "substitute", "d", ",", " ", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "s_", "==_", "\"", "some", "one", " ", "one", "\\\\", "nso", "meth", "ing", " ", "three", "\\\\", "nso", "me", "where", " ", "four", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "TEST_", "._", "three_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Aid", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "formats", "tr_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "src_", "=_", "\"", "one", " ", "{", "one", "}", " ", "{{", "nota", "one", "}}", " ", "two", " ", "{", "two", "}\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fmt_", "=_", "aid_", "._", "formats", "tr_", "(_", "src_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "src_", "._", "format_", "(_", "one_", "=_", "\"", "ONE", "\"_", ",_", "two_", "=_", "\"", "TWO", "\"_", ")_", "==_", "fmt_", "(_", "one_", "=_", "\"", "ONE", "\"_", ",_", "two_", "=_", "\"", "TWO", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "fmt_", "._", "attributes_", "==_", "[_", "\"", "two", "\"_", ",_", "\"", "one", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Aid", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "newclass_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "New_", "=_", "aid_", "._", "newclass_", "(_", "\"", "New", "\"_", ",_", "My", "Base", "Class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "New_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Aid", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "Attr", "Dict", "Wrapper_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ld_", "=_", "{_", "\"", "one", "\"_", ":_", "1_", ",_", "\"", "two", "\"_", ":_", "2_", ",_", "\"", "three", "\"_", ":_", "3_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gd_", "=_", "{_", "\"", "gbo", "ne", "\"_", ":_", "1_", ",_", "\"", "gb", "two", "\"_", ":_", "2_", ",_", "\"", "gb", "three", "\"_", ":_", "3_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lw_", "=_", "dict", "lib_", "._", "Attr", "Dict", "Wrapper_", "(_", "ld_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lw_", "._", "four", "_", "=_", "gd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "lw_", "._", "one_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "lw_", "._", "two_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "lw_", "._", "four", "_", "._", "gbo", "ne_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "lw_", "._", "four", "_", "[_", "\"", "gb", "two", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Aid", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "Attr", "Dict_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "dict", "lib_", "._", "Attr", "Dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "one_", "=_", "\"", "one", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "d_", "._", "get_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "d_", "._", "one_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "d_", "[_", "\"", "one", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "[_", "\"", "two", "\"_", "]_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "d_", "._", "two_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "d_", "[_", "\"", "two", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Aid", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "User", "File_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fd_", "=_", "User", "File_", "._", "User", "File_", "(_", "\"/", "etc", "/", "host", "s", "\"_", ",_", "\"", "rb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "fd_", "._", "read_", "(_", "1024_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "d_", ":_", "\\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_", "fd_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Aid", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "timeli", "b_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mt_", "=_", "timeli", "b_", "._", "localt", "ime", "\\u", "mutable", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "mt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mt_", "._", "add", "\\u", "seconds_", "(_", "3600_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "mt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "timeli", "b_", "._", "strftime_", "(_", "\"%", "Y", "-%", "m", "-%", "d", "\"_", ",_", "timeli", "b_", "._", "week", "of_", "(_", "timeli", "b_", "._", "time_", "(_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "=_", "timeli", "b_", "._", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "d_", "in_", "range_", "(_", "1_", ",_", "60_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "week_", "=_", "timeli", "b_", "._", "week", "of_", "(_", "t_", "+_", "(_", "d_", "*_", "60_", "*_", "60_", "*_", "24_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "timeli", "b_", "._", "Mut", "able", "Time_", "(_", "week_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "\"", "Local", " ", "time", ":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "timeli", "b_", "._", "localt", "imes", "tamp", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "=_", "times", "pec_", "._", "Times", "pec", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "spec_", ",_", "secs_", "in_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "0", "s", "\"_", ",_", "0.0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "3", "m", "\"_", ",_", "180.0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "3.0", "m", "\"_", ",_", "180.0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "3", "minute", "+", "2se", "cs", "\"_", ",_", "182", ".0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "2h", " ", "3", "minute", "+", "2.2", "secs", "\"_", ",_", "738", "2.2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"-", "3", "m", "\"_", ",_", "-_", "180.0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"-", "3.0", "m", "\"_", ",_", "-_", "180.0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "1", "h", "3", "m", "\"_", ",_", "378", "0.0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "1", "h", "-", "3", "m", "\"_", ",_", "342", "0.0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "1d", " ", "3", "m", "\"_", ",_", "865", "80.0_", ")_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "._", "parse_", "(_", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "p_", "._", "seconds_", "==_", "secs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "p_", "._", "parse_", ",_", "\"", "1", "2m", " ", "-", "m", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Aid", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "XX", "Xt", "est", "\\u", "tt", "y", "\\u", "Ser", "ial", "Port_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "just", " ", "call", " ", "some", " ", "setup", " ", "method", "s", ".", " ", "Thi", "s", " ", "reall", "y", " ", "need", "s", " ", "some", " ", "serial_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "loopback", " ", "to", " ", "full", "y", " ", "test", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sp_", "=_", "tty_", "._", "Ser", "ial", "Port_", "(_", "\"/", "dev", "/", "tt", "y", "S0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sp_", "._", "set\\u", "serial_", "(_", "\"", "9600", " ", "8", "N1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sp_", "._", "stt", "y_", "(_", "\"-", "paren", "b", "\"_", ",_", "\"-", "par", "odd", "\"_", ",_", "\"", "cs", "8", "\"_", ",_", "\"", "hu", "pcl", "\"_", ",_", "\"-", "cst", "op", "b", "\"_", ",_", "\"", "crea", "d", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "clo", "cal", "\"_", ",_", "\"-", "crt", "sct", "s", "\"_", ",_", "\"", "ign", "br", "k", "\"_", ",_", "\"-", "br", "kin", "t", "\"_", ",_", "\"", "ign", "par", "\"_", ",_", "\"-", "parm", "rk", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"-", "inp", "ck", "\"_", ",_", "\"-", "istr", "ip", "\"_", ",_", "\"-", "inl", "cr", "\"_", ",_", "\"-", "ign", "cr", "\"_", ",_", "\"-", "ic", "rn", "l", "\"_", ",_", "\"-", "ix", "on", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"-", "ix", "off", "\"_", ",_", "\"-", "iu", "cl", "c", "\"_", ",_", "\"-", "ix", "any", "\"_", ",_", "\"-", "imax", "bel", "\"_", ",_", "\"-", "opo", "st", "\"_", ",_", "\"-", "ol", "cuc", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"-", "ocr", "nl", "\"_", ",_", "\"", "onl", "cr", "\"_", ",_", "\"-", "ono", "cr", "\"_", ",_", "\"-", "onl", "ret", "\"_", ",_", "\"-", "ofi", "ll", "\"_", ",_", "\"-", "ofd", "el", "\"_", ",_", "\"", "nl", "0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cr", "0", "\"_", ",_", "\"", "tab", "0", "\"_", ",_", "\"", "bs", "0", "\"_", ",_", "\"", "vt", "0", "\"_", ",_", "\"", "ff", "0", "\"_", ",_", "\"-", "isi", "g", "\"_", ",_", "\"-", "ican", "on", "\"_", ",_", "\"-", "iex", "ten", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"-", "echo", "\"_", ",_", "\"", "echo", "e", "\"_", ",_", "\"", "echo", "k", "\"_", ",_", "\"-", "echo", "nl", "\"_", ",_", "\"-", "nof", "lsh", "\"_", ",_", "\"-", "xc", "ase", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"-", "tost", "op", "\"_", ",_", "\"-", "echo", "prt", "\"_", ",_", "\"", "echo", "ctl", "\"_", ",_", "\"", "echo", "ke", "\"_", ")_", "\\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, 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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 ]
Unused import
AcademicsToday/py-academicstoday/academicstoday_project/account/tests/test_setting.py
[ { "content": "from django.core.urlresolvers import resolve\nfrom django.http import HttpRequest\nfrom django.http import QueryDict\nfrom django.test import TestCase\nfrom django.test import Client\nfrom django.contrib.auth.models import User\nfrom django.contrib.auth import authenticate, login, logout\nfrom django.contrib.auth.decorators import login_required\nimport json\nfrom account.views import setting\n\n\n# Contants\nTEST_USER_EMAIL = \"[email protected]\"\nTEST_USER_USERNAME = \"Ledo\"\nTEST_USER_PASSWORD = \"password\"\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class SettingTestCase(TestCase):\n\n\n\n", "metadata": "root.SettingTestCase", "header": "['module', '___EOS___']", "index": 18 }, { "content": " def tearDown(self):\n User.objects.get(email=TEST_USER_EMAIL).delete()", "metadata": "root.SettingTestCase.tearDown", "header": "['class', 'SettingTestCase', '(', 'TestCase', ')', ':', '___EOS___']", "index": 19 }, { "content": " def setUp(self):\n # Create our user.\n user = User.objects.create_user(\n email=TEST_USER_EMAIL,\n username=TEST_USER_USERNAME,\n password=TEST_USER_PASSWORD\n )\n user.is_active = True\n user.save()", "metadata": "root.SettingTestCase.setUp", "header": "['class', 'SettingTestCase', '(', 'TestCase', ')', ':', '___EOS___']", "index": 22 }, { "content": " def test_url_resolves_to_settings_page_view(self):\n found = resolve('/settings')\n self.assertEqual(found.func, setting.settings_page)", "metadata": "root.SettingTestCase.test_url_resolves_to_settings_page_view", "header": "['class', 'SettingTestCase', '(', 'TestCase', ')', ':', '___EOS___']", "index": 32 }, { "content": " def test_settings_page_with_success(self):\n # Extra parameters to make this a Ajax style request.\n kwargs = {'HTTP_X_REQUESTED_WITH':'XMLHttpRequest'}\n \n # Test\n client = Client()\n client.login(\n username=TEST_USER_USERNAME,\n password=TEST_USER_PASSWORD\n )\n response = client.post('/settings',{}, **kwargs)\n \n # Verify: Check that the response is 200 OK.\n self.assertEqual(response.status_code, 200)\n \n # Verify: Check that donation content was returned.\n self.assertIn(b'New Password',response.content)\n self.assertIn(b'Repeat New Password',response.content)", "metadata": "root.SettingTestCase.test_settings_page_with_success", "header": "['class', 'SettingTestCase', '(', 'TestCase', ')', ':', '___EOS___']", "index": 36 }, { "content": " def test_update_password_success(self):\n # Extra parameters to make this a Ajax style request.\n kwargs = {'HTTP_X_REQUESTED_WITH':'XMLHttpRequest'}\n \n # Test\n client = Client()\n client.login(\n username=TEST_USER_USERNAME,\n password=TEST_USER_PASSWORD\n )\n response = client.post('/update_password',{\n 'password': 'Transhumanism',\n 'repeat_password': 'Transhumanism',\n 'old_password': TEST_USER_PASSWORD,\n }, **kwargs)\n \n # Verify: Check that the response is 200 OK.\n self.assertEqual(response.status_code, 200)\n \n # Verify: Successful response.\n json_string = response.content.decode(encoding='UTF-8')\n array = json.loads(json_string)\n self.assertEqual(array['status'], 'success')\n self.assertEqual(array['message'], 'updated password')", "metadata": "root.SettingTestCase.test_update_password_success", "header": "['class', 'SettingTestCase', '(', 'TestCase', ')', ':', '___EOS___']", "index": 55 } ]
[ { "span": "from django.http import HttpRequest", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 35 }, { "span": "from django.http import QueryDict", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 33 }, { "span": "from django.contrib.auth import authenticate, login, logout", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 59 }, { "span": "from django.contrib.auth.decorators import login_required", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 57 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "resolve_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Query", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "test_", "import_", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "test_", "import_", "Client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "._", "models_", "import_", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "import_", "authenticate_", ",_", "login_", ",_", "logout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "._", "decorators_", "import_", "login", "\\u", "required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "account_", "._", "views_", "import_", "setting_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Conta", "nts_", "\\u\\u\\uNL\\u\\u\\u_", "TEST", "\\u", "USER", "\\u", "EMAIL_", "=_", "\"", "led", "o", "@", "ga", "h", ".", "com", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TEST", "\\u", "USER", "\\u", "USERNAME_", "=_", "\"", "Led", "o", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TEST", "\\u", "USER", "\\u", "PASSWORD_", "=_", "\"", "password", "\"_", "\\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_", "Sett", "ing", "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_", "\\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_", "Sett", "ing", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "User_", "._", "objects_", "._", "get_", "(_", "email_", "=_", "TEST", "\\u", "USER", "\\u", "EMAIL_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sett", "ing", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "e", " ", "our", " ", "user", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "User_", "._", "objects_", "._", "create", "\\u", "user_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "email_", "=_", "TEST", "\\u", "USER", "\\u", "EMAIL_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "username_", "=_", "TEST", "\\u", "USER", "\\u", "USERNAME_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "password_", "=_", "TEST", "\\u", "USER", "\\u", "PASSWORD_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "._", "is", "\\u", "active_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sett", "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", "url", "\\u", "resolve", "s", "\\u", "to", "\\u", "settings", "\\u", "page", "\\u", "view_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "found_", "=_", "resolve_", "(_", "'/", "settings", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "found_", "._", "func_", ",_", "setting_", "._", "settings", "\\u", "page_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sett", "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", "settings", "\\u", "page", "\\u", "with", "\\u", "success_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Extra", " ", "parameter", "s", " ", "to", " ", "make", " ", "this", " ", "a", " ", "Ajax", " ", "style", " ", "request", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "=_", "{_", "'", "HTTP", "\\u", "X", "\\u", "REQUEST", "ED", "\\u", "WITH", "'_", ":_", "'", "XML", "Http", "Request", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "=_", "Client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "login_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "username_", "=_", "TEST", "\\u", "USER", "\\u", "USERNAME_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "password_", "=_", "TEST", "\\u", "USER", "\\u", "PASSWORD_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "client_", "._", "post_", "(_", "'/", "settings", "'_", ",_", "{_", "}_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", ":", " ", "Check", " ", "tha", "t", " ", "the", " ", "response", " ", "is", " ", "200", " ", "OK", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", ":", " ", "Check", " ", "tha", "t", " ", "donation", " ", "content", " ", "was", " ", "return", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "b", "'", "New", " ", "Passw", "ord", "'_", ",_", "response_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "b", "'", "Repeat", " ", "New", " ", "Passw", "ord", "'_", ",_", "response_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sett", "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", "update", "\\u", "password", "\\u", "success_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Extra", " ", "parameter", "s", " ", "to", " ", "make", " ", "this", " ", "a", " ", "Ajax", " ", "style", " ", "request", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "=_", "{_", "'", "HTTP", "\\u", "X", "\\u", "REQUEST", "ED", "\\u", "WITH", "'_", ":_", "'", "XML", "Http", "Request", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "=_", "Client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "login_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "username_", "=_", "TEST", "\\u", "USER", "\\u", "USERNAME_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "password_", "=_", "TEST", "\\u", "USER", "\\u", "PASSWORD_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "client_", "._", "post_", "(_", "'/", "update", "\\u", "password", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "'", "Trans", "human", "ism", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "repeat", "\\u", "password", "'_", ":_", "'", "Trans", "human", "ism", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "old", "\\u", "password", "'_", ":_", "TEST", "\\u", "USER", "\\u", "PASSWORD_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", ":", " ", "Check", " ", "tha", "t", " ", "the", " ", "response", " ", "is", " ", "200", " ", "OK", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", ":", " ", "Success", "ful", " ", "response", "._", "\\u\\u\\uNL\\u\\u\\u_", "json", "\\u", "string_", "=_", "response_", "._", "content_", "._", "decode_", "(_", "encoding_", "=_", "'", "UT", "F", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "array_", "=_", "json_", "._", "loads_", "(_", "json", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "array_", "[_", "'", "status", "'_", "]_", ",_", "'", "success", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "array_", "[_", "'", "message", "'_", "]_", ",_", "'", "update", "d", " ", "password", "'_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
AppScale/appscale/XMPPReceiver/xmpp_receiver.py
[ { "content": "#!/usr/bin/python\n# pylint: disable-msg=E1101\n\n# a script that receives xmpp messages for an app engine app\n# and forwards them to the app, which must have a route\n# exposed at /_ah/xmpp/message/chat/ to receive them\n\n# usage is ./xmpp_receiver.py appname login_ip app-password\n\n\n# General-purpose Python libraries\nimport httplib\nimport logging\nimport os\nimport re\nimport select\nimport sys\nimport urllib\n\n\n# Third-party libraries\n# On AppScale VMs, we use Python 2.7 to run the XMPPReceiver, but because we\n# install the xmpp library for the default Python (Python 2.6), we have to add\n# it to our path.\ntry:\n import xmpp\nexcept ImportError:\n PYTHON_PACKAGES = '/usr/local/lib/python2.7/dist-packages/'\n sys.path.append(PYTHON_PACKAGES + 'xmpppy-0.5.0rc1-py2.7.egg')\n import xmpp\n\n\n\n\nif __name__ == \"__main__\":\n RECEIVER = XMPPReceiver(sys.argv[1], sys.argv[2], sys.argv[3])\n while True:\n RECEIVER.listen_for_messages()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class XMPPReceiver():\n \"\"\"XMPPReceiver provides callers with a way to receive XMPP messages on\n behalf of Google App Engine applications. The receiver will POST any\n received message to an App Server that runs the app, and will respond\n to presence notifications that users may send to it.\n \"\"\"\n\n\n # The headers necessary for posting XMPP messages to App Engine apps.\n HEADERS = {\n 'Content-Type' : 'application/x-www-form-urlencoded'\n }\n\n\n\n\n\n\n\n", "metadata": "root.XMPPReceiver", "header": "['module', '___EOS___']", "index": 32 }, { "content": " def __init__(self, appid, login_ip, app_password):\n \"\"\"Creates a new XMPPReceiver, which will listen for XMPP messages for\n an App Engine app.\n\n Args:\n appid: A str representing the application ID that this XMPPReceiver\n should poll on behalf of.\n login_ip: A str representing the IP address or FQDN that runs the\n full proxy nginx service, sitting in front of the app we'll be\n posting messages to.\n app_password: A str representing the password associated with the\n XMPP user account for the Google App Engine app that the receiver\n will log in on behalf of.\n \"\"\"\n self.appid = appid\n self.login_ip = login_ip\n self.app_password = app_password\n\n with open(\"/etc/appscale/port-{0}.txt\".format(self.appid)) as file_handle:\n self.app_port = int(file_handle.read().strip())\n\n self.my_jid = self.appid + \"@\" + self.login_ip\n log_file = \"/var/log/appscale/xmppreceiver-{0}.log\".format(self.my_jid)\n sys.stderr = open(log_file, 'a')\n logging.basicConfig(level=logging.INFO,\n format='%(asctime)s %(levelname)s %(message)s',\n filename=log_file,\n filemode='a')\n logging.info(\"Started receiver script for {0}\".format(self.my_jid))", "metadata": "root.XMPPReceiver.__init__", "header": "['class', 'XMPPReceiver', '(', ')', ':', '___EOS___']", "index": 46 }, { "content": " def xmpp_message(self, _, event):\n \"\"\"Responds to the receipt of an XMPP message, by finding an App Server that\n hosts the given application and POSTing the message's payload to it.\n\n Args:\n _: The connection that the message was received on (not used).\n event: The actual message that was received.\n \"\"\"\n logging.info(\"received a message from {0}, with body {1}\" \\\n .format(event.getFrom().getStripped(), event.getBody()))\n logging.info(\"message type is {0}\".format(event.getType))\n from_jid = event.getFrom().getStripped()\n params = {}\n params['from'] = from_jid\n params['to'] = self.my_jid\n params['body'] = event.getBody()\n encoded_params = urllib.urlencode(params)\n\n try:\n logging.debug(\"Attempting to open connection to {0}:{1}\".format(\n self.login_ip, self.app_port))\n connection = httplib.HTTPConnection(self.login_ip, self.app_port)\n connection.request('POST', '/_ah/xmpp/message/chat/', encoded_params,\n self.HEADERS)\n response = connection.getresponse()\n logging.info(\"POST XMPP message returned status of {0}\".format(\n response.status))\n connection.close()\n except Exception as e:\n logging.exception(e)", "metadata": "root.XMPPReceiver.xmpp_message", "header": "['class', 'XMPPReceiver', '(', ')', ':', '___EOS___']", "index": 77 }, { "content": " def xmpp_presence(self, conn, event):\n \"\"\"Responds to the receipt of a presence message, by telling the sender\n that we are subscribing to their presence and that they should do the same.\n\n Args:\n conn: The connection that the message was received on.\n event: The actual message that was received.\n \"\"\"\n logging.info(\"received a presence from {0}, with payload {1}\" \\\n .format(event.getFrom().getStripped(), event.getPayload()))\n prs_type = event.getType()\n logging.info(\"presence type is {0}\".format(prs_type))\n who = event.getFrom()\n if prs_type == \"subscribe\":\n conn.send(xmpp.Presence(to=who, typ='subscribed'))\n conn.send(xmpp.Presence(to=who, typ='subscribe'))", "metadata": "root.XMPPReceiver.xmpp_presence", "header": "['class', 'XMPPReceiver', '(', ')', ':', '___EOS___']", "index": 109 }, { "content": " def listen_for_messages(self, messages_to_listen_for=-1):\n \"\"\"Polls the XMPP server for messages, responding to any that are seen.\n\n Args:\n messages_to_listen_for: An int that represents how many messages we\n should listen for. If set to the default value (-1), then we listen\n for an infinite number of messages.\n Returns:\n An int that indicates how many messages were processed.\n \"\"\"\n jid = xmpp.protocol.JID(self.my_jid)\n client = xmpp.Client(jid.getDomain(), debug=[])\n\n if not client.connect():\n logging.info(\"Could not connect\")\n raise SystemExit(\"Could not connect to XMPP server at {0}\" \\\n .format(self.login_ip))\n\n if not client.auth(jid.getNode(), self.app_password,\n resource=jid.getResource()):\n logging.info(\"Could not authenticate with username {0}, password {1}\" \\\n .format(jid.getNode(), self.app_password))\n raise SystemExit(\"Could not authenticate to XMPP server at {0}\" \\\n .format(self.login_ip))\n\n client.RegisterHandler('message', self.xmpp_message)\n client.RegisterHandler('presence', self.xmpp_presence)\n\n client.sendInitPresence(requestRoster=0)\n\n socketlist = {client.Connection._sock:'xmpp'}\n\n logging.info(\"About to begin processing requests\")\n\n messages_processed = 0\n while messages_processed != messages_to_listen_for:\n (input_data, _, __) = select.select(socketlist.keys(), [], [], 1)\n for _ in input_data:\n try:\n client.Process(1)\n messages_processed += 1\n except xmpp.protocol.Conflict:\n logging.info(\"Lost connection after processing {0} messages\" \\\n .format(messages_processed))\n return messages_processed\n\n return messages_processed", "metadata": "root.XMPPReceiver.listen_for_messages", "header": "['class', 'XMPPReceiver', '(', ')', ':', '___EOS___']", "index": 127 } ]
[ { "span": "import os", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 9 }, { "span": "import re", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "-", "msg", "=", "E1", "101_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "script", " ", "tha", "t", " ", "receive", "s", " ", "xmpp", " ", "message", "s", " ", "for", " ", "an", " ", "app", " ", "eng", "ine", " ", "app_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "forward", "s", " ", "them", " ", "to", " ", "the", " ", "app", ",", " ", "whi", "ch", " ", "must", " ", "have", " ", "a", " ", "route_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "exposed", " ", "at", " ", "/\\u", "ah", "/", "xmpp", "/", "message", "/", "chat", "/", " ", "to", " ", "receive", " ", "them", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "usage", " ", "is", " ", "./", "xmpp", "\\u", "receive", "r", ".", "py", " ", "app", "name", " ", "login", "\\u", "ip", " ", "app", "-", "password_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "General", "-", "purpose", " ", "Pyth", "on", " ", "libraries_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "httplib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "select_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "rd", "-", "part", "y", " ", "libraries_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "On", " ", "App", "Scale", " ", "VM", "s", ",", " ", "we", " ", "use", " ", "Pyth", "on", " ", "2.7", " ", "to", " ", "run", " ", "the", " ", "XMPP", "Receive", "r", ",", " ", "but", " ", "bec", "aus", "e", " ", "we", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "install", " ", "the", " ", "xmpp", " ", "librar", "y", " ", "for", " ", "the", " ", "default", " ", "Pyth", "on", " ", "(", "Pyth", "on", " ", "2.6", "),", " ", "we", " ", "have", " ", "to", " ", "add_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", " ", "to", " ", "our", " ", "path", "._", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "xmpp_", "\\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 ", " _", "PYTHON", "\\u", "PACKAGES", "_", "=_", "'/", "usr", "/", "local", "/", "lib", "/", "python", "2.7", "/", "dist", "-", "package", "s", "/'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "PYTHON", "\\u", "PACKAGES", "_", "+_", "'", "xmpp", "py", "-0", ".5", ".0", "rc", "1", "-", "py2", ".7", ".", "egg", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "xmpp_", "\\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 ", " _", "RECEIVE", "R_", "=_", "XMPP", "Receiver_", "(_", "sys_", "._", "argv_", "[_", "1_", "]_", ",_", "sys_", "._", "argv_", "[_", "2_", "]_", ",_", "sys_", "._", "argv_", "[_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "RECEIVE", "R_", "._", "listen", "\\u", "for", "\\u", "messages_", "(_", ")_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "XMPP", "Receiver_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "XMPP", "Receive", "r", " ", "provide", "s", " ", "caller", "s", " ", "with", " ", "a", " ", "way", " ", "to", " ", "receive", " ", "XMPP", " ", "message", "s", " ", "on", "\\", "10", ";", " ", " ", "beha", "lf", " ", "of", " ", "Goo", "gle", " ", "App", " ", "Engine", " ", "applica", "tion", "s", ".", " ", "The", " ", "receive", "r", " ", "will", " ", "POST", " ", "any", "\\", "10", ";", " ", " ", "receive", "d", " ", "message", " ", "to", " ", "an", " ", "App", " ", "Server", " ", "tha", "t", " ", "runs", " ", "the", " ", "app", ",", " ", "and", " ", "will", " ", "respond", "\\", "10", ";", " ", " ", "to", " ", "presen", "ce", " ", "notification", "s", " ", "tha", "t", " ", "users", " ", "may", " ", "send", " ", "to", " ", "it", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "header", "s", " ", "necessar", "y", " ", "for", " ", "posting", " ", "XMPP", " ", "message", "s", " ", "to", " ", "App", " ", "Engine", " ", "apps", "._", "\\u\\u\\uNL\\u\\u\\u_", "HEADERS_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Conten", "t", "-", "Type", "'_", ":_", "'", "applica", "tion", "/", "x", "-", "www", "-", "form", "-", "url", "encode", "d", "'_", "\\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_", "XMPP", "Receiver_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "appid", "_", ",_", "login", "\\u", "ip_", ",_", "app", "\\u", "password_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "es", " ", "a", " ", "new", " ", "XMPP", "Receive", "r", ",", " ", "whi", "ch", " ", "will", " ", "listen", " ", "for", " ", "XMPP", " ", "message", "s", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "an", " ", "App", " ", "Engine", " ", "app", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "appid", ":", " ", "A", " ", "str", " ", "represent", "ing", " ", "the", " ", "applica", "tion", " ", "ID", " ", "tha", "t", " ", "this", " ", "XMPP", "Receive", "r", "\\", "10", ";", " ", " ", " ", " ", "shou", "ld", " ", "poll", " ", "on", " ", "beha", "lf", " ", "of", ".", "\\", "10", ";", " ", " ", "login", "\\u", "ip", ":", " ", "A", " ", "str", " ", "represent", "ing", " ", "the", " ", "IP", " ", "address", " ", "or", " ", "FQ", "DN", " ", "tha", "t", " ", "runs", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "full", " ", "proxy", " ", "ngin", "x", " ", "service", ",", " ", "sit", "ting", " ", "in", " ", "front", " ", "of", " ", "the", " ", "app", " ", "we", "'", "ll", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "posting", " ", "message", "s", " ", "to", ".", "\\", "10", ";", " ", " ", "app", "\\u", "password", ":", " ", "A", " ", "str", " ", "represent", "ing", " ", "the", " ", "password", " ", "associate", "d", " ", "with", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "XMPP", " ", "user", " ", "account", " ", "for", " ", "the", " ", "Goo", "gle", " ", "App", " ", "Engine", " ", "app", " ", "tha", "t", " ", "the", " ", "receive", "r", "\\", "10", ";", " ", " ", " ", " ", "will", " ", "log", " ", "in", " ", "on", " ", "beha", "lf", " ", "of", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "appid", "_", "=_", "appid", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "login", "\\u", "ip_", "=_", "login", "\\u", "ip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "app", "\\u", "password_", "=_", "app", "\\u", "password_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "open_", "(_", "\"/", "etc", "/", "apps", "cale", "/", "port", "-", "{", "0", "}.", "txt", "\"_", "._", "format_", "(_", "self_", "._", "appid", "_", ")_", ")_", "as_", "file", "\\u", "handle_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "app", "\\u", "port_", "=_", "int_", "(_", "file", "\\u", "handle_", "._", "read_", "(_", ")_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "my", "\\u", "jid_", "=_", "self_", "._", "appid", "_", "+_", "\"@\"_", "+_", "self_", "._", "login", "\\u", "ip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "\\u", "file_", "=_", "\"/", "var", "/", "log", "/", "apps", "cale", "/", "xmpp", "receive", "r", "-", "{", "0", "}.", "log", "\"_", "._", "format_", "(_", "self_", "._", "my", "\\u", "jid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stderr_", "=_", "open_", "(_", "log", "\\u", "file_", ",_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "basic", "Config_", "(_", "level_", "=_", "logging_", "._", "INFO_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "format_", "=_", "'%", "(", "asc", "time", ")", "s", " ", "%", "(", "level", "name", ")", "s", " ", "%", "(", "message", ")", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filename_", "=_", "log", "\\u", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filem", "ode_", "=_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "Start", "ed", " ", "receive", "r", " ", "script", " ", "for", " ", "{", "0", "}\"_", "._", "format_", "(_", "self_", "._", "my", "\\u", "jid_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "XMPP", "Receiver_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "xmpp", "\\u", "message_", "(_", "self_", ",_", "\\u_", ",_", "event_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Respo", "nd", "s", " ", "to", " ", "the", " ", "receipt", " ", "of", " ", "an", " ", "XMPP", " ", "message", ",", " ", "by", " ", "finding", " ", "an", " ", "App", " ", "Server", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "host", "s", " ", "the", " ", "give", "n", " ", "applica", "tion", " ", "and", " ", "POST", "ing", " ", "the", " ", "message", "'", "s", " ", "payload", " ", "to", " ", "it", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "\\u", ":", " ", "The", " ", "connecti", "on", " ", "tha", "t", " ", "the", " ", "message", " ", "was", " ", "receive", "d", " ", "on", " ", "(", "not", " ", "used", ").", "\\", "10", ";", " ", " ", "event", ":", " ", "The", " ", "actual", " ", "message", " ", "tha", "t", " ", "was", " ", "receive", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "receive", "d", " ", "a", " ", "message", " ", "from", " ", "{", "0", "},", " ", "with", " ", "body", " ", "{", "1", "}\"_", "._", "format_", "(_", "event_", "._", "get", "From_", "(_", ")_", "._", "get", "Strip", "ped_", "(_", ")_", ",_", "event_", "._", "get", "Body_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "message", " ", "type", " ", "is", " ", "{", "0", "}\"_", "._", "format_", "(_", "event_", "._", "get", "Type_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from", "\\u", "jid_", "=_", "event_", "._", "get", "From_", "(_", ")_", "._", "get", "Strip", "ped_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "[_", "'", "from", "'_", "]_", "=_", "from", "\\u", "jid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "[_", "'", "to", "'_", "]_", "=_", "self_", "._", "my", "\\u", "jid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "[_", "'", "body", "'_", "]_", "=_", "event_", "._", "get", "Body_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encode", "d\\u", "params_", "=_", "urllib_", "._", "urlencode_", "(_", "params_", ")_", "\\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 ", " _", "logging_", "._", "debug_", "(_", "\"", "Atte", "mpt", "ing", " ", "to", " ", "open", " ", "connecti", "on", " ", "to", " ", "{", "0", "}:", "{", "1", "}\"_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "login", "\\u", "ip_", ",_", "self_", "._", "app", "\\u", "port_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connection_", "=_", "httplib_", "._", "HTTP", "Connection_", "(_", "self_", "._", "login", "\\u", "ip_", ",_", "self_", "._", "app", "\\u", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connection_", "._", "request_", "(_", "'", "POST", "'_", ",_", "'/\\", "ua", "h", "/", "xmpp", "/", "message", "/", "chat", "/'_", ",_", "encode", "d\\u", "params_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "HEADERS_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "connection_", "._", "getresponse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "POST", " ", "XMPP", " ", "message", " ", "return", "ed", " ", "status", " ", "of", " ", "{", "0", "}\"_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "._", "status_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connection_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "exception_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "XMPP", "Receiver_", "(_", ")_", ":_", "\\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_", "xmpp", "\\u", "presence_", "(_", "self_", ",_", "conn_", ",_", "event_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Respo", "nd", "s", " ", "to", " ", "the", " ", "receipt", " ", "of", " ", "a", " ", "presen", "ce", " ", "message", ",", " ", "by", " ", "tell", "ing", " ", "the", " ", "sender", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "we", " ", "are", " ", "subsc", "rib", "ing", " ", "to", " ", "thei", "r", " ", "presen", "ce", " ", "and", " ", "tha", "t", " ", "the", "y", " ", "shou", "ld", " ", "do", " ", "the", " ", "same", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "conn", ":", " ", "The", " ", "connecti", "on", " ", "tha", "t", " ", "the", " ", "message", " ", "was", " ", "receive", "d", " ", "on", ".", "\\", "10", ";", " ", " ", "event", ":", " ", "The", " ", "actual", " ", "message", " ", "tha", "t", " ", "was", " ", "receive", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "receive", "d", " ", "a", " ", "presen", "ce", " ", "from", " ", "{", "0", "},", " ", "with", " ", "payload", " ", "{", "1", "}\"_", "._", "format_", "(_", "event_", "._", "get", "From_", "(_", ")_", "._", "get", "Strip", "ped_", "(_", ")_", ",_", "event_", "._", "get", "Payload_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prs", "\\u", "type_", "=_", "event_", "._", "get", "Type_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "presen", "ce", " ", "type", " ", "is", " ", "{", "0", "}\"_", "._", "format_", "(_", "prs", "\\u", "type_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "who_", "=_", "event_", "._", "get", "From_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "prs", "\\u", "type_", "==_", "\"", "subscribe", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "._", "send_", "(_", "xmpp_", "._", "Presence", "_", "(_", "to_", "=_", "who_", ",_", "typ_", "=_", "'", "subscribed", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "._", "send_", "(_", "xmpp_", "._", "Presence", "_", "(_", "to_", "=_", "who_", ",_", "typ_", "=_", "'", "subscribe", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "XMPP", "Receiver_", "(_", ")_", ":_", "\\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_", "listen", "\\u", "for", "\\u", "messages_", "(_", "self_", ",_", "message", "s", "\\u", "to", "\\u", "listen", "\\u", "for_", "=_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Poll", "s", " ", "the", " ", "XMPP", " ", "server", " ", "for", " ", "message", "s", ",", " ", "respond", "ing", " ", "to", " ", "any", " ", "tha", "t", " ", "are", " ", "see", "n", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "message", "s", "\\u", "to", "\\u", "listen", "\\u", "for", ":", " ", "An", " ", "int", " ", "tha", "t", " ", "represent", "s", " ", "how", " ", "many", " ", "message", "s", " ", "we", "\\", "10", ";", " ", " ", " ", " ", "shou", "ld", " ", "listen", " ", "for", ".", " ", "If", " ", "set", " ", "to", " ", "the", " ", "default", " ", "value", " ", "(-", "1", "),", " ", "then", " ", "we", " ", "listen", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "an", " ", "infini", "te", " ", "number", " ", "of", " ", "message", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "An", " ", "int", " ", "tha", "t", " ", "indicat", "es", " ", "how", " ", "many", " ", "message", "s", " ", "wer", "e", " ", "process", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jid_", "=_", "xmpp_", "._", "protocol_", "._", "JID", "_", "(_", "self_", "._", "my", "\\u", "jid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "=_", "xmpp_", "._", "Client_", "(_", "jid_", "._", "get", "Domain_", "(_", ")_", ",_", "debug_", "=_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "client_", "._", "connect_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "info_", "(_", "\"", "Cou", "ld", " ", "not", " ", "connect", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "System", "Exit_", "(_", "\"", "Cou", "ld", " ", "not", " ", "connect", " ", "to", " ", "XMPP", " ", "server", " ", "at", " ", "{", "0", "}\"_", "._", "format_", "(_", "self_", "._", "login", "\\u", "ip_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "client_", "._", "auth_", "(_", "jid_", "._", "get", "Node_", "(_", ")_", ",_", "self_", "._", "app", "\\u", "password_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "resource_", "=_", "jid_", "._", "get", "Resource_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "info_", "(_", "\"", "Cou", "ld", " ", "not", " ", "authenticat", "e", " ", "with", " ", "user", "name", " ", "{", "0", "},", " ", "password", " ", "{", "1", "}\"_", "._", "format_", "(_", "jid_", "._", "get", "Node_", "(_", ")_", ",_", "self_", "._", "app", "\\u", "password_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "System", "Exit_", "(_", "\"", "Cou", "ld", " ", "not", " ", "authenticat", "e", " ", "to", " ", "XMPP", " ", "server", " ", "at", " ", "{", "0", "}\"_", "._", "format_", "(_", "self_", "._", "login", "\\u", "ip_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "client_", "._", "Register", "Handler_", "(_", "'", "message", "'_", ",_", "self_", "._", "xmpp", "\\u", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "Register", "Handler_", "(_", "'", "presen", "ce", "'_", ",_", "self_", "._", "xmpp", "\\u", "presence_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "send", "Ini", "t", "Presence", "_", "(_", "request", "Ros", "ter_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "socket", "list_", "=_", "{_", "client_", "._", "Connection_", "._", "\\u", "sock_", ":_", "'", "xmpp", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "Abo", "ut", " ", "to", " ", "begin", " ", "process", "ing", " ", "request", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "message", "s", "\\u", "processed_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "message", "s", "\\u", "processed_", "!=_", "message", "s", "\\u", "to", "\\u", "listen", "\\u", "for_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "input", "\\u", "data_", ",_", "\\u_", ",_", "\\u\\u_", ")_", "=_", "select_", "._", "select_", "(_", "socket", "list_", "._", "keys_", "(_", ")_", ",_", "[_", "]_", ",_", "[_", "]_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "\\u_", "in_", "input", "\\u", "data_", ":_", "\\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 ", " _", "client_", "._", "Process_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message", "s", "\\u", "processed_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "xmpp_", "._", "protocol_", "._", "Conflict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "info_", "(_", "\"", "Lost", " ", "connecti", "on", " ", "after", " ", "process", "ing", " ", "{", "0", "}", " ", "message", "s", "\"_", "._", "format_", "(_", "message", "s", "\\u", "processed_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "message", "s", "\\u", "processed_", "\\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_", "message", "s", "\\u", "processed_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 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 ]
Modification of parameter with default
xraypy/xraylarch/plugins/wx/xrfdisplay_utils.py
[ { "content": " def onLine(self, event=None, checked=None, label=None, lines=[]):\n if checked is None:\n try:\n checked =event.IsChecked()\n except:\n pass\n if checked is None: checked = False\n\n if label in lines and not checked:\n lines.remove(label)\n elif label not in lines and checked:\n lines.append(label)\n if self.parent.selected_elem is not None:\n self.parent.onShowLines(elem=self.parent.selected_elem)", "metadata": "root.XrayLinesFrame.onLine", "header": "['class', 'XrayLinesFrame', '(', 'wx', '.', 'Frame', ')', ':', '___EOS___']", "index": 333 } ]
[ { "span": "lines.", "start_line": 342, "start_column": 12, "end_line": 342, "end_column": 17 }, { "span": "lines.", "start_line": 344, "start_column": 12, "end_line": 344, "end_column": 17 } ]
[ { "span": "lines=", "start_line": 333, "start_column": 59, "end_line": 333, "end_column": 64 } ]
1
true
[ "[CLS]_", "Modifica", "tion_", "of_", "parameter_", "with_", "default_", "[SEP]_", "class_", "Xr", "ay", "Line", "s", "Frame_", "(_", "wx_", "._", "Frame_", ")_", ":_", "\\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_", "on", "Line_", "(_", "self_", ",_", "event_", "=_", "None_", ",_", "checked_", "=_", "None_", ",_", "label_", "=_", "None_", ",_", "lines_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "checked_", "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 ", " _", "checked_", "=_", "event_", "._", "Is", "Checked_", "(_", ")_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "checked_", "is_", "None_", ":_", "checked_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "label_", "in_", "lines_", "and_", "not_", "checked_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lines_", "._", "remove_", "(_", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "label_", "not_", "in_", "lines_", "and_", "checked_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lines_", "._", "append_", "(_", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "parent_", "._", "selecte", "d\\u", "elem_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "parent_", "._", "on", "Show", "Lines_", "(_", "elem_", "=_", "self_", "._", "parent_", "._", "selecte", "d\\u", "elem_", ")_", "\\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, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 'global' at module level
jkcom/SublimeRJS/core/factory.py
[ { "content": "import sys\nsys.path.append(\"core\")\n\nimport os\nimport model\nimport editor\nimport ntpath\n\nglobal shadowList\n\nglobal createConfig\ncreateConfig = {}\n\nglobal context\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "global shadowList", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 17 }, { "span": "global createConfig", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 19 }, { "span": "global context", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Use_", "of_", "'", "global", "'_", "at_", "module_", "level_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "\"", "core", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "editor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ntpath", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "global_", "shadow", "List_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "global_", "create", "Config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "Config_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "global_", "context_", "\\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\\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_" ]
[ 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, 0, 1, 1, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
ppwwyyxx/tensorpack/tensorpack/train/trainer.py
[ { "content": "# -*- coding: UTF-8 -*-\n# File: trainer.py\n# Author: Yuxin Wu <[email protected]>\n\nimport tensorflow as tf\nimport threading\nimport copy\nimport re\nimport functools\nfrom six.moves import zip\n\nfrom .base import Trainer\nfrom ..dataflow.common import RepeatedData\nfrom ..utils import *\nfrom ..utils.concurrency import LoopThread\nfrom ..tfutils.summary import summary_moving_average\nfrom ..tfutils import *\n\n__all__ = ['SimpleTrainer', 'QueueInputTrainer', 'start_train']\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class SimpleTrainer(Trainer):\n\n", "metadata": "root.SimpleTrainer", "header": "['module', '___EOS___']", "index": 20 }, { "content": " def run_step(self):\n data = next(self.data_producer)\n feed = dict(zip(self.input_vars, data))\n self.sess.run([self.train_op], feed_dict=feed) # faster since train_op return None", "metadata": "root.SimpleTrainer.run_step", "header": "['class', 'SimpleTrainer', '(', 'Trainer', ')', ':', '___EOS___']", "index": 21 }, { "content": " def train(self):\n model = self.model\n input_vars = model.get_input_vars()\n self.input_vars = input_vars\n cost_var = model.get_cost(input_vars, is_training=True)\n avg_maintain_op = summary_moving_average(cost_var)\n\n grads = self.config.optimizer.compute_gradients(cost_var)\n grads = self.process_grads(grads)\n\n self.train_op = tf.group(\n self.config.optimizer.apply_gradients(grads, get_global_step_var()),\n avg_maintain_op)\n\n self.init_session_and_coord()\n # create an infinte data producer\n self.data_producer = RepeatedData(self.config.dataset, -1).get_data()\n self.main_loop()", "metadata": "root.SimpleTrainer.train", "header": "['class', 'SimpleTrainer', '(', 'Trainer', ')', ':', '___EOS___']", "index": 26 }, { "content": " def _trigger_epoch(self):\n if self.summary_op is not None:\n data = next(self.data_producer)\n feed = dict(zip(self.input_vars, data))\n summary_str = self.summary_op.eval(feed_dict=feed)\n self._process_summary(summary_str)", "metadata": "root.SimpleTrainer._trigger_epoch", "header": "['class', 'SimpleTrainer', '(', 'Trainer', ')', ':', '___EOS___']", "index": 45 }, { "content": "class EnqueueThread(threading.Thread):\n", "metadata": "root.EnqueueThread", "header": "['module', '___EOS___']", "index": 52 }, { "content": " def __init__(self, trainer, queue, enqueue_op, raw_input_var):\n super(EnqueueThread, self).__init__()\n self.sess = trainer.sess\n self.coord = trainer.coord\n self.dataflow = RepeatedData(trainer.config.dataset, -1)\n\n self.input_vars = raw_input_var\n self.op = enqueue_op\n self.queue = queue\n self.close_op = self.queue.close(cancel_pending_enqueues=True)\n\n self.daemon = True", "metadata": "root.EnqueueThread.__init__", "header": "['class', 'EnqueueThread', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 53 }, { "content": " def run(self):\n try:\n while True:\n for dp in self.dataflow.get_data():\n if self.coord.should_stop():\n return\n feed = dict(zip(self.input_vars, dp))\n self.op.run(feed_dict=feed, session=self.sess)\n except tf.errors.CancelledError as e:\n pass\n except Exception:\n logger.exception(\"Exception in EnqueueThread:\")\n self.sess.run(self.close_op)\n self.coord.request_stop()\n finally:\n logger.info(\"Enqueue Thread Exited.\")", "metadata": "root.EnqueueThread.run", "header": "['class', 'EnqueueThread', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 66 }, { "content": "class QueueInputTrainer(Trainer):\n \"\"\"\n Trainer which builds a FIFO queue for input.\n Support multi GPU.\n \"\"\"\n\n\n\n\n\n\n\n\n", "metadata": "root.QueueInputTrainer", "header": "['module', '___EOS___']", "index": 84 }, { "content": " def __init__(self, config, input_queue=None, async=False):\n \"\"\"\n :param config: a `TrainConfig` instance\n :param input_queue: a `tf.QueueBase` instance to be used to buffer datapoints.\n Defaults to a FIFO queue of size 100.\n \"\"\"\n super(QueueInputTrainer, self).__init__(config)\n self.input_vars = self.model.get_input_vars()\n if input_queue is None:\n self.input_queue = tf.FIFOQueue(\n 100, [x.dtype for x in self.input_vars], name='input_queue')\n else:\n self.input_queue = input_queue\n self.async = async\n if self.async:\n assert self.config.nr_tower > 1", "metadata": "root.QueueInputTrainer.__init__", "header": "['class', 'QueueInputTrainer', '(', 'Trainer', ')', ':', '___EOS___']", "index": 90 }, { "content": " @staticmethod\n def _average_grads(tower_grads):\n ret = []\n for grad_and_vars in zip(*tower_grads):\n v = grad_and_vars[0][1]\n try:\n grad = tf.add_n([x[0] for x in grad_and_vars]) / float(len(tower_grads))\n except AssertionError:\n logger.error(\"Error while processing gradients of {}\".format(v.name))\n raise\n ret.append((grad, v))\n return ret", "metadata": "root.QueueInputTrainer._average_grads", "header": "['class', 'QueueInputTrainer', '(', 'Trainer', ')', ':', '___EOS___']", "index": 107 }, { "content": " def _get_model_inputs(self):\n \"\"\" Dequeue a datapoint from input_queue and return\"\"\"\n ret = self.input_queue.dequeue()\n if isinstance(ret, tf.Tensor): # only one input\n ret = [ret]\n assert len(ret) == len(self.input_vars)\n for qv, v in zip(ret, self.input_vars):\n qv.set_shape(v.get_shape())\n return ret", "metadata": "root.QueueInputTrainer._get_model_inputs", "header": "['class', 'QueueInputTrainer', '(', 'Trainer', ')', ':', '___EOS___']", "index": 120 }, { "content": " def _single_tower_grad(self):\n \"\"\" Get grad and cost for single-tower case\"\"\"\n model_inputs = self._get_model_inputs()\n cost_var = self.model.get_cost(model_inputs, is_training=True)\n grads = self.config.optimizer.compute_gradients(cost_var)\n tf.add_to_collection(MOVING_SUMMARY_VARS_KEY, cost_var)\n return grads", "metadata": "root.QueueInputTrainer._single_tower_grad", "header": "['class', 'QueueInputTrainer', '(', 'Trainer', ')', ':', '___EOS___']", "index": 130 }, { "content": " def _multi_tower_grads(self):\n logger.info(\"Training a model of {} tower\".format(self.config.nr_tower))\n\n # to avoid repeated summary from each device\n collect_dedup = [tf.GraphKeys.SUMMARIES, MOVING_SUMMARY_VARS_KEY]\n kept_summaries = {}\n\n grad_list = []\n for i in range(self.config.nr_tower):\n with tf.device('/gpu:{}'.format(i)), \\\n tf.name_scope('tower{}'.format(i)) as scope:\n logger.info(\"Building graph for tower {}...\".format(i))\n model_inputs = self._get_model_inputs() # each tower dequeue from input queue\n cost_var = self.model.get_cost(model_inputs, is_training=True) # build tower\n\n # gate_gradienst=0 seems to be faster?\n grad_list.append(\n self.config.optimizer.compute_gradients(cost_var, gate_gradients=0))\n\n if i == 0:\n tf.add_to_collection(MOVING_SUMMARY_VARS_KEY, cost_var)\n tf.get_variable_scope().reuse_variables()\n for k in collect_dedup:\n kept_summaries[k] = copy.copy(tf.get_collection(k))\n for k in collect_dedup:\n del tf.get_collection_ref(k)[:]\n tf.get_collection_ref(k).extend(kept_summaries[k])\n return grad_list", "metadata": "root.QueueInputTrainer._multi_tower_grads", "header": "['class', 'QueueInputTrainer', '(', 'Trainer', ')', ':', '___EOS___']", "index": 138 }, { "content": " def train(self):\n enqueue_op = self.input_queue.enqueue(self.input_vars)\n\n if self.config.nr_tower > 1:\n grad_list = self._multi_tower_grads()\n if not self.async:\n grads = QueueInputTrainer._average_grads(grad_list)\n grads = self.process_grads(grads)\n else:\n grad_list = [self.process_grads(g) for g in grad_list]\n # pretend to average the grads, in order to make async and\n # sync have consistent effective learning rate\n def scale(grads):\n return [(grad / self.config.nr_tower, var) for grad, var in grads]\n grad_list = map(scale, grad_list)\n grads = grad_list[0] # use grad from the first tower for routinely stuff\n else:\n grads = self._single_tower_grad()\n grads = self.process_grads(grads)\n\n self.train_op = tf.group(\n self.config.optimizer.apply_gradients(grads, get_global_step_var()),\n summary_moving_average())\n\n if self.async:\n self.threads = []\n for k in range(1, self.config.nr_tower):\n train_op = self.config.optimizer.apply_gradients(grad_list[k])\n f = lambda op=train_op: self.sess.run([op]) # avoid late-binding\n th = LoopThread(f)\n th.pause()\n th.start()\n self.threads.append(th)\n self.async_running = False\n\n self.init_session_and_coord()\n # create a thread that keeps filling the queue\n self.input_th = EnqueueThread(self, self.input_queue, enqueue_op, self.input_vars)\n self.main_loop()", "metadata": "root.QueueInputTrainer.train", "header": "['class', 'QueueInputTrainer', '(', 'Trainer', ')', ':', '___EOS___']", "index": 167 }, { "content": " def _start_all_threads(self):\n super(QueueInputTrainer, self)._start_all_threads()\n self.input_th.start()", "metadata": "root.QueueInputTrainer._start_all_threads", "header": "['class', 'QueueInputTrainer', '(', 'Trainer', ')', ':', '___EOS___']", "index": 207 }, { "content": " def run_step(self):\n if self.async:\n if not self.async_running:\n self.async_running = True\n for th in self.threads: # resume all threads\n th.resume()\n self.sess.run([self.train_op]) # faster since train_op return None", "metadata": "root.QueueInputTrainer.run_step", "header": "['class', 'QueueInputTrainer', '(', 'Trainer', ')', ':', '___EOS___']", "index": 211 }, { "content": " def _trigger_epoch(self):\n # note that summary_op will take a data from the queue\n if self.async:\n self.async_running = False\n for th in self.threads:\n th.pause()\n if self.summary_op is not None:\n summary_str = self.summary_op.eval()\n self._process_summary(summary_str)", "metadata": "root.QueueInputTrainer._trigger_epoch", "header": "['class', 'QueueInputTrainer', '(', 'Trainer', ')', ':', '___EOS___']", "index": 219 }, { "content": "def start_train(config):\n tr = QueueInputTrainer(config)\n tr.train()", "metadata": "root.start_train", "header": "['module', '___EOS___']", "index": 230 } ]
[ { "span": "import re", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 9 }, { "span": "import functools", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 16 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "UT", "F", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "File", ":", " ", "trainer", ".", "py_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Author", ":", " ", "Yu", "xin", " ", "Wu", " ", "<", "pp", "ww", "yy", "xx", "@", "gma", "il", ".", "com", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "tensorflow_", "as_", "tf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "threading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "functools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "six_", "._", "moves_", "import_", "zip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "base_", "import_", "Trainer", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "dataflow", "_", "._", "common_", "import_", "Repeat", "ed", "Data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "utils_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "utils_", "._", "concurrency", "_", "import_", "Loop", "Thread_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "tf", "utils_", "._", "summary_", "import_", "summar", "y", "\\u", "movin", "g", "\\u", "average_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "tf", "utils_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "all\\u\\u_", "=_", "[_", "'", "Simple", "Trainer", "'_", ",_", "'", "Queue", "Inp", "ut", "Trainer", "'_", ",_", "'", "start", "\\u", "train", "'_", "]_", "\\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\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Simple", "Trainer", "_", "(_", "Trainer", "_", ")_", ":_", "\\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_", "Simple", "Trainer", "_", "(_", "Trainer", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run", "\\u", "step_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "next_", "(_", "self_", "._", "data\\u", "producer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "feed_", "=_", "dict_", "(_", "zip_", "(_", "self_", "._", "input", "\\u", "vars_", ",_", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sess_", "._", "run_", "(_", "[_", "self_", "._", "train", "\\u", "op_", "]_", ",_", "feed", "\\u", "dict_", "=_", "feed_", ")_", "#", " ", "faste", "r", " ", "sinc", "e", " ", "train", "\\u", "op", " ", "return", " ", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Trainer", "_", "(_", "Trainer", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "train_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "self_", "._", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "\\u", "vars_", "=_", "model_", "._", "get", "\\u", "input", "\\u", "vars_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "input", "\\u", "vars_", "=_", "input", "\\u", "vars_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cost", "\\u", "var_", "=_", "model_", "._", "get", "\\u", "cost_", "(_", "input", "\\u", "vars_", ",_", "is", "\\u", "training_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "avg", "\\u", "maintain", "\\u", "op_", "=_", "summar", "y", "\\u", "movin", "g", "\\u", "average_", "(_", "cost", "\\u", "var_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "grads_", "=_", "self_", "._", "config_", "._", "optimizer_", "._", "compute", "\\u", "gradients_", "(_", "cost", "\\u", "var_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "grads_", "=_", "self_", "._", "process", "\\u", "grads_", "(_", "grads_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "train", "\\u", "op_", "=_", "tf_", "._", "group_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "config_", "._", "optimizer_", "._", "appl", "y", "\\u", "gradients_", "(_", "grads_", ",_", "get", "\\u", "global", "\\u", "step", "\\u", "var_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "avg", "\\u", "maintain", "\\u", "op_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "init", "\\u", "session", "\\u", "and", "\\u", "coord_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "an", " ", "inf", "inte", " ", "data", " ", "producer_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "data\\u", "producer_", "=_", "Repeat", "ed", "Data_", "(_", "self_", "._", "config_", "._", "dataset_", ",_", "-_", "1_", ")_", "._", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "main", "\\u", "loop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Trainer", "_", "(_", "Trainer", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "trigger", "\\u", "epoch_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "summar", "y", "\\u", "op_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "next_", "(_", "self_", "._", "data\\u", "producer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "feed_", "=_", "dict_", "(_", "zip_", "(_", "self_", "._", "input", "\\u", "vars_", ",_", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "summar", "y", "\\u", "str_", "=_", "self_", "._", "summar", "y", "\\u", "op_", "._", "eval_", "(_", "feed", "\\u", "dict_", "=_", "feed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "\\u", "summary_", "(_", "summar", "y", "\\u", "str_", ")_", "\\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_", "Enque", "ue", "Thread_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Enque", "ue", "Thread_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "trainer_", ",_", "queue_", ",_", "enqueue", "\\u", "op_", ",_", "raw", "\\u", "input", "\\u", "var_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Enque", "ue", "Thread_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sess_", "=_", "trainer_", "._", "sess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "coord_", "=_", "trainer_", "._", "coord_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dataflow", "_", "=_", "Repeat", "ed", "Data_", "(_", "trainer_", "._", "config_", "._", "dataset_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "input", "\\u", "vars_", "=_", "raw", "\\u", "input", "\\u", "var_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "op_", "=_", "enqueue", "\\u", "op_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "queue_", "=_", "queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "close", "\\u", "op_", "=_", "self_", "._", "queue_", "._", "close_", "(_", "cancel", "\\u", "pend", "ing", "\\u", "enqueue", "s_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "daemon_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enque", "ue", "Thread_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "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 ", " _", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "dp_", "in_", "self_", "._", "dataflow", "_", "._", "get", "\\u", "data_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "self_", "._", "coord_", "._", "shou", "ld", "\\u", "stop_", "(_", ")_", ":_", "\\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_", "feed_", "=_", "dict_", "(_", "zip_", "(_", "self_", "._", "input", "\\u", "vars_", ",_", "dp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "op_", "._", "run_", "(_", "feed", "\\u", "dict_", "=_", "feed_", ",_", "session_", "=_", "self_", "._", "sess_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "tf_", "._", "errors_", "._", "Cancel", "led", "Error_", "as_", "e_", ":_", "\\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_", "except_", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "exception_", "(_", "\"", "Except", "ion", " ", "in", " ", "Enque", "ue", "Thread", ":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sess_", "._", "run_", "(_", "self_", "._", "close", "\\u", "op_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "coord_", "._", "request", "\\u", "stop_", "(_", ")_", "\\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 ", " _", "logger_", "._", "info_", "(_", "\"", "Enque", "ue", " ", "Thread", " ", "Exi", "ted", ".\"_", ")_", "\\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_", "Queue", "Inp", "ut", "Trainer", "_", "(_", "Trainer", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Trainer", " ", "whi", "ch", " ", "builds", " ", "a", " ", "FIFO", " ", "queue", " ", "for", " ", "input", ".", "\\", "10", ";", " ", " ", " ", " ", "Supp", "ort", " ", "multi", " ", "GPU", ".", "\\", "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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Queue", "Inp", "ut", "Trainer", "_", "(_", "Trainer", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "config_", ",_", "input", "\\u", "queue_", "=_", "None_", ",_", "async_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "config", ":", " ", "a", " ", "`", "Train", "Config", "`", " ", "instance", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "input", "\\u", "queue", ":", " ", "a", " ", "`", "tf", ".", "Queue", "Base", "`", " ", "instance", " ", "to", " ", "be", " ", "used", " ", "to", " ", "buffer", " ", "datapoints", ".", "\\", "10", ";", " ", " ", " ", " ", "Default", "s", " ", "to", " ", "a", " ", "FIFO", " ", "queue", " ", "of", " ", "size", " ", "100", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Queue", "Inp", "ut", "Trainer", "_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "input", "\\u", "vars_", "=_", "self_", "._", "model_", "._", "get", "\\u", "input", "\\u", "vars_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "input", "\\u", "queue_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "input", "\\u", "queue_", "=_", "tf_", "._", "FIFO", "Queue_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "100_", ",_", "[_", "x_", "._", "dtype_", "for_", "x_", "in_", "self_", "._", "input", "\\u", "vars_", "]_", ",_", "name_", "=_", "'", "input", "\\u", "queue", "'_", ")_", "\\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_", "._", "input", "\\u", "queue_", "=_", "input", "\\u", "queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "async_", "=_", "async_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "async_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "self_", "._", "config_", "._", "nr", "\\u", "tower", "_", ">_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Queue", "Inp", "ut", "Trainer", "_", "(_", "Trainer", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "averag", "e\\u", "grads_", "(_", "tower", "\\u", "grads_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "grad", "\\u", "and", "\\u", "vars_", "in_", "zip_", "(_", "*_", "tower", "\\u", "grads_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "grad", "\\u", "and", "\\u", "vars_", "[_", "0_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "grad_", "=_", "tf_", "._", "add", "\\u", "n_", "(_", "[_", "x_", "[_", "0_", "]_", "for_", "x_", "in_", "grad", "\\u", "and", "\\u", "vars_", "]_", ")_", "/_", "float_", "(_", "len_", "(_", "tower", "\\u", "grads_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Assert", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "error_", "(_", "\"", "Error", " ", "whi", "le", " ", "process", "ing", " ", "gradi", "ents", " ", "of", " ", "{}\"_", "._", "format_", "(_", "v_", "._", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ret_", "._", "append_", "(_", "(_", "grad_", ",_", "v_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Queue", "Inp", "ut", "Trainer", "_", "(_", "Trainer", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "model", "\\u", "inputs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Deq", "ueue", " ", "a", " ", "datapoint", " ", "from", " ", "input", "\\u", "queue", " ", "and", " ", "return", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "input", "\\u", "queue_", "._", "dequeue", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "ret_", ",_", "tf_", "._", "Tensor_", ")_", ":_", "#", " ", "only", " ", "one", " ", "input_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", "=_", "[_", "ret_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "len_", "(_", "ret_", ")_", "==_", "len_", "(_", "self_", "._", "input", "\\u", "vars_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "qv", "_", ",_", "v_", "in_", "zip_", "(_", "ret_", ",_", "self_", "._", "input", "\\u", "vars_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "qv", "_", "._", "set\\u", "shape_", "(_", "v_", "._", "get", "\\u", "shape_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Queue", "Inp", "ut", "Trainer", "_", "(_", "Trainer", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "single", "\\u", "tower", "\\u", "grad_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Get", " ", "grad", " ", "and", " ", "cost", " ", "for", " ", "single", "-", "tower", " ", "case", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "\\u", "inputs_", "=_", "self_", "._", "\\u", "get", "\\u", "model", "\\u", "inputs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cost", "\\u", "var_", "=_", "self_", "._", "model_", "._", "get", "\\u", "cost_", "(_", "model", "\\u", "inputs_", ",_", "is", "\\u", "training_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "grads_", "=_", "self_", "._", "config_", "._", "optimizer_", "._", "compute", "\\u", "gradients_", "(_", "cost", "\\u", "var_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tf_", "._", "add", "\\u", "to", "\\u", "collection_", "(_", "MOVI", "NG", "\\u", "SUMMARY", "\\u", "VARS", "\\u", "KEY_", ",_", "cost", "\\u", "var_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "grads_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Queue", "Inp", "ut", "Trainer", "_", "(_", "Trainer", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "multi", "\\u", "tower", "\\u", "grads_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "\"", "Train", "ing", " ", "a", " ", "model", " ", "of", " ", "{}", " ", "tower", "\"_", "._", "format_", "(_", "self_", "._", "config_", "._", "nr", "\\u", "tower", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "avoid", " ", "repeated", " ", "summar", "y", " ", "from", " ", "each", " ", "device_", "\\u\\u\\uNL\\u\\u\\u_", "collect", "\\u", "dedup", "_", "=_", "[_", "tf_", "._", "Graph", "Keys_", "._", "SUM", "MAR", "IES_", ",_", "MOVI", "NG", "\\u", "SUMMARY", "\\u", "VARS", "\\u", "KEY_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kep", "t", "\\u", "summaries_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "grad", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "config_", "._", "nr", "\\u", "tower", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "tf_", "._", "device_", "(_", "'/", "gpu", ":{}'_", "._", "format_", "(_", "i_", ")_", ")_", ",_", "tf_", "._", "name", "\\u", "scope_", "(_", "'", "tower", "{}'_", "._", "format_", "(_", "i_", ")_", ")_", "as_", "scope_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "\"", "Building", " ", "graph", " ", "for", " ", "tower", " ", "{}.", "..\"_", "._", "format_", "(_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "\\u", "inputs_", "=_", "self_", "._", "\\u", "get", "\\u", "model", "\\u", "inputs_", "(_", ")_", "#", " ", "each", " ", "tower", " ", "dequeue", " ", "from", " ", "input", " ", "queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cost", "\\u", "var_", "=_", "self_", "._", "model_", "._", "get", "\\u", "cost_", "(_", "model", "\\u", "inputs_", ",_", "is", "\\u", "training_", "=_", "True_", ")_", "#", " ", "build", " ", "tower", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "gate", "\\u", "gradi", "ens", "t", "=", "0", " ", "see", "ms", " ", "to", " ", "be", " ", "faste", "r", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "grad", "\\u", "list_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "config_", "._", "optimizer_", "._", "compute", "\\u", "gradients_", "(_", "cost", "\\u", "var_", ",_", "gate", "\\u", "gradients_", "=_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "i_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tf_", "._", "add", "\\u", "to", "\\u", "collection_", "(_", "MOVI", "NG", "\\u", "SUMMARY", "\\u", "VARS", "\\u", "KEY_", ",_", "cost", "\\u", "var_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tf_", "._", "get", "\\u", "variab", "le", "\\u", "scope_", "(_", ")_", "._", "reus", "e\\u", "variables_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "collect", "\\u", "dedup", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "kep", "t", "\\u", "summaries_", "[_", "k_", "]_", "=_", "copy_", "._", "copy_", "(_", "tf_", "._", "get", "\\u", "collection_", "(_", "k_", ")_", ")_", "\\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_", "for_", "k_", "in_", "collect", "\\u", "dedup", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "tf_", "._", "get", "\\u", "collection", "\\u", "ref_", "(_", "k_", ")_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tf_", "._", "get", "\\u", "collection", "\\u", "ref_", "(_", "k_", ")_", "._", "extend_", "(_", "kep", "t", "\\u", "summaries_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "grad", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Queue", "Inp", "ut", "Trainer", "_", "(_", "Trainer", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "train_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "enqueue", "\\u", "op_", "=_", "self_", "._", "input", "\\u", "queue_", "._", "enqueue_", "(_", "self_", "._", "input", "\\u", "vars_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "config_", "._", "nr", "\\u", "tower", "_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "grad", "\\u", "list_", "=_", "self_", "._", "\\u", "multi", "\\u", "tower", "\\u", "grads_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "async_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "grads_", "=_", "Queue", "Inp", "ut", "Trainer", "_", "._", "\\u", "averag", "e\\u", "grads_", "(_", "grad", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "grads_", "=_", "self_", "._", "process", "\\u", "grads_", "(_", "grads_", ")_", "\\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 ", " _", "grad", "\\u", "list_", "=_", "[_", "self_", "._", "process", "\\u", "grads_", "(_", "g_", ")_", "for_", "g_", "in_", "grad", "\\u", "list_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "prete", "nd", " ", "to", " ", "averag", "e", " ", "the", " ", "grads", ",", " ", "in", " ", "order", " ", "to", " ", "make", " ", "async", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sync", " ", "have", " ", "consistent", " ", "effective", " ", "learn", "ing", " ", "rate_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "scale_", "(_", "grads_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "[_", "(_", "grad_", "/_", "self_", "._", "config_", "._", "nr", "\\u", "tower", "_", ",_", "var_", ")_", "for_", "grad_", ",_", "var_", "in_", "grads_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "grad", "\\u", "list_", "=_", "map_", "(_", "scale_", ",_", "grad", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "grads_", "=_", "grad", "\\u", "list_", "[_", "0_", "]_", "#", " ", "use", " ", "grad", " ", "from", " ", "the", " ", "first", " ", "tower", " ", "for", " ", "routin", "el", "y", " ", "stuff_", "\\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 ", " _", "grads_", "=_", "self_", "._", "\\u", "single", "\\u", "tower", "\\u", "grad_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "grads_", "=_", "self_", "._", "process", "\\u", "grads_", "(_", "grads_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "train", "\\u", "op_", "=_", "tf_", "._", "group_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "config_", "._", "optimizer_", "._", "appl", "y", "\\u", "gradients_", "(_", "grads_", ",_", "get", "\\u", "global", "\\u", "step", "\\u", "var_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "summar", "y", "\\u", "movin", "g", "\\u", "average_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "async_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "threads_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "range_", "(_", "1_", ",_", "self_", "._", "config_", "._", "nr", "\\u", "tower", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "train", "\\u", "op_", "=_", "self_", "._", "config_", "._", "optimizer_", "._", "appl", "y", "\\u", "gradients_", "(_", "grad", "\\u", "list_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "lambda_", "op_", "=_", "train", "\\u", "op_", ":_", "self_", "._", "sess_", "._", "run_", "(_", "[_", "op_", "]_", ")_", "#", " ", "avoid", " ", "late", "-", "binding_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "th_", "=_", "Loop", "Thread_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "th_", "._", "pause_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "th_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "threads_", "._", "append_", "(_", "th_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "async", "\\u", "running_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "init", "\\u", "session", "\\u", "and", "\\u", "coord_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "thread", " ", "tha", "t", " ", "keep", "s", " ", "filling", " ", "the", " ", "queue_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "input", "\\u", "th_", "=_", "Enque", "ue", "Thread_", "(_", "self_", ",_", "self_", "._", "input", "\\u", "queue_", ",_", "enqueue", "\\u", "op_", ",_", "self_", "._", "input", "\\u", "vars_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "main", "\\u", "loop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Queue", "Inp", "ut", "Trainer", "_", "(_", "Trainer", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "start", "\\u", "all", "\\u", "threads_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Queue", "Inp", "ut", "Trainer", "_", ",_", "self_", ")_", "._", "\\u", "start", "\\u", "all", "\\u", "threads_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "input", "\\u", "th_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Queue", "Inp", "ut", "Trainer", "_", "(_", "Trainer", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run", "\\u", "step_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "async_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "async", "\\u", "running_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "async", "\\u", "running_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "th_", "in_", "self_", "._", "threads_", ":_", "#", " ", "resum", "e", " ", "all", " ", "threads_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "th_", "._", "resume_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "sess_", "._", "run_", "(_", "[_", "self_", "._", "train", "\\u", "op_", "]_", ")_", "#", " ", "faste", "r", " ", "sinc", "e", " ", "train", "\\u", "op", " ", "return", " ", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Queue", "Inp", "ut", "Trainer", "_", "(_", "Trainer", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "trigger", "\\u", "epoch_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "note", " ", "tha", "t", " ", "summar", "y", "\\u", "op", " ", "will", " ", "take", " ", "a", " ", "data", " ", "from", " ", "the", " ", "queue_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "async_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "async", "\\u", "running_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "th_", "in_", "self_", "._", "threads_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "th_", "._", "pause_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "summar", "y", "\\u", "op_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "summar", "y", "\\u", "str_", "=_", "self_", "._", "summar", "y", "\\u", "op_", "._", "eval_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "process", "\\u", "summary_", "(_", "summar", "y", "\\u", "str_", ")_", "\\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_", "start", "\\u", "train_", "(_", "config_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tr_", "=_", "Queue", "Inp", "ut", "Trainer", "_", "(_", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tr_", "._", "train_", "(_", ")_" ]
[ 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, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 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 ]
Unused import
danirus/django-comments-xtd/django_comments_xtd/demos/multiple/projects/views.py
[ { "content": "from django.core.urlresolvers import reverse\nfrom django.shortcuts import render_to_response\nfrom django.template import RequestContext\nfrom django.views.generic import DetailView, ListView\n\nfrom multiple.projects.models import Project, Release\n\n\n\n\n\n\n \n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class ProjectsView(ListView):\n queryset = Project.objects.filter(is_active=True)\n template_name = \"projects/homepage.html\"\n", "metadata": "root.ProjectsView", "header": "['module', '___EOS___']", "index": 8 }, { "content": " def get_context_data(self, **kwargs):\n context = super(ProjectsView, self).get_context_data(**kwargs)\n\n items = []\n for project in self.object_list:\n try:\n last_published_release = project.release_set.filter(\n is_active=True).order_by(\"-release_date\")[0]\n except IndexError:\n continue\n else:\n items.append({\"project\": project, \n \"release\": last_published_release})\n\n if len(items):\n items.sort(key=lambda item: item['release'].release_date, \n reverse=True)\n\n context['items'] = items\n return context", "metadata": "root.ProjectsView.get_context_data", "header": "['class', 'ProjectsView', '(', 'ListView', ')', ':', '___EOS___']", "index": 12 }, { "content": "class ProjectDetailView(DetailView):\n model = Project\n", "metadata": "root.ProjectDetailView", "header": "['module', '___EOS___']", "index": 34 }, { "content": " def get_context_data(self, **kwargs):\n context = super(ProjectDetailView, self).get_context_data(**kwargs)\n context['release_list'] = []\n for release in self.get_object().release_set.filter(is_active=True).order_by(\"-release_date\"):\n context['release_list'].append(release)\n return context", "metadata": "root.ProjectDetailView.get_context_data", "header": "['class', 'ProjectDetailView', '(', 'DetailView', ')', ':', '___EOS___']", "index": 37 }, { "content": "class ReleaseDetailView(DetailView):\n model = Release\n\n", "metadata": "root.ReleaseDetailView", "header": "['module', '___EOS___']", "index": 45 }, { "content": " def get_object(self, queryset=None):\n project_pk = self.kwargs.get('project_slug', None)\n release_slug = self.kwargs.get('release_slug', None)\n try:\n obj = Release.objects.get(project=project_pk, slug=release_slug)\n except ObjectDoesNotExist:\n raise Http404(_(\"No releases found matching the query\"))\n return obj", "metadata": "root.ReleaseDetailView.get_object", "header": "['class', 'ReleaseDetailView', '(', 'DetailView', ')', ':', '___EOS___']", "index": 48 }, { "content": " def get_context_data(self, **kwargs):\n context = super(ReleaseDetailView, self).get_context_data(**kwargs)\n context.update({'next': reverse('comments-xtd-sent')})\n return context", "metadata": "root.ReleaseDetailView.get_context_data", "header": "['class', 'ReleaseDetailView', '(', 'DetailView', ')', ':', '___EOS___']", "index": 57 } ]
[ { "span": "from django.shortcuts import render_to_response", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 47 }, { "span": "from django.template import RequestContext", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 42 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "reverse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "render", "\\u", "to", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "Request", "Context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "views_", "._", "generic_", "import_", "Det", "ail", "View_", ",_", "List", "View_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "multiple_", "._", "projects_", "._", "models_", "import_", "Project_", ",_", "Release_", "\\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_", "Project", "s", "View_", "(_", "List", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "queryset_", "=_", "Project_", "._", "objects_", "._", "filter_", "(_", "is", "\\u", "active_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template", "\\u", "name_", "=_", "\"", "project", "s", "/", "home", "page", ".", "html", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Project", "s", "View_", "(_", "List", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "context", "\\u", "data_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "context_", "=_", "super_", "(_", "Project", "s", "View_", ",_", "self_", ")_", "._", "get", "\\u", "context", "\\u", "data_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "items_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "project_", "in_", "self_", "._", "object\\u", "list_", ":_", "\\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 ", " _", "last", "\\u", "publi", "shed", "\\u", "release_", "=_", "project_", "._", "release", "\\u", "set_", "._", "filter_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "active_", "=_", "True_", ")_", "._", "order", "\\u", "by_", "(_", "\"-", "release", "\\u", "date", "\"_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Index", "Error_", ":_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "items_", "._", "append_", "(_", "{_", "\"", "project", "\"_", ":_", "project_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "release", "\"_", ":_", "last", "\\u", "publi", "shed", "\\u", "release_", "}_", ")_", "\\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_", "len_", "(_", "items_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "items_", "._", "sort_", "(_", "key_", "=_", "lambda_", "item_", ":_", "item_", "[_", "'", "release", "'_", "]_", "._", "release", "\\u", "date_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reverse_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "context_", "[_", "'", "items", "'_", "]_", "=_", "items_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "context_", "\\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_", "Project", "Det", "ail", "View_", "(_", "Det", "ail", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Project_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Project", "Det", "ail", "View_", "(_", "Det", "ail", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "context", "\\u", "data_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "context_", "=_", "super_", "(_", "Project", "Det", "ail", "View_", ",_", "self_", ")_", "._", "get", "\\u", "context", "\\u", "data_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "context_", "[_", "'", "release", "\\u", "list", "'_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "release_", "in_", "self_", "._", "get", "\\u", "object_", "(_", ")_", "._", "release", "\\u", "set_", "._", "filter_", "(_", "is", "\\u", "active_", "=_", "True_", ")_", "._", "order", "\\u", "by_", "(_", "\"-", "release", "\\u", "date", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "context_", "[_", "'", "release", "\\u", "list", "'_", "]_", "._", "append_", "(_", "release_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "context_", "\\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_", "Release", "Det", "ail", "View_", "(_", "Det", "ail", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Release_", "\\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_", "Release", "Det", "ail", "View_", "(_", "Det", "ail", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "object_", "(_", "self_", ",_", "queryset_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "project", "\\u", "pk_", "=_", "self_", "._", "kwargs_", "._", "get_", "(_", "'", "project", "\\u", "slug", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "release", "\\u", "slug_", "=_", "self_", "._", "kwargs_", "._", "get_", "(_", "'", "release", "\\u", "slug", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "Release_", "._", "objects_", "._", "get_", "(_", "project_", "=_", "project", "\\u", "pk_", ",_", "slug_", "=_", "release", "\\u", "slug_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Object", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "(_", "\\u_", "(_", "\"", "No", " ", "release", "s", " ", "found", " ", "matchi", "ng", " ", "the", " ", "query", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Release", "Det", "ail", "View_", "(_", "Det", "ail", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "context", "\\u", "data_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "context_", "=_", "super_", "(_", "Release", "Det", "ail", "View_", ",_", "self_", ")_", "._", "get", "\\u", "context", "\\u", "data_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "context_", "._", "update_", "(_", "{_", "'", "next", "'_", ":_", "reverse_", "(_", "'", "comment", "s", "-", "xt", "d", "-", "sent", "'_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "context_" ]
[ 4, 4,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
openlearningtools/opencompetencies/competencies/models.py
[ { "content": "from django.db import models\nfrom django.forms import ModelForm, TextInput, Textarea, SelectMultiple, CheckboxSelectMultiple\nfrom django.forms import EmailField\nfrom django.contrib.auth.models import User\n\n# --- Competency System Hierarchy ---\n\n# Description of common attributes:\n# public: whether a non-logged in user can see this element\n# description: a public-facing narrative description of this element\n# student-friendly: Many parts of a standards system are written in 'teacher language',\n# which is not very accessible to students. This is a rephrasing of the element in\n# language that is easier for students to understand.\n\n\n\n\n\n\n\n\n\n# --- ModelForms ---\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Organization(models.Model):\n name = models.CharField(max_length=500)\n org_type = models.CharField(max_length=500, default='school')\n public = models.BooleanField(default=False)\n owner = models.ForeignKey(User)\n editors = models.ManyToManyField(User, related_name='org_editors')\n\n # Allow organizations to rename taxonomy elements.\n alias_sa = models.CharField(max_length=500, default='subject area')\n alias_sda = models.CharField(max_length=500, default='subdiscipline area')\n alias_ca = models.CharField(max_length=500, default='competency area')\n alias_eu = models.CharField(max_length=500, default='essential understanding')\n alias_lt = models.CharField(max_length=500, default='learning target')\n\n class Meta:\n unique_together = ('name', 'owner',)\n", "metadata": "root.Organization", "header": "['module', '___EOS___']", "index": 14 }, { "content": " def __str__(self):\n return self.name", "metadata": "root.Organization.__str__", "header": "['class', 'Organization', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 31 }, { "content": "class CoreElement(models.Model):\n public = models.BooleanField(default=False)\n student_friendly = models.TextField(blank=True)\n description = models.TextField(blank=True)\n\n class Meta:\n abstract = True", "metadata": "root.CoreElement", "header": "['module', '___EOS___']", "index": 34 }, { "content": "class SubjectArea(CoreElement):\n subject_area = models.CharField(max_length=500)\n organization = models.ForeignKey(Organization)\n\n\n class Meta:\n order_with_respect_to = 'organization'\n\n\n", "metadata": "root.SubjectArea", "header": "['module', '___EOS___']", "index": 42 }, { "content": " def __str__(self):\n return self.subject_area", "metadata": "root.SubjectArea.__str__", "header": "['class', 'SubjectArea', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 46 }, { "content": " def is_parent_public(self):\n return True", "metadata": "root.SubjectArea.is_parent_public", "header": "['class', 'SubjectArea', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 52 }, { "content": " def get_parent(self):\n return self.organization", "metadata": "root.SubjectArea.get_parent", "header": "['class', 'SubjectArea', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 55 }, { "content": " def get_organization(self):\n return self.organization", "metadata": "root.SubjectArea.get_organization", "header": "['class', 'SubjectArea', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 58 }, { "content": "class SubdisciplineArea(CoreElement):\n subdiscipline_area = models.CharField(max_length=500)\n subject_area = models.ForeignKey(SubjectArea)\n\n\n class Meta:\n order_with_respect_to = 'subject_area'\n\n\n", "metadata": "root.SubdisciplineArea", "header": "['module', '___EOS___']", "index": 61 }, { "content": " def __str__(self):\n return self.subdiscipline_area", "metadata": "root.SubdisciplineArea.__str__", "header": "['class', 'SubdisciplineArea', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 65 }, { "content": " def is_parent_public(self):\n return self.subject_area.public", "metadata": "root.SubdisciplineArea.is_parent_public", "header": "['class', 'SubdisciplineArea', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 71 }, { "content": " def get_parent(self):\n return self.subject_area", "metadata": "root.SubdisciplineArea.get_parent", "header": "['class', 'SubdisciplineArea', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 74 }, { "content": " def get_organization(self):\n return self.subject_area.get_organization()", "metadata": "root.SubdisciplineArea.get_organization", "header": "['class', 'SubdisciplineArea', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 77 }, { "content": "class CompetencyArea(CoreElement):\n competency_area = models.CharField(max_length=500)\n subject_area = models.ForeignKey(SubjectArea)\n subdiscipline_area = models.ForeignKey(SubdisciplineArea, blank=True, null=True)\n\n\n class Meta:\n order_with_respect_to = 'subject_area'\n\n\n", "metadata": "root.CompetencyArea", "header": "['module', '___EOS___']", "index": 80 }, { "content": " def __str__(self):\n return self.competency_area", "metadata": "root.CompetencyArea.__str__", "header": "['class', 'CompetencyArea', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 85 }, { "content": " def is_parent_public(self):\n # If no sda, then only use subject_area\n if self.subdiscipline_area:\n sda_public = self.subdiscipline_area.public\n else:\n sda_public = True\n\n if self.subject_area.public and sda_public:\n return True\n else:\n return False", "metadata": "root.CompetencyArea.is_parent_public", "header": "['class', 'CompetencyArea', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 91 }, { "content": " def get_parent(self):\n # Maybe this should just return subject area?\n # Would make managing ordering easier.\n if self.subdiscipline_area:\n return self.subdiscipline_area\n else:\n return self.subject_area", "metadata": "root.CompetencyArea.get_parent", "header": "['class', 'CompetencyArea', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 103 }, { "content": " def get_organization(self):\n return self.subject_area.get_organization()", "metadata": "root.CompetencyArea.get_organization", "header": "['class', 'CompetencyArea', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 111 }, { "content": "class EssentialUnderstanding(CoreElement):\n essential_understanding = models.CharField(max_length=2000)\n competency_area = models.ForeignKey(CompetencyArea)\n\n\n class Meta:\n order_with_respect_to = 'competency_area'\n\n\n", "metadata": "root.EssentialUnderstanding", "header": "['module', '___EOS___']", "index": 114 }, { "content": " def __str__(self):\n return self.essential_understanding", "metadata": "root.EssentialUnderstanding.__str__", "header": "['class', 'EssentialUnderstanding', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 118 }, { "content": " def is_parent_public(self):\n return self.competency_area.public", "metadata": "root.EssentialUnderstanding.is_parent_public", "header": "['class', 'EssentialUnderstanding', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 124 }, { "content": " def get_parent(self):\n return self.competency_area", "metadata": "root.EssentialUnderstanding.get_parent", "header": "['class', 'EssentialUnderstanding', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 127 }, { "content": " def get_organization(self):\n return self.competency_area.get_organization()", "metadata": "root.EssentialUnderstanding.get_organization", "header": "['class', 'EssentialUnderstanding', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 130 }, { "content": "class LearningTarget(CoreElement):\n learning_target = models.CharField(max_length=2000)\n essential_understanding = models.ForeignKey(EssentialUnderstanding)\n\n\n class Meta:\n order_with_respect_to = 'essential_understanding'\n\n\n", "metadata": "root.LearningTarget", "header": "['module', '___EOS___']", "index": 133 }, { "content": " def __str__(self):\n return self.learning_target", "metadata": "root.LearningTarget.__str__", "header": "['class', 'LearningTarget', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 137 }, { "content": " def is_parent_public(self):\n return self.essential_understanding.public", "metadata": "root.LearningTarget.is_parent_public", "header": "['class', 'LearningTarget', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 143 }, { "content": " def get_parent(self):\n return self.essential_understanding", "metadata": "root.LearningTarget.get_parent", "header": "['class', 'LearningTarget', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 146 }, { "content": " def get_organization(self):\n return self.essential_understanding.get_organization()", "metadata": "root.LearningTarget.get_organization", "header": "['class', 'LearningTarget', '(', 'CoreElement', ')', ':', '___EOS___']", "index": 149 }, { "content": "class OrganizationForm(ModelForm):\n class Meta:\n model = Organization\n fields = ('name', 'org_type')\n labels = {'name': 'Name of new school or organization',\n 'org_type': 'Type of organization',}\n widgets = {\n 'name': TextInput(attrs={'class': 'span4'}),\n 'org_type': TextInput(attrs={'class': 'span4'}),\n }", "metadata": "root.OrganizationForm", "header": "['module', '___EOS___']", "index": 154 }, { "content": "class OrganizationAdminForm(OrganizationForm):\n \"\"\"Extends OrganizationForm to include admin elements.\"\"\"\n class Meta(OrganizationForm.Meta):\n fields = ('name', 'org_type', 'public',\n 'alias_sa', 'alias_sda', 'alias_ca', 'alias_eu', 'alias_lt',\n 'editors',\n )\n OrganizationForm.Meta.labels['name'] = 'Name'\n OrganizationForm.Meta.labels['alias_sa'] = 'Alias - subject area'\n OrganizationForm.Meta.labels['alias_sda'] = 'Alias - subdiscipline area'\n OrganizationForm.Meta.labels['alias_ca'] = 'Alias - competency area'\n OrganizationForm.Meta.labels['alias_eu'] = 'Alias - essential understanding'\n OrganizationForm.Meta.labels['alias_lt'] = 'Alias - learning target'", "metadata": "root.OrganizationAdminForm", "header": "['module', '___EOS___']", "index": 165 }, { "content": "class SubjectAreaForm(ModelForm):\n class Meta:\n model = SubjectArea\n fields = ('subject_area', 'description', 'public')\n widgets = {\n 'subject_area': TextInput(attrs={'class': 'span4'}),\n 'description': Textarea(attrs={'rows': 5, 'class': 'span8'}),\n }", "metadata": "root.SubjectAreaForm", "header": "['module', '___EOS___']", "index": 181 }, { "content": "class SubdisciplineAreaForm(ModelForm):\n # Hacky way to get id of instance from a form in a template (edit_sa_summary).\n my_id = None\n class Meta:\n model = SubdisciplineArea\n fields = ('subdiscipline_area', 'description', 'public')\n widgets = {\n 'subdiscipline_area': TextInput(attrs={'class': 'span4'}),\n 'description': Textarea(attrs={'rows': 5, 'class': 'span8'}),\n }", "metadata": "root.SubdisciplineAreaForm", "header": "['module', '___EOS___']", "index": 190 }, { "content": "class CompetencyAreaForm(ModelForm):\n # Hacky way to get id of instance from a form in a template (edit_sa_summary).\n my_id = None\n class Meta:\n model = CompetencyArea\n fields = ('competency_area', 'student_friendly', 'description', 'public')\n labels = {'competency_area': 'Competency Area'}\n # Bootstrap controls width of Textarea, ignoring the 'cols' setting. Can also use 'class': 'input-block-level'\n widgets = {'competency_area': Textarea(attrs={'rows': 5, 'class': 'span4'}),\n 'student_friendly': Textarea(attrs={'rows': 5, 'class': 'span8'}),\n 'description': Textarea(attrs={'rows': 5, 'class': 'span8'}),\n }", "metadata": "root.CompetencyAreaForm", "header": "['module', '___EOS___']", "index": 201 }, { "content": "class EssentialUnderstandingForm(ModelForm):\n class Meta:\n model = EssentialUnderstanding\n fields = ('essential_understanding', 'student_friendly', 'description', 'public')\n labels = {'essential_understanding': 'Essential Understanding'}\n # Bootstrap controls width of Textarea, ignoring the 'cols' setting. Can also use 'class': 'input-block-level'\n widgets = {'essential_understanding': Textarea(attrs={'rows': 5, 'class': 'span7'}),\n 'student_friendly': Textarea(attrs={'rows': 5, 'class': 'span8'}),\n 'description': Textarea(attrs={'rows': 5, 'class': 'span8'}),\n }", "metadata": "root.EssentialUnderstandingForm", "header": "['module', '___EOS___']", "index": 214 }, { "content": "class LearningTargetForm(ModelForm):\n class Meta:\n model = LearningTarget\n fields = ('learning_target', 'student_friendly', 'description')\n # Bootstrap controls width of Textarea, ignoring the 'cols' setting. Can also use 'class': 'input-block-level'\n widgets = {'learning_target': Textarea(attrs={'rows': 5, 'class': 'span8'}),\n 'student_friendly': Textarea(attrs={'rows': 5, 'class': 'span8'}),\n 'description': Textarea(attrs={'rows': 5, 'class': 'span8'}),\n }", "metadata": "root.LearningTargetForm", "header": "['module', '___EOS___']", "index": 225 } ]
[ { "span": "from django.forms import ModelForm, TextInput, Textarea, SelectMultiple, CheckboxSelectMultiple", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 95 }, { "span": "from django.forms import EmailField", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 35 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "forms_", "import_", "Model", "Form_", ",_", "Text", "Input_", ",_", "Textarea_", ",_", "Select", "Multiple_", ",_", "Checkb", "ox", "Select", "Multiple_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "forms_", "import_", "Ema", "il", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "._", "models_", "import_", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "---", " ", "Compet", "ency", " ", "System", " ", "Hier", "arch", "y", " ", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Descripti", "on", " ", "of", " ", "common", " ", "attribute", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "public", ":", " ", "whe", "ther", " ", "a", " ", "non", "-", "logged", " ", "in", " ", "user", " ", "can", " ", "see", " ", "this", " ", "element_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "description", ":", " ", "a", " ", "public", "-", "facing", " ", "narra", "tiv", "e", " ", "description", " ", "of", " ", "this", " ", "element_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "student", "-", "frie", "ndl", "y", ":", " ", "Many", " ", "part", "s", " ", "of", " ", "a", " ", "standard", "s", " ", "system", " ", "are", " ", "writt", "en", " ", "in", " ", "'", "teacher", " ", "language", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "whi", "ch", " ", "is", " ", "not", " ", "very", " ", "accessible", " ", "to", " ", "student", "s", ".", " ", "Thi", "s", " ", "is", " ", "a", " ", "rep", "hra", "sing", " ", "of", " ", "the", " ", "element", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "language", " ", "tha", "t", " ", "is", " ", "easi", "er", " ", "for", " ", "student", "s", " ", "to", " ", "underst", "and", "._", "\\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\\uNL\\u\\u\\u_", "#", " ", "---", " ", "Model", "Form", "s", " ", "---", "_", "\\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_", "\\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_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Organization_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "500_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "org", "\\u", "type_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "500_", ",_", "default_", "=_", "'", "school", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "public_", "=_", "models_", "._", "Boo", "lean", "Field_", "(_", "default_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "owner_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "User_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "editors", "_", "=_", "models_", "._", "Many", "To", "Many", "Field_", "(_", "User_", ",_", "relate", "d\\u", "name_", "=_", "'", "org", "\\u", "editors", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", "ow", " ", "organization", "s", " ", "to", " ", "rename", " ", "taxonom", "y", " ", "element", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "alias", "\\u", "sa_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "500_", ",_", "default_", "=_", "'", "subject", " ", "area", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "alias", "\\u", "sda", "_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "500_", ",_", "default_", "=_", "'", "subd", "isc", "ipl", "ine", " ", "area", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "alias", "\\u", "ca_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "500_", ",_", "default_", "=_", "'", "compet", "ency", " ", "area", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "alias", "\\u", "eu", "_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "500_", ",_", "default_", "=_", "'", "essential", " ", "underst", "and", "ing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "alias", "\\u", "lt_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "500_", ",_", "default_", "=_", "'", "learn", "ing", " ", "target", "'_", ")_", "\\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 ", " _", "unique", "\\u", "together_", "=_", "(_", "'", "name", "'_", ",_", "'", "owner", "'_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Organization_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "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_", "Core", "Element_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "public_", "=_", "models_", "._", "Boo", "lean", "Field_", "(_", "default_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "student", "\\u", "frie", "ndl", "y_", "=_", "models_", "._", "Text", "Field_", "(_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "description_", "=_", "models_", "._", "Text", "Field_", "(_", "blank_", "=_", "True_", ")_", "\\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 ", " _", "abstract_", "=_", "True_", "\\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_", "Sub", "ject", "Area_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subject", "\\u", "area_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "500_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "organization_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "Organization_", ")_", "\\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_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "order", "\\u", "with", "\\u", "respec", "t", "\\u", "to_", "=_", "'", "organization", "'_", "\\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_", "Sub", "ject", "Area_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "subject", "\\u", "area_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sub", "ject", "Area_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "parent", "\\u", "public_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sub", "ject", "Area_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "parent_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "organization_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sub", "ject", "Area_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "organization_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "organization_", "\\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_", "Subd", "isc", "ipl", "ine", "Area_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subd", "isc", "ipl", "ine", "\\u", "area_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "500_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subject", "\\u", "area_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "Sub", "ject", "Area_", ")_", "\\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_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "order", "\\u", "with", "\\u", "respec", "t", "\\u", "to_", "=_", "'", "subject", "\\u", "area", "'_", "\\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_", "Subd", "isc", "ipl", "ine", "Area_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "subd", "isc", "ipl", "ine", "\\u", "area_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Subd", "isc", "ipl", "ine", "Area_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "parent", "\\u", "public_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "subject", "\\u", "area_", "._", "public_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Subd", "isc", "ipl", "ine", "Area_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "parent_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "subject", "\\u", "area_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Subd", "isc", "ipl", "ine", "Area_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "organization_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "subject", "\\u", "area_", "._", "get", "\\u", "organization_", "(_", ")_", "\\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_", "Compet", "ency", "Area_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "compet", "ency", "\\u", "area_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "500_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subject", "\\u", "area_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "Sub", "ject", "Area_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subd", "isc", "ipl", "ine", "\\u", "area_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "Subd", "isc", "ipl", "ine", "Area_", ",_", "blank_", "=_", "True_", ",_", "null_", "=_", "True_", ")_", "\\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_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "order", "\\u", "with", "\\u", "respec", "t", "\\u", "to_", "=_", "'", "subject", "\\u", "area", "'_", "\\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_", "Compet", "ency", "Area_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "compet", "ency", "\\u", "area_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Compet", "ency", "Area_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "parent", "\\u", "public_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "no", " ", "sda", ",", " ", "then", " ", "only", " ", "use", " ", "subject", "\\u", "area_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "subd", "isc", "ipl", "ine", "\\u", "area_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sda", "\\u", "public_", "=_", "self_", "._", "subd", "isc", "ipl", "ine", "\\u", "area_", "._", "public_", "\\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 ", " _", "sda", "\\u", "public_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "subject", "\\u", "area_", "._", "public_", "and_", "sda", "\\u", "public_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "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 ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Compet", "ency", "Area_", "(_", "Core", "Element_", ")_", ":_", "\\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", "parent_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ma", "yb", "e", " ", "this", " ", "shou", "ld", " ", "just", " ", "return", " ", "subject", " ", "area", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Wo", "ul", "d", " ", "make", " ", "mana", "ging", " ", "orderi", "ng", " ", "easi", "er", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "subd", "isc", "ipl", "ine", "\\u", "area_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "subd", "isc", "ipl", "ine", "\\u", "area_", "\\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_", "._", "subject", "\\u", "area_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Compet", "ency", "Area_", "(_", "Core", "Element_", ")_", ":_", "\\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", "organization_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "subject", "\\u", "area_", "._", "get", "\\u", "organization_", "(_", ")_", "\\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_", "Ess", "ential", "Under", "standing", "_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "essential", "\\u", "underst", "and", "ing_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "2000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compet", "ency", "\\u", "area_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "Compet", "ency", "Area_", ")_", "\\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_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "order", "\\u", "with", "\\u", "respec", "t", "\\u", "to_", "=_", "'", "compet", "ency", "\\u", "area", "'_", "\\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_", "Ess", "ential", "Under", "standing", "_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "essential", "\\u", "underst", "and", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ess", "ential", "Under", "standing", "_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "parent", "\\u", "public_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "compet", "ency", "\\u", "area_", "._", "public_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ess", "ential", "Under", "standing", "_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "parent_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "compet", "ency", "\\u", "area_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ess", "ential", "Under", "standing", "_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "organization_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "compet", "ency", "\\u", "area_", "._", "get", "\\u", "organization_", "(_", ")_", "\\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_", "Learn", "ing", "Target_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "learn", "ing", "\\u", "target_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "2000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "essential", "\\u", "underst", "and", "ing_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "Ess", "ential", "Under", "standing", "_", ")_", "\\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_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "order", "\\u", "with", "\\u", "respec", "t", "\\u", "to_", "=_", "'", "essential", "\\u", "underst", "and", "ing", "'_", "\\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_", "Learn", "ing", "Target_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "learn", "ing", "\\u", "target_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "ing", "Target_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "parent", "\\u", "public_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "essential", "\\u", "underst", "and", "ing_", "._", "public_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "ing", "Target_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "parent_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "essential", "\\u", "underst", "and", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "ing", "Target_", "(_", "Core", "Element_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "organization_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "essential", "\\u", "underst", "and", "ing_", "._", "get", "\\u", "organization_", "(_", ")_", "\\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_", "Organiz", "ation", "Form_", "(_", "Model", "Form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Organization_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "(_", "'", "name", "'_", ",_", "'", "org", "\\u", "type", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels_", "=_", "{_", "'", "name", "'_", ":_", "'", "Name", " ", "of", " ", "new", " ", "school", " ", "or", " ", "organization", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "org", "\\u", "type", "'_", ":_", "'", "Type", " ", "of", " ", "organization", "'_", ",_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "widgets_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "Text", "Input_", "(_", "attrs_", "=_", "{_", "'", "class", "'_", ":_", "'", "span", "4", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "org", "\\u", "type", "'_", ":_", "Text", "Input_", "(_", "attrs_", "=_", "{_", "'", "class", "'_", ":_", "'", "span", "4", "'_", "}_", ")_", ",_", "\\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_", "Organiz", "ation", "Admi", "n", "Form_", "(_", "Organiz", "ation", "Form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Extend", "s", " ", "Organiz", "ation", "Form", " ", "to", " ", "include", " ", "admin", " ", "element", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Meta_", "(_", "Organiz", "ation", "Form_", "._", "Meta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fields_", "=_", "(_", "'", "name", "'_", ",_", "'", "org", "\\u", "type", "'_", ",_", "'", "public", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "alias", "\\u", "sa", "'_", ",_", "'", "alias", "\\u", "sda", "'_", ",_", "'", "alias", "\\u", "ca", "'_", ",_", "'", "alias", "\\u", "eu", "'_", ",_", "'", "alias", "\\u", "lt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "editors", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Organiz", "ation", "Form_", "._", "Meta_", "._", "labels_", "[_", "'", "name", "'_", "]_", "=_", "'", "Name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Organiz", "ation", "Form_", "._", "Meta_", "._", "labels_", "[_", "'", "alias", "\\u", "sa", "'_", "]_", "=_", "'", "Ali", "as", " ", "-", " ", "subject", " ", "area", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Organiz", "ation", "Form_", "._", "Meta_", "._", "labels_", "[_", "'", "alias", "\\u", "sda", "'_", "]_", "=_", "'", "Ali", "as", " ", "-", " ", "subd", "isc", "ipl", "ine", " ", "area", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Organiz", "ation", "Form_", "._", "Meta_", "._", "labels_", "[_", "'", "alias", "\\u", "ca", "'_", "]_", "=_", "'", "Ali", "as", " ", "-", " ", "compet", "ency", " ", "area", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Organiz", "ation", "Form_", "._", "Meta_", "._", "labels_", "[_", "'", "alias", "\\u", "eu", "'_", "]_", "=_", "'", "Ali", "as", " ", "-", " ", "essential", " ", "underst", "and", "ing", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Organiz", "ation", "Form_", "._", "Meta_", "._", "labels_", "[_", "'", "alias", "\\u", "lt", "'_", "]_", "=_", "'", "Ali", "as", " ", "-", " ", "learn", "ing", " ", "target", "'_", "\\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_", "Sub", "ject", "Area", "Form_", "(_", "Model", "Form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Sub", "ject", "Area_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "(_", "'", "subject", "\\u", "area", "'_", ",_", "'", "description", "'_", ",_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "widgets_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "subject", "\\u", "area", "'_", ":_", "Text", "Input_", "(_", "attrs_", "=_", "{_", "'", "class", "'_", ":_", "'", "span", "4", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "Textarea_", "(_", "attrs_", "=_", "{_", "'", "rows", "'_", ":_", "5_", ",_", "'", "class", "'_", ":_", "'", "span", "8", "'_", "}_", ")_", ",_", "\\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_", "Subd", "isc", "ipl", "ine", "Area", "Form_", "(_", "Model", "Form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Hack", "y", " ", "way", " ", "to", " ", "get", " ", "id", " ", "of", " ", "instance", " ", "from", " ", "a", " ", "form", " ", "in", " ", "a", " ", "template", " ", "(", "edit", "\\u", "sa", "\\u", "summar", "y", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "my", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Subd", "isc", "ipl", "ine", "Area_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "(_", "'", "subd", "isc", "ipl", "ine", "\\u", "area", "'_", ",_", "'", "description", "'_", ",_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "widgets_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "subd", "isc", "ipl", "ine", "\\u", "area", "'_", ":_", "Text", "Input_", "(_", "attrs_", "=_", "{_", "'", "class", "'_", ":_", "'", "span", "4", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "Textarea_", "(_", "attrs_", "=_", "{_", "'", "rows", "'_", ":_", "5_", ",_", "'", "class", "'_", ":_", "'", "span", "8", "'_", "}_", ")_", ",_", "\\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_", "Compet", "ency", "Area", "Form_", "(_", "Model", "Form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Hack", "y", " ", "way", " ", "to", " ", "get", " ", "id", " ", "of", " ", "instance", " ", "from", " ", "a", " ", "form", " ", "in", " ", "a", " ", "template", " ", "(", "edit", "\\u", "sa", "\\u", "summar", "y", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "my", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Compet", "ency", "Area_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "(_", "'", "compet", "ency", "\\u", "area", "'_", ",_", "'", "student", "\\u", "frie", "ndl", "y", "'_", ",_", "'", "description", "'_", ",_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels_", "=_", "{_", "'", "compet", "ency", "\\u", "area", "'_", ":_", "'", "Compet", "ency", " ", "Area", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Boots", "trap", " ", "controls", " ", "widt", "h", " ", "of", " ", "Text", "area", ",", " ", "ign", "orin", "g", " ", "the", " ", "'", "cols", "'", " ", "setti", "ng", ".", " ", "Can", " ", "als", "o", " ", "use", " ", "'", "class", "':", " ", "'", "input", "-", "block", "-", "level", "'_", "\\u\\u\\uNL\\u\\u\\u_", "widgets_", "=_", "{_", "'", "compet", "ency", "\\u", "area", "'_", ":_", "Textarea_", "(_", "attrs_", "=_", "{_", "'", "rows", "'_", ":_", "5_", ",_", "'", "class", "'_", ":_", "'", "span", "4", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "student", "\\u", "frie", "ndl", "y", "'_", ":_", "Textarea_", "(_", "attrs_", "=_", "{_", "'", "rows", "'_", ":_", "5_", ",_", "'", "class", "'_", ":_", "'", "span", "8", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "Textarea_", "(_", "attrs_", "=_", "{_", "'", "rows", "'_", ":_", "5_", ",_", "'", "class", "'_", ":_", "'", "span", "8", "'_", "}_", ")_", ",_", "\\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_", "Ess", "ential", "Under", "standing", "Form_", "(_", "Model", "Form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Ess", "ential", "Under", "standing", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "(_", "'", "essential", "\\u", "underst", "and", "ing", "'_", ",_", "'", "student", "\\u", "frie", "ndl", "y", "'_", ",_", "'", "description", "'_", ",_", "'", "public", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels_", "=_", "{_", "'", "essential", "\\u", "underst", "and", "ing", "'_", ":_", "'", "Ess", "ential", " ", "Under", "standing", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Boots", "trap", " ", "controls", " ", "widt", "h", " ", "of", " ", "Text", "area", ",", " ", "ign", "orin", "g", " ", "the", " ", "'", "cols", "'", " ", "setti", "ng", ".", " ", "Can", " ", "als", "o", " ", "use", " ", "'", "class", "':", " ", "'", "input", "-", "block", "-", "level", "'_", "\\u\\u\\uNL\\u\\u\\u_", "widgets_", "=_", "{_", "'", "essential", "\\u", "underst", "and", "ing", "'_", ":_", "Textarea_", "(_", "attrs_", "=_", "{_", "'", "rows", "'_", ":_", "5_", ",_", "'", "class", "'_", ":_", "'", "span", "7", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "student", "\\u", "frie", "ndl", "y", "'_", ":_", "Textarea_", "(_", "attrs_", "=_", "{_", "'", "rows", "'_", ":_", "5_", ",_", "'", "class", "'_", ":_", "'", "span", "8", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "Textarea_", "(_", "attrs_", "=_", "{_", "'", "rows", "'_", ":_", "5_", ",_", "'", "class", "'_", ":_", "'", "span", "8", "'_", "}_", ")_", ",_", "\\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_", "Learn", "ing", "Target", "Form_", "(_", "Model", "Form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Learn", "ing", "Target_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "(_", "'", "learn", "ing", "\\u", "target", "'_", ",_", "'", "student", "\\u", "frie", "ndl", "y", "'_", ",_", "'", "description", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Boots", "trap", " ", "controls", " ", "widt", "h", " ", "of", " ", "Text", "area", ",", " ", "ign", "orin", "g", " ", "the", " ", "'", "cols", "'", " ", "setti", "ng", ".", " ", "Can", " ", "als", "o", " ", "use", " ", "'", "class", "':", " ", "'", "input", "-", "block", "-", "level", "'_", "\\u\\u\\uNL\\u\\u\\u_", "widgets_", "=_", "{_", "'", "learn", "ing", "\\u", "target", "'_", ":_", "Textarea_", "(_", "attrs_", "=_", "{_", "'", "rows", "'_", ":_", "5_", ",_", "'", "class", "'_", ":_", "'", "span", "8", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "student", "\\u", "frie", "ndl", "y", "'_", ":_", "Textarea_", "(_", "attrs_", "=_", "{_", "'", "rows", "'_", ":_", "5_", ",_", "'", "class", "'_", ":_", "'", "span", "8", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "Textarea_", "(_", "attrs_", "=_", "{_", "'", "rows", "'_", ":_", "5_", ",_", "'", "class", "'_", ":_", "'", "span", "8", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
antiboredom/patent-generator/get_illustrations.py
[ { "content": "import sys, random\nimport machine\nfrom pattern.en import tag\nfrom pattern.web import Bing, SEARCH, IMAGE, URL, extension\n\n\n\ntext = sys.stdin.read()\ninvention = machine.Invention(text)\nengine = Bing(license=None)\n\n#the following searches for patent illustrations on bing, using a generated noun from each description of the illustration\n#search_base = \"patent illustration \"\n#for i, illustration in enumerate(invention.unformatted_illustrations):\n #nouns = [word for word, pos in tag(illustration) if pos == 'NN']\n #if len(nouns) > 0:\n #search_string = search_base + random.choice(nouns)#' '.join(nouns) \n #print \"searching for: \" + search_string\n #for j, result in enumerate(engine.search(search_string, type=IMAGE, count=5)):\n #print \"saving: \" + result.url\n #try:\n #save_image(result.url, \"fig_\" + str(i+1) + \"_\" + str(j+1))\n #except:\n #next\n\n# the following searches for \"fig N patent illustration\"\nsearch_base = \" patent illustration\"\nfor i, illustration in enumerate(invention.unformatted_illustrations):\n search_string = 'fig ' + str(i+1) + search_base\n print \"searching for: \" + search_string\n for j, result in enumerate(engine.search(search_string, type=IMAGE, count=5)):\n print \"saving: \" + result.url\n try:\n save_image(result.url, \"fig_\" + str(i+1) + \"_\" + str(j+1))\n except:\n next\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def save_image(url, figure):\n url = URL(url)\n f = open('illustrations/' + figure + extension(url.page), 'wb')\n f.write(url.download())\n f.close()", "metadata": "root.save_image", "header": "['module', '___EOS___']", "index": 5 } ]
[ { "span": "import sys, random", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 18 }, { "span": "from pattern.en import tag", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 26 }, { "span": "from pattern.web import Bing, SEARCH, IMAGE, URL, extension", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 59 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "sys_", ",_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "machine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pattern_", "._", "en_", "import_", "tag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pattern_", "._", "web_", "import_", "Bin", "g_", ",_", "SEARCH", "_", ",_", "IMAGE_", ",_", "URL_", ",_", "extension_", "\\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\\uDEDENT\\u\\u\\u_", "text_", "=_", "sys_", "._", "stdin_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inven", "tion_", "=_", "machine_", "._", "Inven", "tion_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "engine_", "=_", "Bin", "g_", "(_", "license_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "the", " ", "follow", "ing", " ", "searche", "s", " ", "for", " ", "pate", "nt", " ", "illust", "ration", "s", " ", "on", " ", "bing", ",", " ", "usi", "ng", " ", "a", " ", "generat", "ed", " ", "noun", " ", "from", " ", "each", " ", "description", " ", "of", " ", "the", " ", "illust", "ration", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "search", "\\u", "base", " ", "=", " ", "\"", "pate", "nt", " ", "illust", "ration", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "for", " ", "i", ",", " ", "illust", "ration", " ", "in", " ", "enumerate", "(", "inven", "tion", ".", "unfo", "rmat", "ted", "\\u", "illust", "ration", "s", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "noun", "s", " ", "=", " ", "[", "word", " ", "for", " ", "word", ",", " ", "pos", " ", "in", " ", "tag", "(", "illust", "ration", ")", " ", "if", " ", "pos", " ", "==", " ", "'", "NN", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "len", "(", "noun", "s", ")", " ", ">", " ", "0", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "search", "\\u", "string", " ", "=", " ", "search", "\\u", "base", " ", "+", " ", "random", ".", "choice", "(", "noun", "s", ")#", "'", " ", "'.", "join", "(", "noun", "s", ")", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "search", "ing", " ", "for", ":", " ", "\"", " ", "+", " ", "search", "\\u", "string_", "\\u\\u\\uNL\\u\\u\\u_", "#", "for", " ", "j", ",", " ", "result", " ", "in", " ", "enumerate", "(", "eng", "ine", ".", "search", "(", "search", "\\u", "string", ",", " ", "type", "=", "IMA", "GE", ",", " ", "count", "=", "5", "))", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "saving", ":", " ", "\"", " ", "+", " ", "result", ".", "url_", "\\u\\u\\uNL\\u\\u\\u_", "#", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "save", "\\u", "image", "(", "result", ".", "url", ",", " ", "\"", "fig", "\\u\"", " ", "+", " ", "str", "(", "i", "+", "1", ")", " ", "+", " ", "\"\\u", "\"", " ", "+", " ", "str", "(", "j", "+", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "except", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "next_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "follow", "ing", " ", "searche", "s", " ", "for", " ", "\"", "fig", " ", "N", " ", "pate", "nt", " ", "illust", "ration", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "search", "\\u", "base_", "=_", "\"", " ", "pate", "nt", " ", "illust", "ration", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "illust", "ration", "_", "in_", "enumerate_", "(_", "inven", "tion_", "._", "unfo", "rmat", "ted", "\\u", "illust", "ration", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "search", "\\u", "string_", "=_", "'", "fig", " ", "'_", "+_", "str_", "(_", "i_", "+_", "1_", ")_", "+_", "search", "\\u", "base_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "search", "ing", " ", "for", ":", " ", "\"_", "+_", "search", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", ",_", "result_", "in_", "enumerate_", "(_", "engine_", "._", "search_", "(_", "search", "\\u", "string_", ",_", "type_", "=_", "IMAGE_", ",_", "count_", "=_", "5_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "saving", ":", " ", "\"_", "+_", "result_", "._", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "save", "\\u", "image_", "(_", "result_", "._", "url_", ",_", "\"", "fig", "\\u\"_", "+_", "str_", "(_", "i_", "+_", "1_", ")_", "+_", "\"\\u\"_", "+_", "str_", "(_", "j_", "+_", "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 ", " _", "next_", "\\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_", "save", "\\u", "image_", "(_", "url_", ",_", "figure_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "URL_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "open_", "(_", "'", "illust", "ration", "s", "/'_", "+_", "figure_", "+_", "extension_", "(_", "url_", "._", "page_", ")_", ",_", "'", "wb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "url_", "._", "download_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
osrg/ryu/ryu/services/protocols/vrrp/event.py
[ { "content": "# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.\n# Copyright (C) 2013 Isaku Yamahata <yamahata at private email ne jp>\n#\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#\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,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n# implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"\nEvents for VRRP\n\"\"\"\n\nfrom ryu.controller import handler\nfrom ryu.controller import event\nfrom ryu.lib import dpid as dpid_lib\nfrom ryu.lib import mac as mac_lib\nfrom ryu.lib.packet import vrrp\nfrom ryu.lib import addrconv\n\n\n# When an instance is created, state transition is None -> Initialize\nVRRP_STATE_INITIALIZE = 'Initialize'\nVRRP_STATE_MASTER = 'Master'\nVRRP_STATE_BACKUP = 'Backup'\n\n\nVRRP_MANAGER_NAME = 'VRRPManager'\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# Following classes are internally used by VRRP\n\n\n\n\n\nhandler.register_service('ryu.services.protocols.vrrp.manager')\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class VRRPInterfaceBase(object):\n \"\"\"\n interface on which VRRP router works\n vlan_id = None means no vlan.\n NOTE: multiple virtual router can be configured on single port\n See RFC 5798 4.2 Sample Configuration 2\n \"\"\"\n\n", "metadata": "root.VRRPInterfaceBase", "header": "['module', '___EOS___']", "index": 37 }, { "content": " def __init__(self, mac_address, primary_ip_address, vlan_id=None):\n super(VRRPInterfaceBase, self).__init__()\n self.mac_address = mac_address\n self.primary_ip_address = primary_ip_address\n self.vlan_id = vlan_id", "metadata": "root.VRRPInterfaceBase.__init__", "header": "['class', 'VRRPInterfaceBase', '(', 'object', ')', ':', '___EOS___']", "index": 44 }, { "content": " def __eq__(self, other):\n return (self.__class__ == other.__class__ and\n self.mac_address == other.mac_address and\n self.primary_ip_address == other.primary_ip_address and\n self.vlan_id == other.vlan_id)", "metadata": "root.VRRPInterfaceBase.__eq__", "header": "['class', 'VRRPInterfaceBase', '(', 'object', ')', ':', '___EOS___']", "index": 50 }, { "content": " def __hash__(self):\n return hash((\n addrconv.mac.text_to_bin(self.mac_address),\n vrrp.ip_text_to_bin(self.primary_ip_address), self.vlan_id))", "metadata": "root.VRRPInterfaceBase.__hash__", "header": "['class', 'VRRPInterfaceBase', '(', 'object', ')', ':', '___EOS___']", "index": 56 }, { "content": "class VRRPInterfaceNetworkDevice(VRRPInterfaceBase):\n\n\n", "metadata": "root.VRRPInterfaceNetworkDevice", "header": "['module', '___EOS___']", "index": 62 }, { "content": " def __init__(self, mac_address, primary_ip_address, vlan_id,\n device_name):\n super(VRRPInterfaceNetworkDevice, self).__init__(\n mac_address, primary_ip_address, vlan_id)\n self.device_name = device_name", "metadata": "root.VRRPInterfaceNetworkDevice.__init__", "header": "['class', 'VRRPInterfaceNetworkDevice', '(', 'VRRPInterfaceBase', ')', ':', '___EOS___']", "index": 63 }, { "content": " def __str__(self):\n return '%s<%s, %s, %s, %s>' % (\n self.__class__.__name__,\n self.mac_address,\n self.primary_ip_address, self.vlan_id,\n self.device_name)", "metadata": "root.VRRPInterfaceNetworkDevice.__str__", "header": "['class', 'VRRPInterfaceNetworkDevice', '(', 'VRRPInterfaceBase', ')', ':', '___EOS___']", "index": 69 }, { "content": " def __eq__(self, other):\n return (super(VRRPInterfaceNetworkDevice, self).__eq__(other) and\n self.device_name == other.device_name)", "metadata": "root.VRRPInterfaceNetworkDevice.__eq__", "header": "['class', 'VRRPInterfaceNetworkDevice', '(', 'VRRPInterfaceBase', ')', ':', '___EOS___']", "index": 76 }, { "content": " def __hash__(self):\n return hash((\n addrconv.mac.text_to_bin(self.mac_address),\n vrrp.ip_text_to_bin(self.primary_ip_address), self.vlan_id,\n self.device_name))", "metadata": "root.VRRPInterfaceNetworkDevice.__hash__", "header": "['class', 'VRRPInterfaceNetworkDevice', '(', 'VRRPInterfaceBase', ')', ':', '___EOS___']", "index": 80 }, { "content": "class VRRPInterfaceOpenFlow(VRRPInterfaceBase):\n\n\n", "metadata": "root.VRRPInterfaceOpenFlow", "header": "['module', '___EOS___']", "index": 87 }, { "content": " def __init__(self, mac_address, primary_ip_address, vlan_id,\n dpid, port_no):\n super(VRRPInterfaceOpenFlow, self).__init__(\n mac_address, primary_ip_address, vlan_id)\n self.dpid = dpid\n self.port_no = port_no", "metadata": "root.VRRPInterfaceOpenFlow.__init__", "header": "['class', 'VRRPInterfaceOpenFlow', '(', 'VRRPInterfaceBase', ')', ':', '___EOS___']", "index": 88 }, { "content": " def __str__(self):\n return '%s<%s, %s, %s, %s, %d>' % (\n self.__class__.__name__,\n self.mac_address,\n self.primary_ip_address, self.vlan_id,\n dpid_lib.dpid_to_str(self.dpid), self.port_no)", "metadata": "root.VRRPInterfaceOpenFlow.__str__", "header": "['class', 'VRRPInterfaceOpenFlow', '(', 'VRRPInterfaceBase', ')', ':', '___EOS___']", "index": 95 }, { "content": " def __eq__(self, other):\n return (super(VRRPInterfaceOpenFlow, self).__eq__(other) and\n self.dpid == other.dpid and self.port_no == other.port_no)", "metadata": "root.VRRPInterfaceOpenFlow.__eq__", "header": "['class', 'VRRPInterfaceOpenFlow', '(', 'VRRPInterfaceBase', ')', ':', '___EOS___']", "index": 102 }, { "content": " def __hash__(self):\n return hash((\n addrconv.mac.text_to_bin(self.mac_address),\n vrrp.ip_text_to_bin(self.primary_ip_address), self.vlan_id,\n self.dpid, self.port_no))", "metadata": "root.VRRPInterfaceOpenFlow.__hash__", "header": "['class', 'VRRPInterfaceOpenFlow', '(', 'VRRPInterfaceBase', ')', ':', '___EOS___']", "index": 106 }, { "content": "class VRRPConfig(object):\n \"\"\"\n advertmisement_interval is in seconds as float. (Not in centiseconds)\n \"\"\"\n\n\n", "metadata": "root.VRRPConfig", "header": "['module', '___EOS___']", "index": 113 }, { "content": " def __init__(self, version=vrrp.VRRP_VERSION_V3, vrid=None,\n admin_state=True,\n priority=vrrp.VRRP_PRIORITY_BACKUP_DEFAULT, ip_addresses=None,\n advertisement_interval=vrrp.VRRP_MAX_ADVER_INT_DEFAULT_IN_SEC,\n preempt_mode=True, preempt_delay=0, accept_mode=False,\n statistics_interval=30, resource_id=None):\n # To allow version and priority default\n assert vrid is not None\n assert ip_addresses is not None\n super(VRRPConfig, self).__init__()\n\n self.version = version\n self.admin_state = admin_state\n self.vrid = vrid\n self.priority = priority\n self.ip_addresses = ip_addresses\n self.advertisement_interval = advertisement_interval\n self.preempt_mode = preempt_mode\n self.preempt_delay = preempt_delay\n self.accept_mode = accept_mode\n self.is_ipv6 = vrrp.is_ipv6(ip_addresses[0])\n self.statistics_interval = statistics_interval\n self.resource_id = resource_id", "metadata": "root.VRRPConfig.__init__", "header": "['class', 'VRRPConfig', '(', 'object', ')', ':', '___EOS___']", "index": 117 }, { "content": " @property\n def address_owner(self):\n return self.priority == vrrp.VRRP_PRIORITY_ADDRESS_OWNER", "metadata": "root.VRRPConfig.address_owner", "header": "['class', 'VRRPConfig', '(', 'object', ')', ':', '___EOS___']", "index": 141 }, { "content": " def __eq__(self, other):\n return (self.version == other.version and\n self.vrid == other.vrid and\n self.priority == other.priority and\n self.ip_addresses == other.ip_addresses and\n self.advertisement_interval == other.advertisement_interval and\n self.preempt_mode == other.preempt_mode and\n self.preempt_delay == other.preempt_delay and\n self.accept_mode == other.accept_mode and\n self.is_ipv6 == other.is_ipv6)", "metadata": "root.VRRPConfig.__eq__", "header": "['class', 'VRRPConfig', '(', 'object', ')', ':', '___EOS___']", "index": 145 }, { "content": " def __hash__(self):\n hash((self.version, self.vrid, self.priority,\n list(map(vrrp.ip_text_to_bin, self.ip_addresses)),\n self.advertisement_interval, self.preempt_mode,\n self.preempt_delay, self.accept_mode, self.is_ipv6))", "metadata": "root.VRRPConfig.__hash__", "header": "['class', 'VRRPConfig', '(', 'object', ')', ':', '___EOS___']", "index": 156 }, { "content": "class EventVRRPConfigRequest(event.EventRequestBase):\n \"\"\"\n Request from management layer to VRRP manager to initialize VRRP Router.\n \"\"\"", "metadata": "root.EventVRRPConfigRequest", "header": "['module', '___EOS___']", "index": 163 }, { "content": " def __init__(self, interface, config):\n super(EventVRRPConfigRequest, self).__init__()\n self.dst = VRRP_MANAGER_NAME\n self.interface = interface\n self.config = config", "metadata": "root.EventVRRPConfigRequest.__init__", "header": "['class', 'EventVRRPConfigRequest', '(', 'event', '.', 'EventRequestBase', ')', ':', '___EOS___']", "index": 167 }, { "content": "class EventVRRPConfigReply(event.EventReplyBase):", "metadata": "root.EventVRRPConfigReply", "header": "['module', '___EOS___']", "index": 174 }, { "content": " def __init__(self, instance_name, interface, config):\n # dst = None. dst is filled by app_base.RyuApp#reply_to_request()\n super(EventVRRPConfigReply, self).__init__(None)\n self.instance_name = instance_name # None means failure\n self.interface = interface\n self.config = config", "metadata": "root.EventVRRPConfigReply.__init__", "header": "['class', 'EventVRRPConfigReply', '(', 'event', '.', 'EventReplyBase', ')', ':', '___EOS___']", "index": 175 }, { "content": "class EventVRRPShutdownRequest(event.EventRequestBase):\n \"\"\"\n Request from management layer to VRRP to shutdown VRRP Router.\n \"\"\"", "metadata": "root.EventVRRPShutdownRequest", "header": "['module', '___EOS___']", "index": 183 }, { "content": " def __init__(self, instance_name):\n super(EventVRRPShutdownRequest, self).__init__()\n self.instance_name = instance_name", "metadata": "root.EventVRRPShutdownRequest.__init__", "header": "['class', 'EventVRRPShutdownRequest', '(', 'event', '.', 'EventRequestBase', ')', ':', '___EOS___']", "index": 187 }, { "content": "class EventVRRPStateChanged(event.EventBase):\n \"\"\"\n Event that this VRRP Router changed its state.\n \"\"\"", "metadata": "root.EventVRRPStateChanged", "header": "['module', '___EOS___']", "index": 192 }, { "content": " def __init__(self, instance_name, monitor_name, interface, config,\n old_state, new_state):\n super(EventVRRPStateChanged, self).__init__()\n self.instance_name = instance_name\n self.monitor_name = monitor_name\n self.interface = interface\n self.config = config\n self.old_state = old_state\n self.new_state = new_state", "metadata": "root.EventVRRPStateChanged.__init__", "header": "['class', 'EventVRRPStateChanged', '(', 'event', '.', 'EventBase', ')', ':', '___EOS___']", "index": 196 }, { "content": "class VRRPInstance(object):", "metadata": "root.VRRPInstance", "header": "['module', '___EOS___']", "index": 207 }, { "content": " def __init__(self, instance_name, monitor_name, config, interface, state):\n super(VRRPInstance, self).__init__()\n self.instance_name = instance_name\n self.monitor_name = monitor_name\n self.config = config\n self.interface = interface\n self.state = state", "metadata": "root.VRRPInstance.__init__", "header": "['class', 'VRRPInstance', '(', 'object', ')', ':', '___EOS___']", "index": 208 }, { "content": "class EventVRRPListRequest(event.EventRequestBase):\n \"\"\"\n Event that requests list of configured VRRP router\n instance_name=None means all instances.\n \"\"\"", "metadata": "root.EventVRRPListRequest", "header": "['module', '___EOS___']", "index": 217 }, { "content": " def __init__(self, instance_name=None):\n super(EventVRRPListRequest, self).__init__()\n self.instance_name = instance_name", "metadata": "root.EventVRRPListRequest.__init__", "header": "['class', 'EventVRRPListRequest', '(', 'event', '.', 'EventRequestBase', ')', ':', '___EOS___']", "index": 222 }, { "content": "class EventVRRPListReply(event.EventReplyBase):", "metadata": "root.EventVRRPListReply", "header": "['module', '___EOS___']", "index": 227 }, { "content": " def __init__(self, instance_list):\n super(EventVRRPListReply, self).__init__(None)\n self.instance_list = instance_list", "metadata": "root.EventVRRPListReply.__init__", "header": "['class', 'EventVRRPListReply', '(', 'event', '.', 'EventReplyBase', ')', ':', '___EOS___']", "index": 228 }, { "content": "class EventVRRPConfigChangeRequest(event.EventRequestBase):\n \"\"\"\n Event that requests to change configuration of a given VRRP router.\n None means no-change.\n \"\"\"", "metadata": "root.EventVRRPConfigChangeRequest", "header": "['module', '___EOS___']", "index": 233 }, { "content": " def __init__(self, instance_name, priority=None,\n advertisement_interval=None, preempt_mode=None,\n preempt_delay=None, accept_mode=None):\n super(EventVRRPConfigChangeRequest, self).__init__()\n self.instance_name = instance_name\n self.priority = priority\n self.advertisement_interval = advertisement_interval\n self.preempt_mode = preempt_mode\n self.preempt_delay = preempt_delay\n self.accept_mode = accept_mode", "metadata": "root.EventVRRPConfigChangeRequest.__init__", "header": "['class', 'EventVRRPConfigChangeRequest', '(', 'event', '.', 'EventRequestBase', ')', ':', '___EOS___']", "index": 238 }, { "content": "class EventVRRPReceived(event.EventBase):\n \"\"\"\n Event that port manager received valid VRRP packet.\n Usually handed by VRRP Router.\n \"\"\"", "metadata": "root.EventVRRPReceived", "header": "['module', '___EOS___']", "index": 252 }, { "content": " def __init__(self, interface, packet):\n super(EventVRRPReceived, self).__init__()\n self.interface = interface\n self.packet = packet", "metadata": "root.EventVRRPReceived.__init__", "header": "['class', 'EventVRRPReceived', '(', 'event', '.', 'EventBase', ')', ':', '___EOS___']", "index": 257 }, { "content": "class EventVRRPTransmitRequest(event.EventRequestBase):\n \"\"\"\n Request from VRRP router to port manager to transmit VRRP packet.\n \"\"\"", "metadata": "root.EventVRRPTransmitRequest", "header": "['module', '___EOS___']", "index": 263 }, { "content": " def __init__(self, data):\n super(EventVRRPTransmitRequest, self).__init__()\n self.data = data", "metadata": "root.EventVRRPTransmitRequest.__init__", "header": "['class', 'EventVRRPTransmitRequest', '(', 'event', '.', 'EventRequestBase', ')', ':', '___EOS___']", "index": 267 } ]
[ { "span": "from ryu.lib import mac as mac_lib", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 34 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2013", " ", "Ni", "ppo", "n", " ", "Tele", "graph", " ", "and", " ", "Telephone", " ", "Cor", "porat", "ion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2013", " ", "Is", "ak", "u", " ", "Ya", "mah", "ata", " ", "<", "ya", "mah", "ata", " ", "at", " ", "private", " ", "email", " ", "ne", " ", "jp", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\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_", "#", "_", "\\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", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "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_", "\"\"\"", "\\", "10", ";", "Event", "s", " ", "for", " ", "VR", "RP", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "ryu", "_", "._", "controller_", "import_", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ryu", "_", "._", "controller_", "import_", "event_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ryu", "_", "._", "lib_", "import_", "dpid_", "as_", "dpid", "\\u", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ryu", "_", "._", "lib_", "import_", "mac_", "as_", "mac", "\\u", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ryu", "_", "._", "lib_", "._", "packet_", "import_", "vr", "rp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ryu", "_", "._", "lib_", "import_", "addr", "conv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Whe", "n", " ", "an", " ", "instance", " ", "is", " ", "created", ",", " ", "state", " ", "transiti", "on", " ", "is", " ", "Non", "e", " ", "->", " ", "Initializ", "e_", "\\u\\u\\uNL\\u\\u\\u_", "VR", "RP", "\\u", "STATE", "\\u", "INITIAL", "IZE_", "=_", "'", "Initializ", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "VR", "RP", "\\u", "STATE", "\\u", "MASTER", "_", "=_", "'", "Master", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "VR", "RP", "\\u", "STATE", "\\u", "BACKUP", "_", "=_", "'", "Back", "up", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "VR", "RP", "\\u", "MANAGER", "\\u", "NAME_", "=_", "'", "VR", "RPM", "anager", "'_", "\\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_", "\\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_", "#", " ", "Follow", "ing", " ", "classe", "s", " ", "are", " ", "internal", "ly", " ", "used", " ", "by", " ", "VR", "RP", "_", "\\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_", "handler_", "._", "register", "\\u", "service_", "(_", "'", "ryu", ".", "service", "s", ".", "protoc", "ols", ".", "vr", "rp", ".", "manage", "r", "'_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "VR", "RP", "Interface", "Base_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "interface", " ", "on", " ", "whi", "ch", " ", "VR", "RP", " ", "router", " ", "works", "\\", "10", ";", " ", " ", " ", " ", "vlan", "\\u", "id", " ", "=", " ", "Non", "e", " ", "means", " ", "no", " ", "vlan", ".", "\\", "10", ";", " ", " ", " ", " ", "NOTE", ":", " ", "multiple", " ", "virtual", " ", "router", " ", "can", " ", "be", " ", "configur", "ed", " ", "on", " ", "single", " ", "port", "\\", "10", ";", " ", " ", "See", " ", "RF", "C", " ", "579", "8", " ", "4.2", " ", "Sampl", "e", " ", "Configura", "tion", " ", "2", "\\", "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_", "[SEP]_", "class_", "VR", "RP", "Interface", "Base_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "mac", "\\u", "address_", ",_", "primary", "\\u", "ip", "\\u", "address_", ",_", "vlan", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "VR", "RP", "Interface", "Base_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mac", "\\u", "address_", "=_", "mac", "\\u", "address_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "primary", "\\u", "ip", "\\u", "address_", "=_", "primary", "\\u", "ip", "\\u", "address_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "vlan", "\\u", "id_", "=_", "vlan", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VR", "RP", "Interface", "Base_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "==_", "other_", "._", "\\u\\u", "class\\u\\u_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mac", "\\u", "address_", "==_", "other_", "._", "mac", "\\u", "address_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "primary", "\\u", "ip", "\\u", "address_", "==_", "other_", "._", "primary", "\\u", "ip", "\\u", "address_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "vlan", "\\u", "id_", "==_", "other_", "._", "vlan", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VR", "RP", "Interface", "Base_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "hash\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "hash_", "(_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "addr", "conv_", "._", "mac_", "._", "text", "\\u", "to", "\\u", "bin_", "(_", "self_", "._", "mac", "\\u", "address_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vr", "rp_", "._", "ip", "\\u", "text", "\\u", "to", "\\u", "bin_", "(_", "self_", "._", "primary", "\\u", "ip", "\\u", "address_", ")_", ",_", "self_", "._", "vlan", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "VR", "RP", "Interface", "Network", "Device_", "(_", "VR", "RP", "Interface", "Base_", ")_", ":_", "\\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_", "[SEP]_", "class_", "VR", "RP", "Interface", "Network", "Device_", "(_", "VR", "RP", "Interface", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "mac", "\\u", "address_", ",_", "primary", "\\u", "ip", "\\u", "address_", ",_", "vlan", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "device", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "VR", "RP", "Interface", "Network", "Device_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "mac", "\\u", "address_", ",_", "primary", "\\u", "ip", "\\u", "address_", ",_", "vlan", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "device", "\\u", "name_", "=_", "device", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VR", "RP", "Interface", "Network", "Device_", "(_", "VR", "RP", "Interface", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "s", "<", "%", "s", ",", " ", "%", "s", ",", " ", "%", "s", ",", " ", "%", "s", ">'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mac", "\\u", "address_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "primary", "\\u", "ip", "\\u", "address_", ",_", "self_", "._", "vlan", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "device", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VR", "RP", "Interface", "Network", "Device_", "(_", "VR", "RP", "Interface", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "super_", "(_", "VR", "RP", "Interface", "Network", "Device_", ",_", "self_", ")_", "._", "\\u\\u", "eq\\u\\u_", "(_", "other_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "device", "\\u", "name_", "==_", "other_", "._", "device", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VR", "RP", "Interface", "Network", "Device_", "(_", "VR", "RP", "Interface", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "hash\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "hash_", "(_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "addr", "conv_", "._", "mac_", "._", "text", "\\u", "to", "\\u", "bin_", "(_", "self_", "._", "mac", "\\u", "address_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vr", "rp_", "._", "ip", "\\u", "text", "\\u", "to", "\\u", "bin_", "(_", "self_", "._", "primary", "\\u", "ip", "\\u", "address_", ")_", ",_", "self_", "._", "vlan", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "device", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "VR", "RP", "Interface", "Open", "Flow_", "(_", "VR", "RP", "Interface", "Base_", ")_", ":_", "\\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_", "[SEP]_", "class_", "VR", "RP", "Interface", "Open", "Flow_", "(_", "VR", "RP", "Interface", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "mac", "\\u", "address_", ",_", "primary", "\\u", "ip", "\\u", "address_", ",_", "vlan", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dpid_", ",_", "port", "\\u", "no_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "VR", "RP", "Interface", "Open", "Flow_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "mac", "\\u", "address_", ",_", "primary", "\\u", "ip", "\\u", "address_", ",_", "vlan", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dpid_", "=_", "dpid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "port", "\\u", "no_", "=_", "port", "\\u", "no_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VR", "RP", "Interface", "Open", "Flow_", "(_", "VR", "RP", "Interface", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "s", "<", "%", "s", ",", " ", "%", "s", ",", " ", "%", "s", ",", " ", "%", "s", ",", " ", "%", "d", ">'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mac", "\\u", "address_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "primary", "\\u", "ip", "\\u", "address_", ",_", "self_", "._", "vlan", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dpid", "\\u", "lib_", "._", "dpid", "\\u", "to", "\\u", "str_", "(_", "self_", "._", "dpid_", ")_", ",_", "self_", "._", "port", "\\u", "no_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VR", "RP", "Interface", "Open", "Flow_", "(_", "VR", "RP", "Interface", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "super_", "(_", "VR", "RP", "Interface", "Open", "Flow_", ",_", "self_", ")_", "._", "\\u\\u", "eq\\u\\u_", "(_", "other_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dpid_", "==_", "other_", "._", "dpid_", "and_", "self_", "._", "port", "\\u", "no_", "==_", "other_", "._", "port", "\\u", "no_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VR", "RP", "Interface", "Open", "Flow_", "(_", "VR", "RP", "Interface", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "hash\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "hash_", "(_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "addr", "conv_", "._", "mac_", "._", "text", "\\u", "to", "\\u", "bin_", "(_", "self_", "._", "mac", "\\u", "address_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vr", "rp_", "._", "ip", "\\u", "text", "\\u", "to", "\\u", "bin_", "(_", "self_", "._", "primary", "\\u", "ip", "\\u", "address_", ")_", ",_", "self_", "._", "vlan", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dpid_", ",_", "self_", "._", "port", "\\u", "no_", ")_", ")_", "\\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_", "VR", "RP", "Config_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "adver", "tmi", "sem", "ent", "\\u", "interval", " ", "is", " ", "in", " ", "second", "s", " ", "as", " ", "float", ".", " ", "(", "Not", " ", "in", " ", "cent", "ise", "conds", ")", "\\", "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_", "[SEP]_", "class_", "VR", "RP", "Config_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "version_", "=_", "vr", "rp_", "._", "VR", "RP", "\\u", "VERSI", "ON", "\\u", "V3_", ",_", "vr", "id_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "admin", "\\u", "state_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "priority_", "=_", "vr", "rp_", "._", "VR", "RP", "\\u", "PRIORITY", "\\u", "BACKUP", "\\u", "DEFAULT_", ",_", "ip", "\\u", "addresses_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "advertise", "ment", "\\u", "interval_", "=_", "vr", "rp_", "._", "VR", "RP", "\\u", "MAX", "\\u", "ADV", "ER", "\\u", "INT", "\\u", "DEF", "AUL", "T", "\\u", "IN", "\\u", "SEC", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pree", "mpt", "\\u", "mode_", "=_", "True_", ",_", "pree", "mpt", "\\u", "delay_", "=_", "0_", ",_", "accept", "\\u", "mode_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "statistic", "s", "\\u", "interval_", "=_", "30_", ",_", "resource", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "To", " ", "allow", " ", "version", " ", "and", " ", "priorit", "y", " ", "default_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "vr", "id_", "is_", "not_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "ip", "\\u", "addresses_", "is_", "not_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "VR", "RP", "Config_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "version_", "=_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "admin", "\\u", "state_", "=_", "admin", "\\u", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "vr", "id_", "=_", "vr", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "priority_", "=_", "priority_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ip", "\\u", "addresses_", "=_", "ip", "\\u", "addresses_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "advertise", "ment", "\\u", "interval_", "=_", "advertise", "ment", "\\u", "interval_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pree", "mpt", "\\u", "mode_", "=_", "pree", "mpt", "\\u", "mode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pree", "mpt", "\\u", "delay_", "=_", "pree", "mpt", "\\u", "delay_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "accept", "\\u", "mode_", "=_", "accept", "\\u", "mode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "\\u", "ipv6_", "=_", "vr", "rp_", "._", "is", "\\u", "ipv6_", "(_", "ip", "\\u", "addresses_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "statistic", "s", "\\u", "interval_", "=_", "statistic", "s", "\\u", "interval_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "resource", "\\u", "id_", "=_", "resource", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VR", "RP", "Config_", "(_", "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_", "address", "\\u", "owner_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "priority_", "==_", "vr", "rp_", "._", "VR", "RP", "\\u", "PRIORITY", "\\u", "ADDR", "ESS", "\\u", "OWNER", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VR", "RP", "Config_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "self_", "._", "version_", "==_", "other_", "._", "version_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "vr", "id_", "==_", "other_", "._", "vr", "id_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "priority_", "==_", "other_", "._", "priority_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ip", "\\u", "addresses_", "==_", "other_", "._", "ip", "\\u", "addresses_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "advertise", "ment", "\\u", "interval_", "==_", "other_", "._", "advertise", "ment", "\\u", "interval_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "pree", "mpt", "\\u", "mode_", "==_", "other_", "._", "pree", "mpt", "\\u", "mode_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "pree", "mpt", "\\u", "delay_", "==_", "other_", "._", "pree", "mpt", "\\u", "delay_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "accept", "\\u", "mode_", "==_", "other_", "._", "accept", "\\u", "mode_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "is", "\\u", "ipv6_", "==_", "other_", "._", "is", "\\u", "ipv6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VR", "RP", "Config_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "hash\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hash_", "(_", "(_", "self_", "._", "version_", ",_", "self_", "._", "vr", "id_", ",_", "self_", "._", "priority_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "list_", "(_", "map_", "(_", "vr", "rp_", "._", "ip", "\\u", "text", "\\u", "to", "\\u", "bin_", ",_", "self_", "._", "ip", "\\u", "addresses_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "advertise", "ment", "\\u", "interval_", ",_", "self_", "._", "pree", "mpt", "\\u", "mode_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "pree", "mpt", "\\u", "delay_", ",_", "self_", "._", "accept", "\\u", "mode_", ",_", "self_", "._", "is", "\\u", "ipv6_", ")_", ")_", "\\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_", "Event", "VR", "RP", "Config", "Request_", "(_", "event_", "._", "Event", "Request", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Request", " ", "from", " ", "manage", "ment", " ", "layer", " ", "to", " ", "VR", "RP", " ", "manage", "r", " ", "to", " ", "initialize", " ", "VR", "RP", " ", "Route", "r", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Event", "VR", "RP", "Config", "Request_", "(_", "event_", "._", "Event", "Request", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "interface_", ",_", "config_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Event", "VR", "RP", "Config", "Request_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dst_", "=_", "VR", "RP", "\\u", "MANAGER", "\\u", "NAME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "interface_", "=_", "interface_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "config_", "=_", "config_", "\\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_", "Event", "VR", "RP", "Config", "Reply_", "(_", "event_", "._", "Event", "Repl", "y", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Event", "VR", "RP", "Config", "Reply_", "(_", "event_", "._", "Event", "Repl", "y", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "instance", "\\u", "name_", ",_", "interface_", ",_", "config_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "dst", " ", "=", " ", "Non", "e", ".", " ", "dst", " ", "is", " ", "filled", " ", "by", " ", "app", "\\u", "base", ".", "Ry", "u", "App", "#", "repl", "y", "\\u", "to", "\\u", "request", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Event", "VR", "RP", "Config", "Reply_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", "=_", "instance", "\\u", "name_", "#", " ", "Non", "e", " ", "means", " ", "failure_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "interface_", "=_", "interface_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "config_", "=_", "config_", "\\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_", "Event", "VR", "RP", "Shut", "down", "Request_", "(_", "event_", "._", "Event", "Request", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Request", " ", "from", " ", "manage", "ment", " ", "layer", " ", "to", " ", "VR", "RP", " ", "to", " ", "shut", "down", " ", "VR", "RP", " ", "Route", "r", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Event", "VR", "RP", "Shut", "down", "Request_", "(_", "event_", "._", "Event", "Request", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "instance", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Event", "VR", "RP", "Shut", "down", "Request_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", "=_", "instance", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Event", "VR", "RP", "State", "Changed_", "(_", "event_", "._", "Event", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Event", " ", "tha", "t", " ", "this", " ", "VR", "RP", " ", "Route", "r", " ", "change", "d", " ", "its", " ", "state", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Event", "VR", "RP", "State", "Changed_", "(_", "event_", "._", "Event", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "instance", "\\u", "name_", ",_", "monit", "or", "\\u", "name_", ",_", "interface_", ",_", "config_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "old", "\\u", "state_", ",_", "new", "\\u", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Event", "VR", "RP", "State", "Changed_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", "=_", "instance", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "monit", "or", "\\u", "name_", "=_", "monit", "or", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "interface_", "=_", "interface_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "config_", "=_", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "old", "\\u", "state_", "=_", "old", "\\u", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "new", "\\u", "state_", "=_", "new", "\\u", "state_", "\\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_", "VR", "RP", "Instance_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "VR", "RP", "Instance_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "instance", "\\u", "name_", ",_", "monit", "or", "\\u", "name_", ",_", "config_", ",_", "interface_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "VR", "RP", "Instance_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", "=_", "instance", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "monit", "or", "\\u", "name_", "=_", "monit", "or", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "config_", "=_", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "interface_", "=_", "interface_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "=_", "state_", "\\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_", "Event", "VR", "RPL", "ist", "Request_", "(_", "event_", "._", "Event", "Request", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Event", " ", "tha", "t", " ", "request", "s", " ", "list", " ", "of", " ", "configur", "ed", " ", "VR", "RP", " ", "router", "\\", "10", ";", " ", " ", " ", " ", "instance", "\\u", "name", "=", "Non", "e", " ", "means", " ", "all", " ", "instance", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Event", "VR", "RPL", "ist", "Request_", "(_", "event_", "._", "Event", "Request", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "instance", "\\u", "name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Event", "VR", "RPL", "ist", "Request_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", "=_", "instance", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Event", "VR", "RPL", "ist", "Reply_", "(_", "event_", "._", "Event", "Repl", "y", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Event", "VR", "RPL", "ist", "Reply_", "(_", "event_", "._", "Event", "Repl", "y", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "instance", "\\u", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Event", "VR", "RPL", "ist", "Reply_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "instance", "\\u", "list_", "=_", "instance", "\\u", "list_", "\\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_", "Event", "VR", "RP", "Config", "Change", "Request_", "(_", "event_", "._", "Event", "Request", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Event", " ", "tha", "t", " ", "request", "s", " ", "to", " ", "change", " ", "configura", "tion", " ", "of", " ", "a", " ", "give", "n", " ", "VR", "RP", " ", "router", ".", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", " ", "means", " ", "no", "-", "change", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Event", "VR", "RP", "Config", "Change", "Request_", "(_", "event_", "._", "Event", "Request", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "instance", "\\u", "name_", ",_", "priority_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "advertise", "ment", "\\u", "interval_", "=_", "None_", ",_", "pree", "mpt", "\\u", "mode_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pree", "mpt", "\\u", "delay_", "=_", "None_", ",_", "accept", "\\u", "mode_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Event", "VR", "RP", "Config", "Change", "Request_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", "=_", "instance", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "priority_", "=_", "priority_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "advertise", "ment", "\\u", "interval_", "=_", "advertise", "ment", "\\u", "interval_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pree", "mpt", "\\u", "mode_", "=_", "pree", "mpt", "\\u", "mode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pree", "mpt", "\\u", "delay_", "=_", "pree", "mpt", "\\u", "delay_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "accept", "\\u", "mode_", "=_", "accept", "\\u", "mode_", "\\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_", "Event", "VR", "RP", "Received_", "(_", "event_", "._", "Event", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Event", " ", "tha", "t", " ", "port", " ", "manage", "r", " ", "receive", "d", " ", "valid", " ", "VR", "RP", " ", "packet", ".", "\\", "10", ";", " ", " ", " ", " ", "Us", "ual", "ly", " ", "hande", "d", " ", "by", " ", "VR", "RP", " ", "Route", "r", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Event", "VR", "RP", "Received_", "(_", "event_", "._", "Event", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "interface_", ",_", "packet_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Event", "VR", "RP", "Received_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "interface_", "=_", "interface_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "packet_", "=_", "packet_", "\\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_", "Event", "VR", "RP", "Transmit", "Request_", "(_", "event_", "._", "Event", "Request", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Request", " ", "from", " ", "VR", "RP", " ", "router", " ", "to", " ", "port", " ", "manage", "r", " ", "to", " ", "transmit", " ", "VR", "RP", " ", "packet", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Event", "VR", "RP", "Transmit", "Request_", "(_", "event_", "._", "Event", "Request", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Event", "VR", "RP", "Transmit", "Request_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data_", "=_", "data_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 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 ]
Unused local variable
scipy/scipy/scipy/linalg/tests/test_fblas.py
[ { "content": " def test_x_stride_assert(self):\n # What is the use of this test?\n alpha,beta,a,x,y = self.get_data(x_stride=2)\n try:\n y = self.blas_func(1,a,x,1,y,trans=0,incx=3)\n assert_(0)\n except:\n pass\n try:\n y = self.blas_func(1,a,x,1,y,trans=1,incx=3)\n assert_(0)\n except:\n pass", "metadata": "root.BaseGemv.test_x_stride_assert", "header": "['class', 'BaseGemv', '(', 'object', ')', ':', '___EOS___']", "index": 419 }, { "content": " def test_y_stride_assert(self):\n # What is the use of this test?\n alpha,beta,a,x,y = self.get_data(y_stride=2)\n try:\n y = self.blas_func(1,a,x,1,y,trans=0,incy=3)\n assert_(0)\n except:\n pass\n try:\n y = self.blas_func(1,a,x,1,y,trans=1,incy=3)\n assert_(0)\n except:\n pass", "metadata": "root.BaseGemv.test_y_stride_assert", "header": "['class', 'BaseGemv', '(', 'object', ')', ':', '___EOS___']", "index": 447 } ]
[ { "span": "y ", "start_line": 428, "start_column": 12, "end_line": 428, "end_column": 13 }, { "span": "y ", "start_line": 456, "start_column": 12, "end_line": 456, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Base", "Ge", "mv_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "x", "\\u", "stride", "\\u", "assert_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "What", " ", "is", " ", "the", " ", "use", " ", "of", " ", "this", " ", "test", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alpha_", ",_", "beta_", ",_", "a_", ",_", "x_", ",_", "y_", "=_", "self_", "._", "get", "\\u", "data_", "(_", "x", "\\u", "stride_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "y_", "=_", "self_", "._", "bla", "s", "\\u", "func_", "(_", "1_", ",_", "a_", ",_", "x_", ",_", "1_", ",_", "y_", ",_", "trans_", "=_", "0_", ",_", "inc", "x_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert\\u_", "(_", "0_", ")_", "\\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 ", " _", "y_", "=_", "self_", "._", "bla", "s", "\\u", "func_", "(_", "1_", ",_", "a_", ",_", "x_", ",_", "1_", ",_", "y_", ",_", "trans_", "=_", "1_", ",_", "inc", "x_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert\\u_", "(_", "0_", ")_", "\\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_", "[SEP]_", "class_", "Base", "Ge", "mv_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "y", "\\u", "stride", "\\u", "assert_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "What", " ", "is", " ", "the", " ", "use", " ", "of", " ", "this", " ", "test", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alpha_", ",_", "beta_", ",_", "a_", ",_", "x_", ",_", "y_", "=_", "self_", "._", "get", "\\u", "data_", "(_", "y", "\\u", "stride_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "y_", "=_", "self_", "._", "bla", "s", "\\u", "func_", "(_", "1_", ",_", "a_", ",_", "x_", ",_", "1_", ",_", "y_", ",_", "trans_", "=_", "0_", ",_", "inc", "y_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert\\u_", "(_", "0_", ")_", "\\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 ", " _", "y_", "=_", "self_", "._", "bla", "s", "\\u", "func_", "(_", "1_", ",_", "a_", ",_", "x_", ",_", "1_", ",_", "y_", ",_", "trans_", "=_", "1_", ",_", "inc", "y_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert\\u_", "(_", "0_", ")_", "\\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_" ]
[ 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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
treeio/treeio/treeio/finance/south_migrations/0001_initial.py
[ { "content": "# encoding: utf-8\n# Copyright 2011 Tree.io Limited\n# This file is part of Treeio.\n# License www.tree.io/license\n\n# encoding: utf-8\nimport datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Migration(SchemaMigration):\n\n\n\n models = {\n 'auth.group': {\n 'Meta': {'object_name': 'Group'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),\n 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'})\n },\n 'auth.permission': {\n 'Meta': {'ordering': \"('content_type__app_label', 'content_type__model', 'codename')\", 'unique_together': \"(('content_type', 'codename'),)\", 'object_name': 'Permission'},\n 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['contenttypes.ContentType']\"}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n },\n 'auth.user': {\n 'Meta': {'object_name': 'User'},\n 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),\n 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Group']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),\n 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})\n },\n 'contenttypes.contenttype': {\n 'Meta': {'ordering': \"('name',)\", 'unique_together': \"(('app_label', 'model'),)\", 'object_name': 'ContentType', 'db_table': \"'django_content_type'\"},\n 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})\n },\n 'core.group': {\n 'Meta': {'ordering': \"['name']\", 'object_name': 'Group'},\n 'details': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'last_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '256'}),\n 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'child_set'\", 'null': 'True', 'to': \"orm['core.Group']\"})\n },\n 'core.object': {\n 'Meta': {'object_name': 'Object'},\n 'date_created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'everybody_execute': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'everybody_read': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'everybody_write': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'group': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['core.Group']\"}),\n 'group_execute': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'group_read': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'group_write': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'last_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),\n 'links': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'links_rel_+'\", 'null': 'True', 'to': \"orm['core.Object']\"}),\n 'nuvius_resource': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'object_name': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}),\n 'object_type': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}),\n 'subscribers': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'subscriptions'\", 'null': 'True', 'symmetrical': 'False', 'to': \"orm['core.User']\"}),\n 'trash': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['core.User']\"}),\n 'user_execute': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'user_read': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'user_write': ('django.db.models.fields.BooleanField', [], {'default': 'False'})\n },\n 'core.user': {\n 'Meta': {'ordering': \"['name']\", 'object_name': 'User'},\n 'default_group': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'default_user_set'\", 'null': 'True', 'to': \"orm['core.Group']\"}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'last_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '256'}),\n 'other_groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': \"orm['core.Group']\", 'null': 'True', 'blank': 'True'}),\n 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['auth.User']\"})\n },\n 'finance.account': {\n 'Meta': {'ordering': \"['name']\", 'object_name': 'Account', '_ormbases': ['core.Object']},\n 'balance': ('django.db.models.fields.FloatField', [], {'default': '0'}),\n 'details': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}),\n 'object_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': \"orm['core.Object']\", 'unique': 'True', 'primary_key': 'True'}),\n 'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['identities.Contact']\"})\n },\n 'finance.asset': {\n 'Meta': {'ordering': \"['-purchase_date']\", 'object_name': 'Asset', '_ormbases': ['core.Object']},\n 'asset_type': ('django.db.models.fields.CharField', [], {'default': \"'fixed'\", 'max_length': '32'}),\n 'current_value': ('django.db.models.fields.FloatField', [], {'default': '0'}),\n 'depreciation_rate': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'depreciation_type': ('django.db.models.fields.CharField', [], {'default': \"'straight'\", 'max_length': '32', 'null': 'True', 'blank': 'True'}),\n 'details': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'endlife_value': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'initial_value': ('django.db.models.fields.FloatField', [], {'default': '0'}),\n 'lifetime': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}),\n 'object_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': \"orm['core.Object']\", 'unique': 'True', 'primary_key': 'True'}),\n 'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['identities.Contact']\"}),\n 'purchase_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime.now', 'null': 'True', 'blank': 'True'})\n },\n 'finance.category': {\n 'Meta': {'object_name': 'Category', '_ormbases': ['core.Object']},\n 'details': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}),\n 'object_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': \"orm['core.Object']\", 'unique': 'True', 'primary_key': 'True'})\n },\n 'finance.equity': {\n 'Meta': {'ordering': \"['-purchase_date']\", 'object_name': 'Equity', '_ormbases': ['core.Object']},\n 'amount': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),\n 'details': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'equity_type': ('django.db.models.fields.CharField', [], {'default': \"'share'\", 'max_length': '32'}),\n 'issue_price': ('django.db.models.fields.FloatField', [], {}),\n 'issuer': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'finance_equity_issued'\", 'to': \"orm['identities.Contact']\"}),\n 'object_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': \"orm['core.Object']\", 'unique': 'True', 'primary_key': 'True'}),\n 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'finance_equity_owned'\", 'to': \"orm['identities.Contact']\"}),\n 'purchase_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime.now'}),\n 'sell_price': ('django.db.models.fields.FloatField', [], {})\n },\n 'finance.liability': {\n 'Meta': {'ordering': \"['-due_date']\", 'object_name': 'Liability', '_ormbases': ['core.Object']},\n 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['finance.Account']\"}),\n 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['finance.Category']\", 'null': 'True', 'blank': 'True'}),\n 'details': ('django.db.models.fields.TextField', [], {'blank': 'True'}),\n 'due_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}),\n 'object_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': \"orm['core.Object']\", 'unique': 'True', 'primary_key': 'True'}),\n 'source': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'finance_liability_source'\", 'to': \"orm['identities.Contact']\"}),\n 'target': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'finance_liability_target'\", 'to': \"orm['identities.Contact']\"}),\n 'value': ('django.db.models.fields.FloatField', [], {})\n },\n 'finance.transaction': {\n 'Meta': {'ordering': \"['-datetime']\", 'object_name': 'Transaction', '_ormbases': ['core.Object']},\n 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['finance.Account']\"}),\n 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['finance.Category']\", 'null': 'True', 'blank': 'True'}),\n 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'details': ('django.db.models.fields.TextField', [], {'blank': 'True'}),\n 'liability': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['finance.Liability']\", 'null': 'True', 'blank': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}),\n 'object_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': \"orm['core.Object']\", 'unique': 'True', 'primary_key': 'True'}),\n 'source': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'finance_transaction_source'\", 'to': \"orm['identities.Contact']\"}),\n 'target': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'finance_transaction_target'\", 'to': \"orm['identities.Contact']\"}),\n 'value': ('django.db.models.fields.FloatField', [], {})\n },\n 'identities.contact': {\n 'Meta': {'ordering': \"['name']\", 'object_name': 'Contact', '_ormbases': ['core.Object']},\n 'contact_type': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['identities.ContactType']\"}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '256'}),\n 'object_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': \"orm['core.Object']\", 'unique': 'True', 'primary_key': 'True'}),\n 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'child_set'\", 'null': 'True', 'to': \"orm['identities.Contact']\"}),\n 'related_group': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['core.Group']\", 'null': 'True', 'blank': 'True'}),\n 'related_user': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['core.User']\", 'null': 'True', 'blank': 'True'})\n },\n 'identities.contactfield': {\n 'Meta': {'ordering': \"['name']\", 'object_name': 'ContactField', '_ormbases': ['core.Object']},\n 'allowed_values': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'details': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'field_type': ('django.db.models.fields.CharField', [], {'max_length': '64'}),\n 'label': ('django.db.models.fields.CharField', [], {'max_length': '256'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '256'}),\n 'object_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': \"orm['core.Object']\", 'unique': 'True', 'primary_key': 'True'}),\n 'required': ('django.db.models.fields.BooleanField', [], {'default': 'False'})\n },\n 'identities.contacttype': {\n 'Meta': {'ordering': \"['name']\", 'object_name': 'ContactType', '_ormbases': ['core.Object']},\n 'details': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'fields': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': \"orm['identities.ContactField']\", 'null': 'True', 'blank': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '256'}),\n 'object_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': \"orm['core.Object']\", 'unique': 'True', 'primary_key': 'True'}),\n 'slug': ('django.db.models.fields.CharField', [], {'max_length': '256'})\n }\n }\n\n complete_apps = ['finance']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 12 }, { "content": " def forwards(self, orm):\n\n # Adding model 'Category'\n db.create_table('finance_category', (\n ('object_ptr', self.gf('django.db.models.fields.related.OneToOneField')(\n to=orm['core.Object'], unique=True, primary_key=True)),\n ('name', self.gf('django.db.models.fields.CharField')\n (max_length=512)),\n ('details', self.gf('django.db.models.fields.TextField')\n (null=True, blank=True)),\n ))\n db.send_create_signal('finance', ['Category'])\n\n # Adding model 'Asset'\n db.create_table('finance_asset', (\n ('object_ptr', self.gf('django.db.models.fields.related.OneToOneField')(\n to=orm['core.Object'], unique=True, primary_key=True)),\n ('name', self.gf('django.db.models.fields.CharField')\n (max_length=512)),\n ('asset_type', self.gf('django.db.models.fields.CharField')\n (default='fixed', max_length=32)),\n ('initial_value', self.gf(\n 'django.db.models.fields.FloatField')(default=0)),\n ('lifetime', self.gf('django.db.models.fields.FloatField')\n (null=True, blank=True)),\n ('endlife_value', self.gf('django.db.models.fields.FloatField')\n (null=True, blank=True)),\n ('depreciation_rate', self.gf(\n 'django.db.models.fields.FloatField')(null=True, blank=True)),\n ('depreciation_type', self.gf('django.db.models.fields.CharField')\n (default='straight', max_length=32, null=True, blank=True)),\n ('purchase_date', self.gf('django.db.models.fields.DateField')\n (default=datetime.datetime.now, null=True, blank=True)),\n ('current_value', self.gf(\n 'django.db.models.fields.FloatField')(default=0)),\n ('owner', self.gf('django.db.models.fields.related.ForeignKey')\n (to=orm['identities.Contact'])),\n ('details', self.gf('django.db.models.fields.TextField')\n (null=True, blank=True)),\n ))\n db.send_create_signal('finance', ['Asset'])\n\n # Adding model 'Account'\n db.create_table('finance_account', (\n ('object_ptr', self.gf('django.db.models.fields.related.OneToOneField')(\n to=orm['core.Object'], unique=True, primary_key=True)),\n ('name', self.gf('django.db.models.fields.CharField')\n (max_length=512)),\n ('owner', self.gf('django.db.models.fields.related.ForeignKey')\n (to=orm['identities.Contact'])),\n ('balance', self.gf(\n 'django.db.models.fields.FloatField')(default=0)),\n ('details', self.gf('django.db.models.fields.TextField')\n (null=True, blank=True)),\n ))\n db.send_create_signal('finance', ['Account'])\n\n # Adding model 'Equity'\n db.create_table('finance_equity', (\n ('object_ptr', self.gf('django.db.models.fields.related.OneToOneField')(\n to=orm['core.Object'], unique=True, primary_key=True)),\n ('equity_type', self.gf('django.db.models.fields.CharField')\n (default='share', max_length=32)),\n ('issue_price', self.gf('django.db.models.fields.FloatField')()),\n ('sell_price', self.gf('django.db.models.fields.FloatField')()),\n ('issuer', self.gf('django.db.models.fields.related.ForeignKey')(\n related_name='finance_equity_issued', to=orm['identities.Contact'])),\n ('owner', self.gf('django.db.models.fields.related.ForeignKey')(\n related_name='finance_equity_owned', to=orm['identities.Contact'])),\n ('amount', self.gf(\n 'django.db.models.fields.PositiveIntegerField')(default=1)),\n ('purchase_date', self.gf('django.db.models.fields.DateField')\n (default=datetime.datetime.now)),\n ('details', self.gf('django.db.models.fields.TextField')\n (null=True, blank=True)),\n ))\n db.send_create_signal('finance', ['Equity'])\n\n # Adding model 'Liability'\n db.create_table('finance_liability', (\n ('object_ptr', self.gf('django.db.models.fields.related.OneToOneField')(\n to=orm['core.Object'], unique=True, primary_key=True)),\n ('name', self.gf('django.db.models.fields.CharField')\n (max_length=512)),\n ('source', self.gf('django.db.models.fields.related.ForeignKey')(\n related_name='finance_liability_source', to=orm['identities.Contact'])),\n ('target', self.gf('django.db.models.fields.related.ForeignKey')(\n related_name='finance_liability_target', to=orm['identities.Contact'])),\n ('category', self.gf('django.db.models.fields.related.ForeignKey')\n (to=orm['finance.Category'], null=True, blank=True)),\n ('account', self.gf('django.db.models.fields.related.ForeignKey')\n (to=orm['finance.Account'])),\n ('due_date', self.gf('django.db.models.fields.DateField')\n (null=True, blank=True)),\n ('value', self.gf('django.db.models.fields.FloatField')()),\n ('details', self.gf(\n 'django.db.models.fields.TextField')(blank=True)),\n ))\n db.send_create_signal('finance', ['Liability'])\n\n # Adding model 'Transaction'\n db.create_table('finance_transaction', (\n ('object_ptr', self.gf('django.db.models.fields.related.OneToOneField')(\n to=orm['core.Object'], unique=True, primary_key=True)),\n ('name', self.gf('django.db.models.fields.CharField')\n (max_length=512)),\n ('source', self.gf('django.db.models.fields.related.ForeignKey')(\n related_name='finance_transaction_source', to=orm['identities.Contact'])),\n ('target', self.gf('django.db.models.fields.related.ForeignKey')(\n related_name='finance_transaction_target', to=orm['identities.Contact'])),\n ('liability', self.gf('django.db.models.fields.related.ForeignKey')(\n to=orm['finance.Liability'], null=True, blank=True)),\n ('category', self.gf('django.db.models.fields.related.ForeignKey')\n (to=orm['finance.Category'], null=True, blank=True)),\n ('account', self.gf('django.db.models.fields.related.ForeignKey')\n (to=orm['finance.Account'])),\n ('datetime', self.gf('django.db.models.fields.DateTimeField')\n (default=datetime.datetime.now)),\n ('value', self.gf('django.db.models.fields.FloatField')()),\n ('details', self.gf(\n 'django.db.models.fields.TextField')(blank=True)),\n ))\n db.send_create_signal('finance', ['Transaction'])", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 14 }, { "content": " def backwards(self, orm):\n\n # Deleting model 'Category'\n db.delete_table('finance_category')\n\n # Deleting model 'Asset'\n db.delete_table('finance_asset')\n\n # Deleting model 'Account'\n db.delete_table('finance_account')\n\n # Deleting model 'Equity'\n db.delete_table('finance_equity')\n\n # Deleting model 'Liability'\n db.delete_table('finance_liability')\n\n # Deleting model 'Transaction'\n db.delete_table('finance_transaction')", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 138 } ]
[ { "span": "from django.db import models", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "encoding", ":", " ", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2011", " ", "Tree", ".", "io", " ", "Limit", "ed_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "file", " ", "is", " ", "part", " ", "of", " ", "Tree", "io", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", " ", "www", ".", "tree", ".", "io", "/", "license_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "encoding", ":", " ", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "db_", "import_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "v2_", "import_", "Schema", "Migration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\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_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\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_", "models_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "group", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Group", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "80", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "permissi", "on", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "content", "\\u", "type\\u\\u", "app", "\\u", "label", "',", " ", "'", "content", "\\u", "type\\u\\u", "model", "',", " ", "'", "code", "name", "')\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "content", "\\u", "type", "',", " ", "'", "code", "name", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Permi", "ssion", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "code", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "user", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "User", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "joine", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Group", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "active", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "sta", "ff", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "super", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "login", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "128", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "contenttype", "s", ".", "contenttype", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "name", "',)\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "app", "\\u", "label", "',", " ", "'", "model", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Conten", "t", "Type", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "django", "\\u", "content", "\\u", "type", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "app", "\\u", "label", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "model", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "core", ".", "group", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'", "name", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Group", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deta", "il", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "update", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "256", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "parent", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "child", "\\u", "set", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "Group", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "core", ".", "object", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Object", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "created", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "every", "body", "\\u", "execute", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "every", "body", "\\u", "read", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "every", "body", "\\u", "write", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "Group", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "\\u", "execute", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "\\u", "read", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "\\u", "write", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "update", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "link", "s", "\\u", "rel", "\\u", "+'\"", "_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "Object", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nu", "vi", "us", "\\u", "resource", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "512", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "512", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "subscribers", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "subscript", "ion", "s", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "User", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "trash", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "User", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "execute", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "read", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "write", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "core", ".", "user", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'", "name", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "User", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "default", "\\u", "group", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "default", "\\u", "user", "\\u", "set", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "Group", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "update", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "256", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "other", "\\u", "group", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "Group", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "finance", ".", "account", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'", "name", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Account", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "'", "core", ".", "Object", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "balance", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deta", "il", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "512", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "Object", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "owner", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "identities", ".", "Conta", "ct", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "finance", ".", "asset", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'-", "purchase", "\\u", "date", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Asset", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "'", "core", ".", "Object", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "asset", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "fixed", "'\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "32", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "current", "\\u", "value", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "depre", "ciat", "ion", "\\u", "rate", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "depre", "ciat", "ion", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "straight", "'\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "32", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deta", "il", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "endl", "ife", "\\u", "value", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "initial", "\\u", "value", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "life", "time", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "512", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "Object", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "owner", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "identities", ".", "Conta", "ct", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "purchase", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "finance", ".", "category", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Cate", "gory", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "'", "core", ".", "Object", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deta", "il", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "512", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "Object", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "finance", ".", "equit", "y", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'-", "purchase", "\\u", "date", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Equi", "ty", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "'", "core", ".", "Object", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "amo", "unt", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "1", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deta", "il", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "equit", "y", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "share", "'\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "32", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "issue", "\\u", "price", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "issue", "r", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "finance", "\\u", "equit", "y", "\\u", "issue", "d", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "identities", ".", "Conta", "ct", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "Object", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "owner", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "finance", "\\u", "equit", "y", "\\u", "owned", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "identities", ".", "Conta", "ct", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "purchase", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sell", "\\u", "price", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "finance", ".", "lia", "bilit", "y", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'-", "due", "\\u", "date", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Lia", "bilit", "y", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "'", "core", ".", "Object", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "account", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "finance", ".", "Account", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "category", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "finance", ".", "Cate", "gory", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deta", "il", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "due", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "512", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "Object", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "finance", "\\u", "lia", "bilit", "y", "\\u", "source", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "identities", ".", "Conta", "ct", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "target", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "finance", "\\u", "lia", "bilit", "y", "\\u", "target", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "identities", ".", "Conta", "ct", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "value", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "finance", ".", "transaction", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'-", "datetime", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Transa", "ction", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "'", "core", ".", "Object", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "account", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "finance", ".", "Account", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "category", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "finance", ".", "Cate", "gory", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "datetime", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deta", "il", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lia", "bilit", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "finance", ".", "Lia", "bilit", "y", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "512", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "Object", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "finance", "\\u", "transaction", "\\u", "source", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "identities", ".", "Conta", "ct", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "target", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "finance", "\\u", "transaction", "\\u", "target", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "identities", ".", "Conta", "ct", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "value", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "identities", ".", "contact", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'", "name", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Conta", "ct", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "'", "core", ".", "Object", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "contact", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "identities", ".", "Conta", "ct", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "256", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "Object", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "parent", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "child", "\\u", "set", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "identities", ".", "Conta", "ct", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "relate", "d\\u", "group", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "Group", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "relate", "d\\u", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "User", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "identities", ".", "contact", "field", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'", "name", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Conta", "ct", "Field", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "'", "core", ".", "Object", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "allow", "ed", "\\u", "values", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deta", "il", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "field", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "64", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "256", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "256", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "Object", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "require", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "identities", ".", "contact", "type", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'", "name", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Conta", "ct", "Type", "'_", ",_", "'\\u", "ormbase", "s", "'_", ":_", "[_", "'", "core", ".", "Object", "'_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deta", "il", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fields", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "identities", ".", "Conta", "ct", "Field", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "256", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "ptr", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "core", ".", "Object", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slug", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "256", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "complete", "\\u", "apps_", "=_", "[_", "'", "finance", "'_", "]_", "[SEP]_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "forwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "Cate", "gory", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "create", "\\u", "table_", "(_", "'", "finance", "\\u", "category", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object\\u", "ptr", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "to_", "=_", "orm_", "[_", "'", "core", ".", "Object", "'_", "]_", ",_", "unique_", "=_", "True_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "name", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "max", "\\u", "length_", "=_", "512_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "deta", "il", "s", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "'", "finance", "'_", ",_", "[_", "'", "Cate", "gory", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "Asset", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "table_", "(_", "'", "finance", "\\u", "asset", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object\\u", "ptr", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "to_", "=_", "orm_", "[_", "'", "core", ".", "Object", "'_", "]_", ",_", "unique_", "=_", "True_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "name", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "max", "\\u", "length_", "=_", "512_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "asset", "\\u", "type", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "default_", "=_", "'", "fixed", "'_", ",_", "max", "\\u", "length_", "=_", "32_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "initial", "\\u", "value", "'_", ",_", "self_", "._", "gf_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ")_", "(_", "default_", "=_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "life", "time", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "endl", "ife", "\\u", "value", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "depre", "ciat", "ion", "\\u", "rate", "'_", ",_", "self_", "._", "gf_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ")_", "(_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "depre", "ciat", "ion", "\\u", "type", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "default_", "=_", "'", "straight", "'_", ",_", "max", "\\u", "length_", "=_", "32_", ",_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "purchase", "\\u", "date", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "default_", "=_", "datetime_", "._", "datetime_", "._", "now_", ",_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "current", "\\u", "value", "'_", ",_", "self_", "._", "gf_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ")_", "(_", "default_", "=_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "owner", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "to_", "=_", "orm_", "[_", "'", "identities", ".", "Conta", "ct", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "deta", "il", "s", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "'", "finance", "'_", ",_", "[_", "'", "Asset", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "Account", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "table_", "(_", "'", "finance", "\\u", "account", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object\\u", "ptr", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "to_", "=_", "orm_", "[_", "'", "core", ".", "Object", "'_", "]_", ",_", "unique_", "=_", "True_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "name", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "max", "\\u", "length_", "=_", "512_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "owner", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "to_", "=_", "orm_", "[_", "'", "identities", ".", "Conta", "ct", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "balance", "'_", ",_", "self_", "._", "gf_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ")_", "(_", "default_", "=_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "deta", "il", "s", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "'", "finance", "'_", ",_", "[_", "'", "Account", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "Equi", "ty", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "table_", "(_", "'", "finance", "\\u", "equit", "y", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object\\u", "ptr", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "to_", "=_", "orm_", "[_", "'", "core", ".", "Object", "'_", "]_", ",_", "unique_", "=_", "True_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "equit", "y", "\\u", "type", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "default_", "=_", "'", "share", "'_", ",_", "max", "\\u", "length_", "=_", "32_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "issue", "\\u", "price", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ")_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "sell", "\\u", "price", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ")_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "issue", "r", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "relate", "d\\u", "name_", "=_", "'", "finance", "\\u", "equit", "y", "\\u", "issue", "d", "'_", ",_", "to_", "=_", "orm_", "[_", "'", "identities", ".", "Conta", "ct", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "owner", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "relate", "d\\u", "name_", "=_", "'", "finance", "\\u", "equit", "y", "\\u", "owned", "'_", ",_", "to_", "=_", "orm_", "[_", "'", "identities", ".", "Conta", "ct", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "amo", "unt", "'_", ",_", "self_", "._", "gf_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ")_", "(_", "default_", "=_", "1_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "purchase", "\\u", "date", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "default_", "=_", "datetime_", "._", "datetime_", "._", "now_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "deta", "il", "s", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "'", "finance", "'_", ",_", "[_", "'", "Equi", "ty", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "Lia", "bilit", "y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "table_", "(_", "'", "finance", "\\u", "lia", "bilit", "y", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object\\u", "ptr", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "to_", "=_", "orm_", "[_", "'", "core", ".", "Object", "'_", "]_", ",_", "unique_", "=_", "True_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "name", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "max", "\\u", "length_", "=_", "512_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "source", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "relate", "d\\u", "name_", "=_", "'", "finance", "\\u", "lia", "bilit", "y", "\\u", "source", "'_", ",_", "to_", "=_", "orm_", "[_", "'", "identities", ".", "Conta", "ct", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "target", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "relate", "d\\u", "name_", "=_", "'", "finance", "\\u", "lia", "bilit", "y", "\\u", "target", "'_", ",_", "to_", "=_", "orm_", "[_", "'", "identities", ".", "Conta", "ct", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "category", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "to_", "=_", "orm_", "[_", "'", "finance", ".", "Cate", "gory", "'_", "]_", ",_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "account", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "to_", "=_", "orm_", "[_", "'", "finance", ".", "Account", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "due", "\\u", "date", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "value", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ")_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "deta", "il", "s", "'_", ",_", "self_", "._", "gf_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ")_", "(_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "'", "finance", "'_", ",_", "[_", "'", "Lia", "bilit", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "Transa", "ction", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "table_", "(_", "'", "finance", "\\u", "transaction", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "object\\u", "ptr", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "to_", "=_", "orm_", "[_", "'", "core", ".", "Object", "'_", "]_", ",_", "unique_", "=_", "True_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "name", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "max", "\\u", "length_", "=_", "512_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "source", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "relate", "d\\u", "name_", "=_", "'", "finance", "\\u", "transaction", "\\u", "source", "'_", ",_", "to_", "=_", "orm_", "[_", "'", "identities", ".", "Conta", "ct", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "target", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "relate", "d\\u", "name_", "=_", "'", "finance", "\\u", "transaction", "\\u", "target", "'_", ",_", "to_", "=_", "orm_", "[_", "'", "identities", ".", "Conta", "ct", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "lia", "bilit", "y", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "to_", "=_", "orm_", "[_", "'", "finance", ".", "Lia", "bilit", "y", "'_", "]_", ",_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "category", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "to_", "=_", "orm_", "[_", "'", "finance", ".", "Cate", "gory", "'_", "]_", ",_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "account", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "to_", "=_", "orm_", "[_", "'", "finance", ".", "Account", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "datetime", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "default_", "=_", "datetime_", "._", "datetime_", "._", "now_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "value", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ")_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "deta", "il", "s", "'_", ",_", "self_", "._", "gf_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ")_", "(_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "'", "finance", "'_", ",_", "[_", "'", "Transa", "ction", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "backwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "Cate", "gory", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "delete", "\\u", "table_", "(_", "'", "finance", "\\u", "category", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "Asset", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "table_", "(_", "'", "finance", "\\u", "asset", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "Account", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "table_", "(_", "'", "finance", "\\u", "account", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "Equi", "ty", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "table_", "(_", "'", "finance", "\\u", "equit", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "Lia", "bilit", "y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "table_", "(_", "'", "finance", "\\u", "lia", "bilit", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "Transa", "ction", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "table_", "(_", "'", "finance", "\\u", "transaction", "'_", ")_", "\\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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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 ]
Use of the return value of a procedure
ckan/ckanapi/ckanapi/cli/dump.py
[ { "content": "def dump_things(ckan, thing, arguments,\n worker_pool=None, stdout=None, stderr=None):\n \"\"\"\n dump all datasets, groups, orgs or users accessible by the connected user\n\n The parent process creates a pool of worker processes and hands\n out ids to each worker. Status of last record completed and records\n being processed is displayed on stderr.\n \"\"\"\n if worker_pool is None:\n worker_pool = workers.worker_pool\n if stdout is None:\n stdout = getattr(sys.stdout, 'buffer', sys.stdout)\n if stderr is None:\n stderr = getattr(sys.stderr, 'buffer', sys.stderr)\n\n if arguments['--worker']:\n return dump_things_worker(ckan, thing, arguments)\n\n log = None\n if arguments['--log']:\n log = open(arguments['--log'], 'a')\n\n jsonl_output = stdout\n if arguments['--datapackages']: # TODO: do we want to just divert this to devnull?\n jsonl_output = open(os.devnull, 'wb')\n if arguments['--output']:\n jsonl_output = open(arguments['--output'], 'wb')\n if arguments['--gzip']:\n jsonl_output = gzip.GzipFile(fileobj=jsonl_output)\n if arguments['--all']:\n get_thing_list = {\n 'datasets': 'package_list',\n 'groups': 'group_list',\n 'organizations': 'organization_list',\n 'users': 'user_list',\n 'related' :'related_list',\n }[thing]\n names = ckan.call_action(get_thing_list, {})\n\n else:\n names = arguments['ID_OR_NAME']\n\n if names and isinstance(names[0], dict):\n names = [rec.get('name',rec.get('id')) for rec in names]\n\n cmd = _worker_command_line(thing, arguments)\n processes = int(arguments['--processes'])\n if hasattr(ckan, 'parallel_limit'):\n # add your sites to ckanapi.remoteckan.MY_SITES instead of removing\n processes = min(processes, ckan.parallel_limit)\n stats = completion_stats(processes)\n pool = worker_pool(cmd, processes,\n enumerate(compact_json(n) + b'\\n' for n in names))\n\n results = {}\n expecting_number = 0\n with quiet_int_pipe() as errors:\n for job_ids, finished, result in pool:\n if not result:\n # child exited with traceback\n return 1\n timestamp, error, record = json.loads(result.decode('utf-8'))\n results[finished] = record\n\n if not arguments['--quiet']:\n stderr.write('{0} {1} {2} {3} {4}\\n'.format(\n finished,\n job_ids,\n next(stats),\n error,\n record.get('name', '') if record else '',\n ).encode('utf-8'))\n\n if log:\n log.write(compact_json([\n timestamp,\n finished,\n error,\n record.get('name', '') if record else None,\n ]) + b'\\n')\n\n datapackages_path = arguments['--datapackages']\n if datapackages_path:\n create_datapackage(record, datapackages_path, stderr)\n\n # keep the output in the same order as names\n while expecting_number in results:\n record = results.pop(expecting_number)\n if record:\n # sort keys so we can diff output\n jsonl_output.write(compact_json(record,\n sort_keys=True) + b'\\n')\n expecting_number += 1\n if 'pipe' in errors:\n return 1\n if 'interrupt' in errors:\n return 2", "metadata": "root.dump_things", "header": "['module', '___EOS___']", "index": 21 }, { "content": "def dump_things_worker(ckan, thing, arguments,\n stdin=None, stdout=None):\n \"\"\"\n a process that accepts names on stdin which are\n passed to the {thing}_show actions. it produces lines of json\n which are the responses from each action call.\n \"\"\"\n if stdin is None:\n stdin = getattr(sys.stdin, 'buffer', sys.stdin)\n # hack so that pdb can be used in extension/ckan\n # code called by this worker\n try:\n sys.stdin = open('/dev/tty', 'rb')\n except IOError:\n pass\n if stdout is None:\n stdout = getattr(sys.stdout, 'buffer', sys.stdout)\n # hack so that \"print debugging\" can work in extension/ckan\n # code called by this worker\n sys.stdout = sys.stderr\n\n thing_show = {\n 'datasets': 'package_show',\n 'groups': 'group_show',\n 'organizations': 'organization_show',\n 'users': 'user_show',\n 'related':'related_show'\n }[thing]\n\n def reply(error, record=None):\n \"\"\"\n format messages to be sent back to parent process\n \"\"\"\n stdout.write(compact_json([\n datetime.now().isoformat(),\n error,\n record]) + b'\\n')\n stdout.flush()\n\n for line in iter(stdin.readline, b''):\n try:\n name = json.loads(line.decode('utf-8'))\n except UnicodeDecodeError as e:\n reply('UnicodeDecodeError')\n continue\n\n try:\n obj = ckan.call_action(thing_show, {'id': name,\n 'include_datasets': False,\n 'include_password_hash': True,\n })\n reply(None, obj)\n except NotFound:\n reply('NotFound')\n except NotAuthorized:\n reply('NotAuthorized')", "metadata": "root.dump_things_worker", "header": "['module', '___EOS___']", "index": 121 }, { "content": "def _worker_command_line(thing, arguments):\n \"\"\"\n Create a worker command line suitable for Popen with only the\n options the worker process requires\n \"\"\"\n def a(name):\n \"options with values\"\n return [name, arguments[name]] * (arguments[name] is not None)\n def b(name):\n \"boolean options\"\n return [name] * bool(arguments[name])\n return (\n ['ckanapi', 'dump', thing, '--worker']\n + a('--config')\n + a('--ckan-user')\n + a('--remote')\n + a('--apikey')\n + b('--get-request')\n + ['value-here-to-make-docopt-happy']\n )", "metadata": "root._worker_command_line", "header": "['module', '___EOS___']", "index": 233 } ]
[ { "span": "dump_things_worker(ckan, thing, arguments)", "start_line": 38, "start_column": 15, "end_line": 38, "end_column": 57 } ]
[ { "span": "def dump_things_worker(ckan, thing, arguments,\n stdin=None, stdout=None):", "start_line": 121, "start_column": 0, "end_line": 122, "end_column": 33 } ]
1
false
[ "[CLS]_", "Use_", "of_", "the_", "return_", "value_", "of_", "a_", "procedure_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "dump", "\\u", "things_", "(_", "ckan", "_", ",_", "thing_", ",_", "arguments_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "worker", "\\u", "pool_", "=_", "None_", ",_", "stdout_", "=_", "None_", ",_", "stderr_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "dump", " ", "all", " ", "dataset", "s", ",", " ", "group", "s", ",", " ", "orgs", " ", "or", " ", "users", " ", "accessible", " ", "by", " ", "the", " ", "connect", "ed", " ", "user", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "parent", " ", "process", " ", "create", "s", " ", "a", " ", "pool", " ", "of", " ", "worker", " ", "process", "es", " ", "and", " ", "hands", "\\", "10", ";", " ", " ", " ", " ", "out", " ", "ids", " ", "to", " ", "each", " ", "worker", ".", " ", "Status", " ", "of", " ", "last", " ", "record", " ", "complete", "d", " ", "and", " ", "record", "s", "\\", "10", ";", " ", " ", " ", " ", "bei", "ng", " ", "process", "ed", " ", "is", " ", "displaye", "d", " ", "on", " ", "std", "err", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "worker", "\\u", "pool_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "worker", "\\u", "pool_", "=_", "workers_", "._", "worker", "\\u", "pool_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stdout_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stdout_", "=_", "getattr_", "(_", "sys_", "._", "stdout_", ",_", "'", "buffer", "'_", ",_", "sys_", "._", "stdout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stderr_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stderr_", "=_", "getattr_", "(_", "sys_", "._", "stderr_", ",_", "'", "buffer", "'_", ",_", "sys_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "arguments_", "[_", "'--", "worker", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "dump", "\\u", "thing", "s", "\\u", "worker_", "(_", "ckan", "_", ",_", "thing_", ",_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "arguments_", "[_", "'--", "log", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "=_", "open_", "(_", "arguments_", "[_", "'--", "log", "'_", "]_", ",_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "jsonl", "\\u", "output_", "=_", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "arguments_", "[_", "'--", "datap", "ack", "age", "s", "'_", "]_", ":_", "#", " ", "TOD", "O", ":", " ", "do", " ", "we", " ", "want", " ", "to", " ", "just", " ", "dive", "rt", " ", "this", " ", "to", " ", "devn", "ull", "?", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jsonl", "\\u", "output_", "=_", "open_", "(_", "os_", "._", "devnull_", ",_", "'", "wb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "arguments_", "[_", "'--", "output", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jsonl", "\\u", "output_", "=_", "open_", "(_", "arguments_", "[_", "'--", "output", "'_", "]_", ",_", "'", "wb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "arguments_", "[_", "'--", "gzip", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jsonl", "\\u", "output_", "=_", "gzip_", "._", "Gz", "ip", "File_", "(_", "fileobj_", "=_", "jsonl", "\\u", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "arguments_", "[_", "'--", "all", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "get", "\\u", "thing", "\\u", "list_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dataset", "s", "'_", ":_", "'", "package", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "'", "group", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "organization", "s", "'_", ":_", "'", "organization", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "users", "'_", ":_", "'", "user", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "relate", "d", "'_", ":_", "'", "relate", "d\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "[_", "thing_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "names_", "=_", "ckan", "_", "._", "call", "\\u", "action_", "(_", "get", "\\u", "thing", "\\u", "list_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "names_", "=_", "arguments_", "[_", "'", "ID", "\\u", "OR", "\\u", "NAME", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "names_", "and_", "isinstance_", "(_", "names_", "[_", "0_", "]_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "names_", "=_", "[_", "rec_", "._", "get_", "(_", "'", "name", "'_", ",_", "rec_", "._", "get_", "(_", "'", "id", "'_", ")_", ")_", "for_", "rec_", "in_", "names_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmd_", "=_", "\\u", "worker", "\\u", "command", "\\u", "line_", "(_", "thing_", ",_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "processes_", "=_", "int_", "(_", "arguments_", "[_", "'--", "process", "es", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "ckan", "_", ",_", "'", "parall", "el", "\\u", "limit", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "your", " ", "sites", " ", "to", " ", "ckan", "api", ".", "remote", "ckan", ".", "MY", "\\u", "SITE", "S", " ", "inst", "ead", " ", "of", " ", "remo", "ving", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "processes_", "=_", "min_", "(_", "processes_", ",_", "ckan", "_", "._", "parall", "el", "\\u", "limit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stats_", "=_", "completion", "\\u", "stats_", "(_", "processes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pool_", "=_", "worker", "\\u", "pool_", "(_", "cmd_", ",_", "processes_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enumerate_", "(_", "compact", "\\u", "json_", "(_", "n_", ")_", "+_", "b", "'\\\\", "n", "'_", "for_", "n_", "in_", "names_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expect", "ing", "\\u", "number_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "quie", "t", "\\u", "int\\u", "pipe_", "(_", ")_", "as_", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "job", "\\u", "ids_", ",_", "finished_", ",_", "result_", "in_", "pool_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "child", " ", "exit", "ed", " ", "with", " ", "traceback_", "\\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_", "timestamp_", ",_", "error_", ",_", "record_", "=_", "json_", "._", "loads_", "(_", "result_", "._", "decode_", "(_", "'", "utf", "-", "8", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "finished_", "]_", "=_", "record_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "arguments_", "[_", "'--", "quie", "t", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stderr_", "._", "write_", "(_", "'{", "0", "}", " ", "{", "1", "}", " ", "{", "2", "}", " ", "{", "3", "}", " ", "{", "4", "}\\\\", "n", "'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "finished_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "job", "\\u", "ids_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "next_", "(_", "stats_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "record_", "._", "get_", "(_", "'", "name", "'_", ",_", "''_", ")_", "if_", "record_", "else_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "log_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "write_", "(_", "compact", "\\u", "json_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "timestamp_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "finished_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "record_", "._", "get_", "(_", "'", "name", "'_", ",_", "''_", ")_", "if_", "record_", "else_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "+_", "b", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "datap", "ack", "age", "s", "\\u", "path_", "=_", "arguments_", "[_", "'--", "datap", "ack", "age", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "datap", "ack", "age", "s", "\\u", "path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "create", "\\u", "datap", "ack", "age_", "(_", "record_", ",_", "datap", "ack", "age", "s", "\\u", "path_", ",_", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "keep", " ", "the", " ", "output", " ", "in", " ", "the", " ", "same", " ", "order", " ", "as", " ", "names_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "expect", "ing", "\\u", "number_", "in_", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "record_", "=_", "results_", "._", "pop_", "(_", "expect", "ing", "\\u", "number_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "record_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "sort", " ", "keys", " ", "so", " ", "we", " ", "can", " ", "diff", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "jsonl", "\\u", "output_", "._", "write_", "(_", "compact", "\\u", "json_", "(_", "record_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sort", "\\u", "keys_", "=_", "True_", ")_", "+_", "b", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expect", "ing", "\\u", "number_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "pipe", "'_", "in_", "errors_", ":_", "\\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_", "if_", "'", "interrupt", "'_", "in_", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "2_", "\\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_", "dump", "\\u", "thing", "s", "\\u", "worker_", "(_", "ckan", "_", ",_", "thing_", ",_", "arguments_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdin_", "=_", "None_", ",_", "stdout_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "process", " ", "tha", "t", " ", "accepts", " ", "names", " ", "on", " ", "std", "in", " ", "whi", "ch", " ", "are", "\\", "10", ";", " ", " ", " ", " ", "pass", "ed", " ", "to", " ", "the", " ", "{", "thing", "}\\u", "show", " ", "action", "s", ".", " ", " ", "it", " ", "produce", "s", " ", "lines", " ", "of", " ", "json", "\\", "10", ";", " ", " ", " ", " ", "whi", "ch", " ", "are", " ", "the", " ", "response", "s", " ", "from", " ", "each", " ", "action", " ", "call", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "stdin_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stdin_", "=_", "getattr_", "(_", "sys_", "._", "stdin_", ",_", "'", "buffer", "'_", ",_", "sys_", "._", "stdin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "hack", " ", "so", " ", "tha", "t", " ", "pdb", " ", "can", " ", "be", " ", "used", " ", "in", " ", "extensi", "on", "/", "ckan", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "code", " ", "call", "ed", " ", "by", " ", "this", " ", "worker_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stdin_", "=_", "open_", "(_", "'/", "dev", "/", "tt", "y", "'_", ",_", "'", "rb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "IO", "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_", "if_", "stdout_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stdout_", "=_", "getattr_", "(_", "sys_", "._", "stdout_", ",_", "'", "buffer", "'_", ",_", "sys_", "._", "stdout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "hack", " ", "so", " ", "tha", "t", " ", "\"", "print", " ", "debugg", "ing", "\"", " ", "can", " ", "work", " ", "in", " ", "extensi", "on", "/", "ckan", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "code", " ", "call", "ed", " ", "by", " ", "this", " ", "worker_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "stdout_", "=_", "sys_", "._", "stderr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "thing", "\\u", "show_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dataset", "s", "'_", ":_", "'", "package", "\\u", "show", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "'", "group", "\\u", "show", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "organization", "s", "'_", ":_", "'", "organization", "\\u", "show", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "users", "'_", ":_", "'", "user", "\\u", "show", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "relate", "d", "'_", ":_", "'", "relate", "d\\u", "show", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "[_", "thing_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "reply_", "(_", "error_", ",_", "record_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "format", " ", "message", "s", " ", "to", " ", "be", " ", "sent", " ", "back", " ", "to", " ", "parent", " ", "process", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdout_", "._", "write_", "(_", "compact", "\\u", "json_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "datetime_", "._", "now_", "(_", ")_", "._", "isoformat_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "record_", "]_", ")_", "+_", "b", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "line_", "in_", "iter_", "(_", "stdin_", "._", "readline_", ",_", "b", "''_", ")_", ":_", "\\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 ", " _", "name_", "=_", "json_", "._", "loads_", "(_", "line_", "._", "decode_", "(_", "'", "utf", "-", "8", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Unic", "ode", "Decode", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reply_", "(_", "'", "Unic", "ode", "Decode", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\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 ", " _", "obj_", "=_", "ckan", "_", "._", "call", "\\u", "action_", "(_", "thing", "\\u", "show_", ",_", "{_", "'", "id", "'_", ":_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "include", "\\u", "dataset", "s", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "include", "\\u", "password", "\\u", "hash", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reply_", "(_", "None_", ",_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Not", "Found_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reply_", "(_", "'", "Not", "Foun", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Not", "Authorized", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reply_", "(_", "'", "Not", "Authorized", "'_", ")_", "\\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", "worker", "\\u", "command", "\\u", "line_", "(_", "thing_", ",_", "arguments_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "a", " ", "worker", " ", "command", " ", "line", " ", "suit", "able", " ", "for", " ", "Pop", "en", " ", "with", " ", "only", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "options", " ", "the", " ", "worker", " ", "process", " ", "require", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "a_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "options", " ", "with", " ", "values", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "name_", ",_", "arguments_", "[_", "name_", "]_", "]_", "*_", "(_", "arguments_", "[_", "name_", "]_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "b_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "boolean", " ", "options", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "name_", "]_", "*_", "bool_", "(_", "arguments_", "[_", "name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "ckan", "api", "'_", ",_", "'", "dump", "'_", ",_", "thing_", ",_", "'--", "worker", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "a_", "(_", "'--", "config", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "a_", "(_", "'--", "ckan", "-", "user", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "a_", "(_", "'--", "remote", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "a_", "(_", "'--", "api", "key", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "b_", "(_", "'--", "get", "-", "request", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "[_", "'", "value", "-", "here", "-", "to", "-", "make", "-", "doc", "opt", "-", "happy", "'_", "]_", "\\u\\u\\uNL\\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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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 ]
Unused import
SheffieldML/GPy/GPy/likelihoods/gaussian.py
[ { "content": "# Copyright (c) 2012-2014 The GPy authors (see AUTHORS.txt)\n# Licensed under the BSD 3-clause license (see LICENSE.txt)\n#TODO\n\"\"\"\nA lot of this code assumes that the link function is the identity.\n\nI think laplace code is okay, but I'm quite sure that the EP moments will only work if the link is identity.\n\nFurthermore, exact Guassian inference can only be done for the identity link, so we should be asserting so for all calls which relate to that.\n\nJames 11/12/13\n\"\"\"\n\nimport numpy as np\nfrom scipy import stats, special\nfrom . import link_functions\nfrom .likelihood import Likelihood\nfrom ..core.parameterization import Param\nfrom paramz.transformations import Logexp\nfrom scipy import stats\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Gaussian(Likelihood):\n \"\"\"\n Gaussian likelihood\n\n .. math::\n \\\\ln p(y_{i}|\\\\lambda(f_{i})) = -\\\\frac{N \\\\ln 2\\\\pi}{2} - \\\\frac{\\\\ln |K|}{2} - \\\\frac{(y_{i} - \\\\lambda(f_{i}))^{T}\\\\sigma^{-2}(y_{i} - \\\\lambda(f_{i}))}{2}\n\n :param variance: variance value of the Gaussian distribution\n :param N: Number of data points\n :type N: int\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.Gaussian", "header": "['module', '___EOS___']", "index": 21 }, { "content": " def __init__(self, gp_link=None, variance=1., name='Gaussian_noise'):\n if gp_link is None:\n gp_link = link_functions.Identity()\n\n if not isinstance(gp_link, link_functions.Identity):\n print(\"Warning, Exact inference is not implemeted for non-identity link functions,\\\n if you are not already, ensure Laplace inference_method is used\")\n\n super(Gaussian, self).__init__(gp_link, name=name)\n\n self.variance = Param('variance', variance, Logexp())\n self.link_parameter(self.variance)\n\n if isinstance(gp_link, link_functions.Identity):\n self.log_concave = True", "metadata": "root.Gaussian.__init__", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 32 }, { "content": " def betaY(self,Y,Y_metadata=None):\n #TODO: ~Ricardo this does not live here\n raise RuntimeError(\"Please notify the GPy developers, this should not happen\")\n return Y/self.gaussian_variance(Y_metadata)", "metadata": "root.Gaussian.betaY", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 48 }, { "content": " def gaussian_variance(self, Y_metadata=None):\n return self.variance", "metadata": "root.Gaussian.gaussian_variance", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 53 }, { "content": " def update_gradients(self, grad):\n self.variance.gradient = grad", "metadata": "root.Gaussian.update_gradients", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 56 }, { "content": " def exact_inference_gradients(self, dL_dKdiag,Y_metadata=None):\n return dL_dKdiag.sum()", "metadata": "root.Gaussian.exact_inference_gradients", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 59 }, { "content": " def _preprocess_values(self, Y):\n \"\"\"\n Check if the values of the observations correspond to the values\n assumed by the likelihood function.\n \"\"\"\n return Y", "metadata": "root.Gaussian._preprocess_values", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 62 }, { "content": " def moments_match_ep(self, data_i, tau_i, v_i, Y_metadata_i=None):\n \"\"\"\n Moments match of the marginal approximation in EP algorithm\n\n :param i: number of observation (int)\n :param tau_i: precision of the cavity distribution (float)\n :param v_i: mean/variance of the cavity distribution (float)\n \"\"\"\n sigma2_hat = 1./(1./self.variance + tau_i)\n mu_hat = sigma2_hat*(data_i/self.variance + v_i)\n sum_var = self.variance + 1./tau_i\n Z_hat = 1./np.sqrt(2.*np.pi*sum_var)*np.exp(-.5*(data_i - v_i/tau_i)**2./sum_var)\n return Z_hat, mu_hat, sigma2_hat", "metadata": "root.Gaussian.moments_match_ep", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 69 }, { "content": " def predictive_values(self, mu, var, full_cov=False, Y_metadata=None):\n if full_cov:\n if var.ndim == 2:\n var += np.eye(var.shape[0])*self.variance\n if var.ndim == 3:\n var += np.atleast_3d(np.eye(var.shape[0])*self.variance)\n else:\n var += self.variance\n return mu, var", "metadata": "root.Gaussian.predictive_values", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 83 }, { "content": " def predictive_mean(self, mu, sigma):\n return mu", "metadata": "root.Gaussian.predictive_mean", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 93 }, { "content": " def predictive_variance(self, mu, sigma, predictive_mean=None):\n return self.variance + sigma**2", "metadata": "root.Gaussian.predictive_variance", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 96 }, { "content": " def predictive_quantiles(self, mu, var, quantiles, Y_metadata=None):\n return [stats.norm.ppf(q/100.)*np.sqrt(var + self.variance) + mu for q in quantiles]", "metadata": "root.Gaussian.predictive_quantiles", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 99 }, { "content": " def pdf_link(self, link_f, y, Y_metadata=None):\n \"\"\"\n Likelihood function given link(f)\n\n .. math::\n \\\\ln p(y_{i}|\\\\lambda(f_{i})) = -\\\\frac{N \\\\ln 2\\\\pi}{2} - \\\\frac{\\\\ln |K|}{2} - \\\\frac{(y_{i} - \\\\lambda(f_{i}))^{T}\\\\sigma^{-2}(y_{i} - \\\\lambda(f_{i}))}{2}\n\n :param link_f: latent variables link(f)\n :type link_f: Nx1 array\n :param y: data\n :type y: Nx1 array\n :param Y_metadata: Y_metadata not used in gaussian\n :returns: likelihood evaluated for this point\n :rtype: float\n \"\"\"\n #Assumes no covariance, exp, sum, log for numerical stability\n return np.exp(np.sum(np.log(stats.norm.pdf(y, link_f, np.sqrt(self.variance)))))", "metadata": "root.Gaussian.pdf_link", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 102 }, { "content": " def logpdf_link(self, link_f, y, Y_metadata=None):\n \"\"\"\n Log likelihood function given link(f)\n\n .. math::\n \\\\ln p(y_{i}|\\\\lambda(f_{i})) = -\\\\frac{N \\\\ln 2\\\\pi}{2} - \\\\frac{\\\\ln |K|}{2} - \\\\frac{(y_{i} - \\\\lambda(f_{i}))^{T}\\\\sigma^{-2}(y_{i} - \\\\lambda(f_{i}))}{2}\n\n :param link_f: latent variables link(f)\n :type link_f: Nx1 array\n :param y: data\n :type y: Nx1 array\n :param Y_metadata: Y_metadata not used in gaussian\n :returns: log likelihood evaluated for this point\n :rtype: float\n \"\"\"\n ln_det_cov = np.log(self.variance)\n return -(1.0/(2*self.variance))*((y-link_f)**2) - 0.5*ln_det_cov - 0.5*np.log(2.*np.pi)", "metadata": "root.Gaussian.logpdf_link", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 120 }, { "content": " def dlogpdf_dlink(self, link_f, y, Y_metadata=None):\n \"\"\"\n Gradient of the pdf at y, given link(f) w.r.t link(f)\n\n .. math::\n \\\\frac{d \\\\ln p(y_{i}|\\\\lambda(f_{i}))}{d\\\\lambda(f)} = \\\\frac{1}{\\\\sigma^{2}}(y_{i} - \\\\lambda(f_{i}))\n\n :param link_f: latent variables link(f)\n :type link_f: Nx1 array\n :param y: data\n :type y: Nx1 array\n :param Y_metadata: Y_metadata not used in gaussian\n :returns: gradient of log likelihood evaluated at points link(f)\n :rtype: Nx1 array\n \"\"\"\n s2_i = 1.0/self.variance\n grad = s2_i*y - s2_i*link_f\n return grad", "metadata": "root.Gaussian.dlogpdf_dlink", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 138 }, { "content": " def d2logpdf_dlink2(self, link_f, y, Y_metadata=None):\n \"\"\"\n Hessian at y, given link_f, w.r.t link_f.\n i.e. second derivative logpdf at y given link(f_i) link(f_j) w.r.t link(f_i) and link(f_j)\n\n The hessian will be 0 unless i == j\n\n .. math::\n \\\\frac{d^{2} \\\\ln p(y_{i}|\\\\lambda(f_{i}))}{d^{2}f} = -\\\\frac{1}{\\\\sigma^{2}}\n\n :param link_f: latent variables link(f)\n :type link_f: Nx1 array\n :param y: data\n :type y: Nx1 array\n :param Y_metadata: Y_metadata not used in gaussian\n :returns: Diagonal of log hessian matrix (second derivative of log likelihood evaluated at points link(f))\n :rtype: Nx1 array\n\n .. Note::\n Will return diagonal of hessian, since every where else it is 0, as the likelihood factorizes over cases\n (the distribution for y_i depends only on link(f_i) not on link(f_(j!=i))\n \"\"\"\n N = y.shape[0]\n D = link_f.shape[1]\n hess = -(1.0/self.variance)*np.ones((N, D))\n return hess", "metadata": "root.Gaussian.d2logpdf_dlink2", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 157 }, { "content": " def d3logpdf_dlink3(self, link_f, y, Y_metadata=None):\n \"\"\"\n Third order derivative log-likelihood function at y given link(f) w.r.t link(f)\n\n .. math::\n \\\\frac{d^{3} \\\\ln p(y_{i}|\\\\lambda(f_{i}))}{d^{3}\\\\lambda(f)} = 0\n\n :param link_f: latent variables link(f)\n :type link_f: Nx1 array\n :param y: data\n :type y: Nx1 array\n :param Y_metadata: Y_metadata not used in gaussian\n :returns: third derivative of log likelihood evaluated at points link(f)\n :rtype: Nx1 array\n \"\"\"\n N = y.shape[0]\n D = link_f.shape[1]\n d3logpdf_dlink3 = np.zeros((N,D))\n return d3logpdf_dlink3", "metadata": "root.Gaussian.d3logpdf_dlink3", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 184 }, { "content": " def dlogpdf_link_dvar(self, link_f, y, Y_metadata=None):\n \"\"\"\n Gradient of the log-likelihood function at y given link(f), w.r.t variance parameter (noise_variance)\n\n .. math::\n \\\\frac{d \\\\ln p(y_{i}|\\\\lambda(f_{i}))}{d\\\\sigma^{2}} = -\\\\frac{N}{2\\\\sigma^{2}} + \\\\frac{(y_{i} - \\\\lambda(f_{i}))^{2}}{2\\\\sigma^{4}}\n\n :param link_f: latent variables link(f)\n :type link_f: Nx1 array\n :param y: data\n :type y: Nx1 array\n :param Y_metadata: Y_metadata not used in gaussian\n :returns: derivative of log likelihood evaluated at points link(f) w.r.t variance parameter\n :rtype: float\n \"\"\"\n e = y - link_f\n s_4 = 1.0/(self.variance**2)\n dlik_dsigma = -0.5/self.variance + 0.5*s_4*np.square(e)\n return dlik_dsigma", "metadata": "root.Gaussian.dlogpdf_link_dvar", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 204 }, { "content": " def dlogpdf_dlink_dvar(self, link_f, y, Y_metadata=None):\n \"\"\"\n Derivative of the dlogpdf_dlink w.r.t variance parameter (noise_variance)\n\n .. math::\n \\\\frac{d}{d\\\\sigma^{2}}(\\\\frac{d \\\\ln p(y_{i}|\\\\lambda(f_{i}))}{d\\\\lambda(f)}) = \\\\frac{1}{\\\\sigma^{4}}(-y_{i} + \\\\lambda(f_{i}))\n\n :param link_f: latent variables link(f)\n :type link_f: Nx1 array\n :param y: data\n :type y: Nx1 array\n :param Y_metadata: Y_metadata not used in gaussian\n :returns: derivative of log likelihood evaluated at points link(f) w.r.t variance parameter\n :rtype: Nx1 array\n \"\"\"\n s_4 = 1.0/(self.variance**2)\n dlik_grad_dsigma = -s_4*y + s_4*link_f\n return dlik_grad_dsigma", "metadata": "root.Gaussian.dlogpdf_dlink_dvar", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 224 }, { "content": " def d2logpdf_dlink2_dvar(self, link_f, y, Y_metadata=None):\n \"\"\"\n Gradient of the hessian (d2logpdf_dlink2) w.r.t variance parameter (noise_variance)\n\n .. math::\n \\\\frac{d}{d\\\\sigma^{2}}(\\\\frac{d^{2} \\\\ln p(y_{i}|\\\\lambda(f_{i}))}{d^{2}\\\\lambda(f)}) = \\\\frac{1}{\\\\sigma^{4}}\n\n :param link_f: latent variables link(f)\n :type link_f: Nx1 array\n :param y: data\n :type y: Nx1 array\n :param Y_metadata: Y_metadata not used in gaussian\n :returns: derivative of log hessian evaluated at points link(f_i) and link(f_j) w.r.t variance parameter\n :rtype: Nx1 array\n \"\"\"\n s_4 = 1.0/(self.variance**2)\n N = y.shape[0]\n D = link_f.shape[1]\n d2logpdf_dlink2_dvar = np.ones((N, D))*s_4\n return d2logpdf_dlink2_dvar", "metadata": "root.Gaussian.d2logpdf_dlink2_dvar", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 243 }, { "content": " def dlogpdf_link_dtheta(self, f, y, Y_metadata=None):\n dlogpdf_dtheta = np.zeros((self.size, f.shape[0], f.shape[1]))\n dlogpdf_dtheta[0,:,:] = self.dlogpdf_link_dvar(f, y, Y_metadata=Y_metadata)\n return dlogpdf_dtheta", "metadata": "root.Gaussian.dlogpdf_link_dtheta", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 264 }, { "content": " def dlogpdf_dlink_dtheta(self, f, y, Y_metadata=None):\n dlogpdf_dlink_dtheta = np.zeros((self.size, f.shape[0], f.shape[1]))\n dlogpdf_dlink_dtheta[0, :, :]= self.dlogpdf_dlink_dvar(f, y, Y_metadata=Y_metadata)\n return dlogpdf_dlink_dtheta", "metadata": "root.Gaussian.dlogpdf_dlink_dtheta", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 269 }, { "content": " def d2logpdf_dlink2_dtheta(self, f, y, Y_metadata=None):\n d2logpdf_dlink2_dtheta = np.zeros((self.size, f.shape[0], f.shape[1]))\n d2logpdf_dlink2_dtheta[0, :, :] = self.d2logpdf_dlink2_dvar(f, y, Y_metadata=Y_metadata)\n return d2logpdf_dlink2_dtheta", "metadata": "root.Gaussian.d2logpdf_dlink2_dtheta", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 274 }, { "content": " def _mean(self, gp):\n \"\"\"\n Expected value of y under the Mass (or density) function p(y|f)\n\n .. math::\n E_{p(y|f)}[y]\n \"\"\"\n return self.gp_link.transf(gp)", "metadata": "root.Gaussian._mean", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 279 }, { "content": " def _variance(self, gp):\n \"\"\"\n Variance of y under the Mass (or density) function p(y|f)\n\n .. math::\n Var_{p(y|f)}[y]\n \"\"\"\n return self.variance", "metadata": "root.Gaussian._variance", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 288 }, { "content": " def samples(self, gp, Y_metadata=None):\n \"\"\"\n Returns a set of samples of observations based on a given value of the latent variable.\n\n :param gp: latent variable\n \"\"\"\n orig_shape = gp.shape\n gp = gp.flatten()\n #orig_shape = gp.shape\n gp = gp.flatten()\n Ysim = np.array([np.random.normal(self.gp_link.transf(gpj), scale=np.sqrt(self.variance), size=1) for gpj in gp])\n return Ysim.reshape(orig_shape)", "metadata": "root.Gaussian.samples", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 297 }, { "content": " def log_predictive_density(self, y_test, mu_star, var_star, Y_metadata=None):\n \"\"\"\n assumes independence\n \"\"\"\n v = var_star + self.variance\n return -0.5*np.log(2*np.pi) -0.5*np.log(v) - 0.5*np.square(y_test - mu_star)/v", "metadata": "root.Gaussian.log_predictive_density", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 310 }, { "content": " def variational_expectations(self, Y, m, v, gh_points=None, Y_metadata=None):\n if not isinstance(self.gp_link, link_functions.Identity):\n return super(Gaussian, self).variational_expectations(Y=Y, m=m, v=v, gh_points=gh_points, Y_metadata=Y_metadata)\n\n lik_var = float(self.variance)\n F = -0.5*np.log(2*np.pi) -0.5*np.log(lik_var) - 0.5*(np.square(Y) + np.square(m) + v - 2*m*Y)/lik_var\n dF_dmu = (Y - m)/lik_var\n dF_dv = np.ones_like(v)*(-0.5/lik_var)\n dF_dtheta = -0.5/lik_var + 0.5*(np.square(Y) + np.square(m) + v - 2*m*Y)/(lik_var**2)\n return F, dF_dmu, dF_dv, dF_dtheta.reshape(1, Y.shape[0], Y.shape[1])", "metadata": "root.Gaussian.variational_expectations", "header": "['class', 'Gaussian', '(', 'Likelihood', ')', ':', '___EOS___']", "index": 317 }, { "content": "class HeteroscedasticGaussian(Gaussian):\n\n\n\n", "metadata": "root.HeteroscedasticGaussian", "header": "['module', '___EOS___']", "index": 328 }, { "content": " def __init__(self, Y_metadata, gp_link=None, variance=1., name='het_Gauss'):\n if gp_link is None:\n gp_link = link_functions.Identity()\n\n if not isinstance(gp_link, link_functions.Identity):\n print(\"Warning, Exact inference is not implemeted for non-identity link functions,\\\n if you are not already, ensure Laplace inference_method is used\")\n\n super(HeteroscedasticGaussian, self).__init__(gp_link, np.ones(Y_metadata['output_index'].shape)*variance, name)", "metadata": "root.HeteroscedasticGaussian.__init__", "header": "['class', 'HeteroscedasticGaussian', '(', 'Gaussian', ')', ':', '___EOS___']", "index": 329 }, { "content": " def exact_inference_gradients(self, dL_dKdiag,Y_metadata=None):\n return dL_dKdiag[Y_metadata['output_index']]", "metadata": "root.HeteroscedasticGaussian.exact_inference_gradients", "header": "['class', 'HeteroscedasticGaussian', '(', 'Gaussian', ')', ':', '___EOS___']", "index": 339 }, { "content": " def gaussian_variance(self, Y_metadata=None):\n return self.variance[Y_metadata['output_index'].flatten()]", "metadata": "root.HeteroscedasticGaussian.gaussian_variance", "header": "['class', 'HeteroscedasticGaussian', '(', 'Gaussian', ')', ':', '___EOS___']", "index": 342 }, { "content": " def predictive_values(self, mu, var, full_cov=False, Y_metadata=None):\n _s = self.variance[Y_metadata['output_index'].flatten()]\n if full_cov:\n if var.ndim == 2:\n var += np.eye(var.shape[0])*_s\n if var.ndim == 3:\n var += np.atleast_3d(np.eye(var.shape[0])*_s)\n else:\n var += _s\n return mu, var", "metadata": "root.HeteroscedasticGaussian.predictive_values", "header": "['class', 'HeteroscedasticGaussian', '(', 'Gaussian', ')', ':', '___EOS___']", "index": 345 }, { "content": " def predictive_quantiles(self, mu, var, quantiles, Y_metadata=None):\n _s = self.variance[Y_metadata['output_index'].flatten()]\n return [stats.norm.ppf(q/100.)*np.sqrt(var + _s) + mu for q in quantiles]", "metadata": "root.HeteroscedasticGaussian.predictive_quantiles", "header": "['class', 'HeteroscedasticGaussian', '(', 'Gaussian', ')', ':', '___EOS___']", "index": 356 } ]
[ { "span": "from scipy import stats, special", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 32 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2012", "-", "2014", " ", "The", " ", "GP", "y", " ", "author", "s", " ", "(", "see", " ", "AUTHOR", "S", ".", "txt", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "BS", "D", " ", "3", "-", "clause", " ", "license", " ", "(", "see", " ", "LICENSE", ".", "txt", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "TOD", "O_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "A", " ", "lot", " ", "of", " ", "this", " ", "code", " ", "assume", "s", " ", "tha", "t", " ", "the", " ", "link", " ", "function", " ", "is", " ", "the", " ", "identi", "ty", ".", "\\", "10", ";", "\\", "10", ";", "I", " ", "think", " ", "laplac", "e", " ", "code", " ", "is", " ", "oka", "y", ",", " ", "but", " ", "I", "'", "m", " ", "quite", " ", "sure", " ", "tha", "t", " ", "the", " ", "EP", " ", "moments", " ", "will", " ", "only", " ", "work", " ", "if", " ", "the", " ", "link", " ", "is", " ", "identi", "ty", ".", "\\", "10", ";", "\\", "10", ";", "Fur", "thermo", "re", ",", " ", "exact", " ", "Gua", "ssi", "an", " ", "infer", "ence", " ", "can", " ", "only", " ", "be", " ", "don", "e", " ", "for", " ", "the", " ", "identi", "ty", " ", "link", ",", " ", "so", " ", "we", " ", "shou", "ld", " ", "be", " ", "assert", "ing", " ", "so", " ", "for", " ", "all", " ", "calls", " ", "whi", "ch", " ", "relate", " ", "to", " ", "tha", "t", ".", "\\", "10", ";", "\\", "10", ";", "Jam", "es", " ", "11", "/", "1", "2", "/", "13", "\\", "10", ";\"\"\"_", "\\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_", "stats_", ",_", "special_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "import_", "link", "\\u", "functions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "likelihood_", "import_", "Likelihood", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "core_", "._", "parameter", "ization_", "import_", "Param_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "param", "z_", "._", "transformations_", "import_", "Log", "exp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "scipy_", "import_", "stats_", "\\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_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Gaussian", " ", "likelihood", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "math", "::", "\\", "10", ";", " ", " ", " ", " ", "\\\\\\\\", "ln", " ", "p", "(", "y", "\\u{", "i", "}|", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", " ", "=", " ", "-\\\\\\\\", "frac", "{", "N", " ", "\\\\\\\\", "ln", " ", "2", "\\\\\\\\", "pi", "}{", "2", "}", " ", "-", " ", "\\\\\\\\", "frac", "{\\\\", "\\\\", "ln", " ", "|", "K", "|", "}{", "2", "}", " ", "-", " ", "\\\\\\\\", "frac", "{(", "y", "\\u{", "i", "}", " ", "-", " ", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", "^", "{", "T", "}\\\\", "\\\\", "sigma", "^", "{-", "2", "}(", "y", "\\u{", "i", "}", " ", "-", " ", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", "}{", "2", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "varian", "ce", ":", " ", "varian", "ce", " ", "value", " ", "of", " ", "the", " ", "Gaussian", " ", "distribu", "tion", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "N", ":", " ", "Number", " ", "of", " ", "data", " ", "points", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "N", ":", " ", "int", "\\", "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_", "\\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_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "gp", "\\u", "link_", "=_", "None_", ",_", "variance_", "=_", "1._", ",_", "name_", "=_", "'", "Gaussian", "\\u", "noise", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "gp", "\\u", "link_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gp", "\\u", "link_", "=_", "link", "\\u", "functions_", "._", "Identity_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "gp", "\\u", "link_", ",_", "link", "\\u", "functions_", "._", "Identity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Warn", "ing", ",", " ", "Exa", "ct", " ", "infer", "ence", " ", "is", " ", "not", " ", "impl", "eme", "ted", " ", "for", " ", "non", "-", "identi", "ty", " ", "link", " ", "function", "s", ",\\\\", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "you", " ", "are", " ", "not", " ", "alr", "ead", "y", ",", " ", "ensure", " ", "Lap", "lace", " ", "infer", "ence", "\\u", "method", " ", "is", " ", "used", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", "Gaussian", "_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "gp", "\\u", "link_", ",_", "name_", "=_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "variance_", "=_", "Param_", "(_", "'", "varian", "ce", "'_", ",_", "variance_", ",_", "Log", "exp_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "link", "\\u", "parameter_", "(_", "self_", "._", "variance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "gp", "\\u", "link_", ",_", "link", "\\u", "functions_", "._", "Identity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "log", "\\u", "conc", "ave_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\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_", "beta", "Y_", "(_", "self_", ",_", "Y_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "TOD", "O", ":", " ", "~", "Ric", "ard", "o", " ", "this", " ", "doe", "s", " ", "not", " ", "live", " ", "here_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Run", "time", "Error_", "(_", "\"", "Ple", "ase", " ", "notif", "y", " ", "the", " ", "GP", "y", " ", "developer", "s", ",", " ", "this", " ", "shou", "ld", " ", "not", " ", "happ", "en", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Y_", "/_", "self_", "._", "gauss", "ian", "\\u", "variance_", "(_", "Y", "\\u", "metadata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gauss", "ian", "\\u", "variance_", "(_", "self_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "variance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "\\u", "gradients_", "(_", "self_", ",_", "grad_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "variance_", "._", "gradient_", "=_", "grad_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "exact", "\\u", "infer", "ence", "\\u", "gradients_", "(_", "self_", ",_", "d", "L", "\\u", "d", "Kd", "iag", "_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d", "L", "\\u", "d", "Kd", "iag", "_", "._", "sum_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "preproc", "ess", "\\u", "values_", "(_", "self_", ",_", "Y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Check", " ", "if", " ", "the", " ", "values", " ", "of", " ", "the", " ", "observa", "tion", "s", " ", "correspond", " ", "to", " ", "the", " ", "values", "\\", "10", ";", " ", " ", " ", " ", "assume", "d", " ", "by", " ", "the", " ", "likelihood", " ", "function", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "moments", "\\u", "match", "\\u", "ep_", "(_", "self_", ",_", "data\\u", "i_", ",_", "tau", "\\u", "i_", ",_", "v", "\\u", "i_", ",_", "Y", "\\u", "metadata", "\\u", "i_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Moment", "s", " ", "match", " ", "of", " ", "the", " ", "marginal", " ", "approx", "imat", "ion", " ", "in", " ", "EP", " ", "algo", "rit", "hm", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "i", ":", " ", "number", " ", "of", " ", "observa", "tion", " ", "(", "int", ")", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "tau", "\\u", "i", ":", " ", "preci", "sion", " ", "of", " ", "the", " ", "cav", "it", "y", " ", "distribu", "tion", " ", "(", "float", ")", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "v", "\\u", "i", ":", " ", "mean", "/", "varian", "ce", " ", "of", " ", "the", " ", "cav", "it", "y", " ", "distribu", "tion", " ", "(", "float", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sigma", "2", "\\u", "hat_", "=_", "1._", "/_", "(_", "1._", "/_", "self_", "._", "variance_", "+_", "tau", "\\u", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mu", "\\u", "hat_", "=_", "sigma", "2", "\\u", "hat_", "*_", "(_", "data\\u", "i_", "/_", "self_", "._", "variance_", "+_", "v", "\\u", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sum", "\\u", "var_", "=_", "self_", "._", "variance_", "+_", "1._", "/_", "tau", "\\u", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z", "\\u", "hat_", "=_", "1._", "/_", "np_", "._", "sqrt_", "(_", "2._", "*_", "np_", "._", "pi_", "*_", "sum", "\\u", "var_", ")_", "*_", "np_", "._", "exp_", "(_", "-_", ".5_", "*_", "(_", "data\\u", "i_", "-_", "v", "\\u", "i_", "/_", "tau", "\\u", "i_", ")_", "**_", "2._", "/_", "sum", "\\u", "var_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Z", "\\u", "hat_", ",_", "mu", "\\u", "hat_", ",_", "sigma", "2", "\\u", "hat_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predicti", "ve", "\\u", "values_", "(_", "self_", ",_", "mu_", ",_", "var_", ",_", "full", "\\u", "cov_", "=_", "False_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "full", "\\u", "cov_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "var_", "._", "ndim_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "var_", "+=_", "np_", "._", "eye_", "(_", "var_", "._", "shape_", "[_", "0_", "]_", ")_", "*_", "self_", "._", "variance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "var_", "._", "ndim_", "==_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "var_", "+=_", "np_", "._", "atl", "east", "\\u", "3d_", "(_", "np_", "._", "eye_", "(_", "var_", "._", "shape_", "[_", "0_", "]_", ")_", "*_", "self_", "._", "variance_", ")_", "\\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 ", " _", "var_", "+=_", "self_", "._", "variance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "mu_", ",_", "var_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predicti", "ve", "\\u", "mean_", "(_", "self_", ",_", "mu_", ",_", "sigma_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "mu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predicti", "ve", "\\u", "variance_", "(_", "self_", ",_", "mu_", ",_", "sigma_", ",_", "predicti", "ve", "\\u", "mean_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "variance_", "+_", "sigma_", "**_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predicti", "ve", "\\u", "quantiles", "_", "(_", "self_", ",_", "mu_", ",_", "var_", ",_", "quantiles", "_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "stats_", "._", "norm_", "._", "pp", "f_", "(_", "q_", "/_", "100._", ")_", "*_", "np_", "._", "sqrt_", "(_", "var_", "+_", "self_", "._", "variance_", ")_", "+_", "mu_", "for_", "q_", "in_", "quantiles", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pdf", "\\u", "link_", "(_", "self_", ",_", "link", "\\u", "f_", ",_", "y_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Likelihood", " ", "function", " ", "give", "n", " ", "link", "(", "f", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "math", "::", "\\", "10", ";", " ", " ", " ", " ", "\\\\\\\\", "ln", " ", "p", "(", "y", "\\u{", "i", "}|", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", " ", "=", " ", "-\\\\\\\\", "frac", "{", "N", " ", "\\\\\\\\", "ln", " ", "2", "\\\\\\\\", "pi", "}{", "2", "}", " ", "-", " ", "\\\\\\\\", "frac", "{\\\\", "\\\\", "ln", " ", "|", "K", "|", "}{", "2", "}", " ", "-", " ", "\\\\\\\\", "frac", "{(", "y", "\\u{", "i", "}", " ", "-", " ", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", "^", "{", "T", "}\\\\", "\\\\", "sigma", "^", "{-", "2", "}(", "y", "\\u{", "i", "}", " ", "-", " ", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", "}{", "2", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "link", "\\u", "f", ":", " ", "latent", " ", "variab", "les", " ", "link", "(", "f", ")", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "link", "\\u", "f", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "y", ":", " ", "data", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "y", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "Y", "\\u", "metadata", ":", " ", "Y", "\\u", "metadata", " ", "not", " ", "used", " ", "in", " ", "gauss", "ian", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "likelihood", " ", "evaluate", "d", " ", "for", " ", "this", " ", "point", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "float", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Assume", "s", " ", "no", " ", "covariance", ",", " ", "exp", ",", " ", "sum", ",", " ", "log", " ", "for", " ", "numerical", " ", "stability", "_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "np_", "._", "exp_", "(_", "np_", "._", "sum_", "(_", "np_", "._", "log_", "(_", "stats_", "._", "norm_", "._", "pdf_", "(_", "y_", ",_", "link", "\\u", "f_", ",_", "np_", "._", "sqrt_", "(_", "self_", "._", "variance_", ")_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "logp", "df", "\\u", "link_", "(_", "self_", ",_", "link", "\\u", "f_", ",_", "y_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Log", " ", "likelihood", " ", "function", " ", "give", "n", " ", "link", "(", "f", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "math", "::", "\\", "10", ";", " ", " ", " ", " ", "\\\\\\\\", "ln", " ", "p", "(", "y", "\\u{", "i", "}|", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", " ", "=", " ", "-\\\\\\\\", "frac", "{", "N", " ", "\\\\\\\\", "ln", " ", "2", "\\\\\\\\", "pi", "}{", "2", "}", " ", "-", " ", "\\\\\\\\", "frac", "{\\\\", "\\\\", "ln", " ", "|", "K", "|", "}{", "2", "}", " ", "-", " ", "\\\\\\\\", "frac", "{(", "y", "\\u{", "i", "}", " ", "-", " ", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", "^", "{", "T", "}\\\\", "\\\\", "sigma", "^", "{-", "2", "}(", "y", "\\u{", "i", "}", " ", "-", " ", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", "}{", "2", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "link", "\\u", "f", ":", " ", "latent", " ", "variab", "les", " ", "link", "(", "f", ")", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "link", "\\u", "f", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "y", ":", " ", "data", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "y", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "Y", "\\u", "metadata", ":", " ", "Y", "\\u", "metadata", " ", "not", " ", "used", " ", "in", " ", "gauss", "ian", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "log", " ", "likelihood", " ", "evaluate", "d", " ", "for", " ", "this", " ", "point", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "float", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ln", "\\u", "det", "\\u", "cov_", "=_", "np_", "._", "log_", "(_", "self_", "._", "variance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "-_", "(_", "1.0_", "/_", "(_", "2_", "*_", "self_", "._", "variance_", ")_", ")_", "*_", "(_", "(_", "y_", "-_", "link", "\\u", "f_", ")_", "**_", "2_", ")_", "-_", "0.5_", "*_", "ln", "\\u", "det", "\\u", "cov_", "-_", "0.5_", "*_", "np_", "._", "log_", "(_", "2._", "*_", "np_", "._", "pi_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dlo", "gpd", "f", "\\u", "dli", "nk_", "(_", "self_", ",_", "link", "\\u", "f_", ",_", "y_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Grad", "ient", " ", "of", " ", "the", " ", "pdf", " ", "at", " ", "y", ",", " ", "give", "n", " ", "link", "(", "f", ")", " ", "w", ".", "r", ".", "t", " ", "link", "(", "f", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "math", "::", "\\", "10", ";", " ", " ", " ", " ", "\\\\\\\\", "frac", "{", "d", " ", "\\\\\\\\", "ln", " ", "p", "(", "y", "\\u{", "i", "}|", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", "}{", "d", "\\\\\\\\", "lambda", "(", "f", ")}", " ", "=", " ", "\\\\\\\\", "frac", "{", "1", "}{\\\\", "\\\\", "sigma", "^", "{", "2", "}}", "(", "y", "\\u{", "i", "}", " ", "-", " ", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "link", "\\u", "f", ":", " ", "latent", " ", "variab", "les", " ", "link", "(", "f", ")", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "link", "\\u", "f", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "y", ":", " ", "data", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "y", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "Y", "\\u", "metadata", ":", " ", "Y", "\\u", "metadata", " ", "not", " ", "used", " ", "in", " ", "gauss", "ian", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "gradi", "ent", " ", "of", " ", "log", " ", "likelihood", " ", "evaluate", "d", " ", "at", " ", "points", " ", "link", "(", "f", ")", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s2", "\\u", "i_", "=_", "1.0_", "/_", "self_", "._", "variance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "grad_", "=_", "s2", "\\u", "i_", "*_", "y_", "-_", "s2", "\\u", "i_", "*_", "link", "\\u", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "grad_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "d2", "logp", "df", "\\u", "dli", "nk", "2_", "(_", "self_", ",_", "link", "\\u", "f_", ",_", "y_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Hes", "sia", "n", " ", "at", " ", "y", ",", " ", "give", "n", " ", "link", "\\u", "f", ",", " ", "w", ".", "r", ".", "t", " ", "link", "\\u", "f", ".", "\\", "10", ";", " ", " ", " ", " ", "i", ".", "e", ".", " ", "second", " ", "deriv", "ative", " ", "logp", "df", " ", "at", " ", "y", " ", "give", "n", " ", "link", "(", "f", "\\u", "i", ")", " ", "link", "(", "f", "\\u", "j", ")", " ", " ", "w", ".", "r", ".", "t", " ", "link", "(", "f", "\\u", "i", ")", " ", "and", " ", "link", "(", "f", "\\u", "j", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "hessian", " ", "will", " ", "be", " ", "0", " ", "unl", "ess", " ", "i", " ", "==", " ", "j", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "math", "::", "\\", "10", ";", " ", " ", " ", " ", "\\\\\\\\", "frac", "{", "d", "^", "{", "2", "}", " ", "\\\\\\\\", "ln", " ", "p", "(", "y", "\\u{", "i", "}|", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", "}{", "d", "^", "{", "2", "}", "f", "}", " ", "=", " ", "-\\\\\\\\", "frac", "{", "1", "}{\\\\", "\\\\", "sigma", "^", "{", "2", "}}\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "link", "\\u", "f", ":", " ", "latent", " ", "variab", "les", " ", "link", "(", "f", ")", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "link", "\\u", "f", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "y", ":", " ", "data", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "y", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "Y", "\\u", "metadata", ":", " ", "Y", "\\u", "metadata", " ", "not", " ", "used", " ", "in", " ", "gauss", "ian", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "Diag", "onal", " ", "of", " ", "log", " ", "hessian", " ", "matrix", " ", "(", "second", " ", "deriv", "ative", " ", "of", " ", "log", " ", "likelihood", " ", "evaluate", "d", " ", "at", " ", "points", " ", "link", "(", "f", "))\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "Not", "e", "::", "\\", "10", ";", " ", " ", " ", " ", "Wil", "l", " ", "return", " ", "diagonal", " ", "of", " ", "hessian", ",", " ", "sinc", "e", " ", "every", " ", "where", " ", "else", " ", "it", " ", "is", " ", "0", ",", " ", "as", " ", "the", " ", "likelihood", " ", "factori", "zes", " ", "over", " ", "case", "s", "\\", "10", ";", " ", " ", " ", " ", "(", "the", " ", "distribu", "tion", " ", "for", " ", "y", "\\u", "i", " ", "depend", "s", " ", "only", " ", "on", " ", "link", "(", "f", "\\u", "i", ")", " ", "not", " ", "on", " ", "link", "(", "f", "\\u(", "j", "!=", "i", "))\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "N_", "=_", "y_", "._", "shape_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "D_", "=_", "link", "\\u", "f_", "._", "shape_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hess", "_", "=_", "-_", "(_", "1.0_", "/_", "self_", "._", "variance_", ")_", "*_", "np_", "._", "ones_", "(_", "(_", "N_", ",_", "D_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "hess", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "d3", "logp", "df", "\\u", "dli", "nk", "3_", "(_", "self_", ",_", "link", "\\u", "f_", ",_", "y_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "rd", " ", "order", " ", "deriv", "ative", " ", "log", "-", "likelihood", " ", "function", " ", "at", " ", "y", " ", "give", "n", " ", "link", "(", "f", ")", " ", "w", ".", "r", ".", "t", " ", "link", "(", "f", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "math", "::", "\\", "10", ";", " ", " ", " ", " ", "\\\\\\\\", "frac", "{", "d", "^", "{", "3", "}", " ", "\\\\\\\\", "ln", " ", "p", "(", "y", "\\u{", "i", "}|", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", "}{", "d", "^", "{", "3", "}\\\\", "\\\\", "lambda", "(", "f", ")}", " ", "=", " ", "0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "link", "\\u", "f", ":", " ", "latent", " ", "variab", "les", " ", "link", "(", "f", ")", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "link", "\\u", "f", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "y", ":", " ", "data", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "y", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "Y", "\\u", "metadata", ":", " ", "Y", "\\u", "metadata", " ", "not", " ", "used", " ", "in", " ", "gauss", "ian", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "third", " ", "deriv", "ative", " ", "of", " ", "log", " ", "likelihood", " ", "evaluate", "d", " ", "at", " ", "points", " ", "link", "(", "f", ")", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "N_", "=_", "y_", "._", "shape_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "D_", "=_", "link", "\\u", "f_", "._", "shape_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d3", "logp", "df", "\\u", "dli", "nk", "3_", "=_", "np_", "._", "zeros_", "(_", "(_", "N_", ",_", "D_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d3", "logp", "df", "\\u", "dli", "nk", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dlo", "gpd", "f", "\\u", "link", "\\u", "dva", "r_", "(_", "self_", ",_", "link", "\\u", "f_", ",_", "y_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Grad", "ient", " ", "of", " ", "the", " ", "log", "-", "likelihood", " ", "function", " ", "at", " ", "y", " ", "give", "n", " ", "link", "(", "f", "),", " ", "w", ".", "r", ".", "t", " ", "varian", "ce", " ", "parameter", " ", "(", "noise", "\\u", "varian", "ce", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "math", "::", "\\", "10", ";", " ", " ", " ", " ", "\\\\\\\\", "frac", "{", "d", " ", "\\\\\\\\", "ln", " ", "p", "(", "y", "\\u{", "i", "}|", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", "}{", "d", "\\\\\\\\", "sigma", "^", "{", "2", "}}", " ", "=", " ", "-\\\\\\\\", "frac", "{", "N", "}{", "2", "\\\\\\\\", "sigma", "^", "{", "2", "}}", " ", "+", " ", "\\\\\\\\", "frac", "{(", "y", "\\u{", "i", "}", " ", "-", " ", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", "^", "{", "2", "}}{", "2", "\\\\\\\\", "sigma", "^", "{", "4", "}}\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "link", "\\u", "f", ":", " ", "latent", " ", "variab", "les", " ", "link", "(", "f", ")", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "link", "\\u", "f", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "y", ":", " ", "data", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "y", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "Y", "\\u", "metadata", ":", " ", "Y", "\\u", "metadata", " ", "not", " ", "used", " ", "in", " ", "gauss", "ian", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "deriv", "ative", " ", "of", " ", "log", " ", "likelihood", " ", "evaluate", "d", " ", "at", " ", "points", " ", "link", "(", "f", ")", " ", "w", ".", "r", ".", "t", " ", "varian", "ce", " ", "parameter", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "float", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "=_", "y_", "-_", "link", "\\u", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s", "\\u", "4_", "=_", "1.0_", "/_", "(_", "self_", "._", "variance_", "**_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dli", "k", "\\u", "dsi", "gma", "_", "=_", "-_", "0.5_", "/_", "self_", "._", "variance_", "+_", "0.5_", "*_", "s", "\\u", "4_", "*_", "np_", "._", "square_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dli", "k", "\\u", "dsi", "gma", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dlo", "gpd", "f", "\\u", "dli", "nk", "\\u", "dva", "r_", "(_", "self_", ",_", "link", "\\u", "f_", ",_", "y_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Derivati", "ve", " ", "of", " ", "the", " ", "dlo", "gpd", "f", "\\u", "dli", "nk", " ", "w", ".", "r", ".", "t", " ", "varian", "ce", " ", "parameter", " ", "(", "noise", "\\u", "varian", "ce", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "math", "::", "\\", "10", ";", " ", " ", " ", " ", "\\\\\\\\", "frac", "{", "d", "}{", "d", "\\\\\\\\", "sigma", "^", "{", "2", "}}", "(\\\\\\\\", "frac", "{", "d", " ", "\\\\\\\\", "ln", " ", "p", "(", "y", "\\u{", "i", "}|", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", "}{", "d", "\\\\\\\\", "lambda", "(", "f", ")}", ")", " ", "=", " ", "\\\\\\\\", "frac", "{", "1", "}{\\\\", "\\\\", "sigma", "^", "{", "4", "}}", "(-", "y", "\\u{", "i", "}", " ", "+", " ", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "link", "\\u", "f", ":", " ", "latent", " ", "variab", "les", " ", "link", "(", "f", ")", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "link", "\\u", "f", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "y", ":", " ", "data", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "y", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "Y", "\\u", "metadata", ":", " ", "Y", "\\u", "metadata", " ", "not", " ", "used", " ", "in", " ", "gauss", "ian", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "deriv", "ative", " ", "of", " ", "log", " ", "likelihood", " ", "evaluate", "d", " ", "at", " ", "points", " ", "link", "(", "f", ")", " ", "w", ".", "r", ".", "t", " ", "varian", "ce", " ", "parameter", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s", "\\u", "4_", "=_", "1.0_", "/_", "(_", "self_", "._", "variance_", "**_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dli", "k", "\\u", "grad", "\\u", "dsi", "gma", "_", "=_", "-_", "s", "\\u", "4_", "*_", "y_", "+_", "s", "\\u", "4_", "*_", "link", "\\u", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dli", "k", "\\u", "grad", "\\u", "dsi", "gma", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "d2", "logp", "df", "\\u", "dli", "nk", "2", "\\u", "dva", "r_", "(_", "self_", ",_", "link", "\\u", "f_", ",_", "y_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Grad", "ient", " ", "of", " ", "the", " ", "hessian", " ", "(", "d2", "logp", "df", "\\u", "dli", "nk", "2", ")", " ", "w", ".", "r", ".", "t", " ", "varian", "ce", " ", "parameter", " ", "(", "noise", "\\u", "varian", "ce", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "math", "::", "\\", "10", ";", " ", " ", " ", " ", "\\\\\\\\", "frac", "{", "d", "}{", "d", "\\\\\\\\", "sigma", "^", "{", "2", "}}", "(\\\\\\\\", "frac", "{", "d", "^", "{", "2", "}", " ", "\\\\\\\\", "ln", " ", "p", "(", "y", "\\u{", "i", "}|", "\\\\\\\\", "lambda", "(", "f", "\\u{", "i", "}))", "}{", "d", "^", "{", "2", "}\\\\", "\\\\", "lambda", "(", "f", ")}", ")", " ", "=", " ", "\\\\\\\\", "frac", "{", "1", "}{\\\\", "\\\\", "sigma", "^", "{", "4", "}}\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "link", "\\u", "f", ":", " ", "latent", " ", "variab", "les", " ", "link", "(", "f", ")", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "link", "\\u", "f", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "y", ":", " ", "data", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "y", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "Y", "\\u", "metadata", ":", " ", "Y", "\\u", "metadata", " ", "not", " ", "used", " ", "in", " ", "gauss", "ian", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "deriv", "ative", " ", "of", " ", "log", " ", "hessian", " ", "evaluate", "d", " ", "at", " ", "points", " ", "link", "(", "f", "\\u", "i", ")", " ", "and", " ", "link", "(", "f", "\\u", "j", ")", " ", "w", ".", "r", ".", "t", " ", "varian", "ce", " ", "parameter", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "Nx", "1", " ", "array", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s", "\\u", "4_", "=_", "1.0_", "/_", "(_", "self_", "._", "variance_", "**_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "N_", "=_", "y_", "._", "shape_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "D_", "=_", "link", "\\u", "f_", "._", "shape_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d2", "logp", "df", "\\u", "dli", "nk", "2", "\\u", "dva", "r_", "=_", "np_", "._", "ones_", "(_", "(_", "N_", ",_", "D_", ")_", ")_", "*_", "s", "\\u", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d2", "logp", "df", "\\u", "dli", "nk", "2", "\\u", "dva", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dlo", "gpd", "f", "\\u", "link", "\\u", "dth", "eta_", "(_", "self_", ",_", "f_", ",_", "y_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dlo", "gpd", "f", "\\u", "dth", "eta_", "=_", "np_", "._", "zeros_", "(_", "(_", "self_", "._", "size_", ",_", "f_", "._", "shape_", "[_", "0_", "]_", ",_", "f_", "._", "shape_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dlo", "gpd", "f", "\\u", "dth", "eta_", "[_", "0_", ",_", ":_", ",_", ":_", "]_", "=_", "self_", "._", "dlo", "gpd", "f", "\\u", "link", "\\u", "dva", "r_", "(_", "f_", ",_", "y_", ",_", "Y", "\\u", "metadata_", "=_", "Y", "\\u", "metadata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dlo", "gpd", "f", "\\u", "dth", "eta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dlo", "gpd", "f", "\\u", "dli", "nk", "\\u", "dth", "eta_", "(_", "self_", ",_", "f_", ",_", "y_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dlo", "gpd", "f", "\\u", "dli", "nk", "\\u", "dth", "eta_", "=_", "np_", "._", "zeros_", "(_", "(_", "self_", "._", "size_", ",_", "f_", "._", "shape_", "[_", "0_", "]_", ",_", "f_", "._", "shape_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dlo", "gpd", "f", "\\u", "dli", "nk", "\\u", "dth", "eta_", "[_", "0_", ",_", ":_", ",_", ":_", "]_", "=_", "self_", "._", "dlo", "gpd", "f", "\\u", "dli", "nk", "\\u", "dva", "r_", "(_", "f_", ",_", "y_", ",_", "Y", "\\u", "metadata_", "=_", "Y", "\\u", "metadata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dlo", "gpd", "f", "\\u", "dli", "nk", "\\u", "dth", "eta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "d2", "logp", "df", "\\u", "dli", "nk", "2", "\\u", "dth", "eta_", "(_", "self_", ",_", "f_", ",_", "y_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d2", "logp", "df", "\\u", "dli", "nk", "2", "\\u", "dth", "eta_", "=_", "np_", "._", "zeros_", "(_", "(_", "self_", "._", "size_", ",_", "f_", "._", "shape_", "[_", "0_", "]_", ",_", "f_", "._", "shape_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d2", "logp", "df", "\\u", "dli", "nk", "2", "\\u", "dth", "eta_", "[_", "0_", ",_", ":_", ",_", ":_", "]_", "=_", "self_", "._", "d2", "logp", "df", "\\u", "dli", "nk", "2", "\\u", "dva", "r_", "(_", "f_", ",_", "y_", ",_", "Y", "\\u", "metadata_", "=_", "Y", "\\u", "metadata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d2", "logp", "df", "\\u", "dli", "nk", "2", "\\u", "dth", "eta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "mean_", "(_", "self_", ",_", "gp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Expect", "ed", " ", "value", " ", "of", " ", "y", " ", "under", " ", "the", " ", "Mass", " ", "(", "or", " ", "densit", "y", ")", " ", "function", " ", "p", "(", "y", "|", "f", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "math", "::", "\\", "10", ";", " ", " ", " ", " ", "E", "\\u{", "p", "(", "y", "|", "f", ")}", "[", "y", "]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "gp", "\\u", "link_", "._", "transf", "_", "(_", "gp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "variance_", "(_", "self_", ",_", "gp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Variance", " ", "of", " ", "y", " ", "under", " ", "the", " ", "Mass", " ", "(", "or", " ", "densit", "y", ")", " ", "function", " ", "p", "(", "y", "|", "f", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "math", "::", "\\", "10", ";", " ", " ", " ", " ", "Var", "\\u{", "p", "(", "y", "|", "f", ")}", "[", "y", "]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "variance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "samples_", "(_", "self_", ",_", "gp_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "set", " ", "of", " ", "samples", " ", "of", " ", "observa", "tion", "s", " ", "based", " ", "on", " ", "a", " ", "give", "n", " ", "value", " ", "of", " ", "the", " ", "latent", " ", "variab", "le", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "gp", ":", " ", "latent", " ", "variab", "le", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "orig", "\\u", "shape_", "=_", "gp_", "._", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gp_", "=_", "gp_", "._", "flatten_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "orig", "\\u", "shape", " ", "=", " ", "gp", ".", "shape_", "\\u\\u\\uNL\\u\\u\\u_", "gp_", "=_", "gp_", "._", "flatten_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ys", "im_", "=_", "np_", "._", "array_", "(_", "[_", "np_", "._", "random_", "._", "normal_", "(_", "self_", "._", "gp", "\\u", "link_", "._", "transf", "_", "(_", "gp", "j_", ")_", ",_", "scale_", "=_", "np_", "._", "sqrt_", "(_", "self_", "._", "variance_", ")_", ",_", "size_", "=_", "1_", ")_", "for_", "gp", "j_", "in_", "gp_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Ys", "im_", "._", "reshape_", "(_", "orig", "\\u", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "log", "\\u", "predicti", "ve", "\\u", "density_", "(_", "self_", ",_", "y", "\\u", "test_", ",_", "mu", "\\u", "star_", ",_", "var", "\\u", "star_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "assume", "s", " ", "indep", "ende", "nce", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "var", "\\u", "star_", "+_", "self_", "._", "variance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "-_", "0.5_", "*_", "np_", "._", "log_", "(_", "2_", "*_", "np_", "._", "pi_", ")_", "-_", "0.5_", "*_", "np_", "._", "log_", "(_", "v_", ")_", "-_", "0.5_", "*_", "np_", "._", "square_", "(_", "y", "\\u", "test_", "-_", "mu", "\\u", "star_", ")_", "/_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "_", "(_", "Likelihood", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "variatio", "nal", "\\u", "expectations", "_", "(_", "self_", ",_", "Y_", ",_", "m_", ",_", "v_", ",_", "gh", "\\u", "points_", "=_", "None_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "self_", "._", "gp", "\\u", "link_", ",_", "link", "\\u", "functions_", "._", "Identity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "Gaussian", "_", ",_", "self_", ")_", "._", "variatio", "nal", "\\u", "expectations", "_", "(_", "Y_", "=_", "Y_", ",_", "m_", "=_", "m_", ",_", "v_", "=_", "v_", ",_", "gh", "\\u", "points_", "=_", "gh", "\\u", "points_", ",_", "Y", "\\u", "metadata_", "=_", "Y", "\\u", "metadata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lik", "\\u", "var_", "=_", "float_", "(_", "self_", "._", "variance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "F_", "=_", "-_", "0.5_", "*_", "np_", "._", "log_", "(_", "2_", "*_", "np_", "._", "pi_", ")_", "-_", "0.5_", "*_", "np_", "._", "log_", "(_", "lik", "\\u", "var_", ")_", "-_", "0.5_", "*_", "(_", "np_", "._", "square_", "(_", "Y_", ")_", "+_", "np_", "._", "square_", "(_", "m_", ")_", "+_", "v_", "-_", "2_", "*_", "m_", "*_", "Y_", ")_", "/_", "lik", "\\u", "var_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d", "F", "\\u", "dm", "u_", "=_", "(_", "Y_", "-_", "m_", ")_", "/_", "lik", "\\u", "var_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d", "F", "\\u", "dv_", "=_", "np_", "._", "ones", "\\u", "like_", "(_", "v_", ")_", "*_", "(_", "-_", "0.5_", "/_", "lik", "\\u", "var_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d", "F", "\\u", "dth", "eta_", "=_", "-_", "0.5_", "/_", "lik", "\\u", "var_", "+_", "0.5_", "*_", "(_", "np_", "._", "square_", "(_", "Y_", ")_", "+_", "np_", "._", "square_", "(_", "m_", ")_", "+_", "v_", "-_", "2_", "*_", "m_", "*_", "Y_", ")_", "/_", "(_", "lik", "\\u", "var_", "**_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "F_", ",_", "d", "F", "\\u", "dm", "u_", ",_", "d", "F", "\\u", "dv_", ",_", "d", "F", "\\u", "dth", "eta_", "._", "reshape_", "(_", "1_", ",_", "Y_", "._", "shape_", "[_", "0_", "]_", ",_", "Y_", "._", "shape_", "[_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "He", "tero", "sce", "das", "tic", "Gaussian", "_", "(_", "Gaussian", "_", ")_", ":_", "\\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_", "[SEP]_", "class_", "He", "tero", "sce", "das", "tic", "Gaussian", "_", "(_", "Gaussian", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "Y", "\\u", "metadata_", ",_", "gp", "\\u", "link_", "=_", "None_", ",_", "variance_", "=_", "1._", ",_", "name_", "=_", "'", "het", "\\u", "Gau", "ss", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "gp", "\\u", "link_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gp", "\\u", "link_", "=_", "link", "\\u", "functions_", "._", "Identity_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "gp", "\\u", "link_", ",_", "link", "\\u", "functions_", "._", "Identity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Warn", "ing", ",", " ", "Exa", "ct", " ", "infer", "ence", " ", "is", " ", "not", " ", "impl", "eme", "ted", " ", "for", " ", "non", "-", "identi", "ty", " ", "link", " ", "function", "s", ",\\\\", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "you", " ", "are", " ", "not", " ", "alr", "ead", "y", ",", " ", "ensure", " ", "Lap", "lace", " ", "infer", "ence", "\\u", "method", " ", "is", " ", "used", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", "He", "tero", "sce", "das", "tic", "Gaussian", "_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "gp", "\\u", "link_", ",_", "np_", "._", "ones_", "(_", "Y", "\\u", "metadata_", "[_", "'", "output", "\\u", "index", "'_", "]_", "._", "shape_", ")_", "*_", "variance_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "He", "tero", "sce", "das", "tic", "Gaussian", "_", "(_", "Gaussian", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "exact", "\\u", "infer", "ence", "\\u", "gradients_", "(_", "self_", ",_", "d", "L", "\\u", "d", "Kd", "iag", "_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d", "L", "\\u", "d", "Kd", "iag", "_", "[_", "Y", "\\u", "metadata_", "[_", "'", "output", "\\u", "index", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "He", "tero", "sce", "das", "tic", "Gaussian", "_", "(_", "Gaussian", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gauss", "ian", "\\u", "variance_", "(_", "self_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "variance_", "[_", "Y", "\\u", "metadata_", "[_", "'", "output", "\\u", "index", "'_", "]_", "._", "flatten_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "He", "tero", "sce", "das", "tic", "Gaussian", "_", "(_", "Gaussian", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predicti", "ve", "\\u", "values_", "(_", "self_", ",_", "mu_", ",_", "var_", ",_", "full", "\\u", "cov_", "=_", "False_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "s_", "=_", "self_", "._", "variance_", "[_", "Y", "\\u", "metadata_", "[_", "'", "output", "\\u", "index", "'_", "]_", "._", "flatten_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "full", "\\u", "cov_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "var_", "._", "ndim_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "var_", "+=_", "np_", "._", "eye_", "(_", "var_", "._", "shape_", "[_", "0_", "]_", ")_", "*_", "\\u", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "var_", "._", "ndim_", "==_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "var_", "+=_", "np_", "._", "atl", "east", "\\u", "3d_", "(_", "np_", "._", "eye_", "(_", "var_", "._", "shape_", "[_", "0_", "]_", ")_", "*_", "\\u", "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 ", " _", "var_", "+=_", "\\u", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "mu_", ",_", "var_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "He", "tero", "sce", "das", "tic", "Gaussian", "_", "(_", "Gaussian", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predicti", "ve", "\\u", "quantiles", "_", "(_", "self_", ",_", "mu_", ",_", "var_", ",_", "quantiles", "_", ",_", "Y", "\\u", "metadata_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "s_", "=_", "self_", "._", "variance_", "[_", "Y", "\\u", "metadata_", "[_", "'", "output", "\\u", "index", "'_", "]_", "._", "flatten_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "stats_", "._", "norm_", "._", "pp", "f_", "(_", "q_", "/_", "100._", ")_", "*_", "np_", "._", "sqrt_", "(_", "var_", "+_", "\\u", "s_", ")_", "+_", "mu_", "for_", "q_", "in_", "quantiles", "_", "]_" ]
[ 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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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 ]
Nested loops with same variable
Arelle/Arelle/arelle/ViewWinRenderedGrid.py
[ { "content": " def explicitDimensionFilterMembers(self, structuralNode, structuralNodeWithFilter):\n for aspect in structuralNodeWithFilter.aspectsCovered():\n if isinstance(aspect, QName): # dimension\n break\n valueHeaders = set()\n if structuralNode is not None:\n headerValues = {}\n # check for dimension filter(s)\n dimFilterRels = structuralNodeWithFilter.definitionNode.filterRelationships\n if dimFilterRels:\n for rel in dimFilterRels:\n dimFilter = rel.toModelObject\n if dimFilter is not None:\n for memberModel in dimFilter.memberProgs:\n memQname = memberModel.qname\n memConcept = self.modelXbrl.qnameConcepts.get(memQname)\n if memConcept is not None and (not memberModel.axis or memberModel.axis.endswith('-self')):\n header = memConcept.label(lang=self.lang)\n valueHeaders.add(header)\n if rel.isUsable:\n headerValues[header] = memQname\n else:\n headerValues[header] = memConcept\n if memberModel.axis and memberModel.linkrole and memberModel.arcrole:\n # merge of pull request 42 acsone:TABLE_Z_AXIS_DESCENDANT_OR_SELF\n if memberModel.axis.endswith('-or-self'):\n searchAxis = memberModel.axis[:len(memberModel.axis)-len('-or-self')]\n else:\n searchAxis = memberModel.axis\n relationships = concept_relationships(self.rendrCntx, \n None, \n (memQname,\n memberModel.linkrole,\n memberModel.arcrole,\n searchAxis),\n False) # return flat list\n for rel in relationships:\n if rel.isUsable:\n header = rel.toModelObject.label(lang=self.lang)\n valueHeaders.add(header)\n headerValues[header] = rel.toModelObject.qname\n if not valueHeaders:\n relationships = concept_relationships(self.rendrCntx, \n None, \n (aspect,\n \"XBRL-all-linkroles\", # linkrole,\n \"XBRL-dimensions\",\n 'descendant'),\n False) # return flat list\n for rel in relationships:\n if (rel.arcrole in (XbrlConst.dimensionDomain, XbrlConst.domainMember)\n and rel.isUsable):\n header = rel.toModelObject.label(lang=self.lang)\n valueHeaders.add(header)\n headerValues[header] = rel.toModelObject.qname\n structuralNode.aspectEntryHeaderValues = headerValues\n return sorted(valueHeaders)", "metadata": "root.ViewRenderedGrid.explicitDimensionFilterMembers", "header": "['class', 'ViewRenderedGrid', '(', 'ViewWinTkTable', '.', 'ViewTkTable', ')', ':', '___EOS___']", "index": 1155 } ]
[ { "span": "for rel in relationships:", "start_line": 1191, "start_column": 36, "end_line": 1191, "end_column": 61 } ]
[ { "span": "for rel in dimFilterRels:", "start_line": 1165, "start_column": 16, "end_line": 1165, "end_column": 41 } ]
1
true
[ "[CLS]_", "Nest", "ed_", "loops_", "with_", "same_", "variable_", "[SEP]_", "class_", "View", "Render", "ed", "Grid_", "(_", "View", "Win", "Tk", "Table_", "._", "View", "Tk", "Table_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "explicit", "Dimen", "sion", "Filter", "Members_", "(_", "self_", ",_", "structural", "Node_", ",_", "structural", "Node", "With", "Filter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "aspect_", "in_", "structural", "Node", "With", "Filter_", "._", "aspect", "s", "Cover", "ed_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "aspect_", ",_", "QN", "ame_", ")_", ":_", "#", " ", "dimension_", "\\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_", "value", "Headers_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "structural", "Node_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header", "Values_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "for", " ", "dimension", " ", "filter", "(", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "dim", "Filter", "Rel", "s_", "=_", "structural", "Node", "With", "Filter_", "._", "definit", "ion", "Node_", "._", "filter", "Relationship", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "dim", "Filter", "Rel", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "rel_", "in_", "dim", "Filter", "Rel", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "dim", "Filter_", "=_", "rel_", "._", "to", "Model", "Object_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "dim", "Filter_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "member", "Model_", "in_", "dim", "Filter_", "._", "member", "Prog", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "mem", "Qn", "ame_", "=_", "member", "Model_", "._", "qname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mem", "Concept", "_", "=_", "self_", "._", "model", "Xbrl", "_", "._", "qna", "me", "Concept", "s_", "._", "get_", "(_", "mem", "Qn", "ame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mem", "Concept", "_", "is_", "not_", "None_", "and_", "(_", "not_", "member", "Model_", "._", "axis_", "or_", "member", "Model_", "._", "axis_", "._", "endswith_", "(_", "'-", "self", "'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "header_", "=_", "mem", "Concept", "_", "._", "label_", "(_", "lang_", "=_", "self_", "._", "lang_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Headers_", "._", "add_", "(_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "rel_", "._", "is", "Us", "able_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "header", "Values_", "[_", "header_", "]_", "=_", "mem", "Qn", "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 ", " ", " ", " _", "header", "Values_", "[_", "header_", "]_", "=_", "mem", "Concept", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "member", "Model_", "._", "axis_", "and_", "member", "Model_", "._", "link", "role_", "and_", "member", "Model_", "._", "arc", "role_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "merge", " ", "of", " ", "pull", " ", "request", " ", "4", "2", " ", "acs", "one", ":", "TAB", "LE", "\\u", "Z", "\\u", "AXIS", "\\u", "DESC", "END", "ANT", "\\u", "OR", "\\u", "SELF", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "member", "Model_", "._", "axis_", "._", "endswith_", "(_", "'-", "or", "-", "self", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "search", "Axis_", "=_", "member", "Model_", "._", "axis_", "[_", ":_", "len_", "(_", "member", "Model_", "._", "axis_", ")_", "-_", "len_", "(_", "'-", "or", "-", "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 ", " ", " ", " _", "search", "Axis_", "=_", "member", "Model_", "._", "axis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "relationships_", "=_", "concept", "\\u", "relationships_", "(_", "self_", "._", "rend", "r", "Cnt", "x_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "mem", "Qn", "ame_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "member", "Model_", "._", "link", "role_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "member", "Model_", "._", "arc", "role_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "search", "Axis_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "False_", ")_", "#", " ", "return", " ", "flat", " ", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "rel_", "in_", "relationships_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "if_", "rel_", "._", "is", "Us", "able_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "header_", "=_", "rel_", "._", "to", "Model", "Object_", "._", "label_", "(_", "lang_", "=_", "self_", "._", "lang_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Headers_", "._", "add_", "(_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header", "Values_", "[_", "header_", "]_", "=_", "rel_", "._", "to", "Model", "Object_", "._", "qname_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "value", "Headers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relationships_", "=_", "concept", "\\u", "relationships_", "(_", "self_", "._", "rend", "r", "Cnt", "x_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "aspect_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "XB", "RL", "-", "all", "-", "link", "role", "s", "\"_", ",_", "#", " ", "link", "role", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "XB", "RL", "-", "dimension", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "descendant", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "False_", ")_", "#", " ", "return", " ", "flat", " ", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "rel_", "in_", "relationships_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "(_", "rel_", "._", "arc", "role_", "in_", "(_", "Xbrl", "Const_", "._", "dimension", "Domain_", ",_", "Xbrl", "Const_", "._", "domain", "Member_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "rel_", "._", "is", "Us", "able_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "header_", "=_", "rel_", "._", "to", "Model", "Object_", "._", "label_", "(_", "lang_", "=_", "self_", "._", "lang_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "Headers_", "._", "add_", "(_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header", "Values_", "[_", "header_", "]_", "=_", "rel_", "._", "to", "Model", "Object_", "._", "qname_", "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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 ]
Unguarded next in generator
thefactory/marathon-python/marathon/client.py
[ { "content": " def kill_tasks(self, app_id, scale=False,\n host=None, batch_size=0, batch_delay=0):\n \"\"\"Kill all tasks belonging to app.\n\n :param str app_id: application ID\n :param bool scale: if true, scale down the app by the number of tasks killed\n :param str host: if provided, only terminate tasks on this Mesos slave\n :param int batch_size: if non-zero, terminate tasks in groups of this size\n :param int batch_delay: time (in seconds) to wait in between batched kills. If zero, automatically determine\n\n :returns: list of killed tasks\n :rtype: list[:class:`marathon.models.task.MarathonTask`]\n \"\"\"\n def batch(iterable, size):\n sourceiter = iter(iterable)\n while True:\n batchiter = itertools.islice(sourceiter, size)\n yield itertools.chain([next(batchiter)], batchiter)\n\n if batch_size == 0:\n # Terminate all at once\n params = {'scale': scale}\n if host:\n params['host'] = host\n response = self._do_request(\n 'DELETE', '/v2/apps/{app_id}/tasks'.format(app_id=app_id), params)\n # Marathon is inconsistent about what type of object it returns on the multi\n # task deletion endpoint, depending on the version of Marathon. See:\n # https://github.com/mesosphere/marathon/blob/06a6f763a75fb6d652b4f1660685ae234bd15387/src/main/scala/mesosphere/marathon/api/v2/AppTasksResource.scala#L88-L95\n if \"tasks\" in response.json():\n return self._parse_response(response, MarathonTask, is_list=True, resource_name='tasks')\n else:\n return response.json()\n else:\n # Terminate in batches\n tasks = self.list_tasks(\n app_id, host=host) if host else self.list_tasks(app_id)\n for tbatch in batch(tasks, batch_size):\n killed_tasks = [self.kill_task(app_id, t.id, scale=scale)\n for t in tbatch]\n\n # Pause until the tasks have been killed to avoid race\n # conditions\n killed_task_ids = set(t.id for t in killed_tasks)\n running_task_ids = killed_task_ids\n while killed_task_ids.intersection(running_task_ids):\n time.sleep(1)\n running_task_ids = set(\n t.id for t in self.get_app(app_id).tasks)\n\n if batch_delay == 0:\n # Pause until the replacement tasks are healthy\n desired_instances = self.get_app(app_id).instances\n running_instances = 0\n while running_instances < desired_instances:\n time.sleep(1)\n running_instances = sum(\n t.started_at is None for t in self.get_app(app_id).tasks)\n else:\n time.sleep(batch_delay)\n\n return tasks", "metadata": "root.MarathonClient.kill_tasks", "header": "['class', 'MarathonClient', '(', 'object', ')', ':', '___EOS___']", "index": 432 } ]
[ { "span": "next(batchiter)]", "start_line": 449, "start_column": 39, "end_line": 449, "end_column": 54 } ]
[]
1
true
[ "[CLS]_", "Un", "guard", "ed_", "next_", "in_", "generator_", "[SEP]_", "class_", "Mar", "athon", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "kill", "\\u", "tasks_", "(_", "self_", ",_", "app", "\\u", "id_", ",_", "scale_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "host_", "=_", "None_", ",_", "batch", "\\u", "size_", "=_", "0_", ",_", "batch", "\\u", "delay_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Kill", " ", "all", " ", "task", "s", " ", "belonging", " ", "to", " ", "app", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "str", " ", "app", "\\u", "id", ":", " ", "applica", "tion", " ", "ID", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "bool", " ", "scale", ":", " ", "if", " ", "true", ",", " ", "scale", " ", "down", " ", "the", " ", "app", " ", "by", " ", "the", " ", "number", " ", "of", " ", "task", "s", " ", "kille", "d", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "str", " ", "host", ":", " ", "if", " ", "provided", ",", " ", "only", " ", "terminate", " ", "task", "s", " ", "on", " ", "this", " ", "Mes", "os", " ", "slave", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "int", " ", "batch", "\\u", "size", ":", " ", "if", " ", "non", "-", "zero", ",", " ", "terminate", " ", "task", "s", " ", "in", " ", "group", "s", " ", "of", " ", "this", " ", "size", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "int", " ", "batch", "\\u", "dela", "y", ":", " ", "time", " ", "(", "in", " ", "second", "s", ")", " ", "to", " ", "wait", " ", "in", " ", "bet", "ween", " ", "batched", " ", "kills", ".", " ", "If", " ", "zero", ",", " ", "automati", "call", "y", " ", "dete", "rmin", "e", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "list", " ", "of", " ", "kille", "d", " ", "task", "s", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "list", "[:", "class", ":`", "marathon", ".", "model", "s", ".", "task", ".", "Mar", "athon", "Task", "`]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "batch_", "(_", "iterable_", ",_", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source", "iter_", "=_", "iter_", "(_", "iterable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "batch", "iter_", "=_", "itertools_", "._", "islice_", "(_", "source", "iter_", ",_", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "itertools_", "._", "chain_", "(_", "[_", "next_", "(_", "batch", "iter_", ")_", "]_", ",_", "batch", "iter_", ")_", "\\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_", "batch", "\\u", "size_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Terminate", " ", "all", " ", "at", " ", "once_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "{_", "'", "scale", "'_", ":_", "scale_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "host_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "[_", "'", "host", "'_", "]_", "=_", "host_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "=_", "self_", "._", "\\u", "do", "\\u", "request_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "DELET", "E", "'_", ",_", "'/", "v2", "/", "apps", "/{", "app", "\\u", "id", "}/", "task", "s", "'_", "._", "format_", "(_", "app", "\\u", "id_", "=_", "app", "\\u", "id_", ")_", ",_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Mar", "athon", " ", "is", " ", "inconsistent", " ", "abo", "ut", " ", "what", " ", "type", " ", "of", " ", "object", " ", "it", " ", "return", "s", " ", "on", " ", "the", " ", "multi_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "task", " ", "deletion", " ", "endpoint", ",", " ", "depend", "ing", " ", "on", " ", "the", " ", "version", " ", "of", " ", "Mar", "athon", ".", " ", "See", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "https", "://", "git", "hub", ".", "com", "/", "mesos", "pher", "e", "/", "marathon", "/", "blob", "/", "0", "6a", "6f", "763", "a7", "5f", "b6", "d6", "5", "2b", "4f", "166", "068", "5a", "e2", "3", "4b", "d1", "538", "7", "/", "src", "/", "main", "/", "scala", "/", "mesos", "pher", "e", "/", "marathon", "/", "api", "/", "v2", "/", "App", "Task", "s", "Reso", "urc", "e", ".", "scala", "#", "L", "88", "-", "L", "95_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\"", "task", "s", "\"_", "in_", "response_", "._", "json_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "parse", "\\u", "response_", "(_", "response_", ",_", "Mar", "athon", "Task_", ",_", "is", "\\u", "list_", "=_", "True_", ",_", "resource", "\\u", "name_", "=_", "'", "task", "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 ", " _", "return_", "response_", "._", "json_", "(_", ")_", "\\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_", "#", " ", "Terminate", " ", "in", " ", "batches_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tasks_", "=_", "self_", "._", "list", "\\u", "tasks_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "app", "\\u", "id_", ",_", "host_", "=_", "host_", ")_", "if_", "host_", "else_", "self_", "._", "list", "\\u", "tasks_", "(_", "app", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "tba", "tch_", "in_", "batch_", "(_", "tasks_", ",_", "batch", "\\u", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kille", "d\\u", "tasks_", "=_", "[_", "self_", "._", "kill", "\\u", "task_", "(_", "app", "\\u", "id_", ",_", "t_", "._", "id_", ",_", "scale_", "=_", "scale_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "t_", "in_", "tba", "tch_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pause", " ", "unti", "l", " ", "the", " ", "task", "s", " ", "have", " ", "bee", "n", " ", "kille", "d", " ", "to", " ", "avoid", " ", "race_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "conditions_", "\\u\\u\\uNL\\u\\u\\u_", "kille", "d\\u", "task", "\\u", "ids_", "=_", "set_", "(_", "t_", "._", "id_", "for_", "t_", "in_", "kille", "d\\u", "tasks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "runn", "ing", "\\u", "task", "\\u", "ids_", "=_", "kille", "d\\u", "task", "\\u", "ids_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "kille", "d\\u", "task", "\\u", "ids_", "._", "intersection_", "(_", "runn", "ing", "\\u", "task", "\\u", "ids_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "time_", "._", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "runn", "ing", "\\u", "task", "\\u", "ids_", "=_", "set_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "._", "id_", "for_", "t_", "in_", "self_", "._", "get", "\\u", "app_", "(_", "app", "\\u", "id_", ")_", "._", "tasks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "batch", "\\u", "delay_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pause", " ", "unti", "l", " ", "the", " ", "replace", "ment", " ", "task", "s", " ", "are", " ", "healthy", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "desi", "red", "\\u", "instances_", "=_", "self_", "._", "get", "\\u", "app_", "(_", "app", "\\u", "id_", ")_", "._", "instances_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "runn", "ing", "\\u", "instances_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "runn", "ing", "\\u", "instances_", "<_", "desi", "red", "\\u", "instances_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "time_", "._", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "runn", "ing", "\\u", "instances_", "=_", "sum_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "._", "start", "ed", "\\u", "at_", "is_", "None_", "for_", "t_", "in_", "self_", "._", "get", "\\u", "app_", "(_", "app", "\\u", "id_", ")_", "._", "tasks_", ")_", "\\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 ", " ", "_", "time_", "._", "sleep_", "(_", "batch", "\\u", "delay_", ")_", "\\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_", "tasks_", "\\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, 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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 ]
An assert statement has a side-effect
schematics/schematics/tests/test_conversion.py
[ { "content": "@pytest.mark.parametrize('variant', (None, 'noerrors'))\[email protected]('partial', (True, False))\[email protected]('import_, two_pass, input_instance, input_init, init, missing_obj',\n [( True, False, False, None, True, None),\n ( True, False, False, None, False, Undefined),\n ( True, False, True, False, True, None),\n ( True, False, True, False, False, Undefined),\n ( True, False, True, True, True, None),\n ( True, False, True, True, False, None),\n ( True, True, False, None, True, None),\n ( True, True, False, None, False, Undefined),\n ( True, True, True, False, True, None),\n ( True, True, True, False, False, Undefined),\n ( True, True, True, True, True, None),\n ( True, True, True, True, False, None),\n ( False, None, True, False, True, None),\n ( False, None, True, False, False, Undefined),\n ( False, None, True, True, True, None),\n ( False, None, True, True, False, None)])\ndef test_conversion_with_validation(input, import_, two_pass, input_instance, init, missing_obj,\n partial, variant):\n\n if variant == 'noerrors':\n\n orig_input = copy(input)\n\n if input_instance:\n assert input.modelfield is orig_input.modelfield\n\n if import_:\n if two_pass:\n m = M(input, init=init)\n m.validate(partial=partial)\n else:\n m = M(input, init=init, partial=partial, validate=True)\n else:\n input.validate(init_values=init, partial=partial)\n m = input\n\n assert input == orig_input\n\n if input_instance:\n if import_:\n assert m.modelfield is not input.modelfield\n assert m._data['modelfield'] is not input._data['modelfield']\n assert m.modelfield.listfield is not input.modelfield.listfield\n else:\n assert m.modelfield is input.modelfield\n assert m._data['modelfield'] is input._data['modelfield']\n assert m.modelfield.listfield is input.modelfield.listfield\n\n return\n\n if missing_obj is None:\n partial_data = {\n 'intfield': 1,\n 'reqfield': u'foo',\n 'matrixfield': None,\n 'modelfield': {\n 'intfield': None,\n 'reqfield': u'bar',\n 'matrixfield': None,\n 'modelfield': {\n 'reqfield': None,\n 'listfield': None,\n 'modelfield': M({\n 'intfield': 0,\n 'reqfield': u'foo',\n 'listfield': None})}}}\n else:\n partial_data = {\n 'intfield': 1,\n 'reqfield': u'foo',\n 'modelfield': {\n 'reqfield': u'bar',\n 'modelfield': {\n 'listfield': None,\n 'modelfield': M({\n 'intfield': 0,\n 'reqfield': u'foo',\n 'listfield': None}, init=False)}}}\n\n with pytest.raises(DataError) as excinfo:\n if import_:\n if two_pass:\n m = M(input, init=init)\n m.validate(partial=partial)\n else:\n M(input, init=init, partial=partial, validate=True)\n else:\n input.validate(init_values=init, partial=partial)\n\n messages = excinfo.value.messages\n\n err_list = messages.pop('listfield')\n assert err_list.pop().type == ValidationError\n assert err_list == []\n\n err_list = messages['modelfield'].pop('listfield')\n assert err_list.pop().type == ValidationError\n assert err_list.pop().type == ValidationError\n assert err_list == []\n\n err_list = messages['modelfield']['modelfield'].pop('intfield')\n err_msg = err_list.pop()\n assert err_list == []\n assert err_msg.type == ValidationError\n\n if not partial:\n err_list = messages['modelfield']['modelfield'].pop('reqfield')\n err_msg = err_list.pop()\n assert err_list == []\n assert err_msg.type == ConversionError\n if missing_obj is None:\n partial_data['modelfield']['modelfield'].pop('reqfield')\n\n err_dict = messages['modelfield']['modelfield'].pop('matrixfield')\n sub_err_dict = err_dict.pop(1)\n err_list_1 = sub_err_dict.pop(2)\n err_list_2 = sub_err_dict.pop(3)\n assert err_list_1.pop().type == ValidationError\n assert err_list_2.pop().type == ValidationError\n assert err_list_1 == err_list_2 == []\n assert err_dict == sub_err_dict == {}\n\n assert messages['modelfield'].pop('modelfield') == {}\n assert messages.pop('modelfield') == {}\n assert messages == {}\n\n assert excinfo.value.partial_data == partial_data", "metadata": "root.test_conversion_with_validation", "header": "['module', '___EOS___']", "index": 169 } ]
[ { "span": "assert err_list.pop().type == ValidationError", "start_line": 264, "start_column": 4, "end_line": 264, "end_column": 49 }, { "span": "assert err_list.pop().type == ValidationError", "start_line": 268, "start_column": 4, "end_line": 268, "end_column": 49 }, { "span": "assert err_list.pop().type == ValidationError", "start_line": 269, "start_column": 4, "end_line": 269, "end_column": 49 }, { "span": "assert err_list_1.pop().type == ValidationError", "start_line": 289, "start_column": 4, "end_line": 289, "end_column": 51 }, { "span": "assert err_list_2.pop().type == ValidationError", "start_line": 290, "start_column": 4, "end_line": 290, "end_column": 51 }, { "span": "assert messages['modelfield'].pop('modelfield') == {}", "start_line": 294, "start_column": 4, "end_line": 294, "end_column": 57 }, { "span": "assert messages.pop('modelfield') == {}", "start_line": 295, "start_column": 4, "end_line": 295, "end_column": 43 } ]
[]
1
true
[ "[CLS]_", "An", "_", "assert_", "statement_", "has_", "a_", "side_", "-_", "effect_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "pytest_", "._", "mark_", "._", "parametrize_", "(_", "'", "variant", "'_", ",_", "(_", "None_", ",_", "'", "noe", "rror", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "pytest_", "._", "mark_", "._", "parametrize_", "(_", "'", "partial", "'_", ",_", "(_", "True_", ",_", "False_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "pytest_", "._", "mark_", "._", "parametrize_", "(_", "'", "import", "\\u", ",", " ", "two", "\\u", "pass", ",", " ", "input", "\\u", "instance", ",", " ", "input", "\\u", "init", ",", " ", "init", ",", " ", " ", "missi", "ng", "\\u", "obj", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "True_", ",_", "False_", ",_", "False_", ",_", "None_", ",_", "True_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "True_", ",_", "False_", ",_", "False_", ",_", "None_", ",_", "False_", ",_", "Unde", "fined", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "True_", ",_", "False_", ",_", "True_", ",_", "False_", ",_", "True_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "True_", ",_", "False_", ",_", "True_", ",_", "False_", ",_", "False_", ",_", "Unde", "fined", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "True_", ",_", "False_", ",_", "True_", ",_", "True_", ",_", "True_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "True_", ",_", "False_", ",_", "True_", ",_", "True_", ",_", "False_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "True_", ",_", "True_", ",_", "False_", ",_", "None_", ",_", "True_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "True_", ",_", "True_", ",_", "False_", ",_", "None_", ",_", "False_", ",_", "Unde", "fined", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "True_", ",_", "True_", ",_", "True_", ",_", "False_", ",_", "True_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "True_", ",_", "True_", ",_", "True_", ",_", "False_", ",_", "False_", ",_", "Unde", "fined", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "True_", ",_", "True_", ",_", "True_", ",_", "True_", ",_", "True_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "True_", ",_", "True_", ",_", "True_", ",_", "True_", ",_", "False_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "False_", ",_", "None_", ",_", "True_", ",_", "False_", ",_", "True_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "False_", ",_", "None_", ",_", "True_", ",_", "False_", ",_", "False_", ",_", "Unde", "fined", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "False_", ",_", "None_", ",_", "True_", ",_", "True_", ",_", "True_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "False_", ",_", "None_", ",_", "True_", ",_", "True_", ",_", "False_", ",_", "None_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "conve", "rsi", "on", "\\u", "with", "\\u", "validation_", "(_", "input_", ",_", "import", "\\u_", ",_", "two", "\\u", "pass_", ",_", "input", "\\u", "instance_", ",_", "init_", ",_", "missi", "ng", "\\u", "obj_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "partial_", ",_", "variant_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "variant_", "==_", "'", "noe", "rror", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "orig", "\\u", "input_", "=_", "copy_", "(_", "input_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "input", "\\u", "instance_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "input_", "._", "modelf", "ield_", "is_", "orig", "\\u", "input_", "._", "modelf", "ield_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "import", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "two", "\\u", "pass_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "M_", "(_", "input_", ",_", "init_", "=_", "init_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "validate_", "(_", "partial_", "=_", "partial_", ")_", "\\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 ", " _", "m_", "=_", "M_", "(_", "input_", ",_", "init_", "=_", "init_", ",_", "partial_", "=_", "partial_", ",_", "validate_", "=_", "True_", ")_", "\\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 ", " _", "input_", "._", "validate_", "(_", "init", "\\u", "values_", "=_", "init_", ",_", "partial_", "=_", "partial_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "input_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "input_", "==_", "orig", "\\u", "input_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "input", "\\u", "instance_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "import", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "m_", "._", "modelf", "ield_", "is_", "not_", "input_", "._", "modelf", "ield_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "m_", "._", "\\u", "data_", "[_", "'", "modelf", "iel", "d", "'_", "]_", "is_", "not_", "input_", "._", "\\u", "data_", "[_", "'", "modelf", "iel", "d", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "m_", "._", "modelf", "ield_", "._", "list", "field_", "is_", "not_", "input_", "._", "modelf", "ield_", "._", "list", "field_", "\\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 ", " _", "assert_", "m_", "._", "modelf", "ield_", "is_", "input_", "._", "modelf", "ield_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "m_", "._", "\\u", "data_", "[_", "'", "modelf", "iel", "d", "'_", "]_", "is_", "input_", "._", "\\u", "data_", "[_", "'", "modelf", "iel", "d", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "m_", "._", "modelf", "ield_", "._", "list", "field_", "is_", "input_", "._", "modelf", "ield_", "._", "list", "field_", "\\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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "missi", "ng", "\\u", "obj_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "partial", "\\u", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "intf", "iel", "d", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "req", "field", "'_", ":_", "u", "'", "foo", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "matrix", "field", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "modelf", "iel", "d", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "intf", "iel", "d", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "req", "field", "'_", ":_", "u", "'", "bar", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "matrix", "field", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "modelf", "iel", "d", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "req", "field", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "field", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "modelf", "iel", "d", "'_", ":_", "M_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "intf", "iel", "d", "'_", ":_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "req", "field", "'_", ":_", "u", "'", "foo", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "field", "'_", ":_", "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 ", " _", "partial", "\\u", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "intf", "iel", "d", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "req", "field", "'_", ":_", "u", "'", "foo", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "modelf", "iel", "d", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "req", "field", "'_", ":_", "u", "'", "bar", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "modelf", "iel", "d", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "field", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "modelf", "iel", "d", "'_", ":_", "M_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "intf", "iel", "d", "'_", ":_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "req", "field", "'_", ":_", "u", "'", "foo", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "field", "'_", ":_", "None_", "}_", ",_", "init_", "=_", "False_", ")_", "}_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Data", "Error_", ")_", "as_", "excinfo_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "import", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "two", "\\u", "pass_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "M_", "(_", "input_", ",_", "init_", "=_", "init_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "validate_", "(_", "partial_", "=_", "partial_", ")_", "\\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 ", " _", "M_", "(_", "input_", ",_", "init_", "=_", "init_", ",_", "partial_", "=_", "partial_", ",_", "validate_", "=_", "True_", ")_", "\\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 ", " _", "input_", "._", "validate_", "(_", "init", "\\u", "values_", "=_", "init_", ",_", "partial_", "=_", "partial_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "messages_", "=_", "excinfo_", "._", "value_", "._", "messages_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "err", "\\u", "list_", "=_", "messages_", "._", "pop_", "(_", "'", "list", "field", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "err", "\\u", "list_", "._", "pop_", "(_", ")_", "._", "type_", "==_", "Validat", "ion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "err", "\\u", "list_", "==_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "err", "\\u", "list_", "=_", "messages_", "[_", "'", "modelf", "iel", "d", "'_", "]_", "._", "pop_", "(_", "'", "list", "field", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "err", "\\u", "list_", "._", "pop_", "(_", ")_", "._", "type_", "==_", "Validat", "ion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "err", "\\u", "list_", "._", "pop_", "(_", ")_", "._", "type_", "==_", "Validat", "ion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "err", "\\u", "list_", "==_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "err", "\\u", "list_", "=_", "messages_", "[_", "'", "modelf", "iel", "d", "'_", "]_", "[_", "'", "modelf", "iel", "d", "'_", "]_", "._", "pop_", "(_", "'", "intf", "iel", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "err", "\\u", "msg_", "=_", "err", "\\u", "list_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "err", "\\u", "list_", "==_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "err", "\\u", "msg_", "._", "type_", "==_", "Validat", "ion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "partial_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "list_", "=_", "messages_", "[_", "'", "modelf", "iel", "d", "'_", "]_", "[_", "'", "modelf", "iel", "d", "'_", "]_", "._", "pop_", "(_", "'", "req", "field", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "err", "\\u", "msg_", "=_", "err", "\\u", "list_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "err", "\\u", "list_", "==_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "err", "\\u", "msg_", "._", "type_", "==_", "Conversion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "missi", "ng", "\\u", "obj_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "partial", "\\u", "data_", "[_", "'", "modelf", "iel", "d", "'_", "]_", "[_", "'", "modelf", "iel", "d", "'_", "]_", "._", "pop_", "(_", "'", "req", "field", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "err", "\\u", "dict_", "=_", "messages_", "[_", "'", "modelf", "iel", "d", "'_", "]_", "[_", "'", "modelf", "iel", "d", "'_", "]_", "._", "pop_", "(_", "'", "matrix", "field", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub\\u", "err", "\\u", "dict_", "=_", "err", "\\u", "dict_", "._", "pop_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "err", "\\u", "list", "\\u", "1_", "=_", "sub\\u", "err", "\\u", "dict_", "._", "pop_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "err", "\\u", "list", "\\u", "2_", "=_", "sub\\u", "err", "\\u", "dict_", "._", "pop_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "err", "\\u", "list", "\\u", "1_", "._", "pop_", "(_", ")_", "._", "type_", "==_", "Validat", "ion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "err", "\\u", "list", "\\u", "2_", "._", "pop_", "(_", ")_", "._", "type_", "==_", "Validat", "ion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "err", "\\u", "list", "\\u", "1_", "==_", "err", "\\u", "list", "\\u", "2_", "==_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "err", "\\u", "dict_", "==_", "sub\\u", "err", "\\u", "dict_", "==_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "messages_", "[_", "'", "modelf", "iel", "d", "'_", "]_", "._", "pop_", "(_", "'", "modelf", "iel", "d", "'_", ")_", "==_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "messages_", "._", "pop_", "(_", "'", "modelf", "iel", "d", "'_", ")_", "==_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "messages_", "==_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "excinfo_", "._", "value_", "._", "partial", "\\u", "data_", "==_", "partial", "\\u", "data_" ]
[ 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, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
dikien/Machine-Learning-Newspaper/nytimes/step1_data_wrangling.py
[ { "content": "def trans_json_to_csv(date):\n '''\n if data == 20101010 -> 20101010.csv will be saved with article that were written in 2010.10.10\n :param date: date\n :return: nothing\n '''\n ft = open(\"articles/\"+ date + \".csv\", \"wb+\")\n f = csv.writer(ft, delimiter='\\t')\n payload.update({\"begin_date\" : date, \"end_date\" : date})\n docs_lens = 1\n page = 1\n\n while(docs_lens > 0 and page < 15):\n # when page get around 100, there were some errors.\n try:\n r = requests.get(basic_url, params=payload)\n except:\n r = requests.get(basic_url, params=payload)\n\n # If one day limie query occurs, exit(0)\n if \"X-Mashery-Error-Code\" in r.headers:\n print \"ERR_403_DEVELOPER_OVER_RATE\"\n sys.exit(0)\n\n try:\n contents = r.json()\n for k in contents[\"response\"][\"docs\"]:\n # Don't save \"THE ASSOCIATED PRESS\" and \"REUTERS\" because these are not the goal of this.\n if type(k[\"byline\"]) == dict \\\n and type(k[\"lead_paragraph\"]) == unicode\\\n and k[\"byline\"][\"original\"].replace(\"By \", \"\").encode(\"UTF-8\", errors=\"ignore\") != \"THE ASSOCIATED PRESS\"\\\n and k[\"byline\"][\"original\"].replace(\"By \", \"\").encode(\"UTF-8\", errors=\"ignore\") != \"REUTERS\":\n f.writerow([k[\"byline\"][\"original\"].replace(\"By \", \"\").encode(\"UTF-8\", errors=\"ignore\"), # write \"writer\"\n k[\"lead_paragraph\"].encode(\"UTF-8\", errors=\"ignore\") # write \"lead paragraph\"\n ])\n print \"writer is %s\" % k[\"byline\"][\"original\"].replace(\"By \", \"\")\n time.sleep(0.5)\n # print \"paragraph is %s\" % k[\"lead_paragraph\"]\n\n print \"page number is %s\" % page\n page += 1\n\n docs_lens = len(contents[\"response\"][\"docs\"])\n print \"doc length is %s\" % docs_lens\n payload.update({\"page\" : page})\n\n except Exception as e:\n page += 1\n print \"page number is %s\" % page\n print e\n # print json.dumps(contents, indent=4, sort_keys=True)\n pass\n ft.close()", "metadata": "root.trans_json_to_csv", "header": "['module', '___EOS___']", "index": 16 } ]
[ { "span": "except:", "start_line": 32, "start_column": 8, "end_line": 32, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "trans", "\\u", "json", "\\u", "to", "\\u", "csv_", "(_", "date_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "data", " ", "==", " ", "2010", "1010", " ", "->", " ", "2010", "1010", ".", "csv", " ", "will", " ", "be", " ", "saved", " ", "with", " ", "article", " ", "tha", "t", " ", "wer", "e", " ", "writt", "en", " ", "in", " ", "2010", ".1", "0.10", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "date", ":", " ", "date", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "not", "hing", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft_", "=_", "open_", "(_", "\"", "article", "s", "/\"_", "+_", "date_", "+_", "\".", "csv", "\"_", ",_", "\"", "wb", "+\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "csv_", "._", "writer_", "(_", "ft_", ",_", "delimiter_", "=_", "'\\\\", "t", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "payload_", "._", "update_", "(_", "{_", "\"", "begin", "\\u", "date", "\"_", ":_", "date_", ",_", "\"", "end", "\\u", "date", "\"_", ":_", "date_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "docs", "\\u", "lens_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "(_", "docs", "\\u", "lens_", ">_", "0_", "and_", "page_", "<_", "15_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "whe", "n", " ", "page", " ", "get", " ", "aro", "und", " ", "100", ",", " ", "there", " ", "wer", "e", " ", "some", " ", "error", "s", "._", "\\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 ", " _", "r_", "=_", "requests_", "._", "get_", "(_", "basic", "\\u", "url_", ",_", "params_", "=_", "payload_", ")_", "\\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 ", " _", "r_", "=_", "requests_", "._", "get_", "(_", "basic", "\\u", "url_", ",_", "params_", "=_", "payload_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "one", " ", "day", " ", "lim", "ie", " ", "query", " ", "occur", "s", ",", " ", "exit", "(", "0", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\"", "X", "-", "Mas", "her", "y", "-", "Error", "-", "Code", "\"_", "in_", "r_", "._", "headers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "ERR", "\\u", "403", "\\u", "DEVELO", "PER", "\\u", "OVER", "\\u", "RAT", "E", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\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 ", " _", "contents_", "=_", "r_", "._", "json_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "contents_", "[_", "\"", "response", "\"_", "]_", "[_", "\"", "docs", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "save", " ", "\"", "THE", " ", "ASSOC", "IAT", "ED", " ", "PRESS", "\"", " ", "and", " ", "\"", "RE", "UT", "ERS", "\"", " ", "bec", "aus", "e", " ", "these", " ", "are", " ", "not", " ", "the", " ", "goal", " ", "of", " ", "this", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "k_", "[_", "\"", "by", "line", "\"_", "]_", ")_", "==_", "dict_", "and_", "type_", "(_", "k_", "[_", "\"", "lead", "\\u", "paragraph", "\"_", "]_", ")_", "==_", "unicode_", "and_", "k_", "[_", "\"", "by", "line", "\"_", "]_", "[_", "\"", "original", "\"_", "]_", "._", "replace_", "(_", "\"", "By", " ", "\"_", ",_", "\"\"_", ")_", "._", "encode_", "(_", "\"", "UT", "F", "-", "8", "\"_", ",_", "errors_", "=_", "\"", "ignore", "\"_", ")_", "!=_", "\"", "THE", " ", "ASSOC", "IAT", "ED", " ", "PRESS", "\"_", "and_", "k_", "[_", "\"", "by", "line", "\"_", "]_", "[_", "\"", "original", "\"_", "]_", "._", "replace_", "(_", "\"", "By", " ", "\"_", ",_", "\"\"_", ")_", "._", "encode_", "(_", "\"", "UT", "F", "-", "8", "\"_", ",_", "errors_", "=_", "\"", "ignore", "\"_", ")_", "!=_", "\"", "RE", "UT", "ERS", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "f_", "._", "writerow_", "(_", "[_", "k_", "[_", "\"", "by", "line", "\"_", "]_", "[_", "\"", "original", "\"_", "]_", "._", "replace_", "(_", "\"", "By", " ", "\"_", ",_", "\"\"_", ")_", "._", "encode_", "(_", "\"", "UT", "F", "-", "8", "\"_", ",_", "errors_", "=_", "\"", "ignore", "\"_", ")_", ",_", "#", " ", "write", " ", "\"", "writer", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "k_", "[_", "\"", "lead", "\\u", "paragraph", "\"_", "]_", "._", "encode_", "(_", "\"", "UT", "F", "-", "8", "\"_", ",_", "errors_", "=_", "\"", "ignore", "\"_", ")_", "#", " ", "write", " ", "\"", "lead", " ", "paragraph", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "writer", " ", "is", " ", "%", "s", "\"_", "%_", "k_", "[_", "\"", "by", "line", "\"_", "]_", "[_", "\"", "original", "\"_", "]_", "._", "replace_", "(_", "\"", "By", " ", "\"_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "sleep_", "(_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "\"", "paragraph", " ", "is", " ", "%", "s", "\"", " ", "%", " ", "k", "[\"", "lead", "\\u", "paragraph", "\"]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "page", " ", "number", " ", "is", " ", "%", "s", "\"_", "%_", "page_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "docs", "\\u", "lens_", "=_", "len_", "(_", "contents_", "[_", "\"", "response", "\"_", "]_", "[_", "\"", "docs", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "doc", " ", "length", " ", "is", " ", "%", "s", "\"_", "%_", "docs", "\\u", "lens_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "payload_", "._", "update_", "(_", "{_", "\"", "page", "\"_", ":_", "page_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "page_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "page", " ", "number", " ", "is", " ", "%", "s", "\"_", "%_", "page_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "json", ".", "dump", "s", "(", "content", "s", ",", " ", "indent", "=", "4", ",", " ", "sort", "\\u", "keys", "=", "Tru", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ft_", "._", "close_", "(_", ")_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unreachable code
gratipay/gratipay.com/gratipay/billing/payday.py
[ { "content": " @staticmethod\n def transfer_takes(cursor, ts_start):\n return # XXX Bring me back!\n cursor.run(\"\"\"\n\n INSERT INTO payday_takes\n SELECT team, member, amount\n FROM ( SELECT DISTINCT ON (team, member)\n team, member, amount, ctime\n FROM takes\n WHERE mtime < %(ts_start)s\n ORDER BY team, member, mtime DESC\n ) t\n WHERE t.amount > 0\n AND t.team IN (SELECT username FROM payday_participants)\n AND t.member IN (SELECT username FROM payday_participants)\n AND ( SELECT id\n FROM payday_transfers_done t2\n WHERE t.team = t2.tipper\n AND t.member = t2.tippee\n AND context = 'take'\n ) IS NULL\n ORDER BY t.team, t.ctime DESC;\n\n \"\"\", dict(ts_start=ts_start))", "metadata": "root.Payday.transfer_takes", "header": "['class', 'Payday', '(', 'object', ')', ':', '___EOS___']", "index": 261 } ]
[ { "span": "cursor.run(\"\"\"\n\n INSERT INTO payday_takes\n SELECT team, member, amount\n FROM ( SELECT DISTINCT ON (team, member)\n team, member, amount, ctime\n FROM takes\n WHERE mtime < %(ts_start)s\n ORDER BY team, member, mtime DESC\n ) t\n WHERE t.amount > 0\n AND t.team IN (SELECT username FROM payday_participants)\n AND t.member IN (SELECT username FROM payday_participants)\n AND ( SELECT id\n FROM payday_transfers_done t2\n WHERE t.team = t2.tipper\n AND t.member = t2.tippee\n AND context = 'take'\n ) IS NULL\n ORDER BY t.team, t.ctime DESC;\n\n \"\"\", dict(ts_start=ts_start))", "start_line": 264, "start_column": 8, "end_line": 285, "end_column": 37 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Pay", "day_", "(_", "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_", "transfer", "\\u", "take", "s_", "(_", "cursor_", ",_", "ts", "\\u", "start_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "#", " ", "XX", "X", " ", "Bri", "ng", " ", "me", " ", "back", "!", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "._", "run_", "(_", "\"\"\"", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "INSERT", " ", "INT", "O", " ", "pay", "day", "\\u", "take", "s", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "team", ",", " ", "member", ",", " ", "amo", "unt", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "FROM", " ", "(", " ", "SELECT", " ", "DIST", "INC", "T", " ", "ON", " ", "(", "team", ",", " ", "member", ")", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "team", ",", " ", "member", ",", " ", "amo", "unt", ",", " ", "ctime", "\\", "10", ";", " ", " ", " ", " ", " ", "FROM", " ", "take", "s", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "mti", "me", " ", "<", " ", "%", "(", "ts", "\\u", "start", ")", "s", "\\", "10", ";", " ", "ORDE", "R", " ", "BY", " ", "team", ",", " ", "member", ",", " ", "mti", "me", " ", "DESC", "\\", "10", ";", " ", ")", " ", "t", "\\", "10", ";", " ", " ", " ", " ", " ", "WHE", "RE", " ", "t", ".", "amo", "unt", " ", ">", " ", "0", "\\", "10", ";", " ", " ", " ", "AND", " ", "t", ".", "team", " ", "IN", " ", "(", "SELECT", " ", "user", "name", " ", "FROM", " ", "pay", "day", "\\u", "participa", "nts", ")", "\\", "10", ";", " ", " ", " ", "AND", " ", "t", ".", "member", " ", "IN", " ", "(", "SELECT", " ", "user", "name", " ", "FROM", " ", "pay", "day", "\\u", "participa", "nts", ")", "\\", "10", ";", " ", " ", " ", "AND", " ", "(", " ", "SELECT", " ", "id", "\\", "10", ";", " ", " ", " ", " ", " ", "FROM", " ", "pay", "day", "\\u", "transfers", "\\u", "don", "e", " ", "t2", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "t", ".", "team", " ", "=", " ", "t2", ".", "tip", "per", "\\", "10", ";", " ", " ", "AND", " ", "t", ".", "member", " ", "=", " ", "t2", ".", "tip", "pee", "\\", "10", ";", " ", " ", "AND", " ", "context", " ", "=", " ", "'", "take", "'", "\\", "10", ";", " ", ")", " ", "IS", " ", "NULL", "\\", "10", ";", " ", " ", "ORDE", "R", " ", "BY", " ", "t", ".", "team", ",", " ", "t", ".", "ctime", " ", "DESC", ";", "\\", "10", ";", "\\", "10", ";", " ", "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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused local variable
aws/aws-cli/awscli/testutils.py
[ { "content": " def put_object(self, bucket_name, key_name, contents='', extra_args=None):\n client = self.create_client_for_bucket(bucket_name)\n call_args = {\n 'Bucket': bucket_name,\n 'Key': key_name, 'Body': contents\n }\n if extra_args is not None:\n call_args.update(extra_args)\n response = client.put_object(**call_args)\n self.addCleanup(self.delete_key, bucket_name, key_name)", "metadata": "root.BaseS3CLICommand.put_object", "header": "['class', 'BaseS3CLICommand', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 674 }, { "content": " def delete_bucket(self, bucket_name):\n self.remove_all_objects(bucket_name)\n client = self.create_client_for_bucket(bucket_name)\n response = client.delete_bucket(Bucket=bucket_name)\n self.regions.pop(bucket_name, None)", "metadata": "root.BaseS3CLICommand.delete_bucket", "header": "['class', 'BaseS3CLICommand', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 685 }, { "content": " def delete_key(self, bucket_name, key_name):\n client = self.create_client_for_bucket(bucket_name)\n response = client.delete_object(Bucket=bucket_name, Key=key_name)", "metadata": "root.BaseS3CLICommand.delete_key", "header": "['class', 'BaseS3CLICommand', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 701 } ]
[ { "span": "response ", "start_line": 682, "start_column": 8, "end_line": 682, "end_column": 16 }, { "span": "response ", "start_line": 688, "start_column": 8, "end_line": 688, "end_column": 16 }, { "span": "response ", "start_line": 703, "start_column": 8, "end_line": 703, "end_column": 16 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Base", "S", "3", "CLI", "Command_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "put", "\\u", "object_", "(_", "self_", ",_", "bucket", "\\u", "name_", ",_", "key", "\\u", "name_", ",_", "contents_", "=_", "''_", ",_", "extra", "\\u", "args_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "self_", "._", "create", "\\u", "client", "\\u", "for", "\\u", "bucket_", "(_", "bucket", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "call", "\\u", "args_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Buck", "et", "'_", ":_", "bucket", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Key", "'_", ":_", "key", "\\u", "name_", ",_", "'", "Bod", "y", "'_", ":_", "contents_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "extra", "\\u", "args_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "call", "\\u", "args_", "._", "update_", "(_", "extra", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "=_", "client_", "._", "put", "\\u", "object_", "(_", "**_", "call", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Cleanup_", "(_", "self_", "._", "delete", "\\u", "key_", ",_", "bucket", "\\u", "name_", ",_", "key", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "S", "3", "CLI", "Command_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "bucket_", "(_", "self_", ",_", "bucket", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "remove", "\\u", "all", "\\u", "objects_", "(_", "bucket", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "=_", "self_", "._", "create", "\\u", "client", "\\u", "for", "\\u", "bucket_", "(_", "bucket", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "client_", "._", "delete", "\\u", "bucket_", "(_", "Bucket_", "=_", "bucket", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "regions_", "._", "pop_", "(_", "bucket", "\\u", "name_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "S", "3", "CLI", "Command_", "(_", "unittest_", "._", "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_", "delete", "\\u", "key_", "(_", "self_", ",_", "bucket", "\\u", "name_", ",_", "key", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "self_", "._", "create", "\\u", "client", "\\u", "for", "\\u", "bucket_", "(_", "bucket", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "client_", "._", "delete", "\\u", "object_", "(_", "Bucket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2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
limodou/uliweb/uliweb/i18n/pygettext.py
[ { "content": "#! /usr/bin/env python\n# coding=utf-8\n# Originally written by Barry Warsaw <[email protected]>\n#\n# Minimally patched to make it even more xgettext compatible\n# by Peter Funk <[email protected]>\n#\n# 2002-11-22 J?gen Hermann <[email protected]>\n# Added checks that _() only contains string literals, and\n# command line args are resolved to module lists, i.e. you\n# can now pass a filename, a module or package name, or a\n# directory (including globbing chars, important for Win32).\n# Made docstring fit in 80 chars wide displays using pydoc.\n# \n# 2010-06-12 Jan-Hendrik G?lner <[email protected]>\n# Made it plural sensitive, added ngettext as default keyword.\n# Any keyworded function that is being supplied > 2 arguments\n# is treated like ngettext.\n# Also added support for constructs like \"_('foo' + 10*'bar')\"\n# by evaluating the whole expression.\n# Code like _(foo(arg1, arg2) + \"bar\") does not work by design\n# as that expression must be evaluated at runtime and this script\n# only extracts static strings known before runtime.\n# However it is possible to do things like\n# \"ngettext('World', 'Worlds', numWorlds)\"\n# as only the first two arguments are evaluated.\n# Advanced version number from 1.5 to 1.6\n#\n\n# for selftesting\nimport sys\nsys.path.insert(0, '..')\ntry:\n import fintl\n _ = fintl.gettext\nexcept ImportError:\n _ = lambda s: s\n\n__doc__ = \"\"\"pygettext -- Python equivalent of xgettext(1)\n\nMany systems (Solaris, Linux, Gnu) provide extensive tools that ease the\ninternationalization of C programs. Most of these tools are independent of\nthe programming language and can be used from within Python programs.\nMartin von Loewis' work[1] helps considerably in this regard.\n\nThere's one problem though; xgettext is the program that scans source code\nlooking for message strings, but it groks only C (or C++). Python\nintroduces a few wrinkles, such as dual quoting characters, triple quoted\nstrings, and raw strings. xgettext understands none of this.\n\nEnter pygettext, which uses Python's standard tokenize module to scan\nPython source code, generating .pot files identical to what GNU xgettext[2]\ngenerates for C and C++ code. From there, the standard GNU tools can be\nused.\n\nA word about marking Python strings as candidates for translation. GNU\nxgettext recognizes the following keywords: gettext, dgettext, dcgettext,\nand gettext_noop. But those can be a lot of text to include all over your\ncode. C and C++ have a trick: they use the C preprocessor. Most\ninternationalized C source includes a #define for gettext() to _() so that\nwhat has to be written in the source is much less. Thus these are both\ntranslatable strings:\n\n gettext(\"Translatable String\")\n _(\"Translatable String\")\n\nPython of course has no preprocessor so this doesn't work so well. Thus,\npygettext searches only for _() by default, but see the -k/--keyword flag\nbelow for how to augment this.\n\n [1] http://www.python.org/workshops/1997-10/proceedings/loewis.html\n [2] http://www.gnu.org/software/gettext/gettext.html\n\nNOTE: pygettext attempts to be option and feature compatible with GNU\nxgettext where ever possible. However some options are still missing or are\nnot fully implemented. Also, xgettext's use of command line switches with\noption arguments is broken, and in these cases, pygettext just defines\nadditional switches.\n\nUsage: pygettext [options] inputfile ...\n\nOptions:\n\n -a\n --extract-all\n Extract all strings.\n\n -d name\n --default-domain=name\n Rename the default output file from messages.pot to name.pot.\n\n -E\n --escape\n Replace non-ASCII characters with octal escape sequences.\n\n -D\n --docstrings\n Extract module, class, method, and function docstrings. These do\n not need to be wrapped in _() markers, and in fact cannot be for\n Python to consider them docstrings. (See also the -X option).\n\n -h\n --help\n Print this help message and exit.\n\n -k word\n --keyword=word\n Keywords to look for in addition to the default set, which are:\n %(DEFAULTKEYWORDS)s\n\n You can have multiple -k flags on the command line.\n\n -K\n --no-default-keywords\n Disable the default set of keywords (see above). Any keywords\n explicitly added with the -k/--keyword option are still recognized.\n\n --no-location\n Do not write filename/lineno location comments.\n\n -n\n --add-location\n Write filename/lineno location comments indicating where each\n extracted string is found in the source. These lines appear before\n each msgid. The style of comments is controlled by the -S/--style\n option. This is the default.\n\n -o filename\n --output=filename\n Rename the default output file from messages.pot to filename. If\n filename is `-' then the output is sent to standard out.\n\n -p dir\n --output-dir=dir\n Output files will be placed in directory dir.\n\n -S stylename\n --style stylename\n Specify which style to use for location comments. Two styles are\n supported:\n\n Solaris # File: filename, line: line-number\n GNU #: filename:line\n\n The style name is case insensitive. GNU style is the default.\n\n -v\n --verbose\n Print the names of the files being processed.\n\n -V\n --version\n Print the version of pygettext and exit.\n\n -w columns\n --width=columns\n Set width of output to columns.\n\n -x filename\n --exclude-file=filename\n Specify a file that contains a list of strings that are not be\n extracted from the input files. Each string to be excluded must\n appear on a line by itself in the file.\n\n -X filename\n --no-docstrings=filename\n Specify a file that contains a list of files (one per line) that\n should not have their docstrings extracted. This is only useful in\n conjunction with the -D option above.\n\nIf `inputfile' is -, standard input is read.\n\"\"\"\n\nimport os\nimport imp\nimport sys\nimport glob\nimport time\nimport getopt\nimport token\nimport tokenize\n\n__version__ = '1.6'\n\ndefault_keywords = ['_', 'ngettext']\nDEFAULTKEYWORDS = ', '.join(default_keywords)\n\nEMPTYSTRING = ''\n\n\n# The normal pot-file header. msgmerge and Emacs's po-mode work better if it's\n# there.\npot_header = '''\\\n# SOME DESCRIPTIVE TITLE.\n# Copyright (C) YEAR ORGANIZATION\n# {First_Author}, YEAR.\n#\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: {Project_Id_Version}\\\\n\"\n\"POT-Creation-Date: {time}\\\\n\"\n\"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\\\n\"\n\"Last-Translator: {Last_Translator}\\\\n\"\n\"Language-Team: {Language_Team}\\\\n\"\n\"MIME-Version: 1.0\\\\n\"\n\"Content-Type: text/plain; charset={Content_Type_Charset}\\\\n\"\n\"Content-Transfer-Encoding: {Content_Transfer_Encoding}\\\\n\"\n\"Plural-Forms: {Plural_Forms}\\\\n\"\n\"Generated-By: pygettext.py {version}\\\\n\"\n\n'''\n\n\n\nescapes = []\n\n# if pass_iso8859:\n# # Allow iso-8859 characters to pass through so that e.g. 'msgid\n# # \"H?e\"' would result not result in 'msgid \"H\\366he\"'. Otherwise we\n# # escape any character outside the 32..126 range.\n# mod = 128\n# else:\n# mod = 256\n# for i in range(256):\n# if 32 <= (i % mod) <= 126:\n# escapes.append(chr(i))\n# else:\n# escapes.append(\"\\\\%03o\" % i)\n# escapes[ord('\\\\')] = '\\\\\\\\'\n# escapes[ord('\\t')] = '\\\\t'\n# escapes[ord('\\r')] = '\\\\r'\n# escapes[ord('\\n')] = '\\\\n'\n# escapes[ord('\\\"')] = '\\\\\"'\n\n__escapes__ = {}\n__escapes__['\\\\'] = '\\\\\\\\'\n__escapes__['\\t'] = '\\\\t'\n__escapes__['\\r'] = '\\\\r'\n__escapes__['\\n'] = '\\\\n'\n__escapes__['\\\"'] = '\\\\\"'\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n main()\n # some more test strings\n# _(u'a unicode string')\n# # this one creates a warning\n# _('*** Seen unexpected token \"%(token)s\"') % {'token': 'test'}\n# _('more' 'than' 'one' 'string')\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def usage(code, msg=''):\n print >> sys.stderr, __doc__ % globals()\n if msg:\n print >> sys.stderr, msg\n sys.exit(code)", "metadata": "root.usage", "header": "['module', '___EOS___']", "index": 212 }, { "content": "def make_escapes(pass_iso8859):\n global escapes", "metadata": "root.make_escapes", "header": "['module', '___EOS___']", "index": 221 }, { "content": "def escape(s):\n# global escapes\n if isinstance(s, unicode):\n s = s.encode('utf-8')\n s = list(s)\n for i in range(len(s)):\n s[i] = __escapes__.get(s[i], s[i])\n return EMPTYSTRING.join(s)", "metadata": "root.escape", "header": "['module', '___EOS___']", "index": 248 }, { "content": "def safe_eval(s):\n # unwrap quotes, safely\n return eval(s, {'__builtins__':{}}, {})", "metadata": "root.safe_eval", "header": "['module', '___EOS___']", "index": 258 }, { "content": "def normalize(s):\n # This converts the various Python string types into a format that is\n # appropriate for .po files, namely much closer to C style.\n lines = s.split('\\n')\n if len(lines) == 1:\n s = '\"' + escape(s) + '\"'\n else:\n if not lines[-1]:\n del lines[-1]\n lines[-1] = lines[-1] + '\\n'\n for i in range(len(lines)):\n lines[i] = escape(lines[i])\n lineterm = '\\\\n\"\\n\"'\n s = '\"\"\\n\"' + lineterm.join(lines) + '\"'\n return s", "metadata": "root.normalize", "header": "['module', '___EOS___']", "index": 263 }, { "content": "def containsAny(str, set):\n \"\"\"Check whether 'str' contains ANY of the chars in 'set'\"\"\"\n return 1 in [c in str for c in set]", "metadata": "root.containsAny", "header": "['module', '___EOS___']", "index": 279 }, { "content": "def _visit_pyfiles(list, dirname, names):\n \"\"\"Helper for getFilesForName().\"\"\"\n # get extension for python source files\n if not globals().has_key('_py_ext'):\n global _py_ext\n# _py_ext = [triple[0] for triple in imp.get_suffixes()\n# if triple[2] == imp.PY_SOURCE][0]\n _py_ext = [triple[0] for triple in imp.get_suffixes()\n if triple[2] == imp.PY_SOURCE]\n \n # don't recurse into CVS directories\n if 'CVS' in names:\n names.remove('CVS')\n\n if '.svn' in names:\n names.remove('.svn')\n\n if '.git' in names:\n names.remove('.git')\n\n if 'static' in names:\n names.remove('static')\n \n # add all *.py files to list\n list.extend(\n [os.path.join(dirname, file) for file in names\n if os.path.splitext(file)[1] in _py_ext]\n )", "metadata": "root._visit_pyfiles", "header": "['module', '___EOS___']", "index": 284 }, { "content": "def _get_modpkg_path(dotted_name, pathlist=None):\n \"\"\"Get the filesystem path for a module or a package.\n\n Return the file system path to a file for a module, and to a directory for\n a package. Return None if the name is not found, or is a builtin or\n extension module.\n \"\"\"\n # split off top-most name\n parts = dotted_name.split('.', 1)\n\n if len(parts) > 1:\n # we have a dotted path, import top-level package\n try:\n file, pathname, description = imp.find_module(parts[0], pathlist)\n if file: file.close()\n except ImportError:\n return None\n\n # check if it's indeed a package\n if description[2] == imp.PKG_DIRECTORY:\n # recursively handle the remaining name parts\n pathname = _get_modpkg_path(parts[1], [pathname])\n else:\n pathname = None\n else:\n # plain name\n try:\n file, pathname, description = imp.find_module(\n dotted_name, pathlist)\n if file:\n file.close()\n if description[2] not in [imp.PY_SOURCE, imp.PKG_DIRECTORY]:\n pathname = None\n except ImportError:\n pathname = None\n\n return pathname", "metadata": "root._get_modpkg_path", "header": "['module', '___EOS___']", "index": 313 }, { "content": "def getFilesForName(name):\n \"\"\"Get a list of module files for a filename, a module or package name,\n or a directory.\n \"\"\"\n if not os.path.exists(name):\n # check for glob chars\n if containsAny(name, \"*?[]\"):\n files = glob.glob(name)\n list = []\n for file in files:\n list.extend(getFilesForName(file))\n return list\n\n # try to find module or package\n name = _get_modpkg_path(name)\n if not name:\n return []\n\n if os.path.isdir(name):\n # find all python files in directory\n list = []\n os.path.walk(name, _visit_pyfiles, list)\n return list\n elif os.path.exists(name):\n # a single file\n return [name]\n\n return []", "metadata": "root.getFilesForName", "header": "['module', '___EOS___']", "index": 352 }, { "content": "class TokenEater:\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TokenEater", "header": "['module', '___EOS___']", "index": 381 }, { "content": " def __init__(self, options, vars=None):\n self.__options = options\n self.__messages = {}\n self.__state = self.__waiting\n self.__args = []\n self.__lineno = -1\n self.__freshmodule = 1\n self.__curfile = None\n self.__vars = vars", "metadata": "root.TokenEater.__init__", "header": "['class', 'TokenEater', ':', '___EOS___']", "index": 382 }, { "content": " def __call__(self, ttype, tstring, stup, etup, line):\n # dispatch\n## import token\n## print >> sys.stderr, 'ttype:', token.tok_name[ttype], \\\n## 'tstring:', tstring\n self.__state(ttype, tstring, stup[0])", "metadata": "root.TokenEater.__call__", "header": "['class', 'TokenEater', ':', '___EOS___']", "index": 392 }, { "content": " def __waiting(self, ttype, tstring, lineno):\n opts = self.__options\n # Do docstring extractions, if enabled\n if opts.docstrings and not opts.nodocstrings.get(self.__curfile):\n # module docstring?\n if self.__freshmodule:\n if ttype == tokenize.STRING:\n try:\n s = safe_eval(tstring)\n except Exception as e:\n print >> sys.stderr, (\n '*** %(file)s:%(lineno)s: could not evaluate argument \"%(arg)s\"'\n ) % {\n 'arg': tstring,\n 'file': self.__curfile,\n 'lineno': self.__lineno\n }\n print >> sys.stderr, str(e)\n else:\n self.__addentry([s], lineno, isdocstring=1)\n self.__freshmodule = 0\n elif ttype not in (tokenize.COMMENT, tokenize.NL):\n self.__freshmodule = 0\n return\n # class docstring?\n if ttype == tokenize.NAME and tstring in ('class', 'def'):\n self.__state = self.__suiteseen\n return\n if ttype == tokenize.NAME and tstring in opts.keywords:\n self.__state = self.__keywordseen", "metadata": "root.TokenEater.__waiting", "header": "['class', 'TokenEater', ':', '___EOS___']", "index": 400 }, { "content": " def __suiteseen(self, ttype, tstring, lineno):\n # ignore anything until we see the colon\n if ttype == tokenize.OP and tstring == ':':\n self.__state = self.__suitedocstring", "metadata": "root.TokenEater.__suiteseen", "header": "['class', 'TokenEater', ':', '___EOS___']", "index": 431 }, { "content": " def __suitedocstring(self, ttype, tstring, lineno):\n # ignore any intervening noise\n if ttype == tokenize.STRING:\n try:\n s = safe_eval(tstring)\n except Exception as e:\n print >> sys.stderr, (\n '*** %(file)s:%(lineno)s: could not evaluate argument \"%(arg)s\"'\n ) % {\n 'arg': tstring,\n 'file': self.__curfile,\n 'lineno': self.__lineno\n }\n print >> sys.stderr, str(e)\n else:\n self.__addentry(s, lineno, isdocstring=1)\n self.__state = self.__waiting\n elif ttype not in (tokenize.NEWLINE, tokenize.INDENT,\n tokenize.COMMENT):\n # there was no class docstring\n self.__state = self.__waiting", "metadata": "root.TokenEater.__suitedocstring", "header": "['class', 'TokenEater', ':', '___EOS___']", "index": 436 }, { "content": " def __keywordseen(self, ttype, tstring, lineno):\n if ttype == tokenize.OP and tstring == '(':\n self.__args = ['']\n self.__lineno = lineno\n self.__depth = 0\n self.__state = self.__scanstring1\n else:\n self.__state = self.__waiting", "metadata": "root.TokenEater.__keywordseen", "header": "['class', 'TokenEater', ':', '___EOS___']", "index": 458 }, { "content": " def __scanstring1(self, ttype, tstring, lineno):\n # handle first argument, which is supposed to be a string.\n if ttype == tokenize.OP and tstring == ')':\n # End of list of arguments for the current function call.\n # If the argument list is empty (as in keyword()), ignore this call.\n # otherwise evaluate the fragments we collected as the first\n # argument and record its line number and update the list of\n # messages seen. Reset state for the next batch.\n if self.__args[-1]:\n try:\n s = safe_eval(self.__args[-1])\n except Exception as e:\n print >> sys.stderr, (\n '*** %(file)s:%(lineno)s: could not evaluate argument \"%(arg)s\"'\n ) % {\n 'arg': self.__args[-1],\n 'file': self.__curfile,\n 'lineno': self.__lineno\n }\n print >> sys.stderr, str(e)\n self.__state = self.__waiting\n return\n if type(s) == str or type(s) == unicode:\n self.__args[-1] = s\n self.__addentry(self.__args)\n else:\n print >> sys.stderr, (\n '*** %(file)s:%(lineno)s: argument is no str or unicode object \"%(arg)s\"'\n ) % {\n 'arg': s,\n 'file': self.__curfile,\n 'lineno': self.__lineno\n }\n self.__state = self.__waiting\n elif ttype == tokenize.OP and tstring == ',':\n # Start of the next argument.\n try:\n s = safe_eval(self.__args[-1])\n except Exception as e:\n print >> sys.stderr, (\n '*** %(file)s:%(lineno)s: could not evaluate argument \"%(arg)s\"'\n ) % {\n 'arg': self.__args[-1],\n 'file': self.__curfile,\n 'lineno': self.__lineno\n }\n print >> sys.stderr, str(e)\n self.__state = self.__waiting\n return\n if type(s) == str or type(s) == unicode:\n self.__args[-1] = s\n self.__args.append('') # next argument.\n self.__state = self.__scanstring2\n else:\n print >> sys.stderr, (\n '*** %(file)s:%(lineno)s: argument 1 is no str or unicode object \"%(arg)s\"'\n ) % {\n 'arg': s,\n 'file': self.__curfile,\n 'lineno': self.__lineno\n }\n self.__state = self.__waiting\n else:\n # add string to current argument for later evaluation.\n # no state change in this case.\n self.__args[-1] += tstring", "metadata": "root.TokenEater.__scanstring1", "header": "['class', 'TokenEater', ':', '___EOS___']", "index": 467 }, { "content": " def __scanstring2(self, ttype, tstring, lineno):\n # handle second argument, which is supposed to be a string.\n if ttype == tokenize.OP and tstring == ')':\n # End of list of arguments for the current function call.\n # This is an error if we expect either one or three arguments but\n # never two.\n print >> sys.stderr, (\n '*** %(file)s:%(lineno)s: unexpected number of arguments (2)\"'\n ) % {\n 'file': self.__curfile,\n 'lineno': self.__lineno\n }\n self.__state = self.__waiting\n elif ttype == tokenize.OP and tstring == ',':\n # Start of the next argument. We do not need to parse it, we only\n # made sure it is there and now we assume this is a plural call.\n try:\n s = safe_eval(self.__args[-1])\n except Exception as e:\n print >> sys.stderr, (\n '*** %(file)s:%(lineno)s: could not evaluate argument \"%(arg)s\"'\n ) % {\n 'arg': self.__args[-1],\n 'file': self.__curfile,\n 'lineno': self.__lineno\n }\n print >> sys.stderr, str(e)\n self.__state = self.__waiting\n return\n s = safe_eval(self.__args[-1])\n if type(s) == str or type(s) == unicode:\n self.__args[-1] = s\n self.__addentry(self.__args)\n self.__state = self.__waiting\n else:\n print >> sys.stderr, (\n '*** %(file)s:%(lineno)s: argument 2 is no str or unicode object \"%(arg)s\"'\n ) % {\n 'arg': s,\n 'file': self.__curfile,\n 'lineno': self.__lineno\n }\n self.__state = self.__waiting\n else:\n # add string to current argument for later evaluation.\n # no state change in this case.\n self.__args[-1] += tstring", "metadata": "root.TokenEater.__scanstring2", "header": "['class', 'TokenEater', ':', '___EOS___']", "index": 534 }, { "content": " def __addentry(self, args, lineno=None, isdocstring=0):\n isplural = 0\n if len(args) > 1:\n isplural = 1\n if lineno is None:\n lineno = self.__lineno\n exclude = 0\n if args[0] in self.__options.toexclude:\n exclude = 1\n if isplural:\n if args[1] not in self.__options.toexclude:\n # in case of plural, both strings must be in the toexclude list\n # to exclude this entry.\n exclude = 0\n if not exclude:\n entry = (self.__curfile, lineno)\n # entries look like this:\n # {('arg1','arg2') : {(filename,lineno) : <isdocstring>},\n # ('arg1',) : {(filename,lineno) : <iscodstring>}}\n # a key with len > 1 indicates plurals\n self.__messages.setdefault(tuple(args[0:2]), {})[entry] = isdocstring", "metadata": "root.TokenEater.__addentry", "header": "['class', 'TokenEater', ':', '___EOS___']", "index": 582 }, { "content": " def set_filename(self, filename):\n self.__curfile = filename\n self.__freshmodule = 1", "metadata": "root.TokenEater.set_filename", "header": "['class', 'TokenEater', ':', '___EOS___']", "index": 604 }, { "content": " def write(self, fp):\n options = self.__options\n timestamp = time.strftime('%Y-%m-%d %H:%M')\n # The time stamp in the header doesn't have the same format as that\n # generated by xgettext...\n d = self.__vars.copy()\n d.update({'time': timestamp, 'version': __version__})\n print >> fp, pot_header.format(**d)\n # Sort the entries. First sort each particular entry's keys, then\n # sort all the entries by their first item.\n reverse = {}\n for k, v in self.__messages.items():\n keys = v.keys()\n keys.sort()\n reverse.setdefault(tuple(keys), []).append((k, v))\n rkeys = reverse.keys()\n rkeys.sort()\n for rkey in rkeys:\n rentries = reverse[rkey]\n rentries.sort()\n for k, v in rentries:\n # If the entry was gleaned out of a docstring, then add a\n # comment stating so. This is to aid translators who may wish\n # to skip translating some unimportant docstrings.\n isdocstring = sum(v.values())\n # k is the message string, v is a dictionary-set of (filename,\n # lineno) tuples. We want to sort the entries in v first by\n # file name and then by line number.\n v = v.keys()\n v.sort()\n if not options.writelocations:\n pass\n # location comments are different b/w Solaris and GNU:\n elif options.locationstyle == options.SOLARIS:\n for filename, lineno in v:\n d = {'filename': filename, 'lineno': lineno}\n print >>fp, (\n '# File: %(filename)s, line: %(lineno)d') % d\n elif options.locationstyle == options.GNU:\n # fit as many locations on one line, as long as the\n # resulting line length doesn't exceeds 'options.width'\n locline = '#:'\n for filename, lineno in v:\n d = {'filename': filename, 'lineno': lineno}\n s = (' %(filename)s:%(lineno)d') % d\n if len(locline) + len(s) <= options.width:\n locline = locline + s\n else:\n print >> fp, locline\n locline = \"#:\" + s\n if len(locline) > 2:\n print >> fp, locline\n if isdocstring:\n print >> fp, '#, docstring'\n print >> fp, 'msgid', normalize(k[0])\n if len(k) > 1:\n print >> fp, 'msgid_plural', normalize(k[1])\n print >> fp, 'msgstr[0] \"\"'\n print >> fp, 'msgstr[1] \"\"\\n'\n else:\n print >> fp, 'msgstr \"\"\\n'", "metadata": "root.TokenEater.write", "header": "['class', 'TokenEater', ':', '___EOS___']", "index": 608 }, { "content": "def main():\n global default_keywords\n try:\n opts, args = getopt.getopt(\n sys.argv[1:],\n 'ad:DEhk:Kno:p:S:Vvw:x:X:f:',\n ['extract-all', 'default-domain=', 'escape', 'help',\n 'keyword=', 'no-default-keywords',\n 'add-location', 'no-location', 'output=', 'output-dir=',\n 'style=', 'verbose', 'version', 'width=', 'exclude-file=',\n 'docstrings', 'no-docstrings',\n ])\n except getopt.error, msg:\n usage(1, msg)\n\n # for holding option values\n class Options:\n # constants\n GNU = 1\n SOLARIS = 2\n # defaults\n extractall = 0 # FIXME: currently this option has no effect at all.\n escape = 0\n keywords = ['ugettext', 'ungettext']\n outpath = ''\n outfile = 'messages.pot'\n writelocations = 1\n locationstyle = GNU\n verbose = 0\n width = 78\n excludefilename = ''\n docstrings = 0\n nodocstrings = {}\n\n options = Options()\n locations = {'gnu' : options.GNU,\n 'solaris' : options.SOLARIS,\n }\n\n files = ''\n\n # parse options\n for opt, arg in opts:\n if opt in ('-h', '--help'):\n usage(0)\n elif opt in ('-a', '--extract-all'):\n options.extractall = 1\n elif opt in ('-d', '--default-domain'):\n options.outfile = arg + '.pot'\n elif opt in ('-E', '--escape'):\n options.escape = 1\n elif opt in ('-D', '--docstrings'):\n options.docstrings = 1\n elif opt in ('-k', '--keyword'):\n options.keywords.append(arg)\n elif opt in ('-K', '--no-default-keywords'):\n default_keywords = []\n elif opt in ('-n', '--add-location'):\n options.writelocations = 1\n elif opt in ('--no-location',):\n options.writelocations = 0\n elif opt in ('-S', '--style'):\n options.locationstyle = locations.get(arg.lower())\n if options.locationstyle is None:\n usage(1, ('Invalid value for --style: %s') % arg)\n elif opt in ('-o', '--output'):\n options.outfile = arg\n elif opt in ('-p', '--output-dir'):\n options.outpath = arg\n elif opt in ('-v', '--verbose'):\n options.verbose = 1\n elif opt in ('-V', '--version'):\n print ('pygettext.py (xgettext for Python) %s') % __version__\n sys.exit(0)\n elif opt in ('-w', '--width'):\n try:\n options.width = int(arg)\n except ValueError:\n usage(1, ('--width argument must be an integer: %s') % arg)\n elif opt in ('-x', '--exclude-file'):\n options.excludefilename = arg\n elif opt in ('-X', '--no-docstrings'):\n fp = open(arg)\n try:\n while 1:\n line = fp.readline()\n if not line:\n break\n options.nodocstrings[line[:-1]] = 1\n finally:\n fp.close()\n elif opt == '-f':\n files = arg\n\n # calculate escapes\n# make_escapes(options.escape)\n\n # calculate all keywords\n options.keywords.extend(default_keywords)\n\n # initialize list of strings to exclude\n if options.excludefilename:\n try:\n fp = open(options.excludefilename)\n options.toexclude = fp.readlines()\n fp.close()\n except IOError:\n print >> sys.stderr, (\n \"Can't read --exclude-file: %s\") % options.excludefilename\n sys.exit(1)\n else:\n options.toexclude = []\n\n # resolve args to module lists\n expanded = []\n for arg in args:\n if arg == '-':\n expanded.append(arg)\n else:\n expanded.extend(getFilesForName(arg))\n args = expanded\n\n if files:\n lines = open(files).readlines()\n for line in lines:\n args.append(line.strip())\n\n # slurp through all the files\n eater = TokenEater(options)\n for filename in args:\n if filename == '-':\n if options.verbose:\n print ('Reading standard input')\n fp = sys.stdin\n closep = 0\n else:\n if options.verbose:\n print ('Working on %s') % filename\n if filename.endswith('.html'):\n from uliweb.core.template import template_file_py\n from cStringIO import StringIO\n text = template_file_py(filename, skip_extern=True, multilines=True)\n fp = StringIO(text)\n else:\n fp = open(filename)\n closep = 1\n try:\n eater.set_filename(filename)\n try:\n tokenize.tokenize(fp.readline, eater)\n except tokenize.TokenError, e:\n print >> sys.stderr, '%s: %s, line %d, column %d' % (\n e[0], filename, e[1][0], e[1][1])\n finally:\n if closep:\n fp.close()\n\n # write the output\n if options.outfile == '-':\n fp = sys.stdout\n closep = 0\n else:\n if options.outpath:\n options.outfile = os.path.join(options.outpath, options.outfile)\n path = os.path.dirname(options.outfile)\n if path:\n if not os.path.exists(path):\n try:\n os.makedirs(path)\n except:\n pass\n fp = open(options.outfile, 'w')\n closep = 1\n try:\n eater.write(fp)\n finally:\n if closep:\n fp.close()", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 670 }, { "content": "def extrace_files(files, outputfile, opts=None, vars=None):\n global _py_ext\n import logging\n\n log = logging.getLogger('pygettext')\n \n opts = opts or {}\n vars = vars or {}\n \n _py_ext = ['.py', '.ini', '.html']\n class Options:\n # constants\n GNU = 1\n SOLARIS = 2\n # defaults\n extractall = 0 # FIXME: currently this option has no effect at all.\n escape = 0\n keywords = ['_', 'gettext', 'ngettext', 'ungettext', 'ugettext']\n outpath = ''\n outfile = outputfile\n writelocations = 1\n locationstyle = GNU\n verbose = 0\n width = 78\n excludefilename = ''\n docstrings = 0\n nodocstrings = {}\n toexclude = []\n\n options = Options()\n\n# make_escapes(options.escape)\n options.keywords.extend(default_keywords)\n for k, v in opts.items():\n if v and hasattr(options, k):\n _v = getattr(options, k)\n if isinstance(_v, list):\n _v.extend(v)\n elif isinstance(_v, dict):\n _v.update(v)\n else:\n setattr(options, k, v)\n \n if not isinstance(files, list):\n files = getFilesForName(files)\n eater = TokenEater(options, vars=vars)\n for filename in files:\n if options.verbose:\n print ('Working on %s') % filename\n if not os.path.exists(filename):\n continue\n if filename.endswith('.html'):\n from uliweb.core import template\n from cStringIO import StringIO\n from uliweb.core.template import template_file_py\n text = template_file_py(filename, skip_extern=True, log=log, multilines=True)\n fp = StringIO(text)\n closep = 0\n else:\n fp = open(filename)\n closep = 1\n \n try:\n eater.set_filename(filename)\n try:\n tokenize.tokenize(fp.readline, eater)\n except tokenize.TokenError, e:\n print >> sys.stderr, '%s: %s, line %d, column %d' % (\n e[0], filename, e[1][0], e[1][1])\n finally:\n if closep:\n fp.close()\n \n if options.outfile == '-':\n fp = sys.stdout\n closep = 0\n else:\n if options.outpath:\n options.outfile = os.path.join(options.outpath, options.outfile)\n path = os.path.dirname(options.outfile)\n if path:\n if not os.path.exists(path):\n try:\n os.makedirs(path)\n except:\n pass\n fp = open(options.outfile, 'w')\n closep = 1\n try:\n eater.write(fp)\n finally:\n if closep:\n fp.close()", "metadata": "root.extrace_files", "header": "['module', '___EOS___']", "index": 849 } ]
[ { "span": "import token", "start_line": 179, "start_column": 0, "end_line": 179, "end_column": 12 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", " ", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "codi", "ng", "=", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Origina", "ll", "y", " ", "writt", "en", " ", "by", " ", "Barr", "y", " ", "War", "saw", " ", "<", "barr", "y", "@", "zop", "e", ".", "com", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Mini", "mall", "y", " ", "patche", "d", " ", "to", " ", "make", " ", "it", " ", "even", " ", "more", " ", "xg", "ette", "xt", " ", "compatible_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "by", " ", "Peter", " ", "Fun", "k", " ", "<", "pf", "@", "art", "com", "-", "gm", "bh", ".", "de", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2002", "-1", "1", "-", "2", "2", " ", "J", "?", "gen", " ", "Her", "man", "n", " ", "<", "jh", "@", "web", ".", "de", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Added", " ", "checks", " ", "tha", "t", " ", "\\u(", ")", " ", "only", " ", "contain", "s", " ", "string", " ", "literal", "s", ",", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "command", " ", "line", " ", "args", " ", "are", " ", "resolve", "d", " ", "to", " ", "module", " ", "lists", ",", " ", "i", ".", "e", ".", " ", "you", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "can", " ", "now", " ", "pass", " ", "a", " ", "filename", ",", " ", "a", " ", "module", " ", "or", " ", "package", " ", "name", ",", " ", "or", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "director", "y", " ", "(", "inclu", "ding", " ", "glob", "bing", " ", "char", "s", ",", " ", "importa", "nt", " ", "for", " ", "Win", "32", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Made", " ", "docstr", "ing", " ", "fit", " ", "in", " ", "80", " ", "char", "s", " ", "wide", " ", "display", "s", " ", "usi", "ng", " ", "pydo", "c", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2010", "-0", "6", "-1", "2", " ", "Jan", "-", "Hen", "dri", "k", " ", "G", "?", "ln", "er", " ", "<", "jan", "-", "hen", "dri", "k", ".", "go", "ell", "ner", "@", "gm", "x", ".", "de", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Made", " ", "it", " ", "plural", " ", "sensi", "tiv", "e", ",", " ", "adde", "d", " ", "nge", "ttext", " ", "as", " ", "default", " ", "keyw", "ord", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Any", " ", "keyw", "ord", "ed", " ", "function", " ", "tha", "t", " ", "is", " ", "bei", "ng", " ", "supplie", "d", " ", ">", " ", "2", " ", "arguments_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "treat", "ed", " ", "like", " ", "nge", "ttext", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Al", "so", " ", "adde", "d", " ", "support", " ", "for", " ", "construct", "s", " ", "like", " ", "\"\\u", "('", "foo", "'", " ", "+", " ", "10", "*'", "bar", "')\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "by", " ", "evaluat", "ing", " ", "the", " ", "whole", " ", "express", "ion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Code", " ", "like", " ", "\\u(", "foo", "(", "arg", "1", ",", " ", "arg", "2", ")", " ", "+", " ", "\"", "bar", "\")", " ", "doe", "s", " ", "not", " ", "work", " ", "by", " ", "design_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "as", " ", "tha", "t", " ", "express", "ion", " ", "must", " ", "be", " ", "evaluate", "d", " ", "at", " ", "runt", "ime", " ", "and", " ", "this", " ", "script_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "only", " ", "extracts", " ", "static", " ", "string", "s", " ", "know", "n", " ", "bef", "ore", " ", "runt", "ime", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ho", "we", "ver", " ", "it", " ", "is", " ", "possib", "le", " ", "to", " ", "do", " ", "thing", "s", " ", "like_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "nge", "ttext", "('", "Wor", "ld", "',", " ", "'", "Wor", "lds", "',", " ", "num", "Wor", "lds", ")\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "as", " ", "only", " ", "the", " ", "first", " ", "two", " ", "argu", "ment", "s", " ", "are", " ", "evaluate", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Advance", "d", " ", "version", " ", "number", " ", "from", " ", "1.5", " ", "to", " ", "1.6_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "self", "testing_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "'..'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "fin", "tl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u_", "=_", "fin", "tl_", "._", "gettext_", "\\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_", "=_", "lambda_", "s_", ":_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u", "doc\\u\\u_", "=_", "\"\"\"", "pyg", "ette", "xt", " ", "--", " ", "Pyth", "on", " ", "equivalent", " ", "of", " ", "xg", "ette", "xt", "(", "1", ")", "\\", "10", ";", "\\", "10", ";", "Many", " ", "system", "s", " ", "(", "Sol", "aris", ",", " ", "Lin", "ux", ",", " ", "Gnu", ")", " ", "provide", " ", "extensi", "ve", " ", "tool", "s", " ", "tha", "t", " ", "eas", "e", " ", "the", "\\", "10", ";", "international", "izatio", "n", " ", "of", " ", "C", " ", "program", "s", ".", " ", "Mos", "t", " ", "of", " ", "these", " ", "tool", "s", " ", "are", " ", "independent", " ", "of", "\\", "10", ";", "the", " ", "program", "ming", " ", "language", " ", "and", " ", "can", " ", "be", " ", "used", " ", "from", " ", "within", " ", "Pyth", "on", " ", "program", "s", ".", "\\", "10", ";", "Mart", "in", " ", "vo", "n", " ", "Lo", "ew", "is", "'", " ", "work", "[", "1", "]", " ", "helps", " ", "consider", "abl", "y", " ", "in", " ", "this", " ", "rega", "rd", ".", "\\", "10", ";", "\\", "10", ";", "There", "'", "s", " ", "one", " ", "problem", " ", "tho", "ugh", ";", " ", "xg", "ette", "xt", " ", "is", " ", "the", " ", "program", " ", "tha", "t", " ", "scans", " ", "source", " ", "code", "\\", "10", ";", "look", "ing", " ", "for", " ", "message", " ", "string", "s", ",", " ", "but", " ", "it", " ", "gro", "ks", " ", "only", " ", "C", " ", "(", "or", " ", "C", "++", ").", " ", "Pyth", "on", "\\", "10", ";", "introduce", "s", " ", "a", " ", "few", " ", "wri", "nk", "les", ",", " ", "suc", "h", " ", "as", " ", "dual", " ", "quoting", " ", "character", "s", ",", " ", "triple", " ", "quoted", "\\", "10", ";", "string", "s", ",", " ", "and", " ", "raw", " ", "string", "s", ".", " ", "xg", "ette", "xt", " ", "underst", "ands", " ", "none", " ", "of", " ", "this", ".", "\\", "10", ";", "\\", "10", ";", "Enter", " ", "pyg", "ette", "xt", ",", " ", "whi", "ch", " ", "use", "s", " ", "Pyth", "on", "'", "s", " ", "standard", " ", "tokenize", " ", "module", " ", "to", " ", "scan", "\\", "10", ";", "Pyth", "on", " ", "source", " ", "code", ",", " ", "generat", "ing", " ", ".", "pot", " ", "files", " ", "identi", "cal", " ", "to", " ", "what", " ", "GN", "U", " ", "xg", "ette", "xt", "[", "2", "]", "\\", "10", ";", "generat", "es", " ", "for", " ", "C", " ", "and", " ", "C", "++", " ", "code", ".", " ", "Fro", "m", " ", "there", ",", " ", "the", " ", "standard", " ", "GN", "U", " ", "tool", "s", " ", "can", " ", "be", "\\", "10", ";", "used", ".", "\\", "10", ";", "\\", "10", ";", "A", " ", "word", " ", "abo", "ut", " ", "marking", " ", "Pyth", "on", " ", "string", "s", " ", "as", " ", "candidate", "s", " ", "for", " ", "translatio", "n", ".", " ", "GN", "U", "\\", "10", ";", "xg", "ette", "xt", " ", "recognize", "s", " ", "the", " ", "follow", "ing", " ", "keywords", ":", " ", "gettext", ",", " ", "dget", "text", ",", " ", "dc", "gettext", ",", "\\", "10", ";", "and", " ", "gettext", "\\u", "noop", ".", " ", "Bu", "t", " ", "tho", "se", " ", "can", " ", "be", " ", "a", " ", "lot", " ", "of", " ", "text", " ", "to", " ", "include", " ", "all", " ", "over", " ", "your", "\\", "10", ";", "code", ".", " ", "C", " ", "and", " ", "C", "++", " ", "have", " ", "a", " ", "trick", ":", " ", "the", "y", " ", "use", " ", "the", " ", "C", " ", "preprocessor", ".", " ", "Mos", "t", "\\", "10", ";", "international", "ize", "d", " ", "C", " ", "source", " ", "include", "s", " ", "a", " ", "#", "defin", "e", " ", "for", " ", "gettext", "()", " ", "to", " ", "\\u(", ")", " ", "so", " ", "tha", "t", "\\", "10", ";", "what", " ", "has", " ", "to", " ", "be", " ", "writt", "en", " ", "in", " ", "the", " ", "source", " ", "is", " ", "muc", "h", " ", "less", ".", " ", "Thu", "s", " ", "these", " ", "are", " ", "bot", "h", "\\", "10", ";", "translat", "able", " ", "string", "s", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "gettext", "(\"", "Translat", "able", " ", "String", "\")", "\\", "10", ";", " ", " ", " ", " ", "\\u(", "\"", "Translat", "able", " ", "String", "\")", "\\", "10", ";", "\\", "10", ";", "Pyth", "on", " ", "of", " ", "course", " ", "has", " ", "no", " ", "preprocessor", " ", "so", " ", "this", " ", "doe", "sn", "'", "t", " ", "work", " ", "so", " ", "well", ".", " ", " ", "Thu", "s", ",", "\\", "10", ";", "pyg", "ette", "xt", " ", "searche", "s", " ", "only", " ", "for", " ", "\\u(", ")", " ", "by", " ", "default", ",", " ", "but", " ", "see", " ", "the", " ", "-", "k", "/--", "keyw", "ord", " ", "flag", "\\", "10", ";", "belo", "w", " ", "for", " ", "how", " ", "to", " ", "augment", " ", "this", ".", "\\", "10", ";", "\\", "10", ";", " ", "[", "1", "]", " ", "http", "://", "www", ".", "python", ".", "org", "/", "workshop", "s", "/", "1997", "-1", "0", "/", "proceed", "ings", "/", "lo", "ew", "is", ".", "html", "\\", "10", ";", " ", "[", "2", "]", " ", "http", "://", "www", ".", "gnu", ".", "org", "/", "software", "/", "gettext", "/", "gettext", ".", "html", "\\", "10", ";", "\\", "10", ";", "NOTE", ":", " ", "pyg", "ette", "xt", " ", "atte", "mpt", "s", " ", "to", " ", "be", " ", "option", " ", "and", " ", "feature", " ", "compatible", " ", "with", " ", "GN", "U", "\\", "10", ";", "xg", "ette", "xt", " ", "where", " ", "ever", " ", "possib", "le", ".", " ", "Ho", "we", "ver", " ", "some", " ", "options", " ", "are", " ", "still", " ", "missi", "ng", " ", "or", " ", "are", "\\", "10", ";", "not", " ", "full", "y", " ", "implemented", ".", " ", "Al", "so", ",", " ", "xg", "ette", "xt", "'", "s", " ", "use", " ", "of", " ", "command", " ", "line", " ", "switche", "s", " ", "with", "\\", "10", ";", "option", " ", "argu", "ment", "s", " ", "is", " ", "broken", ",", " ", "and", " ", "in", " ", "these", " ", "case", "s", ",", " ", "pyg", "ette", "xt", " ", "just", " ", "defin", "es", "\\", "10", ";", "addition", "al", " ", "switche", "s", ".", "\\", "10", ";", "\\", "10", ";", "Us", "age", ":", " ", "pyg", "ette", "xt", " ", "[", "options", "]", " ", "inputfil", "e", " ", "...", "\\", "10", ";", "\\", "10", ";", "Optio", "ns", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "a", "\\", "10", ";", " ", " ", " ", " ", "--", "extract", "-", "all", "\\", "10", ";", " ", " ", " ", " ", "Extract", " ", "all", " ", "string", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "d", " ", "name", "\\", "10", ";", " ", " ", " ", " ", "--", "default", "-", "domain", "=", "name", "\\", "10", ";", " ", " ", " ", " ", "Rename", " ", "the", " ", "default", " ", "output", " ", "file", " ", "from", " ", "message", "s", ".", "pot", " ", "to", " ", "name", ".", "pot", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "E", "\\", "10", ";", " ", " ", " ", " ", "--", "escape", "\\", "10", ";", " ", " ", " ", " ", "Replace", " ", "non", "-", "ASCII", " ", "character", "s", " ", "with", " ", "octa", "l", " ", "escape", " ", "sequence", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "D", "\\", "10", ";", " ", " ", " ", " ", "--", "docstrings", "\\", "10", ";", " ", " ", " ", " ", "Extract", " ", "module", ",", " ", "class", ",", " ", "method", ",", " ", "and", " ", "function", " ", "docstrings", ".", " ", " ", "The", "se", " ", "do", "\\", "10", ";", " ", " ", " ", " ", "not", " ", "need", " ", "to", " ", "be", " ", "wrapp", "ed", " ", "in", " ", "\\u(", ")", " ", "marker", "s", ",", " ", "and", " ", "in", " ", "fact", " ", "cann", "ot", " ", "be", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "Pyth", "on", " ", "to", " ", "consider", " ", "them", " ", "docstrings", ".", " ", "(", "See", " ", "als", "o", " ", "the", " ", "-", "X", " ", "option", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "h", "\\", "10", ";", " ", " ", " ", " ", "--", "help", "\\", "10", ";", " ", " ", " ", " ", "Print", " ", "this", " ", "help", " ", "message", " ", "and", " ", "exit", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "k", " ", "word", "\\", "10", ";", " ", " ", " ", " ", "--", "keyw", "ord", "=", "word", "\\", "10", ";", " ", " ", " ", " ", "Key", "words", " ", "to", " ", "look", " ", "for", " ", "in", " ", "addition", " ", "to", " ", "the", " ", "default", " ", "set", ",", " ", "whi", "ch", " ", "are", ":", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "DEF", "AUL", "TK", "EY", "WORD", "S", ")", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "You", " ", "can", " ", "have", " ", "multiple", " ", "-", "k", " ", "flags", " ", "on", " ", "the", " ", "command", " ", "line", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "K", "\\", "10", ";", " ", " ", " ", " ", "--", "no", "-", "default", "-", "keywords", "\\", "10", ";", " ", " ", " ", " ", "Disa", "ble", " ", "the", " ", "default", " ", "set", " ", "of", " ", "keywords", " ", "(", "see", " ", "above", ").", " ", " ", "Any", " ", "keywords", "\\", "10", ";", " ", " ", " ", " ", "explicit", "ly", " ", "adde", "d", " ", "with", " ", "the", " ", "-", "k", "/--", "keyw", "ord", " ", "option", " ", "are", " ", "still", " ", "recognize", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "--", "no", "-", "location", "\\", "10", ";", " ", " ", " ", " ", "Do", " ", "not", " ", "write", " ", "filename", "/", "linen", "o", " ", "location", " ", "comment", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "n", "\\", "10", ";", " ", " ", " ", " ", "--", "add", "-", "location", "\\", "10", ";", " ", " ", " ", " ", "Write", " ", "filename", "/", "linen", "o", " ", "location", " ", "comment", "s", " ", "indicati", "ng", " ", "where", " ", "each", "\\", "10", ";", " ", " ", " ", " ", "extracted", " ", "string", " ", "is", " ", "found", " ", "in", " ", "the", " ", "source", ".", " ", " ", "The", "se", " ", "lines", " ", "appear", " ", "bef", "ore", "\\", "10", ";", " ", " ", " ", " ", "each", " ", "msgid", ".", " ", " ", "The", " ", "style", " ", "of", " ", "comment", "s", " ", "is", " ", "controlle", "d", " ", "by", " ", "the", " ", "-", "S", "/--", "style", "\\", "10", ";", " ", " ", " ", " ", "option", ".", " ", " ", "Thi", "s", " ", "is", " ", "the", " ", "default", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "o", " ", "filename", "\\", "10", ";", " ", " ", " ", " ", "--", "output", "=", "filename", "\\", "10", ";", " ", " ", " ", " ", "Rename", " ", "the", " ", "default", " ", "output", " ", "file", " ", "from", " ", "message", "s", ".", "pot", " ", "to", " ", "filename", ".", " ", " ", "If", "\\", "10", ";", " ", " ", " ", " ", "filename", " ", "is", " ", "`-", "'", " ", "then", " ", "the", " ", "output", " ", "is", " ", "sent", " ", "to", " ", "standard", " ", "out", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "p", " ", "dir", "\\", "10", ";", " ", " ", " ", " ", "--", "output", "-", "dir", "=", "dir", "\\", "10", ";", " ", " ", " ", " ", "Output", " ", "files", " ", "will", " ", "be", " ", "place", "d", " ", "in", " ", "director", "y", " ", "dir", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "S", " ", "style", "name", "\\", "10", ";", " ", " ", " ", " ", "--", "style", " ", "style", "name", "\\", "10", ";", " ", " ", " ", " ", "Speci", "fy", " ", "whi", "ch", " ", "style", " ", "to", " ", "use", " ", "for", " ", "location", " ", "comment", "s", ".", " ", " ", "Tw", "o", " ", "style", "s", " ", "are", "\\", "10", ";", " ", " ", " ", " ", "support", "ed", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Sol", "aris", " ", " ", "#", " ", "File", ":", " ", "filename", ",", " ", "line", ":", " ", "line", "-", "number", "\\", "10", ";", " ", " ", " ", " ", "GN", "U", " ", " ", "#", ":", " ", "filename", ":", "line", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "style", " ", "name", " ", "is", " ", "case", " ", "inse", "nsitive", ".", " ", " ", "GN", "U", " ", "style", " ", "is", " ", "the", " ", "default", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "v", "\\", "10", ";", " ", " ", " ", " ", "--", "verbo", "se", "\\", "10", ";", " ", " ", " ", " ", "Print", " ", "the", " ", "names", " ", "of", " ", "the", " ", "files", " ", "bei", "ng", " ", "process", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "V", "\\", "10", ";", " ", " ", " ", " ", "--", "version", "\\", "10", ";", " ", " ", " ", " ", "Print", " ", "the", " ", "version", " ", "of", " ", "pyg", "ette", "xt", " ", "and", " ", "exit", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "w", " ", "column", "s", "\\", "10", ";", " ", " ", " ", " ", "--", "widt", "h", "=", "column", "s", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "widt", "h", " ", "of", " ", "output", " ", "to", " ", "column", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "x", " ", "filename", "\\", "10", ";", " ", " ", " ", " ", "--", "exclu", "de", "-", "file", "=", "filename", "\\", "10", ";", " ", " ", " ", " ", "Speci", "fy", " ", "a", " ", "file", " ", "tha", "t", " ", "contain", "s", " ", "a", " ", "list", " ", "of", " ", "string", "s", " ", "tha", "t", " ", "are", " ", "not", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "extracted", " ", "from", " ", "the", " ", "input", " ", "files", ".", " ", " ", "Ea", "ch", " ", "string", " ", "to", " ", "be", " ", "exclu", "ded", " ", "must", "\\", "10", ";", " ", " ", " ", " ", "appear", " ", "on", " ", "a", " ", "line", " ", "by", " ", "its", "elf", " ", "in", " ", "the", " ", "file", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "X", " ", "filename", "\\", "10", ";", " ", " ", " ", " ", "--", "no", "-", "docstrings", "=", "filename", "\\", "10", ";", " ", " ", " ", " ", "Speci", "fy", " ", "a", " ", "file", " ", "tha", "t", " ", "contain", "s", " ", "a", " ", "list", " ", "of", " ", "files", " ", "(", "one", " ", "per", " ", "line", ")", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "shou", "ld", " ", "not", " ", "have", " ", "thei", "r", " ", "docstrings", " ", "extracted", ".", " ", " ", "Thi", "s", " ", "is", " ", "only", " ", "usef", "ul", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "conjunction", " ", "with", " ", "the", " ", "-", "D", " ", "option", " ", "above", ".", "\\", "10", ";", "\\", "10", ";", "If", " ", "`", "inputfil", "e", "'", " ", "is", " ", "-", ",", " ", "standard", " ", "input", " ", "is", " ", "read", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "imp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "glob_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "getopt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "token_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tokenize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "version\\u\\u_", "=_", "'", "1.6", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "keywords_", "=_", "[_", "'\\u'_", ",_", "'", "nge", "ttext", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DEF", "AUL", "TK", "EY", "WORDS_", "=_", "',", " ", "'_", "._", "join_", "(_", "default", "\\u", "keywords_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "EMP", "TY", "STRING_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "normal", " ", "pot", "-", "file", " ", "header", ".", " ", "msg", "merge", " ", "and", " ", "Ema", "cs", "'", "s", " ", "po", "-", "mode", " ", "work", " ", "bett", "er", " ", "if", " ", "it", "'", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "there", "._", "\\u\\u\\uNL\\u\\u\\u_", "pot", "\\u", "header_", "=_", "'''", "\\\\", "\\", "10", ";", "#", " ", "SOME", " ", "DESCRIPT", "IV", "E", " ", "TIT", "LE", ".", "\\", "10", ";", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "YEA", "R", " ", "ORGANIZ", "ATION", "\\", "10", ";", "#", " ", "{", "Fi", "rst", "\\u", "Author", "},", " ", "YEA", "R", ".", "\\", "10", ";", "#", "\\", "10", ";", "msgid", " ", "\"\"", "\\", "10", ";", "msgs", "tr", " ", "\"\"", "\\", "10", ";", "\"", "Project", "-", "Id", "-", "Version", ":", " ", "{", "Project", "\\u", "Id", "\\u", "Version", "}\\\\", "\\\\", "n", "\"", "\\", "10", ";", "\"", "POT", "-", "Creat", "ion", "-", "Date", ":", " ", "{", "time", "}\\\\", "\\\\", "n", "\"", "\\", "10", ";", "\"", "PO", "-", "Revi", "sion", "-", "Date", ":", " ", "YEA", "R", "-", "MO", "-", "DA", " ", "HO", ":", "MI", "+", "ZONE", "\\\\\\\\", "n", "\"", "\\", "10", ";", "\"", "Las", "t", "-", "Translat", "or", ":", " ", "{", "Las", "t", "\\u", "Translat", "or", "}\\\\", "\\\\", "n", "\"", "\\", "10", ";", "\"", "Lang", "ua", "ge", "-", "Tea", "m", ":", " ", "{", "Lang", "ua", "ge", "\\u", "Tea", "m", "}\\\\", "\\\\", "n", "\"", "\\", "10", ";", "\"", "MIME", "-", "Version", ":", " ", "1.0", "\\\\\\\\", "n", "\"", "\\", "10", ";", "\"", "Conten", "t", "-", "Type", ":", " ", "text", "/", "plain", ";", " ", "charset", "={", "Conten", "t", "\\u", "Type", "\\u", "Charset", "}\\\\", "\\\\", "n", "\"", "\\", "10", ";", "\"", "Conten", "t", "-", "Transfer", "-", "Enco", "ding", ":", " ", "{", "Conten", "t", "\\u", "Transfer", "\\u", "Enco", "ding", "}\\\\", "\\\\", "n", "\"", "\\", "10", ";", "\"", "Plur", "al", "-", "Form", "s", ":", " ", "{", "Plur", "al", "\\u", "Form", "s", "}\\\\", "\\\\", "n", "\"", "\\", "10", ";", "\"", "Generate", "d", "-", "By", ":", " ", "pyg", "ette", "xt", ".", "py", " ", "{", "version", "}\\\\", "\\\\", "n", "\"", "\\", "10", ";", "\\", "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\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "escape", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "pass", "\\u", "iso", "8859", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "All", "ow", " ", "iso", "-", "8859", " ", "character", "s", " ", "to", " ", "pass", " ", "through", " ", "so", " ", "tha", "t", " ", "e", ".", "g", ".", " ", "'", "msgid_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "\"", "H", "?", "e", "\"'", " ", "wou", "ld", " ", "result", " ", "not", " ", "result", " ", "in", " ", "'", "msgid", " ", "\"", "H", "\\\\", "366", "he", "\"'", ".", " ", " ", "Ot", "her", "wis", "e", " ", "we", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "escape", " ", "any", " ", "character", " ", "outsi", "de", " ", "the", " ", "32.", ".12", "6", " ", "range", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "mod", " ", "=", " ", "128_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "mod", " ", "=", " ", "256_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "for", " ", "i", " ", "in", " ", "range", "(", "256", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "32", " ", "<=", " ", "(", "i", " ", "%", " ", "mod", ")", " ", "<=", " ", "126", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "escape", "s", ".", "append", "(", "chr", "(", "i", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "escape", "s", ".", "append", "(\"", "\\\\\\\\", "%", "03", "o", "\"", " ", "%", " ", "i", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "escape", "s", "[", "ord", "('\\", "\\\\", "\\", "')]", " ", "=", " ", "'\\\\\\\\\\\\\\\\", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "escape", "s", "[", "ord", "('\\", "\\", "t", "')]", " ", "=", " ", "'\\\\\\\\", "t", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "escape", "s", "[", "ord", "('\\", "\\", "r", "')]", " ", "=", " ", "'\\\\\\\\", "r", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "escape", "s", "[", "ord", "('\\", "\\", "n", "')]", " ", "=", " ", "'\\\\\\\\", "n", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "escape", "s", "[", "ord", "('\\", "\\", "\"')", "]", " ", "=", " ", "'\\\\\\\\", "\"'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u", "escape", "s\\u\\u_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "escape", "s\\u\\u_", "[_", "'\\\\\\\\'_", "]_", "=_", "'\\\\\\\\\\\\\\\\", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "escape", "s\\u\\u_", "[_", "'\\\\", "t", "'_", "]_", "=_", "'\\\\\\\\", "t", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "escape", "s\\u\\u_", "[_", "'\\\\", "r", "'_", "]_", "=_", "'\\\\\\\\", "r", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "escape", "s\\u\\u_", "[_", "'\\\\", "n", "'_", "]_", "=_", "'\\\\\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "escape", "s\\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\\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\\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_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "main_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "some", " ", "more", " ", "test", " ", "strings_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "\\u(", "u", "'", "a", " ", "unicode", " ", "string", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "this", " ", "one", " ", "create", "s", " ", "a", " ", "warning_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "\\u(", "'**", "*", " ", "Seen", " ", "unexpected", " ", "token", " ", "\"%", "(", "token", ")", "s", "\"')", " ", "%", " ", "{", "'", "token", "':", " ", "'", "test", "'}", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "\\u(", "'", "more", "'", " ", "'", "than", "'", " ", "'", "one", "'", " ", "'", "string", "')", "_", "\\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_", "usage_", "(_", "code_", ",_", "msg_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "\\u\\u", "doc\\u\\u_", "%_", "globals_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "msg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "msg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sys_", "._", "exit_", "(_", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "make", "\\u", "escape", "s_", "(_", "pass", "\\u", "iso", "8859", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "escape", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "escape_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "global", " ", "escape", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "s_", ",_", "unicode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "s_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "list_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "s_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "[_", "i_", "]_", "=_", "\\u\\u", "escape", "s\\u\\u_", "._", "get_", "(_", "s_", "[_", "i_", "]_", ",_", "s_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "EMP", "TY", "STRING_", "._", "join_", "(_", "s_", ")_", "\\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_", "safe", "\\u", "eval_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "unwrap", " ", "quote", "s", ",", " ", "safe", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "eval_", "(_", "s_", ",_", "{_", "'\\u", "\\u", "bui", "lti", "ns", "\\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_", "def_", "normalize_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "convert", "s", " ", "the", " ", "vari", "ous", " ", "Pyth", "on", " ", "string", " ", "types", " ", "int", "o", " ", "a", " ", "format", " ", "tha", "t", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "appropr", "iate", " ", "for", " ", ".", "po", " ", "files", ",", " ", "namel", "y", " ", "muc", "h", " ", "close", "r", " ", "to", " ", "C", " ", "style", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lines_", "=_", "s_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "lines_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "'\"'_", "+_", "escape_", "(_", "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 ", " _", "if_", "not_", "lines_", "[_", "-_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "lines_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "[_", "-_", "1_", "]_", "=_", "lines_", "[_", "-_", "1_", "]_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "lines_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lines_", "[_", "i_", "]_", "=_", "escape_", "(_", "lines_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "linet", "erm", "_", "=_", "'\\\\\\\\", "n", "\"\\\\", "n", "\"'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "'\"", "\"\\\\", "n", "\"'_", "+_", "linet", "erm", "_", "._", "join_", "(_", "lines_", ")_", "+_", "'\"'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "s_", "\\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_", "contain", "s", "Any_", "(_", "str_", ",_", "set_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Check", " ", "whe", "ther", " ", "'", "str", "'", " ", "contain", "s", " ", "ANY", " ", "of", " ", "the", " ", "char", "s", " ", "in", " ", "'", "set", "'\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "in_", "[_", "c_", "in_", "str_", "for_", "c_", "in_", "set_", "]_", "\\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", "visit", "\\u", "pyfi", "les_", "(_", "list_", ",_", "dirname_", ",_", "names_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Help", "er", " ", "for", " ", "get", "Files", "For", "Name", "().\"", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "extensi", "on", " ", "for", " ", "python", " ", "source", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "globals_", "(_", ")_", "._", "has", "\\u", "key_", "(_", "'\\u", "py", "\\u", "ext", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "\\u", "py", "\\u", "ext_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "\\u", "py", "\\u", "ext", " ", "=", " ", "[", "triple", "[", "0", "]", " ", "for", " ", "triple", " ", "in", " ", "imp", ".", "get", "\\u", "suffixe", "s", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "triple", "[", "2", "]", " ", "==", " ", "imp", ".", "PY", "\\u", "SOU", "RC", "E", "][", "0", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "py", "\\u", "ext_", "=_", "[_", "triple_", "[_", "0_", "]_", "for_", "triple_", "in_", "imp_", "._", "get", "\\u", "suffixes_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "triple_", "[_", "2_", "]_", "==_", "imp_", "._", "PY", "\\u", "SOURCE_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "don", "'", "t", " ", "recurse", " ", "int", "o", " ", "CV", "S", " ", "directories_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "CV", "S", "'_", "in_", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "names_", "._", "remove_", "(_", "'", "CV", "S", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'.", "svn", "'_", "in_", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "names_", "._", "remove_", "(_", "'.", "svn", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'.", "git", "'_", "in_", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "names_", "._", "remove_", "(_", "'.", "git", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "static", "'_", "in_", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "names_", "._", "remove_", "(_", "'", "static", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "all", " ", "*.", "py", " ", "files", " ", "to", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "list_", "._", "extend_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "os_", "._", "path_", "._", "join_", "(_", "dirname_", ",_", "file_", ")_", "for_", "file_", "in_", "names_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "splitext_", "(_", "file_", ")_", "[_", "1_", "]_", "in_", "\\u", "py", "\\u", "ext_", "]_", "\\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_", "def_", "\\u", "get", "\\u", "modp", "kg", "\\u", "path_", "(_", "dot", "ted", "\\u", "name_", ",_", "pathli", "st_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "the", " ", "filesystem", " ", "path", " ", "for", " ", "a", " ", "module", " ", "or", " ", "a", " ", "package", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "the", " ", "file", " ", "system", " ", "path", " ", "to", " ", "a", " ", "file", " ", "for", " ", "a", " ", "module", ",", " ", "and", " ", "to", " ", "a", " ", "director", "y", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "package", ".", " ", "Return", " ", "Non", "e", " ", "if", " ", "the", " ", "name", " ", "is", " ", "not", " ", "found", ",", " ", "or", " ", "is", " ", "a", " ", "bui", "lti", "n", " ", "or", "\\", "10", ";", " ", " ", " ", " ", "extensi", "on", " ", "module", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "split", " ", "off", " ", "top", "-", "most", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "parts_", "=_", "dot", "ted", "\\u", "name_", "._", "split_", "(_", "'.'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "parts_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "have", " ", "a", " ", "dot", "ted", " ", "path", ",", " ", "import", " ", "top", "-", "level", " ", "package_", "\\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 ", " _", "file_", ",_", "pathname_", ",_", "description_", "=_", "imp_", "._", "find", "\\u", "module_", "(_", "parts_", "[_", "0_", "]_", ",_", "pathli", "st_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "file_", ":_", "file_", "._", "close_", "(_", ")_", "\\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 ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "it", "'", "s", " ", "inde", "ed", " ", "a", " ", "package_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "description_", "[_", "2_", "]_", "==_", "imp_", "._", "PKG", "\\u", "DIRECTORY_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "recurs", "ively", " ", "handle", " ", "the", " ", "rema", "inin", "g", " ", "name", " ", "parts_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pathname_", "=_", "\\u", "get", "\\u", "modp", "kg", "\\u", "path_", "(_", "parts_", "[_", "1_", "]_", ",_", "[_", "pathname_", "]_", ")_", "\\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 ", " _", "pathname_", "=_", "None_", "\\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_", "#", " ", "plain", " ", "name_", "\\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 ", " _", "file_", ",_", "pathname_", ",_", "description_", "=_", "imp_", "._", "find", "\\u", "module_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "dot", "ted", "\\u", "name_", ",_", "pathli", "st_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "description_", "[_", "2_", "]_", "not_", "in_", "[_", "imp_", "._", "PY", "\\u", "SOURCE_", ",_", "imp_", "._", "PKG", "\\u", "DIRECTORY_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pathname_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pathname_", "=_", "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_", "return_", "pathname_", "\\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_", "get", "Files", "For", "Name_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "a", " ", "list", " ", "of", " ", "module", " ", "files", " ", "for", " ", "a", " ", "filename", ",", " ", "a", " ", "module", " ", "or", " ", "package", " ", "name", ",", "\\", "10", ";", " ", " ", " ", " ", "or", " ", "a", " ", "director", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "for", " ", "glob", " ", "chars_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "contain", "s", "Any_", "(_", "name_", ",_", "\"*", "?", "[]\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "files_", "=_", "glob_", "._", "glob_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "file_", "in_", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "list_", "._", "extend_", "(_", "get", "Files", "For", "Name_", "(_", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", " ", "to", " ", "find", " ", "module", " ", "or", " ", "package_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "name_", "=_", "\\u", "get", "\\u", "modp", "kg", "\\u", "path_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\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_", "if_", "os_", "._", "path_", "._", "isdir_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "find", " ", "all", " ", "python", " ", "files", " ", "in", " ", "directory_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "path_", "._", "walk_", "(_", "name_", ",_", "\\u", "visit", "\\u", "pyfi", "les_", ",_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "os_", "._", "path_", "._", "exists_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "a", " ", "single", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\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_", "class_", "Token", "Ea", "ter_", ":_", "\\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\\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_", "Token", "Ea", "ter_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "options_", ",_", "vars_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "options_", "=_", "options_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "messages_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "state_", "=_", "self_", "._", "\\u\\u", "waiting_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "args_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "lineno_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "fresh", "module_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "cur", "file_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "vars_", "=_", "vars_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Token", "Ea", "ter_", ":_", "\\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_", ",_", "ttype_", ",_", "tstr", "ing_", ",_", "stu", "p_", ",_", "etu", "p_", ",_", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "dispatch_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", "import", " ", "token_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", "print", " ", ">>", " ", "sys", ".", "std", "err", ",", " ", "'", "ttype", ":'", ",", " ", "token", ".", "tok", "\\u", "name", "[", "ttype", "],", " ", "\\\\_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", " ", " ", "'", "tstr", "ing", ":'", ",", " ", "tstr", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "state_", "(_", "ttype_", ",_", "tstr", "ing_", ",_", "stu", "p_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Token", "Ea", "ter_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "waiting_", "(_", "self_", ",_", "ttype_", ",_", "tstr", "ing_", ",_", "lineno_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opts_", "=_", "self_", "._", "\\u\\u", "options_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Do", " ", "docstr", "ing", " ", "extracti", "ons", ",", " ", "if", " ", "enabled_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "opts_", "._", "docstrings", "_", "and_", "not_", "opts_", "._", "nod", "ocs", "tring", "s_", "._", "get_", "(_", "self_", "._", "\\u\\u", "cur", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "module", " ", "docstr", "ing", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u\\u", "fresh", "module_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ttype_", "==_", "tokenize_", "._", "STRING_", ":_", "\\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 ", " ", " _", "s_", "=_", "safe", "\\u", "eval_", "(_", "tstr", "ing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'**", "*", " ", "%", "(", "file", ")", "s", ":", "%", "(", "linen", "o", ")", "s", ":", " ", "coul", "d", " ", "not", " ", "evaluate", " ", "argu", "ment", " ", "\"%", "(", "arg", ")", "s", "\"'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "%_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "arg", "'_", ":_", "tstr", "ing_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", "'_", ":_", "self_", "._", "\\u\\u", "cur", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "linen", "o", "'_", ":_", "self_", "._", "\\u\\u", "lineno_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", ">>_", "sys_", "._", "stderr_", ",_", "str_", "(_", "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 ", " ", " _", "self_", "._", "\\u\\u", "adde", "ntry_", "(_", "[_", "s_", "]_", ",_", "lineno_", ",_", "isd", "ocs", "tring_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u\\u", "fresh", "module_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "ttype_", "not_", "in_", "(_", "tokenize_", "._", "COMMENT_", ",_", "tokenize_", "._", "NL", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u\\u", "fresh", "module_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "class", " ", "docstr", "ing", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ttype_", "==_", "tokenize_", "._", "NAME_", "and_", "tstr", "ing_", "in_", "(_", "'", "class", "'_", ",_", "'", "def", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "state_", "=_", "self_", "._", "\\u\\u", "suites", "een", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ttype_", "==_", "tokenize_", "._", "NAME_", "and_", "tstr", "ing_", "in_", "opts_", "._", "keywords_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "state_", "=_", "self_", "._", "\\u\\u", "keywords", "een", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Token", "Ea", "ter_", ":_", "\\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", "suites", "een", "_", "(_", "self_", ",_", "ttype_", ",_", "tstr", "ing_", ",_", "lineno_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "ignore", " ", "anyt", "hing", " ", "unti", "l", " ", "we", " ", "see", " ", "the", " ", "colon", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ttype_", "==_", "tokenize_", "._", "OP_", "and_", "tstr", "ing_", "==_", "':'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "state_", "=_", "self_", "._", "\\u\\u", "suit", "edo", "cstr", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Token", "Ea", "ter_", ":_", "\\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", "suit", "edo", "cstr", "ing_", "(_", "self_", ",_", "ttype_", ",_", "tstr", "ing_", ",_", "lineno_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "ignore", " ", "any", " ", "interv", "eni", "ng", " ", "noise_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ttype_", "==_", "tokenize_", "._", "STRING_", ":_", "\\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 ", " _", "s_", "=_", "safe", "\\u", "eval_", "(_", "tstr", "ing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'**", "*", " ", "%", "(", "file", ")", "s", ":", "%", "(", "linen", "o", ")", "s", ":", " ", "coul", "d", " ", "not", " ", "evaluate", " ", "argu", "ment", " ", "\"%", "(", "arg", ")", "s", "\"'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "%_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "arg", "'_", ":_", "tstr", "ing_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", "'_", ":_", "self_", "._", "\\u\\u", "cur", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "linen", "o", "'_", ":_", "self_", "._", "\\u\\u", "lineno_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", ">>_", "sys_", "._", "stderr_", ",_", "str_", "(_", "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 ", " _", "self_", "._", "\\u\\u", "adde", "ntry_", "(_", "s_", ",_", "lineno_", ",_", "isd", "ocs", "tring_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u\\u", "state_", "=_", "self_", "._", "\\u\\u", "waiting_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "ttype_", "not_", "in_", "(_", "tokenize_", "._", "NEWLINE", "_", ",_", "tokenize_", "._", "INDENT", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "tokenize_", "._", "COMMENT_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "there", " ", "was", " ", "no", " ", "class", " ", "docstring_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "state_", "=_", "self_", "._", "\\u\\u", "waiting_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Token", "Ea", "ter_", ":_", "\\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", "keywords", "een", "_", "(_", "self_", ",_", "ttype_", ",_", "tstr", "ing_", ",_", "lineno_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ttype_", "==_", "tokenize_", "._", "OP_", "and_", "tstr", "ing_", "==_", "'('_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "args_", "=_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "lineno_", "=_", "lineno_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "depth_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "state_", "=_", "self_", "._", "\\u\\u", "scans", "tring", "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 ", " _", "self_", "._", "\\u\\u", "state_", "=_", "self_", "._", "\\u\\u", "waiting_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Token", "Ea", "ter_", ":_", "\\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", "scans", "tring", "1_", "(_", "self_", ",_", "ttype_", ",_", "tstr", "ing_", ",_", "lineno_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "handle", " ", "first", " ", "argu", "ment", ",", " ", "whi", "ch", " ", "is", " ", "supposed", " ", "to", " ", "be", " ", "a", " ", "string", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ttype_", "==_", "tokenize_", "._", "OP_", "and_", "tstr", "ing_", "==_", "')'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "End", " ", "of", " ", "list", " ", "of", " ", "argu", "ment", "s", " ", "for", " ", "the", " ", "current", " ", "function", " ", "call", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "argu", "ment", " ", "list", " ", "is", " ", "empty", " ", "(", "as", " ", "in", " ", "keyw", "ord", "())", ",", " ", "ignore", " ", "this", " ", "call", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", "wis", "e", " ", "evaluate", " ", "the", " ", "fragment", "s", " ", "we", " ", "collected", " ", "as", " ", "the", " ", "first_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "argu", "ment", " ", "and", " ", "record", " ", "its", " ", "line", " ", "number", " ", "and", " ", "update", " ", "the", " ", "list", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "message", "s", " ", "see", "n", ".", " ", "Reset", " ", "state", " ", "for", " ", "the", " ", "next", " ", "batch", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u\\u", "args_", "[_", "-_", "1_", "]_", ":_", "\\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 ", " ", "_", "s_", "=_", "safe", "\\u", "eval_", "(_", "self_", "._", "\\u\\u", "args_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", ">>_", "sys_", "._", "stderr_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'**", "*", " ", "%", "(", "file", ")", "s", ":", "%", "(", "linen", "o", ")", "s", ":", " ", "coul", "d", " ", "not", " ", "evaluate", " ", "argu", "ment", " ", "\"%", "(", "arg", ")", "s", "\"'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "%_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "arg", "'_", ":_", "self_", "._", "\\u\\u", "args_", "[_", "-_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", "'_", ":_", "self_", "._", "\\u\\u", "cur", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "linen", "o", "'_", ":_", "self_", "._", "\\u\\u", "lineno_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", ">>_", "sys_", "._", "stderr_", ",_", "str_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "state_", "=_", "self_", "._", "\\u\\u", "waiting_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "s_", ")_", "==_", "str_", "or_", "type_", "(_", "s_", ")_", "==_", "unicode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u\\u", "args_", "[_", "-_", "1_", "]_", "=_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "adde", "ntry_", "(_", "self_", "._", "\\u\\u", "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 ", " ", "_", "print_", ">>_", "sys_", "._", "stderr_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'**", "*", " ", "%", "(", "file", ")", "s", ":", "%", "(", "linen", "o", ")", "s", ":", " ", "argu", "ment", " ", "is", " ", "no", " ", "str", " ", "or", " ", "unicode", " ", "object", " ", "\"%", "(", "arg", ")", "s", "\"'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "%_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "arg", "'_", ":_", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", "'_", ":_", "self_", "._", "\\u\\u", "cur", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "linen", "o", "'_", ":_", "self_", "._", "\\u\\u", "lineno_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u\\u", "state_", "=_", "self_", "._", "\\u\\u", "waiting_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "ttype_", "==_", "tokenize_", "._", "OP_", "and_", "tstr", "ing_", "==_", "','_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Start", " ", "of", " ", "the", " ", "next", " ", "argu", "ment", "._", "\\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 ", " _", "s_", "=_", "safe", "\\u", "eval_", "(_", "self_", "._", "\\u\\u", "args_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'**", "*", " ", "%", "(", "file", ")", "s", ":", "%", "(", "linen", "o", ")", "s", ":", " ", "coul", "d", " ", "not", " ", "evaluate", " ", "argu", "ment", " ", "\"%", "(", "arg", ")", "s", "\"'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "%_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "arg", "'_", ":_", "self_", "._", "\\u\\u", "args_", "[_", "-_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", "'_", ":_", "self_", "._", "\\u\\u", "cur", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "linen", "o", "'_", ":_", "self_", "._", "\\u\\u", "lineno_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", ">>_", "sys_", "._", "stderr_", ",_", "str_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "state_", "=_", "self_", "._", "\\u\\u", "waiting_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "s_", ")_", "==_", "str_", "or_", "type_", "(_", "s_", ")_", "==_", "unicode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "args_", "[_", "-_", "1_", "]_", "=_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "args_", "._", "append_", "(_", "''_", ")_", "#", " ", "next", " ", "argu", "ment", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "state_", "=_", "self_", "._", "\\u\\u", "scans", "tring", "2_", "\\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_", ">>_", "sys_", "._", "stderr_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'**", "*", " ", "%", "(", "file", ")", "s", ":", "%", "(", "linen", "o", ")", "s", ":", " ", "argu", "ment", " ", "1", " ", "is", " ", "no", " ", "str", " ", "or", " ", "unicode", " ", "object", " ", "\"%", "(", "arg", ")", "s", "\"'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "%_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "arg", "'_", ":_", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", "'_", ":_", "self_", "._", "\\u\\u", "cur", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "linen", "o", "'_", ":_", "self_", "._", "\\u\\u", "lineno_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "state_", "=_", "self_", "._", "\\u\\u", "waiting_", "\\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_", "#", " ", "add", " ", "string", " ", "to", " ", "current", " ", "argu", "ment", " ", "for", " ", "late", "r", " ", "evaluat", "ion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "no", " ", "state", " ", "change", " ", "in", " ", "this", " ", "case", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "args_", "[_", "-_", "1_", "]_", "+=_", "tstr", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Token", "Ea", "ter_", ":_", "\\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", "scans", "tring", "2_", "(_", "self_", ",_", "ttype_", ",_", "tstr", "ing_", ",_", "lineno_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "handle", " ", "second", " ", "argu", "ment", ",", " ", "whi", "ch", " ", "is", " ", "supposed", " ", "to", " ", "be", " ", "a", " ", "string", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ttype_", "==_", "tokenize_", "._", "OP_", "and_", "tstr", "ing_", "==_", "')'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "End", " ", "of", " ", "list", " ", "of", " ", "argu", "ment", "s", " ", "for", " ", "the", " ", "current", " ", "function", " ", "call", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "an", " ", "error", " ", "if", " ", "we", " ", "expect", " ", "eit", "her", " ", "one", " ", "or", " ", "three", " ", "argu", "ment", "s", " ", "but", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "neve", "r", " ", "two", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'**", "*", " ", "%", "(", "file", ")", "s", ":", "%", "(", "linen", "o", ")", "s", ":", " ", "unexpected", " ", "number", " ", "of", " ", "argu", "ment", "s", " ", "(", "2", ")\"", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "%_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", "'_", ":_", "self_", "._", "\\u\\u", "cur", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "linen", "o", "'_", ":_", "self_", "._", "\\u\\u", "lineno_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "state_", "=_", "self_", "._", "\\u\\u", "waiting_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "ttype_", "==_", "tokenize_", "._", "OP_", "and_", "tstr", "ing_", "==_", "','_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Start", " ", "of", " ", "the", " ", "next", " ", "argu", "ment", ".", " ", "We", " ", "do", " ", "not", " ", "need", " ", "to", " ", "parse", " ", "it", ",", " ", "we", " ", "only_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "made", " ", "sure", " ", "it", " ", "is", " ", "there", " ", "and", " ", "now", " ", "we", " ", "assume", " ", "this", " ", "is", " ", "a", " ", "plural", " ", "call", "._", "\\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 ", " _", "s_", "=_", "safe", "\\u", "eval_", "(_", "self_", "._", "\\u\\u", "args_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'**", "*", " ", "%", "(", "file", ")", "s", ":", "%", "(", "linen", "o", ")", "s", ":", " ", "coul", "d", " ", "not", " ", "evaluate", " ", "argu", "ment", " ", "\"%", "(", "arg", ")", "s", "\"'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "%_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "arg", "'_", ":_", "self_", "._", "\\u\\u", "args_", "[_", "-_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", "'_", ":_", "self_", "._", "\\u\\u", "cur", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "linen", "o", "'_", ":_", "self_", "._", "\\u\\u", "lineno_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", ">>_", "sys_", "._", "stderr_", ",_", "str_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "state_", "=_", "self_", "._", "\\u\\u", "waiting_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "safe", "\\u", "eval_", "(_", "self_", "._", "\\u\\u", "args_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "s_", ")_", "==_", "str_", "or_", "type_", "(_", "s_", ")_", "==_", "unicode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "args_", "[_", "-_", "1_", "]_", "=_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "adde", "ntry_", "(_", "self_", "._", "\\u\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "state_", "=_", "self_", "._", "\\u\\u", "waiting_", "\\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_", ">>_", "sys_", "._", "stderr_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'**", "*", " ", "%", "(", "file", ")", "s", ":", "%", "(", "linen", "o", ")", "s", ":", " ", "argu", "ment", " ", "2", " ", "is", " ", "no", " ", "str", " ", "or", " ", "unicode", " ", "object", " ", "\"%", "(", "arg", ")", "s", "\"'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "%_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "arg", "'_", ":_", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", "'_", ":_", "self_", "._", "\\u\\u", "cur", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "linen", "o", "'_", ":_", "self_", "._", "\\u\\u", "lineno_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "state_", "=_", "self_", "._", "\\u\\u", "waiting_", "\\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_", "#", " ", "add", " ", "string", " ", "to", " ", "current", " ", "argu", "ment", " ", "for", " ", "late", "r", " ", "evaluat", "ion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "no", " ", "state", " ", "change", " ", "in", " ", "this", " ", "case", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "args_", "[_", "-_", "1_", "]_", "+=_", "tstr", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Token", "Ea", "ter_", ":_", "\\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", "adde", "ntry_", "(_", "self_", ",_", "args_", ",_", "lineno_", "=_", "None_", ",_", "isd", "ocs", "tring_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "isp", "lu", "ral_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "args_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "isp", "lu", "ral_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "lineno_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lineno_", "=_", "self_", "._", "\\u\\u", "lineno_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "exclude_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", "[_", "0_", "]_", "in_", "self_", "._", "\\u\\u", "options_", "._", "toe", "xc", "lud", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exclude_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isp", "lu", "ral_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "args_", "[_", "1_", "]_", "not_", "in_", "self_", "._", "\\u\\u", "options_", "._", "toe", "xc", "lud", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "in", " ", "case", " ", "of", " ", "plural", ",", " ", "bot", "h", " ", "string", "s", " ", "must", " ", "be", " ", "in", " ", "the", " ", "toe", "xc", "lud", "e", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "exclu", "de", " ", "this", " ", "entry", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exclude_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "exclude_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entry_", "=_", "(_", "self_", "._", "\\u\\u", "cur", "file_", ",_", "lineno_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "entri", "es", " ", "look", " ", "like", " ", "this", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "{(", "'", "arg", "1", "','", "arg", "2", "')", " ", ":", " ", "{(", "filename", ",", "linen", "o", ")", " ", ":", " ", "<", "isd", "ocs", "tring", ">}", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "('", "arg", "1", "',", ")", " ", " ", " ", ":", " ", "{(", "filename", ",", "linen", "o", ")", " ", ":", " ", "<", "isco", "dstr", "ing", ">}", "}_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "key", " ", "with", " ", "len", " ", ">", " ", "1", " ", "indicat", "es", " ", "plural", "s_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "messages_", "._", "setdefault_", "(_", "tuple_", "(_", "args_", "[_", "0_", ":_", "2_", "]_", ")_", ",_", "{_", "}_", ")_", "[_", "entry_", "]_", "=_", "isd", "ocs", "tring_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Token", "Ea", "ter_", ":_", "\\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", "filename_", "(_", "self_", ",_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "cur", "file_", "=_", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "fresh", "module_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Token", "Ea", "ter_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "fp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "=_", "self_", "._", "\\u\\u", "options_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timestamp_", "=_", "time_", "._", "strftime_", "(_", "'%", "Y", "-%", "m", "-%", "d", " ", "%", "H", ":", "%", "M", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "time", " ", "stamp", " ", "in", " ", "the", " ", "header", " ", "doe", "sn", "'", "t", " ", "have", " ", "the", " ", "same", " ", "format", " ", "as", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "generat", "ed", " ", "by", " ", "xg", "ette", "xt", "..._", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u\\u", "vars_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "update_", "(_", "{_", "'", "time", "'_", ":_", "timestamp_", ",_", "'", "version", "'_", ":_", "\\u\\u", "version\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", ">>_", "fp_", ",_", "pot", "\\u", "header_", "._", "format_", "(_", "**_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sort", " ", "the", " ", "entri", "es", ".", " ", " ", "Fi", "rst", " ", "sort", " ", "each", " ", "partic", "ular", " ", "entry", "'", "s", " ", "keys", ",", " ", "then_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sort", " ", "all", " ", "the", " ", "entri", "es", " ", "by", " ", "thei", "r", " ", "first", " ", "item", "._", "\\u\\u\\uNL\\u\\u\\u_", "reverse_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "self_", "._", "\\u\\u", "messages_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keys_", "=_", "v_", "._", "keys_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keys_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reverse_", "._", "setdefault_", "(_", "tuple_", "(_", "keys_", ")_", ",_", "[_", "]_", ")_", "._", "append_", "(_", "(_", "k_", ",_", "v_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rke", "ys_", "=_", "reverse_", "._", "keys_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rke", "ys_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "rke", "y_", "in_", "rke", "ys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rent", "ries_", "=_", "reverse_", "[_", "rke", "y_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rent", "ries_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "rent", "ries_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "entry", " ", "was", " ", "gle", "ane", "d", " ", "out", " ", "of", " ", "a", " ", "docstr", "ing", ",", " ", "then", " ", "add", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "comment", " ", "stati", "ng", " ", "so", ".", " ", " ", "Thi", "s", " ", "is", " ", "to", " ", "aid", " ", "translator", "s", " ", "who", " ", "may", " ", "wish", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "skip", " ", "translat", "ing", " ", "some", " ", "unim", "porta", "nt", " ", "docstrings", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "isd", "ocs", "tring_", "=_", "sum_", "(_", "v_", "._", "values_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "k", " ", "is", " ", "the", " ", "message", " ", "string", ",", " ", "v", " ", "is", " ", "a", " ", "dictionar", "y", "-", "set", " ", "of", " ", "(", "filename", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "linen", "o", ")", " ", "tuple", "s", ".", " ", " ", "We", " ", "want", " ", "to", " ", "sort", " ", "the", " ", "entri", "es", " ", "in", " ", "v", " ", "first", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "file", " ", "name", " ", "and", " ", "then", " ", "by", " ", "line", " ", "number", "._", "\\u\\u\\uNL\\u\\u\\u_", "v_", "=_", "v_", "._", "keys_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "options_", "._", "write", "locations_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "location", " ", "comment", "s", " ", "are", " ", "different", " ", "b", "/", "w", " ", "Sol", "aris", " ", "and", " ", "GN", "U", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "location", "style_", "==_", "options_", "._", "SOL", "ARI", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "filename_", ",_", "lineno_", "in_", "v_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "d_", "=_", "{_", "'", "filename", "'_", ":_", "filename_", ",_", "'", "linen", "o", "'_", ":_", "lineno_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", ">>_", "fp_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'#", " ", "File", ":", " ", "%", "(", "filename", ")", "s", ",", " ", "line", ":", " ", "%", "(", "linen", "o", ")", "d", "'_", ")_", "%_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "location", "style_", "==_", "options_", "._", "GN", "U_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "fit", " ", "as", " ", "many", " ", "location", "s", " ", "on", " ", "one", " ", "line", ",", " ", "as", " ", "long", " ", "as", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "result", "ing", " ", "line", " ", "length", " ", "doe", "sn", "'", "t", " ", "exceed", "s", " ", "'", "options", ".", "widt", "h", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "loc", "line_", "=_", "'#", ":'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "filename_", ",_", "lineno_", "in_", "v_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "d_", "=_", "{_", "'", "filename", "'_", ":_", "filename_", ",_", "'", "linen", "o", "'_", ":_", "lineno_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "(_", "'", " ", "%", "(", "filename", ")", "s", ":", "%", "(", "linen", "o", ")", "d", "'_", ")_", "%_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "loc", "line_", ")_", "+_", "len_", "(_", "s_", ")_", "<=_", "options_", "._", "width_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "loc", "line_", "=_", "loc", "line_", "+_", "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 ", " ", " _", "print_", ">>_", "fp_", ",_", "loc", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loc", "line_", "=_", "\"#", ":\"_", "+_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "loc", "line_", ")_", ">_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", ">>_", "fp_", ",_", "loc", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isd", "ocs", "tring_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", ">>_", "fp_", ",_", "'#", ",", " ", "docstr", "ing", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", ">>_", "fp_", ",_", "'", "msgid", "'_", ",_", "normalize_", "(_", "k_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "k_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", ">>_", "fp_", ",_", "'", "msgid", "\\u", "plural", "'_", ",_", "normalize_", "(_", "k_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", ">>_", "fp_", ",_", "'", "msgs", "tr", "[", "0", "]", " ", "\"\"", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", ">>_", "fp_", ",_", "'", "msgs", "tr", "[", "1", "]", " ", "\"\"", "\\\\", "n", "'_", "\\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_", ">>_", "fp_", ",_", "'", "msgs", "tr", " ", "\"\"", "\\\\", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "default", "\\u", "keywords_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opts_", ",_", "args_", "=_", "getopt_", "._", "getopt_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "argv_", "[_", "1_", ":_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ad", ":", "DE", "hk", ":", "Kno", ":", "p", ":", "S", ":", "V", "vw", ":", "x", ":", "X", ":", "f", ":'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "extract", "-", "all", "'_", ",_", "'", "default", "-", "domain", "='_", ",_", "'", "escape", "'_", ",_", "'", "help", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "keyw", "ord", "='_", ",_", "'", "no", "-", "default", "-", "keywords", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "add", "-", "location", "'_", ",_", "'", "no", "-", "location", "'_", ",_", "'", "output", "='_", ",_", "'", "output", "-", "dir", "='_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "style", "='_", ",_", "'", "verbo", "se", "'_", ",_", "'", "version", "'_", ",_", "'", "widt", "h", "='_", ",_", "'", "exclu", "de", "-", "file", "='_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "docstrings", "'_", ",_", "'", "no", "-", "docstrings", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "getopt_", "._", "error_", ",_", "msg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "usage_", "(_", "1_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "holding", " ", "option", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "constants_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "GN", "U_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SOL", "ARI", "S_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "defaults_", "\\u\\u\\uNL\\u\\u\\u_", "extracta", "ll_", "=_", "0_", "#", " ", "FIX", "ME", ":", " ", "currentl", "y", " ", "this", " ", "option", " ", "has", " ", "no", " ", "effect", " ", "at", " ", "all", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "escape_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keywords_", "=_", "[_", "'", "uge", "ttext", "'_", ",_", "'", "unge", "ttext", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outpath_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outfile_", "=_", "'", "message", "s", ".", "pot", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "locations_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "location", "style_", "=_", "GN", "U_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verbose_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "width_", "=_", "78_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exclu", "def", "ilename_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "docstrings", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nod", "ocs", "tring", "s_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "=_", "Options_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "locations_", "=_", "{_", "'", "gnu", "'_", ":_", "options_", "._", "GN", "U_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "solar", "is", "'_", ":_", "options_", "._", "SOL", "ARI", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "files_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parse", " ", "options_", "\\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_", "(_", "'-", "h", "'_", ",_", "'--", "help", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "usage_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'-", "a", "'_", ",_", "'--", "extract", "-", "all", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "extracta", "ll_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'-", "d", "'_", ",_", "'--", "default", "-", "domain", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "outfile_", "=_", "arg_", "+_", "'.", "pot", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'-", "E", "'_", ",_", "'--", "escape", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "escape_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'-", "D", "'_", ",_", "'--", "docstrings", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "docstrings", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'-", "k", "'_", ",_", "'--", "keyw", "ord", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "keywords_", "._", "append_", "(_", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'-", "K", "'_", ",_", "'--", "no", "-", "default", "-", "keywords", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "default", "\\u", "keywords_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'-", "n", "'_", ",_", "'--", "add", "-", "location", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "write", "locations_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'--", "no", "-", "location", "'_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "write", "locations_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'-", "S", "'_", ",_", "'--", "style", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "location", "style_", "=_", "locations_", "._", "get_", "(_", "arg_", "._", "lower_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "location", "style_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "usage_", "(_", "1_", ",_", "(_", "'", "Inva", "lid", " ", "value", " ", "for", " ", "--", "style", ":", " ", "%", "s", "'_", ")_", "%_", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'-", "o", "'_", ",_", "'--", "output", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "outfile_", "=_", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'-", "p", "'_", ",_", "'--", "output", "-", "dir", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "outpath_", "=_", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'-", "v", "'_", ",_", "'--", "verbo", "se", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "verbose_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'-", "V", "'_", ",_", "'--", "version", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "pyg", "ette", "xt", ".", "py", " ", "(", "xg", "ette", "xt", " ", "for", " ", "Pyth", "on", ")", " ", "%", "s", "'_", ")_", "%_", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'-", "w", "'_", ",_", "'--", "widt", "h", "'_", ")_", ":_", "\\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 ", " _", "options_", "._", "width_", "=_", "int_", "(_", "arg_", ")_", "\\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 ", " _", "usage_", "(_", "1_", ",_", "(_", "'--", "widt", "h", " ", "argu", "ment", " ", "must", " ", "be", " ", "an", " ", "integ", "er", ":", " ", "%", "s", "'_", ")_", "%_", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'-", "x", "'_", ",_", "'--", "exclu", "de", "-", "file", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "exclu", "def", "ilename_", "=_", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'-", "X", "'_", ",_", "'--", "no", "-", "docstrings", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "=_", "open_", "(_", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "line_", "=_", "fp_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "line_", ":_", "\\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_", "options_", "._", "nod", "ocs", "tring", "s_", "[_", "line_", "[_", ":_", "-_", "1_", "]_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "==_", "'-", "f", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "files_", "=_", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "calcul", "ate", " ", "escape", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "make", "\\u", "escape", "s", "(", "options", ".", "escape", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "calcul", "ate", " ", "all", " ", "keywords_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "._", "keywords_", "._", "extend_", "(_", "default", "\\u", "keywords_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "initialize", " ", "list", " ", "of", " ", "string", "s", " ", "to", " ", "exclude_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "exclu", "def", "ilename_", ":_", "\\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 ", " _", "fp_", "=_", "open_", "(_", "options_", "._", "exclu", "def", "ilename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options_", "._", "toe", "xc", "lud", "e_", "=_", "fp_", "._", "readlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fp_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "IO", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Can", "'", "t", " ", "read", " ", "--", "exclu", "de", "-", "file", ":", " ", "%", "s", "\"_", ")_", "%_", "options_", "._", "exclu", "def", "ilename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\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 ", " _", "options_", "._", "toe", "xc", "lud", "e_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "resolve", " ", "args", " ", "to", " ", "module", " ", "lists_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expanded_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "arg_", "in_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "arg_", "==_", "'-'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expanded_", "._", "append_", "(_", "arg_", ")_", "\\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 ", " _", "expanded_", "._", "extend_", "(_", "get", "Files", "For", "Name_", "(_", "arg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "args_", "=_", "expanded_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lines_", "=_", "open_", "(_", "files_", ")_", "._", "readlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "lines_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "._", "append_", "(_", "line_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "slur", "p", " ", "through", " ", "all", " ", "the", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "eat", "er_", "=_", "Token", "Ea", "ter_", "(_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "filename_", "in_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "filename_", "==_", "'-'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "options_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Reading", " ", "standard", " ", "input", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fp_", "=_", "sys_", "._", "stdin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "close", "p_", "=_", "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 ", " _", "if_", "options_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Work", "ing", " ", "on", " ", "%", "s", "'_", ")_", "%_", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "filename_", "._", "endswith_", "(_", "'.", "html", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "uli", "web_", "._", "core_", "._", "template_", "import_", "template", "\\u", "file", "\\u", "py_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "c", "String", "IO_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "template", "\\u", "file", "\\u", "py_", "(_", "filename_", ",_", "skip", "\\u", "extern", "_", "=_", "True_", ",_", "multiline", "s_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fp_", "=_", "String", "IO_", "(_", "text_", ")_", "\\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 ", " _", "fp_", "=_", "open_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "close", "p_", "=_", "1_", "\\u\\u\\uNEWLINE\\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 ", " _", "eat", "er_", "._", "set\\u", "filename_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tokenize_", "._", "tokenize_", "(_", "fp_", "._", "readline_", ",_", "eat", "er_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "tokenize_", "._", "Token", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'%", "s", ":", " ", "%", "s", ",", " ", "line", " ", "%", "d", ",", " ", "column", " ", "%", "d", "'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "e_", "[_", "0_", "]_", ",_", "filename_", ",_", "e_", "[_", "1_", "]_", "[_", "0_", "]_", ",_", "e_", "[_", "1_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "close", "p_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "write", " ", "the", " ", "output_", "\\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_", "options_", "._", "outfile_", "==_", "'-'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "=_", "sys_", "._", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "close", "p_", "=_", "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 ", " _", "if_", "options_", "._", "outpath_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "outfile_", "=_", "os_", "._", "path_", "._", "join_", "(_", "options_", "._", "outpath_", ",_", "options_", "._", "outfile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "path_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "options_", "._", "outfile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "path_", ")_", ":_", "\\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 ", " ", "_", "os_", "._", "makedirs_", "(_", "path_", ")_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fp_", "=_", "open_", "(_", "options_", "._", "outfile_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "close", "p_", "=_", "1_", "\\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 ", " _", "eat", "er_", "._", "write_", "(_", "fp_", ")_", "\\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 ", " _", "if_", "close", "p_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "._", "close_", "(_", ")_", "\\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_", "extra", "ce", "\\u", "files_", "(_", "files_", ",_", "outputfile_", ",_", "opts_", "=_", "None_", ",_", "vars_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "\\u", "py", "\\u", "ext_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "pyg", "ette", "xt", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "opts_", "=_", "opts_", "or_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vars_", "=_", "vars_", "or_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "py", "\\u", "ext_", "=_", "[_", "'.", "py", "'_", ",_", "'.", "ini", "'_", ",_", "'.", "html", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "constants_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "GN", "U_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SOL", "ARI", "S_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "defaults_", "\\u\\u\\uNL\\u\\u\\u_", "extracta", "ll_", "=_", "0_", "#", " ", "FIX", "ME", ":", " ", "currentl", "y", " ", "this", " ", "option", " ", "has", " ", "no", " ", "effect", " ", "at", " ", "all", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "escape_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keywords_", "=_", "[_", "'\\u'_", ",_", "'", "gettext", "'_", ",_", "'", "nge", "ttext", "'_", ",_", "'", "unge", "ttext", "'_", ",_", "'", "uge", "ttext", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outpath_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outfile_", "=_", "outputfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "locations_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "location", "style_", "=_", "GN", "U_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verbose_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "width_", "=_", "78_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exclu", "def", "ilename_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "docstrings", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nod", "ocs", "tring", "s_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toe", "xc", "lud", "e_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "=_", "Options_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "make", "\\u", "escape", "s", "(", "options", ".", "escape", ")_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "._", "keywords_", "._", "extend_", "(_", "default", "\\u", "keywords_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "opts_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "v_", "and_", "hasattr_", "(_", "options_", ",_", "k_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "v_", "=_", "getattr_", "(_", "options_", ",_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "\\u", "v_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "v_", "._", "extend_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "\\u", "v_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "v_", "._", "update_", "(_", "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 ", " _", "setattr_", "(_", "options_", ",_", "k_", ",_", "v_", ")_", "\\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_", "isinstance_", "(_", "files_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "files_", "=_", "get", "Files", "For", "Name_", "(_", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "eat", "er_", "=_", "Token", "Ea", "ter_", "(_", "options_", ",_", "vars_", "=_", "vars_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "filename_", "in_", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "options_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Work", "ing", " ", "on", " ", "%", "s", "'_", ")_", "%_", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "filename_", ")_", ":_", "\\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_", "filename_", "._", "endswith_", "(_", "'.", "html", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "uli", "web_", "._", "core_", "import_", "template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "c", "String", "IO_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "uli", "web_", "._", "core_", "._", "template_", "import_", "template", "\\u", "file", "\\u", "py_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "template", "\\u", "file", "\\u", "py_", "(_", "filename_", ",_", "skip", "\\u", "extern", "_", "=_", "True_", ",_", "log_", "=_", "log_", ",_", "multiline", "s_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fp_", "=_", "String", "IO_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "close", "p_", "=_", "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 ", " _", "fp_", "=_", "open_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "close", "p_", "=_", "1_", "\\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 ", " _", "eat", "er_", "._", "set\\u", "filename_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tokenize_", "._", "tokenize_", "(_", "fp_", "._", "readline_", ",_", "eat", "er_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "tokenize_", "._", "Token", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'%", "s", ":", " ", "%", "s", ",", " ", "line", " ", "%", "d", ",", " ", "column", " ", "%", "d", "'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "e_", "[_", "0_", "]_", ",_", "filename_", ",_", "e_", "[_", "1_", "]_", "[_", "0_", "]_", ",_", "e_", "[_", "1_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "close", "p_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "._", "close_", "(_", ")_", "\\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_", "options_", "._", "outfile_", "==_", "'-'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "=_", "sys_", "._", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "close", "p_", "=_", "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 ", " _", "if_", "options_", "._", "outpath_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "outfile_", "=_", "os_", "._", "path_", "._", "join_", "(_", "options_", "._", "outpath_", ",_", "options_", "._", "outfile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "path_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "options_", "._", "outfile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "path_", ")_", ":_", "\\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 ", " ", "_", "os_", "._", "makedirs_", "(_", "path_", ")_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fp_", "=_", "open_", "(_", "options_", "._", "outfile_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "close", "p_", "=_", "1_", "\\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 ", " _", "eat", "er_", "._", "write_", "(_", "fp_", ")_", "\\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 ", " _", "if_", "close", "p_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 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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 ]
Unused import
radekstepan/FlaskBudget/tests_gui.py
[ { "content": "#!/usr/bin/env python\n\"\"\"\n\nAn enhanced GUI test runner for the PyUnit unit testing framework, derived from\nSteve Purcell's original GUI framework and application shipped with PyUnit.\n\nFor further information, see http://www.path-not-tested.com\n\nCopyright (c) 2010 Jonella Michaylov\nThis module is free software, and you may redistribute it and/or modify\nit under the same terms as Python itself, so long as these copyright messages\nand disclaimers are retained in their original form.\n\n============ Original Copyright Notice and Disclaimer below =================\n\nGUI framework and application for use with Python unit testing framework.\nExecute tests written using the framework provided by the 'unittest' module.\n\nFurther information is available in the bundled documentation, and from\n\n http://pyunit.sourceforge.net/\n\nCopyright (c) 1999, 2000, 2001 Steve Purcell\nThis module is free software, and you may redistribute it and/or modify\nit under the same terms as Python itself, so long as this copyright message\nand disclaimer are retained in their original form.\n\nIN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,\nSPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF\nTHIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGE.\n\nTHE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN \"AS IS\" BASIS,\nAND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,\nSUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n\"\"\"\n\n__author__ = \"Jonella Michaylov ([email protected])\"\n__version__ = \"$Revision: 1.0 $\"\n\n# import tests\nimport tests.users\nimport tests.accounts\nimport tests.income\nimport tests.expenses\n\nimport unittest\nimport sys\nimport Tkinter\nimport tkMessageBox\nimport traceback\nimport threading\nimport Queue\nimport time\n\nimport string\ntk = Tkinter # Alternative to the messy 'from Tkinter import *' often seen\n\n\n##############################################################################\n# GUI framework classes\n##############################################################################\n\n\n\n\n\n\n##############################################################################\n# Tkinter GUI\n##############################################################################\n\n_ABOUT_TEXT=\"\"\"\\\nAn enhanced GUI test runner for the PyUnit unit testing framework.\n\nFor more information, visit http://www.path-not-tested.com/\n\nCopyright (c) 2010 Jonella Michaylov\n<[email protected]>\nbased on the original GUI Test Runner from PyUnit:\nCopyright (c) 2000 Steve Purcell\n<[email protected]>\n\"\"\"\n_HELP_TEXT=\"\"\"\\\nEnter the name of a callable object which, when called, will return a \\\nTestCase or TestSuite. Click 'start', and the test thus produced will be run.\n\nDouble click on an error in the listbox to see more information about it,\\\nincluding the stack trace. Unlike the original GUI test runner in PyUnit, \\\nthe listbox is populated before the tests run, and the test-by-test progress \\\nand results are indicated in real time. \n\nOther improvements over the original include the ability to stop a run, \\\na mode where the run stops on the first error or failure, and some timing information.\n\nFor more information, visit http://www.path-not-tested.com/\n\"\"\"\n\n \n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n if len(sys.argv) == 2:\n main(sys.argv[1])\n else:\n main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class GUITestResult(unittest.TestResult):\n \"\"\"A TestResult that makes callbacks to its associated GUI TestRunner.\n Used by EnhancedGUIRunner. Need not be created directly.\n \"\"\"\n\n\n\n", "metadata": "root.GUITestResult", "header": "['module', '___EOS___']", "index": 66 }, { "content": " def __init__(self, callback):\n unittest.TestResult.__init__(self)\n self.callback = callback", "metadata": "root.GUITestResult.__init__", "header": "['class', 'GUITestResult', '(', 'unittest', '.', 'TestResult', ')', ':', '___EOS___']", "index": 70 }, { "content": " def addError(self, test, err):\n unittest.TestResult.addError(self, test, err)\n self.callback.notifyTestErrored(test, err)", "metadata": "root.GUITestResult.addError", "header": "['class', 'GUITestResult', '(', 'unittest', '.', 'TestResult', ')', ':', '___EOS___']", "index": 74 }, { "content": " def addFailure(self, test, err):\n unittest.TestResult.addFailure(self, test, err)\n self.callback.notifyTestFailed(test, err)", "metadata": "root.GUITestResult.addFailure", "header": "['class', 'GUITestResult', '(', 'unittest', '.', 'TestResult', ')', ':', '___EOS___']", "index": 78 }, { "content": " def stopTest(self, test):\n unittest.TestResult.stopTest(self, test)\n self.callback.notifyTestFinished(test)", "metadata": "root.GUITestResult.stopTest", "header": "['class', 'GUITestResult', '(', 'unittest', '.', 'TestResult', ')', ':', '___EOS___']", "index": 82 }, { "content": " def startTest(self, test):\n unittest.TestResult.startTest(self, test)\n self.callback.notifyTestStarted(test)", "metadata": "root.GUITestResult.startTest", "header": "['class', 'GUITestResult', '(', 'unittest', '.', 'TestResult', ')', ':', '___EOS___']", "index": 86 }, { "content": "class RollbackImporter:\n \"\"\"This tricky little class is used to make sure that modules under test\n will be reloaded the next time they are imported.\n \"\"\"\n ", "metadata": "root.RollbackImporter", "header": "['module', '___EOS___']", "index": 91 }, { "content": " def __init__(self):\n self.previousModules = sys.modules.copy()", "metadata": "root.RollbackImporter.__init__", "header": "['class', 'RollbackImporter', ':', '___EOS___']", "index": 95 }, { "content": " def rollbackImports(self):\n for modname in sys.modules.keys():\n if not self.previousModules.has_key(modname):\n # Force reload when modname next imported\n del(sys.modules[modname])", "metadata": "root.RollbackImporter.rollbackImports", "header": "['class', 'RollbackImporter', ':', '___EOS___']", "index": 98 }, { "content": "class TestStartedMessage():\n \n ", "metadata": "root.TestStartedMessage", "header": "['module', '___EOS___']", "index": 135 }, { "content": " def __init__(self, test):\n self.test = test\n pass", "metadata": "root.TestStartedMessage.__init__", "header": "['class', 'TestStartedMessage', '(', ')', ':', '___EOS___']", "index": 137 }, { "content": " def __call__(self, receiver):\n receiver.executeTestStarted(self.test)\n pass", "metadata": "root.TestStartedMessage.__call__", "header": "['class', 'TestStartedMessage', '(', ')', ':', '___EOS___']", "index": 141 }, { "content": "class TestFailedMessage():\n \n ", "metadata": "root.TestFailedMessage", "header": "['module', '___EOS___']", "index": 145 }, { "content": " def __init__(self, test, err):\n self.test = test\n self.err = err\n pass", "metadata": "root.TestFailedMessage.__init__", "header": "['class', 'TestFailedMessage', '(', ')', ':', '___EOS___']", "index": 147 }, { "content": " def __call__(self, receiver):\n receiver.executeTestFailed(self.test, self.err)\n pass", "metadata": "root.TestFailedMessage.__call__", "header": "['class', 'TestFailedMessage', '(', ')', ':', '___EOS___']", "index": 152 }, { "content": "class TestErroredMessage():\n \n ", "metadata": "root.TestErroredMessage", "header": "['module', '___EOS___']", "index": 156 }, { "content": " def __init__(self, test, err):\n self.test = test\n self.err = err\n pass", "metadata": "root.TestErroredMessage.__init__", "header": "['class', 'TestErroredMessage', '(', ')', ':', '___EOS___']", "index": 158 }, { "content": " def __call__(self, receiver):\n receiver.executeTestErrored(self.test, self.err)\n pass", "metadata": "root.TestErroredMessage.__call__", "header": "['class', 'TestErroredMessage', '(', ')', ':', '___EOS___']", "index": 163 }, { "content": "class TestFinishedMessage():\n \n ", "metadata": "root.TestFinishedMessage", "header": "['module', '___EOS___']", "index": 167 }, { "content": " def __init__(self, test):\n self.test = test\n pass", "metadata": "root.TestFinishedMessage.__init__", "header": "['class', 'TestFinishedMessage', '(', ')', ':', '___EOS___']", "index": 169 }, { "content": " def __call__(self, receiver):\n receiver.executeTestFinished(self.test)\n pass", "metadata": "root.TestFinishedMessage.__call__", "header": "['class', 'TestFinishedMessage', '(', ')', ':', '___EOS___']", "index": 173 }, { "content": "class StoppedMessage():\n \n ", "metadata": "root.StoppedMessage", "header": "['module', '___EOS___']", "index": 177 }, { "content": " def __init__(self):\n pass", "metadata": "root.StoppedMessage.__init__", "header": "['class', 'StoppedMessage', '(', ')', ':', '___EOS___']", "index": 179 }, { "content": " def __call__(self, receiver):\n receiver.executeStopped()\n pass", "metadata": "root.StoppedMessage.__call__", "header": "['class', 'StoppedMessage', '(', ')', ':', '___EOS___']", "index": 182 }, { "content": "class EnhancedGUIRunner():\n \"\"\"A test runner GUI using Tkinter.\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.EnhancedGUIRunner", "header": "['module', '___EOS___']", "index": 186 }, { "content": " def __init__(self, *args, **kwargs):\n self.currentResult = None\n self.running = 0\n self.rollbackImporter = None\n apply(self.initGUI, args, kwargs)\n self.runClicked()", "metadata": "root.EnhancedGUIRunner.__init__", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 190 }, { "content": " def initGUI(self, root, initialTestName):\n \"\"\"Set up the GUI inside the given root window. The test name entry\n field will be pre-filled with the given initialTestName.\n \"\"\"\n self.root = root\n # Set up values that will be tied to widgets\n self.suiteNameVar = tk.StringVar()\n self.suiteNameVar.set(initialTestName)\n self.statusVar = tk.StringVar()\n self.statusVar.set(\"Idle\")\n self.runCountVar = tk.IntVar()\n self.failCountVar = tk.IntVar()\n self.errorCountVar = tk.IntVar()\n self.remainingCountVar = tk.IntVar()\n self.stopOnErrorVar = tk.IntVar()\n self.elapsedVar = tk.StringVar()\n self.elapsedVar.set(\"0:00\")\n self.averageVar = tk.StringVar()\n self.averageVar.set(\"0:00\")\n self.top = tk.Frame()\n self.top.pack(fill=tk.BOTH, expand=1)\n self.createWidgets()\n self.queue = Queue.Queue()\n self.currentTestIndex = 0", "metadata": "root.EnhancedGUIRunner.initGUI", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 197 }, { "content": " def runClicked(self):\n \"To be called in response to user choosing to run a test\"\n if self.running: return\n self.running = 1 \n self.currentTestIndex = 0\n while self.errorListbox.size():\n self.errorListbox.delete(0)\n testName = self.getSelectedTestName()\n if not testName:\n self.errorDialog(\"Test name entry\", \"You must enter a test name\")\n return\n if self.rollbackImporter:\n self.rollbackImporter.rollbackImports()\n self.rollbackImporter = RollbackImporter()\n try:\n self.test = unittest.defaultTestLoader.loadTestsFromName(testName)\n except:\n exc_type, exc_value, exc_tb = sys.exc_info()\n apply(traceback.print_exception,sys.exc_info())\n self.errorDialog(\"Unable to run test '%s'\" % testName,\n \"Error loading specified test: %s, %s\" % \\\n (exc_type, exc_value))\n return\n self.showtests(self.test)\n self.currentResult = GUITestResult(self)\n self.totalTests = self.test.countTestCases()\n self.notifyRunning()\n self.thread1 = threading.Thread(target=self.bgRunner)\n self.thread1.start()\n self.theLoop()", "metadata": "root.EnhancedGUIRunner.runClicked", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 223 }, { "content": " def showtests(self, x):\n if isinstance(x, unittest.TestCase):\n print x.id()\n self.errorListbox.insert(Tkinter.END, x.id())\n #tk.Label(self.testFrame, text=x.id()).pack() \n elif isinstance(x, unittest.TestSuite):\n for thing in x._tests:\n self.showtests(thing) ", "metadata": "root.EnhancedGUIRunner.showtests", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 254 }, { "content": " def bgRunner(self): \n print \"start thread\"\n print \"actually running\"\n self.test.run(self.currentResult)\n print \"done running\"\n self.notifyStopped()\n pass", "metadata": "root.EnhancedGUIRunner.bgRunner", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 263 }, { "content": " def stopClicked(self):\n \"To be called in response to user stopping the running of a test\"\n if self.currentResult:\n self.currentResult.stop()\n print \"processed a user stop\"\n self.stopGoButton.config(state=tk.DISABLED)", "metadata": "root.EnhancedGUIRunner.stopClicked", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 271 }, { "content": " def theLoop(self):\n if self.running:\n soFar = time.clock() - self.runStartTime\n self.elapsedVar.set(time.strftime(\"%M:%S\", \n time.localtime(soFar)))\n while self.queue.qsize():\n try:\n print \"getting message\"\n msg = self.queue.get(0)\n # Check contents of message and do what it says\n # As a test, we simply print it\n msg(self)\n self.top.update()\n except Queue.Empty:\n pass\n self.top.after(100, self.theLoop) ", "metadata": "root.EnhancedGUIRunner.theLoop", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 279 }, { "content": " def createWidgets(self):\n \"\"\"Creates and packs the various widgets.\n \n Why is it that GUI code always ends up looking a mess, despite all the\n best intentions to keep it tidy? Answers on a postcard, please.\n \"\"\"\n # Status bar\n statusFrame = tk.Frame(self.top, relief=tk.SUNKEN, borderwidth=2)\n statusFrame.pack(anchor=tk.SW, fill=tk.X, side=tk.BOTTOM)\n tk.Label(statusFrame, textvariable=self.statusVar).pack(side=tk.LEFT)\n\n rightFrame = tk.Frame(self.top, borderwidth=3)\n rightFrame.pack(fill=tk.BOTH, side=tk.LEFT, anchor=tk.NW, expand=1)\n\n # Area to enter name of test to run\n suiteNameFrame = tk.Frame(rightFrame, borderwidth=3)\n suiteNameFrame.pack(fill=tk.X)\n tk.Label(suiteNameFrame, text=\"Enter test name:\").pack(side=tk.LEFT)\n e = tk.Entry(suiteNameFrame, textvariable=self.suiteNameVar, width=25)\n e.pack(side=tk.LEFT, fill=tk.X, expand=1)\n e.focus_set()\n e.bind('<Key-Return>', lambda e, self=self: self.runClicked())\n\n # stop on error checkbox\n stopOnErrorFrame = tk.Frame(rightFrame, borderwidth=0)\n stopOnErrorFrame.pack(side=tk.TOP, anchor=tk.W)\n stopOnErrorButton = tk.Checkbutton(stopOnErrorFrame, text=\"Stop on first error\", \n variable=self.stopOnErrorVar)\n stopOnErrorButton.pack(side=tk.LEFT, expand=0, anchor=tk.W)\n stopOnErrorButton.toggle()\n\n # Progress bar\n progressFrame = tk.Frame(rightFrame, relief=tk.GROOVE, borderwidth=2)\n progressFrame.pack(fill=tk.X, expand=0, anchor=tk.NW)\n tk.Label(progressFrame, text=\"Progress:\").pack(anchor=tk.W)\n self.progressBar = ProgressBar(progressFrame, relief=tk.SUNKEN,\n borderwidth=2)\n self.progressBar.pack(fill=tk.X, expand=1)\n\n # Area with buttons to start/stop tests and quit\n buttonFrame = tk.Frame(self.top, borderwidth=3)\n buttonFrame.pack(side=tk.LEFT, anchor=tk.NW, fill=tk.Y)\n self.stopGoButton = tk.Button(buttonFrame, text=\"Start\",\n command=self.runClicked)\n self.stopGoButton.pack(fill=tk.X)\n tk.Button(buttonFrame, text=\"Close\",\n command=self.top.quit).pack(side=tk.BOTTOM, fill=tk.X)\n tk.Button(buttonFrame, text=\"About\",\n command=self.showAboutDialog).pack(side=tk.BOTTOM, fill=tk.X)\n tk.Button(buttonFrame, text=\"Help\",\n command=self.showHelpDialog).pack(side=tk.BOTTOM, fill=tk.X)\n\n # Area with labels reporting results\n countFrame = tk.Frame(progressFrame, borderwidth=2)\n countFrame.pack(fill=tk.X, expand=1) \n for label, var in (('Run:', self.runCountVar),\n ('Failures:', self.failCountVar),\n ('Errors:', self.errorCountVar),\n ('Remaining:', self.remainingCountVar)\n ):\n tk.Label(countFrame, text=label).pack(side=tk.LEFT)\n tk.Label(countFrame, textvariable=var,\n foreground=\"blue\").pack(side=tk.LEFT, fill=tk.X,\n expand=1, anchor=tk.W)\n \n timeFrame = tk.Frame(progressFrame, borderwidth=2)\n timeFrame.pack(fill=tk.X, expand=1) \n for label, var in (('Elapsed time:', self.elapsedVar),\n ('Average time:', self.averageVar)\n ):\n tk.Label(timeFrame, text=label).pack(side=tk.LEFT)\n tk.Label(timeFrame, textvariable=var,\n foreground=\"blue\").pack(side=tk.LEFT, fill=tk.X,\n expand=1, anchor=tk.W)\n\n\n # List box showing errors and failures\n tk.Label(rightFrame, text=\"Detailed progress:\").pack(anchor=tk.W)\n listFrame = tk.Frame(rightFrame, relief=tk.SUNKEN, borderwidth=2)\n listFrame.grid_rowconfigure(0, weight=1)\n listFrame.grid_columnconfigure(0, weight=1)\n\n \n self.errorListbox = tk.Listbox(listFrame, foreground='black',\n selectmode=tk.SINGLE,\n selectborderwidth=0,\n width='50')\n self.errorListbox.grid(row=0, column=0, sticky=tk.N+tk.S+tk.E+tk.W)\n\n #self.errorListbox.pack(side=tk.LEFT, fill=tk.BOTH, expand=1,\n # anchor=tk.NW)\n listVScroll = tk.Scrollbar(listFrame, command=self.errorListbox.yview)\n listVScroll.grid(row=0, column=1, sticky=tk.N+tk.S)\n\n #listVScroll.pack(side=tk.LEFT, fill=tk.Y, anchor=tk.N)\n listHScroll = tk.Scrollbar(listFrame, command=self.errorListbox.xview,\n orient=Tkinter.HORIZONTAL)\n listHScroll.grid(row=1, column=0, sticky=tk.E+tk.W)\n\n #listHScroll.pack(side=tk.BOTTOM, fill=tk.X, anchor=tk.N)\n self.errorListbox.bind(\"<Double-1>\",\n lambda e, self=self: self.showSelectedError())\n self.errorListbox.configure(yscrollcommand=listVScroll.set)\n self.errorListbox.configure(xscrollcommand=listHScroll.set)\n listFrame.pack(fill=tk.BOTH, expand=1)", "metadata": "root.EnhancedGUIRunner.createWidgets", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 296 }, { "content": " def getSelectedTestName(self):\n return self.suiteNameVar.get()", "metadata": "root.EnhancedGUIRunner.getSelectedTestName", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 402 }, { "content": " def errorDialog(self, title, message):\n tkMessageBox.showerror(parent=self.root, title=title,\n message=message)", "metadata": "root.EnhancedGUIRunner.errorDialog", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 405 }, { "content": " def notifyRunning(self):\n self.runStartTime = time.clock()\n self.runCountVar.set(0)\n self.failCountVar.set(0)\n self.errorCountVar.set(0)\n self.elapsedVar.set(\"0:00\")\n self.averageVar.set(\"0:00\")\n self.remainingCountVar.set(self.totalTests)\n self.errorInfo = []\n #while self.errorListbox.size():\n # self.errorListbox.delete(0)\n #Stopping seems not to work, so simply disable the start button\n self.stopGoButton.config(command=self.stopClicked, text=\"Stop\")\n #self.stopGoButton.config(state=tk.DISABLED)\n self.progressBar.setProgressFraction(0.0)\n self.top.update_idletasks()", "metadata": "root.EnhancedGUIRunner.notifyRunning", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 409 }, { "content": " def notifyStopped(self):\n self.queue.put(StoppedMessage())\n pass", "metadata": "root.EnhancedGUIRunner.notifyStopped", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 426 }, { "content": " def executeStopped(self):\n print \"got a stop\"\n self.stopGoButton.config(state=tk.ACTIVE)\n self.stopGoButton.config(command=self.runClicked, text=\"Start\")\n self.statusVar.set(\"Idle\")\n self.top.update_idletasks()\n self.running = 0\n pass", "metadata": "root.EnhancedGUIRunner.executeStopped", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 430 }, { "content": " def notifyTestStarted(self, test):\n self.queue.put(TestStartedMessage(test))\n pass", "metadata": "root.EnhancedGUIRunner.notifyTestStarted", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 439 }, { "content": " def setDisplayStatus(self, position, status):\n str = self.errorListbox.get(position)\n parts = str.split(': ', 1)\n if len(parts) == 2:\n if parts[0] == 'FAILED' or parts[0] == 'ERROR':\n return\n else:\n str = parts[1]\n str = status + ': ' + str\n self.errorListbox.insert(position, str)\n self.errorListbox.delete(position + 1)\n if status == 'RUNNING':\n self.errorListbox.itemconfig(position, fg='blue')\n elif status == 'FAILED':\n self.errorListbox.itemconfig(position, fg='red')\n elif status == 'ERROR':\n self.errorListbox.itemconfig(position, fg='red')\n elif status == 'SUCCESS':\n self.errorListbox.itemconfig(position, fg='darkgreen')\n if position > 0:\n self.errorListbox.select_clear(position-1)\n self.errorListbox.select_set(position)\n self.errorListbox.see(min(position+4, self.errorListbox.size()) )\n pass", "metadata": "root.EnhancedGUIRunner.setDisplayStatus", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 443 }, { "content": " def executeTestStarted(self, test):\n self.statusVar.set(str(test))\n self.setDisplayStatus(self.currentTestIndex, 'RUNNING')\n self.top.update_idletasks()\n pass", "metadata": "root.EnhancedGUIRunner.executeTestStarted", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 468 }, { "content": " def notifyTestFailed(self, test, err):\n if self.stopOnErrorVar.get() == 1:\n self.currentResult.stop()\n self.queue.put(TestFailedMessage(test, err))\n pass", "metadata": "root.EnhancedGUIRunner.notifyTestFailed", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 474 }, { "content": " def executeTestFailed(self, test, err):\n self.failCountVar.set(1 + self.failCountVar.get())\n #self.errorListbox.insert(tk.END, \"Failure: %s\" % test)\n self.errorInfo.append((test,err))\n self.setDisplayStatus(self.currentTestIndex, 'FAILED')\n pass", "metadata": "root.EnhancedGUIRunner.executeTestFailed", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 480 }, { "content": " def notifyTestErrored(self, test, err):\n if self.stopOnErrorVar.get() == 1:\n self.currentResult.stop()\n self.queue.put(TestErroredMessage(test, err))\n pass", "metadata": "root.EnhancedGUIRunner.notifyTestErrored", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 487 }, { "content": " def executeTestErrored(self, test, err):\n self.errorCountVar.set(1 + self.errorCountVar.get())\n #self.errorListbox.insert(tk.END, \"Error: %s\" % test)\n self.errorInfo.append((test,err))\n self.setDisplayStatus(self.currentTestIndex, 'ERROR')\n pass", "metadata": "root.EnhancedGUIRunner.executeTestErrored", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 493 }, { "content": " def notifyTestFinished(self, test):\n self.queue.put(TestFinishedMessage(test))\n pass", "metadata": "root.EnhancedGUIRunner.notifyTestFinished", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 500 }, { "content": " def executeTestFinished(self, test):\n self.remainingCountVar.set(self.remainingCountVar.get() - 1)\n self.runCountVar.set(1 + self.runCountVar.get())\n fractionDone = float(self.runCountVar.get())/float(self.totalTests)\n fillColor = (self.errorCountVar.get() > 0 or self.failCountVar.get() > 0) \\\n and \"red\" or \"darkgreen\"\n self.progressBar.setProgressFraction(fractionDone, fillColor)\n soFar = time.clock() - self.runStartTime\n self.averageVar.set(time.strftime(\"%M:%S\", \n time.localtime(soFar / self.runCountVar.get())))\n self.setDisplayStatus(self.currentTestIndex, 'SUCCESS')\n if self.currentTestIndex >= len(self.errorInfo):\n # no error, so pad the error list for this test\n self.errorInfo.append((test,None))\n self.currentTestIndex = self.currentTestIndex + 1\n pass", "metadata": "root.EnhancedGUIRunner.executeTestFinished", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 504 }, { "content": " def showAboutDialog(self):\n tkMessageBox.showinfo(parent=self.root, title=\"About PyUnit Enhanced Runner\",\n message=_ABOUT_TEXT)", "metadata": "root.EnhancedGUIRunner.showAboutDialog", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 521 }, { "content": " def showHelpDialog(self):\n tkMessageBox.showinfo(parent=self.root, title=\"PyUnit Enhanced Runner help\",\n message=_HELP_TEXT)", "metadata": "root.EnhancedGUIRunner.showHelpDialog", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 525 }, { "content": " def showSelectedError(self):\n selection = self.errorListbox.curselection()\n if not selection: return\n selected = int(selection[0])\n txt = self.errorListbox.get(selected)\n window = tk.Toplevel(self.root)\n window.title(txt)\n window.protocol('WM_DELETE_WINDOW', window.quit)\n if selected < len(self.errorInfo):\n test, error = self.errorInfo[selected]\n tk.Label(window, text=str(test),\n foreground=(error is None) and \"darkgreen\" or \"red\", \n justify=tk.LEFT).pack(anchor=tk.W)\n if error is None:\n tk.Label(window, text='Test succeeded!', justify=tk.LEFT).pack()\n else:\n tracebackLines = apply(traceback.format_exception, error + (10,))\n tracebackText = string.join(tracebackLines,'')\n tk.Label(window, text=tracebackText, justify=tk.LEFT).pack()\n else:\n tk.Label(window, text='Test has not been executed!', justify=tk.LEFT).pack()\n tk.Button(window, text=\"Close\",\n command=window.quit).pack(side=tk.BOTTOM)\n window.bind('<Key-Return>', lambda e, w=window: w.quit())\n window.mainloop()\n window.destroy()", "metadata": "root.EnhancedGUIRunner.showSelectedError", "header": "['class', 'EnhancedGUIRunner', '(', ')', ':', '___EOS___']", "index": 529 }, { "content": "class ProgressBar(tk.Frame):\n \"\"\"A simple progress bar that shows a percentage progress in\n the given colour.\"\"\"\n\n\n ", "metadata": "root.ProgressBar", "header": "['module', '___EOS___']", "index": 557 }, { "content": " def __init__(self, *args, **kwargs):\n apply(tk.Frame.__init__, (self,) + args, kwargs)\n self.canvas = tk.Canvas(self, height='20', width='60',\n background='white', borderwidth=3)\n self.canvas.pack(fill=tk.X, expand=1)\n self.rect = self.text = None\n self.canvas.bind('<Configure>', self.paint)\n self.setProgressFraction(0.0)", "metadata": "root.ProgressBar.__init__", "header": "['class', 'ProgressBar', '(', 'tk', '.', 'Frame', ')', ':', '___EOS___']", "index": 561 }, { "content": " def setProgressFraction(self, fraction, color='blue'):\n self.fraction = fraction\n self.color = color\n self.paint()\n self.canvas.update_idletasks()", "metadata": "root.ProgressBar.setProgressFraction", "header": "['class', 'ProgressBar', '(', 'tk', '.', 'Frame', ')', ':', '___EOS___']", "index": 570 }, { "content": " def paint(self, *args):\n totalWidth = self.canvas.winfo_width()\n width = int(self.fraction * float(totalWidth))\n height = self.canvas.winfo_height()\n if self.rect is not None: self.canvas.delete(self.rect)\n if self.text is not None: self.canvas.delete(self.text)\n self.rect = self.canvas.create_rectangle(0, 0, width, height,\n fill=self.color)\n percentString = \"%3.0f%%\" % (100.0 * self.fraction)\n self.text = self.canvas.create_text(totalWidth/2, height/2,\n anchor=tk.CENTER,\n text=percentString)", "metadata": "root.ProgressBar.paint", "header": "['class', 'ProgressBar', '(', 'tk', '.', 'Frame', ')', ':', '___EOS___']", "index": 576 }, { "content": "def main(initialTestName=\"\"):\n root = tk.Tk()\n root.title(\"PyUnit Enhanced Runner\")\n runner = EnhancedGUIRunner(root, initialTestName)\n root.protocol('WM_DELETE_WINDOW', root.quit)\n root.mainloop()", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 589 } ]
[ { "span": "import tests.users", "start_line": 43, "start_column": 0, "end_line": 43, "end_column": 18 }, { "span": "import tests.accounts", "start_line": 44, "start_column": 0, "end_line": 44, "end_column": 21 }, { "span": "import tests.income", "start_line": 45, "start_column": 0, "end_line": 45, "end_column": 19 }, { "span": "import tests.expenses", "start_line": 46, "start_column": 0, "end_line": 46, "end_column": 21 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "\\", "10", ";", "An", " ", "enhance", "d", " ", "GU", "I", " ", "test", " ", "runn", "er", " ", "for", " ", "the", " ", "Py", "Unit", " ", "unit", " ", "testi", "ng", " ", "frame", "work", ",", " ", "derive", "d", " ", "from", "\\", "10", ";", "Ste", "ve", " ", "Pur", "cell", "'", "s", " ", "original", " ", "GU", "I", " ", "frame", "work", " ", "and", " ", "applica", "tion", " ", "ship", "ped", " ", "with", " ", "Py", "Unit", ".", "\\", "10", ";", "\\", "10", ";", "For", " ", "fur", "ther", " ", "informati", "on", ",", " ", "see", " ", "http", "://", "www", ".", "path", "-", "not", "-", "tested", ".", "com", "\\", "10", ";", "\\", "10", ";", "Copy", "right", " ", "(", "c", ")", " ", "2010", " ", "Jon", "ella", " ", "Mich", "ay", "lo", "v", "\\", "10", ";", "Thi", "s", " ", "module", " ", "is", " ", "free", " ", "software", ",", " ", "and", " ", "you", " ", "may", " ", "redis", "tribut", "e", " ", "it", " ", "and", "/", "or", " ", "modif", "y", "\\", "10", ";", "it", " ", "under", " ", "the", " ", "same", " ", "term", "s", " ", "as", " ", "Pyth", "on", " ", "its", "elf", ",", " ", "so", " ", "long", " ", "as", " ", "these", " ", "copyr", "ight", " ", "message", "s", "\\", "10", ";", "and", " ", "discl", "aime", "rs", " ", "are", " ", "retained", " ", "in", " ", "thei", "r", " ", "original", " ", "form", ".", "\\", "10", ";", "\\", "10", ";", "============", " ", "Origina", "l", " ", "Copy", "right", " ", "Noti", "ce", " ", "and", " ", "Disc", "lai", "mer", " ", "belo", "w", " ", "==============", "===", "\\", "10", ";", "\\", "10", ";", "GU", "I", " ", "frame", "work", " ", "and", " ", "applica", "tion", " ", "for", " ", "use", " ", "with", " ", "Pyth", "on", " ", "unit", " ", "testi", "ng", " ", "frame", "work", ".", "\\", "10", ";", "Execut", "e", " ", "tests", " ", "writt", "en", " ", "usi", "ng", " ", "the", " ", "frame", "work", " ", "provided", " ", "by", " ", "the", " ", "'", "unittest", "'", " ", "module", ".", "\\", "10", ";", "\\", "10", ";", "Fur", "ther", " ", "informati", "on", " ", "is", " ", "avail", "able", " ", "in", " ", "the", " ", "bundle", "d", " ", "documentation", ",", " ", "and", " ", "from", "\\", "10", ";", "\\", "10", ";", " ", " ", "http", "://", "pyu", "nit", ".", "sourcef", "org", "e", ".", "net", "/", "\\", "10", ";", "\\", "10", ";", "Copy", "right", " ", "(", "c", ")", " ", "1999", ",", " ", "2000", ",", " ", "200", "1", " ", "Ste", "ve", " ", "Pur", "cell", "\\", "10", ";", "Thi", "s", " ", "module", " ", "is", " ", "free", " ", "software", ",", " ", "and", " ", "you", " ", "may", " ", "redis", "tribut", "e", " ", "it", " ", "and", "/", "or", " ", "modif", "y", "\\", "10", ";", "it", " ", "under", " ", "the", " ", "same", " ", "term", "s", " ", "as", " ", "Pyth", "on", " ", "its", "elf", ",", " ", "so", " ", "long", " ", "as", " ", "this", " ", "copyr", "ight", " ", "message", "\\", "10", ";", "and", " ", "discl", "aime", "r", " ", "are", " ", "retained", " ", "in", " ", "thei", "r", " ", "original", " ", "form", ".", "\\", "10", ";", "\\", "10", ";", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "AUTHOR", " ", "BE", " ", "LI", "AB", "LE", " ", "TO", " ", "ANY", " ", "PART", "Y", " ", "FOR", " ", "DIRECT", ",", " ", "INDI", "RECT", ",", "\\", "10", ";", "SPECIAL", ",", " ", "INC", "IDENT", "AL", ",", " ", "OR", " ", "CONS", "EQU", "ENTI", "AL", " ", "DA", "MAGE", "S", " ", "ARI", "SIN", "G", " ", "OUT", " ", "OF", " ", "THE", " ", "USE", " ", "OF", "\\", "10", ";", "THIS", " ", "CODE", ",", " ", "EVE", "N", " ", "IF", " ", "THE", " ", "AUTHOR", " ", "HAS", " ", "BE", "EN", " ", "ADV", "ISE", "D", " ", "OF", " ", "THE", " ", "POS", "SIB", "ILI", "TY", " ", "OF", " ", "SUC", "H", "\\", "10", ";", "DA", "MAGE", ".", "\\", "10", ";", "\\", "10", ";", "THE", " ", "AUTHOR", " ", "SPECIFI", "CALL", "Y", " ", "DISC", "LAI", "MS", " ", "ANY", " ", "WAR", "RAN", "TIES", ",", " ", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", "\\", "10", ";", "LIMIT", "ED", " ", "TO", ",", " ", "THE", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "AND", " ", "FIT", "NESS", " ", "FOR", " ", "A", "\\", "10", ";", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", ".", " ", " ", "THE", " ", "CODE", " ", "PROVI", "DED", " ", "HER", "EU", "NDE", "R", " ", "IS", " ", "ON", " ", "AN", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",", "\\", "10", ";", "AND", " ", "THER", "E", " ", "IS", " ", "NO", " ", "OB", "LIG", "ATION", " ", "WH", "ATS", "OE", "VER", " ", "TO", " ", "PROVI", "DE", " ", "MAIN", "TEN", "ANCE", ",", "\\", "10", ";", "SUPPORT", ",", " ", "UPDATE", "S", ",", " ", "EN", "HAN", "CE", "MENT", "S", ",", " ", "OR", " ", "MODI", "FICATION", "S", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "author\\u\\u_", "=_", "\"", "Jon", "ella", " ", "Mich", "ay", "lo", "v", " ", "(", "admin", "@", "path", "-", "not", "-", "tested", ".", "com", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "version\\u\\u_", "=_", "\"$", "Revi", "sion", ":", " ", "1.0", " ", "$\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "import", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "tests_", "._", "users_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tests_", "._", "accounts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tests_", "._", "income", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tests_", "._", "expense", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Tkinter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tk", "Messag", "e", "Box_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "threading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tk_", "=_", "Tkinter_", "#", " ", "Alternative", " ", "to", " ", "the", " ", "mess", "y", " ", "'", "from", " ", "Tk", "inter", " ", "import", " ", "*'", " ", "oft", "en", " ", "seen_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "GU", "I", " ", "frame", "work", " ", "classes_", "\\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\\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_", "#", " ", "Tk", "inter", " ", "GUI_", "\\u\\u\\uNL\\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\\u\\uDEDENT\\u\\u\\u_", "\\u", "ABO", "UT\\u", "TEXT_", "=_", "\"\"\"", "\\\\", "\\", "10", ";", "An", " ", "enhance", "d", " ", "GU", "I", " ", "test", " ", "runn", "er", " ", "for", " ", "the", " ", "Py", "Unit", " ", "unit", " ", "testi", "ng", " ", "frame", "work", ".", "\\", "10", ";", "\\", "10", ";", "For", " ", "more", " ", "informati", "on", ",", " ", "visit", " ", "http", "://", "www", ".", "path", "-", "not", "-", "tested", ".", "com", "/", "\\", "10", ";", "\\", "10", ";", "Copy", "right", " ", "(", "c", ")", " ", "2010", " ", "Jon", "ella", " ", "Mich", "ay", "lo", "v", "\\", "10", ";<", "admin", "@", "path", "-", "not", "-", "tested", ".", "com", ">", "\\", "10", ";", "based", " ", "on", " ", "the", " ", "original", " ", "GU", "I", " ", "Test", " ", "Run", "ner", " ", "from", " ", "Py", "Unit", ":", "\\", "10", ";", "Copy", "right", " ", "(", "c", ")", " ", "2000", " ", "Ste", "ve", " ", "Pur", "cell", "\\", "10", ";<", "step", "hen", "\\u", "pur", "cell", "@", "ya", "hoo", ".", "com", ">", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "HELP", "\\u", "TEXT_", "=_", "\"\"\"", "\\\\", "\\", "10", ";", "Enter", " ", "the", " ", "name", " ", "of", " ", "a", " ", "calla", "ble", " ", "object", " ", "whi", "ch", ",", " ", "whe", "n", " ", "call", "ed", ",", " ", "will", " ", "return", " ", "a", " ", "\\\\", "\\", "10", ";", "Test", "Case", " ", "or", " ", "Test", "Suit", "e", ".", " ", "Click", " ", "'", "start", "',", " ", "and", " ", "the", " ", "test", " ", "thu", "s", " ", "produce", "d", " ", "will", " ", "be", " ", "run", ".", "\\", "10", ";", "\\", "10", ";", "Doub", "le", " ", "click", " ", "on", " ", "an", " ", "error", " ", "in", " ", "the", " ", "list", "box", " ", "to", " ", "see", " ", "more", " ", "informati", "on", " ", "abo", "ut", " ", "it", ",\\\\", "\\", "10", ";", "inclu", "ding", " ", "the", " ", "stack", " ", "trace", ".", " ", "Unli", "ke", " ", "the", " ", "original", " ", "GU", "I", " ", "test", " ", "runn", "er", " ", "in", " ", "Py", "Unit", ",", " ", "\\\\", "\\", "10", ";", "the", " ", "list", "box", " ", "is", " ", "populate", "d", " ", "bef", "ore", " ", "the", " ", "tests", " ", "run", ",", " ", "and", " ", "the", " ", "test", "-", "by", "-", "test", " ", "progress", " ", "\\\\", "\\", "10", ";", "and", " ", "results", " ", "are", " ", "indicat", "ed", " ", "in", " ", "real", " ", "time", ".", " ", "\\", "10", ";", "\\", "10", ";", "Ot", "her", " ", "improvement", "s", " ", "over", " ", "the", " ", "original", " ", "include", " ", "the", " ", "abilit", "y", " ", "to", " ", "stop", " ", "a", " ", "run", ",", " ", "\\\\", "\\", "10", ";", "a", " ", "mode", " ", "where", " ", "the", " ", "run", " ", "stop", "s", " ", "on", " ", "the", " ", "first", " ", "error", " ", "or", " ", "fail", "ure", ",", " ", "and", " ", "some", " ", "tim", "ing", " ", "informati", "on", ".", "\\", "10", ";", "\\", "10", ";", "For", " ", "more", " ", "informati", "on", ",", " ", "visit", " ", "http", "://", "www", ".", "path", "-", "not", "-", "tested", ".", "com", "/", "\\", "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\\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_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "sys_", "._", "argv_", ")_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "main_", "(_", "sys_", "._", "argv_", "[_", "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 ", " _", "main_", "(_", ")_", "\\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_", "GU", "IT", "est", "Result_", "(_", "unittest_", "._", "Test", "Result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "Test", "Result", " ", "tha", "t", " ", "make", "s", " ", "callback", "s", " ", "to", " ", "its", " ", "associate", "d", " ", "GU", "I", " ", "Test", "Run", "ner", ".", "\\", "10", ";", " ", " ", " ", " ", "Us", "ed", " ", "by", " ", "Enhance", "d", "GU", "IR", "unne", "r", ".", " ", "Ne", "ed", " ", "not", " ", "be", " ", "created", " ", "direct", "ly", ".", "\\", "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_", "[SEP]_", "class_", "GU", "IT", "est", "Result_", "(_", "unittest_", "._", "Test", "Result_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "callback_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "Test", "Result_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "callback_", "=_", "callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GU", "IT", "est", "Result_", "(_", "unittest_", "._", "Test", "Result_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Error_", "(_", "self_", ",_", "test_", ",_", "err_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "Test", "Result_", "._", "add", "Error_", "(_", "self_", ",_", "test_", ",_", "err_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "callback_", "._", "notif", "y", "Test", "Error", "ed_", "(_", "test_", ",_", "err_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GU", "IT", "est", "Result_", "(_", "unittest_", "._", "Test", "Result_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Failure_", "(_", "self_", ",_", "test_", ",_", "err_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "Test", "Result_", "._", "add", "Failure_", "(_", "self_", ",_", "test_", ",_", "err_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "callback_", "._", "notif", "y", "Test", "Failed_", "(_", "test_", ",_", "err_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GU", "IT", "est", "Result_", "(_", "unittest_", "._", "Test", "Result_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "stop", "Test_", "(_", "self_", ",_", "test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "Test", "Result_", "._", "stop", "Test_", "(_", "self_", ",_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "callback_", "._", "notif", "y", "Test", "Finished_", "(_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GU", "IT", "est", "Result_", "(_", "unittest_", "._", "Test", "Result_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "start", "Test_", "(_", "self_", ",_", "test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "Test", "Result_", "._", "start", "Test_", "(_", "self_", ",_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "callback_", "._", "notif", "y", "Test", "Started_", "(_", "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_", "Roll", "back", "Importer_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Thi", "s", " ", "trick", "y", " ", "litt", "le", " ", "class", " ", "is", " ", "used", " ", "to", " ", "make", " ", "sure", " ", "tha", "t", " ", "module", "s", " ", "under", " ", "test", "\\", "10", ";", " ", " ", " ", " ", "will", " ", "be", " ", "reloade", "d", " ", "the", " ", "next", " ", "time", " ", "the", "y", " ", "are", " ", "import", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Roll", "back", "Importer_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "previ", "ous", "Modules_", "=_", "sys_", "._", "modules_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Roll", "back", "Importer_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rollback", "Imports", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "modname_", "in_", "sys_", "._", "modules_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "previ", "ous", "Modules_", "._", "has", "\\u", "key_", "(_", "modname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Force", " ", "relo", "ad", " ", "whe", "n", " ", "mod", "name", " ", "next", " ", "imported_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "(_", "sys_", "._", "modules_", "[_", "modname_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "Start", "ed", "Message_", "(_", ")_", ":_", "\\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", "Start", "ed", "Message_", "(_", ")_", ":_", "\\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_", ",_", "test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "test_", "=_", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Start", "ed", "Message_", "(_", ")_", ":_", "\\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_", ",_", "receiver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "receiver_", "._", "execute", "Test", "Started_", "(_", "self_", "._", "test_", ")_", "\\u\\u\\uNEWLINE\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Fail", "ed", "Message_", "(_", ")_", ":_", "\\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", "Fail", "ed", "Message_", "(_", ")_", ":_", "\\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_", ",_", "test_", ",_", "err_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "test_", "=_", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "err_", "=_", "err_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fail", "ed", "Message_", "(_", ")_", ":_", "\\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_", ",_", "receiver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "receiver_", "._", "execute", "Test", "Failed_", "(_", "self_", "._", "test_", ",_", "self_", "._", "err_", ")_", "\\u\\u\\uNEWLINE\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Error", "ed", "Message_", "(_", ")_", ":_", "\\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", "Error", "ed", "Message_", "(_", ")_", ":_", "\\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_", ",_", "test_", ",_", "err_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "test_", "=_", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "err_", "=_", "err_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Error", "ed", "Message_", "(_", ")_", ":_", "\\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_", ",_", "receiver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "receiver_", "._", "execute", "Test", "Error", "ed_", "(_", "self_", "._", "test_", ",_", "self_", "._", "err_", ")_", "\\u\\u\\uNEWLINE\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Finish", "ed", "Message_", "(_", ")_", ":_", "\\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", "Finish", "ed", "Message_", "(_", ")_", ":_", "\\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_", ",_", "test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "test_", "=_", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Finish", "ed", "Message_", "(_", ")_", ":_", "\\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_", ",_", "receiver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "receiver_", "._", "execute", "Test", "Finished_", "(_", "self_", "._", "test_", ")_", "\\u\\u\\uNEWLINE\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Stopp", "ed", "Message_", "(_", ")_", ":_", "\\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_", "Stopp", "ed", "Message_", "(_", ")_", ":_", "\\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_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stopp", "ed", "Message_", "(_", ")_", ":_", "\\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_", ",_", "receiver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "receiver_", "._", "execute", "Stopp", "ed_", "(_", ")_", "\\u\\u\\uNEWLINE\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "test", " ", "runn", "er", " ", "GU", "I", " ", "usi", "ng", " ", "Tk", "inter", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNE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\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_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "current", "Result_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "running_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rollback", "Importer_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "apply_", "(_", "self_", "._", "init", "GUI_", ",_", "args_", ",_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "run", "Clicked_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "init", "GUI_", "(_", "self_", ",_", "root_", ",_", "initial", "Test", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Set", " ", "up", " ", "the", " ", "GU", "I", " ", "insi", "de", " ", "the", " ", "give", "n", " ", "root", " ", "window", ".", " ", "The", " ", "test", " ", "name", " ", "entry", "\\", "10", ";", " ", " ", " ", " ", "field", " ", "will", " ", "be", " ", "pre", "-", "filled", " ", "with", " ", "the", " ", "give", "n", " ", "initial", "Test", "Name", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "root_", "=_", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Set", " ", "up", " ", "values", " ", "tha", "t", " ", "will", " ", "be", " ", "tied", " ", "to", " ", "widgets_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "suit", "e", "Name", "Var_", "=_", "tk_", "._", "String", "Var_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "suit", "e", "Name", "Var_", "._", "set_", "(_", "initial", "Test", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "status", "Var_", "=_", "tk_", "._", "String", "Var_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "status", "Var_", "._", "set_", "(_", "\"", "Id", "le", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "run", "Count", "Var_", "=_", "tk_", "._", "Int", "Var_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Count", "Var_", "=_", "tk_", "._", "Int", "Var_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error", "Count", "Var_", "=_", "tk_", "._", "Int", "Var_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rema", "inin", "g", "Count", "Var_", "=_", "tk_", "._", "Int", "Var_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stop", "On", "Error", "Var_", "=_", "tk_", "._", "Int", "Var_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ela", "pse", "d", "Var_", "=_", "tk_", "._", "String", "Var_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ela", "pse", "d", "Var_", "._", "set_", "(_", "\"", "0", ":", "00", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "averag", "e", "Var_", "=_", "tk_", "._", "String", "Var_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "averag", "e", "Var_", "._", "set_", "(_", "\"", "0", ":", "00", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "=_", "tk_", "._", "Frame_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "pack_", "(_", "fill_", "=_", "tk_", "._", "BOTH_", ",_", "expand_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "create", "Widgets_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "queue_", "=_", "Queue_", "._", "Queue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "current", "Test", "Index_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run", "Clicked_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "To", " ", "be", " ", "call", "ed", " ", "in", " ", "response", " ", "to", " ", "user", " ", "choo", "sing", " ", "to", " ", "run", " ", "a", " ", "test", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "running_", ":_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "running_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "current", "Test", "Index_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "self_", "._", "error", "Listbox", "_", "._", "size_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error", "Listbox", "_", "._", "delete_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "test", "Name_", "=_", "self_", "._", "get", "Select", "ed", "Test", "Name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "test", "Name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error", "Dialog_", "(_", "\"", "Test", " ", "name", " ", "entry", "\"_", ",_", "\"", "You", " ", "must", " ", "enter", " ", "a", " ", "test", " ", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "rollback", "Importer_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "rollback", "Importer_", "._", "rollback", "Imports", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "rollback", "Importer_", "=_", "Roll", "back", "Importer_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "test_", "=_", "unittest_", "._", "default", "Test", "Loader_", "._", "load", "Test", "s", "Fro", "m", "Name_", "(_", "test", "Name_", ")_", "\\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 ", " _", "exc", "\\u", "type_", ",_", "exc", "\\u", "value_", ",_", "exc", "\\u", "tb_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "apply_", "(_", "traceback_", "._", "print", "\\u", "exception_", ",_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error", "Dialog_", "(_", "\"", "Una", "ble", " ", "to", " ", "run", " ", "test", " ", "'%", "s", "'\"_", "%_", "test", "Name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Error", " ", "load", "ing", " ", "specified", " ", "test", ":", " ", "%", "s", ",", " ", "%", "s", "\"_", "%_", "(_", "exc", "\\u", "type_", ",_", "exc", "\\u", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "showt", "ests", "_", "(_", "self_", "._", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "current", "Result_", "=_", "GU", "IT", "est", "Result_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "total", "Tests_", "=_", "self_", "._", "test_", "._", "count", "Test", "Cases_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "Running_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "thread", "1_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "self_", "._", "bg", "Runner_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "thread", "1_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "the", "Loop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "showt", "ests", "_", "(_", "self_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "x_", ",_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "x_", "._", "id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error", "Listbox", "_", "._", "insert_", "(_", "Tkinter_", "._", "END_", ",_", "x_", "._", "id_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "tk", ".", "Label", "(", "self", ".", "test", "Frame", ",", " ", "text", "=", "x", ".", "id", "())", ".", "pack", "()", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "x_", ",_", "unittest_", "._", "Test", "Suite_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "thing_", "in_", "x_", "._", "\\u", "tests_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "showt", "ests", "_", "(_", "thing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\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_", "bg", "Runner_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "start", " ", "thread", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "actual", "ly", " ", "runn", "ing", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "test_", "._", "run_", "(_", "self_", "._", "current", "Result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "don", "e", " ", "runn", "ing", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "Stopp", "ed_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "stop", "Clicked_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "To", " ", "be", " ", "call", "ed", " ", "in", " ", "response", " ", "to", " ", "user", " ", "stopping", " ", "the", " ", "runn", "ing", " ", "of", " ", "a", " ", "test", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "current", "Result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "current", "Result_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "process", "ed", " ", "a", " ", "user", " ", "stop", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stop", "Go", "Button_", "._", "config_", "(_", "state_", "=_", "tk_", "._", "DISABLED_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\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_", "the", "Loop_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "running_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "so", "Far", "_", "=_", "time_", "._", "clock_", "(_", ")_", "-_", "self_", "._", "run", "Start", "Time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ela", "pse", "d", "Var_", "._", "set_", "(_", "time_", "._", "strftime_", "(_", "\"%", "M", ":", "%", "S", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "localtime_", "(_", "so", "Far", "_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "self_", "._", "queue_", "._", "qsize_", "(_", ")_", ":_", "\\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 ", " ", "_", "print_", "\"", "getti", "ng", " ", "message", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "self_", "._", "queue_", "._", "get_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "content", "s", " ", "of", " ", "message", " ", "and", " ", "do", " ", "what", " ", "it", " ", "say", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "As", " ", "a", " ", "test", ",", " ", "we", " ", "simp", "ly", " ", "print", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "update_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Queue_", "._", "Empty_", ":_", "\\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_", "self_", "._", "top_", "._", "after_", "(_", "100_", ",_", "self_", "._", "the", "Loop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\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_", "create", "Widgets_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "es", " ", "and", " ", "packs", " ", "the", " ", "vari", "ous", " ", "widget", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Wh", "y", " ", "is", " ", "it", " ", "tha", "t", " ", "GU", "I", " ", "code", " ", "alw", "ay", "s", " ", "ends", " ", "up", " ", "look", "ing", " ", "a", " ", "mess", ",", " ", "desp", "ite", " ", "all", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "best", " ", "intent", "ion", "s", " ", "to", " ", "keep", " ", "it", " ", "tidy", "?", " ", "Answer", "s", " ", "on", " ", "a", " ", "postc", "ard", ",", " ", "plea", "se", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Status", " ", "bar_", "\\u\\u\\uNL\\u\\u\\u_", "status", "Frame_", "=_", "tk_", "._", "Frame_", "(_", "self_", "._", "top_", ",_", "relief_", "=_", "tk_", "._", "SUN", "KEN", "_", ",_", "border", "width_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status", "Frame_", "._", "pack_", "(_", "anchor_", "=_", "tk_", "._", "SW", "_", ",_", "fill_", "=_", "tk_", "._", "X_", ",_", "side_", "=_", "tk_", "._", "BOTTOM_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tk_", "._", "Label_", "(_", "status", "Frame_", ",_", "textvariable_", "=_", "self_", "._", "status", "Var_", ")_", "._", "pack_", "(_", "side_", "=_", "tk_", "._", "LEFT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "right", "Frame_", "=_", "tk_", "._", "Frame_", "(_", "self_", "._", "top_", ",_", "border", "width_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "right", "Frame_", "._", "pack_", "(_", "fill_", "=_", "tk_", "._", "BOTH_", ",_", "side_", "=_", "tk_", "._", "LEFT_", ",_", "anchor_", "=_", "tk_", "._", "NW", "_", ",_", "expand_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Area", " ", "to", " ", "enter", " ", "name", " ", "of", " ", "test", " ", "to", " ", "run_", "\\u\\u\\uNL\\u\\u\\u_", "suit", "e", "Name", "Frame_", "=_", "tk_", "._", "Frame_", "(_", "right", "Frame_", ",_", "border", "width_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suit", "e", "Name", "Frame_", "._", "pack_", "(_", "fill_", "=_", "tk_", "._", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tk_", "._", "Label_", "(_", "suit", "e", "Name", "Frame_", ",_", "text_", "=_", "\"", "Enter", " ", "test", " ", "name", ":\"_", ")_", "._", "pack_", "(_", "side_", "=_", "tk_", "._", "LEFT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "=_", "tk_", "._", "Entry_", "(_", "suit", "e", "Name", "Frame_", ",_", "textvariable_", "=_", "self_", "._", "suit", "e", "Name", "Var_", ",_", "width_", "=_", "25_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "._", "pack_", "(_", "side_", "=_", "tk_", "._", "LEFT_", ",_", "fill_", "=_", "tk_", "._", "X_", ",_", "expand_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "._", "foc", "us", "\\u", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "._", "bind_", "(_", "'<", "Key", "-", "Return", ">'_", ",_", "lambda_", "e_", ",_", "self_", "=_", "self_", ":_", "self_", "._", "run", "Clicked_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "stop", " ", "on", " ", "error", " ", "checkbox_", "\\u\\u\\uNL\\u\\u\\u_", "stop", "On", "Error", "Frame_", "=_", "tk_", "._", "Frame_", "(_", "right", "Frame_", ",_", "border", "width_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stop", "On", "Error", "Frame_", "._", "pack_", "(_", "side_", "=_", "tk_", "._", "TOP_", ",_", "anchor_", "=_", "tk_", "._", "W_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stop", "On", "Error", "Button_", "=_", "tk_", "._", "Checkb", "utton_", "(_", "stop", "On", "Error", "Frame_", ",_", "text_", "=_", "\"", "Sto", "p", " ", "on", " ", "first", " ", "error", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variable_", "=_", "self_", "._", "stop", "On", "Error", "Var_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stop", "On", "Error", "Button_", "._", "pack_", "(_", "side_", "=_", "tk_", "._", "LEFT_", ",_", "expand_", "=_", "0_", ",_", "anchor_", "=_", "tk_", "._", "W_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stop", "On", "Error", "Button_", "._", "toggle_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Progres", "s", " ", "bar_", "\\u\\u\\uNL\\u\\u\\u_", "progress", "Frame_", "=_", "tk_", "._", "Frame_", "(_", "right", "Frame_", ",_", "relief_", "=_", "tk_", "._", "GRO", "OV", "E_", ",_", "border", "width_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "progress", "Frame_", "._", "pack_", "(_", "fill_", "=_", "tk_", "._", "X_", ",_", "expand_", "=_", "0_", ",_", "anchor_", "=_", "tk_", "._", "NW", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tk_", "._", "Label_", "(_", "progress", "Frame_", ",_", "text_", "=_", "\"", "Progres", "s", ":\"_", ")_", "._", "pack_", "(_", "anchor_", "=_", "tk_", "._", "W_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "progress", "Bar_", "=_", "Progres", "s", "Bar_", "(_", "progress", "Frame_", ",_", "relief_", "=_", "tk_", "._", "SUN", "KEN", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "border", "width_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "progress", "Bar_", "._", "pack_", "(_", "fill_", "=_", "tk_", "._", "X_", ",_", "expand_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Area", " ", "with", " ", "buttons", " ", "to", " ", "start", "/", "stop", " ", "tests", " ", "and", " ", "quit_", "\\u\\u\\uNL\\u\\u\\u_", "button", "Frame_", "=_", "tk_", "._", "Frame_", "(_", "self_", "._", "top_", ",_", "border", "width_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "button", "Frame_", "._", "pack_", "(_", "side_", "=_", "tk_", "._", "LEFT_", ",_", "anchor_", "=_", "tk_", "._", "NW", "_", ",_", "fill_", "=_", "tk_", "._", "Y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stop", "Go", "Button_", "=_", "tk_", "._", "Button_", "(_", "button", "Frame_", ",_", "text_", "=_", "\"", "Start", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "command_", "=_", "self_", "._", "run", "Clicked_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stop", "Go", "Button_", "._", "pack_", "(_", "fill_", "=_", "tk_", "._", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tk_", "._", "Button_", "(_", "button", "Frame_", ",_", "text_", "=_", "\"", "Clos", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "command_", "=_", "self_", "._", "top_", "._", "quit_", ")_", "._", "pack_", "(_", "side_", "=_", "tk_", "._", "BOTTOM_", ",_", "fill_", "=_", "tk_", "._", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tk_", "._", "Button_", "(_", "button", "Frame_", ",_", "text_", "=_", "\"", "Abo", "ut", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "command_", "=_", "self_", "._", "show", "Abo", "ut", "Dialog_", ")_", "._", "pack_", "(_", "side_", "=_", "tk_", "._", "BOTTOM_", ",_", "fill_", "=_", "tk_", "._", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tk_", "._", "Button_", "(_", "button", "Frame_", ",_", "text_", "=_", "\"", "Help", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "command_", "=_", "self_", "._", "show", "Help", "Dialog_", ")_", "._", "pack_", "(_", "side_", "=_", "tk_", "._", "BOTTOM_", ",_", "fill_", "=_", "tk_", "._", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Area", " ", "with", " ", "labels", " ", "reporting", " ", "results_", "\\u\\u\\uNL\\u\\u\\u_", "count", "Frame_", "=_", "tk_", "._", "Frame_", "(_", "progress", "Frame_", ",_", "border", "width_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count", "Frame_", "._", "pack_", "(_", "fill_", "=_", "tk_", "._", "X_", ",_", "expand_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "label_", ",_", "var_", "in_", "(_", "(_", "'", "Run", ":'_", ",_", "self_", "._", "run", "Count", "Var_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Fail", "ure", "s", ":'_", ",_", "self_", "._", "fail", "Count", "Var_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Error", "s", ":'_", ",_", "self_", "._", "error", "Count", "Var_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Rema", "inin", "g", ":'_", ",_", "self_", "._", "rema", "inin", "g", "Count", "Var_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tk_", "._", "Label_", "(_", "count", "Frame_", ",_", "text_", "=_", "label_", ")_", "._", "pack_", "(_", "side_", "=_", "tk_", "._", "LEFT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tk_", "._", "Label_", "(_", "count", "Frame_", ",_", "textvariable_", "=_", "var_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "foreground_", "=_", "\"", "blue", "\"_", ")_", "._", "pack_", "(_", "side_", "=_", "tk_", "._", "LEFT_", ",_", "fill_", "=_", "tk_", "._", "X_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expand_", "=_", "1_", ",_", "anchor_", "=_", "tk_", "._", "W_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time", "Frame_", "=_", "tk_", "._", "Frame_", "(_", "progress", "Frame_", ",_", "border", "width_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "Frame_", "._", "pack_", "(_", "fill_", "=_", "tk_", "._", "X_", ",_", "expand_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "label_", ",_", "var_", "in_", "(_", "(_", "'", "El", "aps", "ed", " ", "time", ":'_", ",_", "self_", "._", "ela", "pse", "d", "Var_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Average", " ", "time", ":'_", ",_", "self_", "._", "averag", "e", "Var_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tk_", "._", "Label_", "(_", "time", "Frame_", ",_", "text_", "=_", "label_", ")_", "._", "pack_", "(_", "side_", "=_", "tk_", "._", "LEFT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tk_", "._", "Label_", "(_", "time", "Frame_", ",_", "textvariable_", "=_", "var_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "foreground_", "=_", "\"", "blue", "\"_", ")_", "._", "pack_", "(_", "side_", "=_", "tk_", "._", "LEFT_", ",_", "fill_", "=_", "tk_", "._", "X_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expand_", "=_", "1_", ",_", "anchor_", "=_", "tk_", "._", "W_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "List", " ", "box", " ", "showin", "g", " ", "error", "s", " ", "and", " ", "failures_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tk_", "._", "Label_", "(_", "right", "Frame_", ",_", "text_", "=_", "\"", "Det", "ail", "ed", " ", "progress", ":\"_", ")_", "._", "pack_", "(_", "anchor_", "=_", "tk_", "._", "W_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "Frame_", "=_", "tk_", "._", "Frame_", "(_", "right", "Frame_", ",_", "relief_", "=_", "tk_", "._", "SUN", "KEN", "_", ",_", "border", "width_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "Frame_", "._", "grid", "\\u", "rowco", "nfigure", "_", "(_", "0_", ",_", "weight_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "Frame_", "._", "grid", "\\u", "column", "configure_", "(_", "0_", ",_", "weight_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "error", "Listbox", "_", "=_", "tk_", "._", "Listbox", "_", "(_", "list", "Frame_", ",_", "foreground_", "=_", "'", "black", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "select", "mode_", "=_", "tk_", "._", "SINGLE", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "select", "border", "width_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "width_", "=_", "'", "50", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error", "Listbox", "_", "._", "grid_", "(_", "row_", "=_", "0_", ",_", "column_", "=_", "0_", ",_", "sticky_", "=_", "tk_", "._", "N_", "+_", "tk_", "._", "S_", "+_", "tk_", "._", "E_", "+_", "tk_", "._", "W_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "error", "Listbox", ".", "pack", "(", "side", "=", "tk", ".", "LEF", "T", ",", " ", "fill", "=", "tk", ".", "BOT", "H", ",", " ", "expand", "=", "1", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "anchor", "=", "tk", ".", "NW", ")_", "\\u\\u\\uNL\\u\\u\\u_", "list", "VS", "cro", "ll_", "=_", "tk_", "._", "Scrollba", "r_", "(_", "list", "Frame_", ",_", "command_", "=_", "self_", "._", "error", "Listbox", "_", "._", "yv", "iew_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "VS", "cro", "ll_", "._", "grid_", "(_", "row_", "=_", "0_", ",_", "column_", "=_", "1_", ",_", "sticky_", "=_", "tk_", "._", "N_", "+_", "tk_", "._", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "list", "VS", "cro", "ll", ".", "pack", "(", "side", "=", "tk", ".", "LEF", "T", ",", " ", "fill", "=", "tk", ".", "Y", ",", " ", "anchor", "=", "tk", ".", "N", ")_", "\\u\\u\\uNL\\u\\u\\u_", "list", "HS", "cro", "ll_", "=_", "tk_", "._", "Scrollba", "r_", "(_", "list", "Frame_", ",_", "command_", "=_", "self_", "._", "error", "Listbox", "_", "._", "xv", "iew_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "orient_", "=_", "Tkinter_", "._", "HORIZONTAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "HS", "cro", "ll_", "._", "grid_", "(_", "row_", "=_", "1_", ",_", "column_", "=_", "0_", ",_", "sticky_", "=_", "tk_", "._", "E_", "+_", "tk_", "._", "W_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "list", "HS", "cro", "ll", ".", "pack", "(", "side", "=", "tk", ".", "BOT", "TOM", ",", " ", "fill", "=", "tk", ".", "X", ",", " ", "anchor", "=", "tk", ".", "N", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "error", "Listbox", "_", "._", "bind_", "(_", "\"<", "Doub", "le", "-1", ">\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", "e_", ",_", "self_", "=_", "self_", ":_", "self_", "._", "show", "Select", "ed", "Error_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error", "Listbox", "_", "._", "configure_", "(_", "ysc", "roll", "command_", "=_", "list", "VS", "cro", "ll_", "._", "set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error", "Listbox", "_", "._", "configure_", "(_", "xs", "cro", "llc", "ommand", "_", "=_", "list", "HS", "cro", "ll_", "._", "set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "Frame_", "._", "pack_", "(_", "fill_", "=_", "tk_", "._", "BOTH_", ",_", "expand_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Select", "ed", "Test", "Name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "suit", "e", "Name", "Var_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "error", "Dialog_", "(_", "self_", ",_", "title_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tk", "Messag", "e", "Box_", "._", "shower", "ror_", "(_", "parent_", "=_", "self_", "._", "root_", ",_", "title_", "=_", "title_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "=_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "notif", "y", "Running_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "run", "Start", "Time_", "=_", "time_", "._", "clock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "run", "Count", "Var_", "._", "set_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Count", "Var_", "._", "set_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error", "Count", "Var_", "._", "set_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ela", "pse", "d", "Var_", "._", "set_", "(_", "\"", "0", ":", "00", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "averag", "e", "Var_", "._", "set_", "(_", "\"", "0", ":", "00", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rema", "inin", "g", "Count", "Var_", "._", "set_", "(_", "self_", "._", "total", "Tests_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error", "Info_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "whi", "le", " ", "self", ".", "error", "Listbox", ".", "size", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "error", "Listbox", ".", "delete", "(", "0", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Stopp", "ing", " ", "see", "ms", " ", "not", " ", "to", " ", "work", ",", " ", "so", " ", "simp", "ly", " ", "disable", " ", "the", " ", "start", " ", "button_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "stop", "Go", "Button_", "._", "config_", "(_", "command_", "=_", "self_", "._", "stop", "Clicked_", ",_", "text_", "=_", "\"", "Sto", "p", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "stop", "Go", "Butt", "on", ".", "config", "(", "state", "=", "tk", ".", "DISABLED", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "progress", "Bar_", "._", "set", "Progres", "s", "Fraction_", "(_", "0.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "update", "\\u", "idle", "tasks_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "notif", "y", "Stopp", "ed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "queue_", "._", "put_", "(_", "Stopp", "ed", "Message_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute", "Stopp", "ed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "got", " ", "a", " ", "stop", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stop", "Go", "Button_", "._", "config_", "(_", "state_", "=_", "tk_", "._", "ACTIVE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stop", "Go", "Button_", "._", "config_", "(_", "command_", "=_", "self_", "._", "run", "Clicked_", ",_", "text_", "=_", "\"", "Start", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "status", "Var_", "._", "set_", "(_", "\"", "Id", "le", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "update", "\\u", "idle", "tasks_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "running_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "notif", "y", "Test", "Started_", "(_", "self_", ",_", "test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "queue_", "._", "put_", "(_", "Test", "Start", "ed", "Message_", "(_", "test_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Display", "Status_", "(_", "self_", ",_", "position_", ",_", "status_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str_", "=_", "self_", "._", "error", "Listbox", "_", "._", "get_", "(_", "position_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parts_", "=_", "str_", "._", "split_", "(_", "':", " ", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "parts_", ")_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "parts_", "[_", "0_", "]_", "==_", "'", "FAIL", "ED", "'_", "or_", "parts_", "[_", "0_", "]_", "==_", "'", "ERROR", "'_", ":_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str_", "=_", "parts_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "str_", "=_", "status_", "+_", "':", " ", "'_", "+_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error", "Listbox", "_", "._", "insert_", "(_", "position_", ",_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error", "Listbox", "_", "._", "delete_", "(_", "position_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "status_", "==_", "'", "RUNN", "ING", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error", "Listbox", "_", "._", "item", "config_", "(_", "position_", ",_", "fg_", "=_", "'", "blue", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "status_", "==_", "'", "FAIL", "ED", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error", "Listbox", "_", "._", "item", "config_", "(_", "position_", ",_", "fg_", "=_", "'", "red", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "status_", "==_", "'", "ERROR", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error", "Listbox", "_", "._", "item", "config_", "(_", "position_", ",_", "fg_", "=_", "'", "red", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "status_", "==_", "'", "SUCCESS", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error", "Listbox", "_", "._", "item", "config_", "(_", "position_", ",_", "fg_", "=_", "'", "dark", "green", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "position_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error", "Listbox", "_", "._", "select", "\\u", "clear_", "(_", "position_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "error", "Listbox", "_", "._", "select", "\\u", "set_", "(_", "position_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error", "Listbox", "_", "._", "see", "_", "(_", "min_", "(_", "position_", "+_", "4_", ",_", "self_", "._", "error", "Listbox", "_", "._", "size_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute", "Test", "Started_", "(_", "self_", ",_", "test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "status", "Var_", "._", "set_", "(_", "str_", "(_", "test_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Display", "Status_", "(_", "self_", "._", "current", "Test", "Index_", ",_", "'", "RUNN", "ING", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "update", "\\u", "idle", "tasks_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "notif", "y", "Test", "Failed_", "(_", "self_", ",_", "test_", ",_", "err_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "stop", "On", "Error", "Var_", "._", "get_", "(_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "current", "Result_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "queue_", "._", "put_", "(_", "Test", "Fail", "ed", "Message_", "(_", "test_", ",_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute", "Test", "Failed_", "(_", "self_", ",_", "test_", ",_", "err_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail", "Count", "Var_", "._", "set_", "(_", "1_", "+_", "self_", "._", "fail", "Count", "Var_", "._", "get_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "error", "Listbox", ".", "insert", "(", "tk", ".", "END", ",", " ", "\"", "Fail", "ure", ":", " ", "%", "s", "\"", " ", "%", " ", "test", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "error", "Info_", "._", "append_", "(_", "(_", "test_", ",_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Display", "Status_", "(_", "self_", "._", "current", "Test", "Index_", ",_", "'", "FAIL", "ED", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "notif", "y", "Test", "Error", "ed_", "(_", "self_", ",_", "test_", ",_", "err_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "stop", "On", "Error", "Var_", "._", "get_", "(_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "current", "Result_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "queue_", "._", "put_", "(_", "Test", "Error", "ed", "Message_", "(_", "test_", ",_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute", "Test", "Error", "ed_", "(_", "self_", ",_", "test_", ",_", "err_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error", "Count", "Var_", "._", "set_", "(_", "1_", "+_", "self_", "._", "error", "Count", "Var_", "._", "get_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "error", "Listbox", ".", "insert", "(", "tk", ".", "END", ",", " ", "\"", "Error", ":", " ", "%", "s", "\"", " ", "%", " ", "test", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "error", "Info_", "._", "append_", "(_", "(_", "test_", ",_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Display", "Status_", "(_", "self_", "._", "current", "Test", "Index_", ",_", "'", "ERROR", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "notif", "y", "Test", "Finished_", "(_", "self_", ",_", "test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "queue_", "._", "put_", "(_", "Test", "Finish", "ed", "Message_", "(_", "test_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute", "Test", "Finished_", "(_", "self_", ",_", "test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "rema", "inin", "g", "Count", "Var_", "._", "set_", "(_", "self_", "._", "rema", "inin", "g", "Count", "Var_", "._", "get_", "(_", ")_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "run", "Count", "Var_", "._", "set_", "(_", "1_", "+_", "self_", "._", "run", "Count", "Var_", "._", "get_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fract", "ion", "Done_", "=_", "float_", "(_", "self_", "._", "run", "Count", "Var_", "._", "get_", "(_", ")_", ")_", "/_", "float_", "(_", "self_", "._", "total", "Tests_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fill", "Color_", "=_", "(_", "self_", "._", "error", "Count", "Var_", "._", "get_", "(_", ")_", ">_", "0_", "or_", "self_", "._", "fail", "Count", "Var_", "._", "get_", "(_", ")_", ">_", "0_", ")_", "and_", "\"", "red", "\"_", "or_", "\"", "dark", "green", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "progress", "Bar_", "._", "set", "Progres", "s", "Fraction_", "(_", "fract", "ion", "Done_", ",_", "fill", "Color_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "so", "Far", "_", "=_", "time_", "._", "clock_", "(_", ")_", "-_", "self_", "._", "run", "Start", "Time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "averag", "e", "Var_", "._", "set_", "(_", "time_", "._", "strftime_", "(_", "\"%", "M", ":", "%", "S", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "localtime_", "(_", "so", "Far", "_", "/_", "self_", "._", "run", "Count", "Var_", "._", "get_", "(_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Display", "Status_", "(_", "self_", "._", "current", "Test", "Index_", ",_", "'", "SUCCESS", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "current", "Test", "Index_", ">=_", "len_", "(_", "self_", "._", "error", "Info_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "no", " ", "error", ",", " ", "so", " ", "pad", " ", "the", " ", "error", " ", "list", " ", "for", " ", "this", " ", "test_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "error", "Info_", "._", "append_", "(_", "(_", "test_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "current", "Test", "Index_", "=_", "self_", "._", "current", "Test", "Index_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "show", "Abo", "ut", "Dialog_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tk", "Messag", "e", "Box_", "._", "showin", "fo_", "(_", "parent_", "=_", "self_", "._", "root_", ",_", "title_", "=_", "\"", "Abo", "ut", " ", "Py", "Unit", " ", "Enhance", "d", " ", "Run", "ner", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "=_", "\\u", "ABO", "UT\\u", "TEXT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "show", "Help", "Dialog_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tk", "Messag", "e", "Box_", "._", "showin", "fo_", "(_", "parent_", "=_", "self_", "._", "root_", ",_", "title_", "=_", "\"", "Py", "Unit", " ", "Enhance", "d", " ", "Run", "ner", " ", "help", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "=_", "\\u", "HELP", "\\u", "TEXT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "show", "Select", "ed", "Error_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "selection_", "=_", "self_", "._", "error", "Listbox", "_", "._", "curse", "lection", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "selection_", ":_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selected_", "=_", "int_", "(_", "selection_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txt_", "=_", "self_", "._", "error", "Listbox", "_", "._", "get_", "(_", "selected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "=_", "tk_", "._", "Top", "level_", "(_", "self_", "._", "root_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "._", "title_", "(_", "txt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "._", "protocol_", "(_", "'", "WM", "\\u", "DELET", "E", "\\u", "WIND", "OW", "'_", ",_", "window_", "._", "quit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "selected_", "<_", "len_", "(_", "self_", "._", "error", "Info_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test_", ",_", "error_", "=_", "self_", "._", "error", "Info_", "[_", "selected_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tk_", "._", "Label_", "(_", "window_", ",_", "text_", "=_", "str_", "(_", "test_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "foreground_", "=_", "(_", "error_", "is_", "None_", ")_", "and_", "\"", "dark", "green", "\"_", "or_", "\"", "red", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "justify_", "=_", "tk_", "._", "LEFT_", ")_", "._", "pack_", "(_", "anchor_", "=_", "tk_", "._", "W_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "error_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tk_", "._", "Label_", "(_", "window_", ",_", "text_", "=_", "'", "Test", " ", "succe", "eded", "!'_", ",_", "justify_", "=_", "tk_", "._", "LEFT_", ")_", "._", "pack_", "(_", ")_", "\\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 ", " _", "traceback", "Lines_", "=_", "apply_", "(_", "traceback_", "._", "format\\u", "exception_", ",_", "error_", "+_", "(_", "10_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "traceback", "Text_", "=_", "string_", "._", "join_", "(_", "traceback", "Lines_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tk_", "._", "Label_", "(_", "window_", ",_", "text_", "=_", "traceback", "Text_", ",_", "justify_", "=_", "tk_", "._", "LEFT_", ")_", "._", "pack_", "(_", ")_", "\\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 ", " _", "tk_", "._", "Label_", "(_", "window_", ",_", "text_", "=_", "'", "Test", " ", "has", " ", "not", " ", "bee", "n", " ", "executed", "!'_", ",_", "justify_", "=_", "tk_", "._", "LEFT_", ")_", "._", "pack_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tk_", "._", "Button_", "(_", "window_", ",_", "text_", "=_", "\"", "Clos", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "command_", "=_", "window_", "._", "quit_", ")_", "._", "pack_", "(_", "side_", "=_", "tk_", "._", "BOTTOM_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "._", "bind_", "(_", "'<", "Key", "-", "Return", ">'_", ",_", "lambda_", "e_", ",_", "w_", "=_", "window_", ":_", "w_", "._", "quit_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "._", "mainloop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "._", "destroy_", "(_", ")_", "\\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_", "Progres", "s", "Bar_", "(_", "tk_", "._", "Frame_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "simple", " ", "progress", " ", "bar", " ", "tha", "t", " ", "show", "s", " ", "a", " ", "percentage", " ", "progress", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "give", "n", " ", "colour", ".\"\"\"_", "\\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_", "Progres", "s", "Bar_", "(_", "tk_", "._", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "apply_", "(_", "tk_", "._", "Frame_", "._", "\\u\\u", "init\\u\\u_", ",_", "(_", "self_", ",_", ")_", "+_", "args_", ",_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "canvas_", "=_", "tk_", "._", "Canvas_", "(_", "self_", ",_", "height_", "=_", "'", "20", "'_", ",_", "width_", "=_", "'", "60", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "background_", "=_", "'", "white", "'_", ",_", "border", "width_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "canvas_", "._", "pack_", "(_", "fill_", "=_", "tk_", "._", "X_", ",_", "expand_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rect_", "=_", "self_", "._", "text_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "canvas_", "._", "bind_", "(_", "'<", "Configure", ">'_", ",_", "self_", "._", "paint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Progres", "s", "Fraction_", "(_", "0.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Progres", "s", "Bar_", "(_", "tk_", "._", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Progres", "s", "Fraction_", "(_", "self_", ",_", "fraction_", ",_", "color_", "=_", "'", "blue", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fraction_", "=_", "fraction_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "color_", "=_", "color_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "paint_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "canvas_", "._", "update", "\\u", "idle", "tasks_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Progres", "s", "Bar_", "(_", "tk_", "._", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "paint_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "total", "Width_", "=_", "self_", "._", "canvas_", "._", "win", "fo", "\\u", "width_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "width_", "=_", "int_", "(_", "self_", "._", "fraction_", "*_", "float_", "(_", "total", "Width_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "height_", "=_", "self_", "._", "canvas_", "._", "win", "fo", "\\u", "height_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "rect_", "is_", "not_", "None_", ":_", "self_", "._", "canvas_", "._", "delete_", "(_", "self_", "._", "rect_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "text_", "is_", "not_", "None_", ":_", "self_", "._", "canvas_", "._", "delete_", "(_", "self_", "._", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rect_", "=_", "self_", "._", "canvas_", "._", "create", "\\u", "rectangle_", "(_", "0_", ",_", "0_", ",_", "width_", ",_", "height_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fill_", "=_", "self_", "._", "color_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "percent", "String_", "=_", "\"%", "3.0", "f", "%%\"_", "%_", "(_", "100.0_", "*_", "self_", "._", "fraction_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "=_", "self_", "._", "canvas_", "._", "create", "\\u", "text_", "(_", "total", "Width_", "/_", "2_", ",_", "height_", "/_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "anchor_", "=_", "tk_", "._", "CENTER_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "=_", "percent", "String_", ")_", "\\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_", "main_", "(_", "initial", "Test", "Name_", "=_", "\"\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root_", "=_", "tk_", "._", "Tk_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "title_", "(_", "\"", "Py", "Unit", " ", "Enhance", "d", " ", "Run", "ner", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "runner_", "=_", "Enhance", "d", "GU", "IR", "unne", "r_", "(_", "root_", ",_", "initial", "Test", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "protocol_", "(_", "'", "WM", "\\u", "DELET", "E",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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, 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 ]
Unused import
moraes/tipfy/tests/gae_taskqueue_test.py
[ { "content": "# -*- coding: utf-8 -*-\n\"\"\"\n Tests for tipfyext.appenginetaskqueue\n\"\"\"\nimport time\nimport unittest\n\nfrom google.appengine.ext import deferred\n\nfrom google.appengine.api import taskqueue\nfrom google.appengine.ext import db\n\nfrom tipfy import Rule, Tipfy\nfrom tipfy.app import local\n\nimport test_utils\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n test_utils.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def get_rules():\n # Fake get_rules() for testing.\n return [\n Rule('/_tasks/process-mymodel/', name='tasks/process-mymodel',\n handler='%s.TaskTestModelEntityTaskHandler' % __name__),\n Rule('/_tasks/process-mymodel/<string:key>', name='tasks/process-mymodel',\n handler='%s.TaskTestModelEntityTaskHandler' % __name__),\n ]", "metadata": "root.get_rules", "header": "['module', '___EOS___']", "index": 18 }, { "content": "def get_url_rules():\n # Fake get_rules() for testing.\n rules = [\n Rule('/_ah/queue/deferred', name='tasks/deferred', handler='tipfy.appengine.taskqueue.DeferredHandler'),\n ]\n\n return Map(rules)", "metadata": "root.get_url_rules", "header": "['module', '___EOS___']", "index": 28 }, { "content": "def get_app():\n return Tipfy({\n 'tipfy': {\n 'dev': True,\n },\n }, rules=get_url_rules())", "metadata": "root.get_app", "header": "['module', '___EOS___']", "index": 37 }, { "content": "class TaskTestModel(db.Model):\n number = db.IntegerProperty()", "metadata": "root.TaskTestModel", "header": "['module', '___EOS___']", "index": 45 }, { "content": "def save_entities(numbers):\n entities = []\n for number in numbers:\n entities.append(TaskTestModel(key_name=str(number), number=number))\n\n res = db.put(entities)\n\n import sys\n sys.exit(res)", "metadata": "root.save_entities", "header": "['module', '___EOS___']", "index": 49 }, { "content": "class TestDeferredHandler(test_utils.BaseTestCase):\n \"\"\"TODO\"\"\"\n", "metadata": "root.TestDeferredHandler", "header": "['module', '___EOS___']", "index": 60 }, { "content": " def test_simple_deferred(self):\n numbers = [1234, 1577, 988]\n keys = [db.Key.from_path('TaskTestModel', str(number)) for number in numbers]\n entities = db.get(keys)\n self.assertEqual(entities, [None, None, None])\n\n deferred.defer(save_entities, numbers)", "metadata": "root.TestDeferredHandler.test_simple_deferred", "header": "['class', 'TestDeferredHandler', '(', 'test_utils', '.', 'BaseTestCase', ')', ':', '___EOS___']", "index": 63 }, { "content": "class TestTasks(test_utils.BaseTestCase):\n \"\"\"TODO\"\"\"", "metadata": "root.TestTasks", "header": "['module', '___EOS___']", "index": 72 } ]
[ { "span": "import time", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 11 }, { "span": "import unittest", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 15 }, { "span": "from google.appengine.api import taskqueue", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 42 }, { "span": "from tipfy.app import local", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 27 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", "s", " ", "for", " ", "tip", "fy", "ext", ".", "appengine", "task", "queue", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "ext_", "import_", "deferred_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "api_", "import_", "task", "queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "ext_", "import_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "tip", "fy_", "import_", "Rule_", ",_", "Tip", "fy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tip", "fy_", "._", "app_", "import_", "local_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "test\\u", "utils_", "\\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\\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 ", " _", "test\\u", "utils_", "._", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "rules_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fake", " ", "get", "\\u", "rule", "s", "()", " ", "for", " ", "testi", "ng", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Rule_", "(_", "'/\\", "uta", "sk", "s", "/", "process", "-", "mym", "odel", "/'_", ",_", "name_", "=_", "'", "task", "s", "/", "process", "-", "mym", "odel", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "handler_", "=_", "'%", "s", ".", "Task", "Test", "Model", "Entit", "y", "Task", "Handle", "r", "'_", "%_", "\\u\\u", "name\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Rule_", "(_", "'/\\", "uta", "sk", "s", "/", "process", "-", "mym", "odel", "/", "<", "string", ":", "key", ">'_", ",_", "name_", "=_", "'", "task", "s", "/", "process", "-", "mym", "odel", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "handler_", "=_", "'%", "s", ".", "Task", "Test", "Model", "Entit", "y", "Task", "Handle", "r", "'_", "%_", "\\u\\u", "name\\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_", "def_", "get", "\\u", "url", "\\u", "rules_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fake", " ", "get", "\\u", "rule", "s", "()", " ", "for", " ", "testi", "ng", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rules_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Rule_", "(_", "'/\\", "ua", "h", "/", "queue", "/", "defer", "red", "'_", ",_", "name_", "=_", "'", "task", "s", "/", "defer", "red", "'_", ",_", "handler_", "=_", "'", "tip", "fy", ".", "appengine", ".", "task", "queue", ".", "Defe", "rre", "d", "Handle", "r", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Map_", "(_", "rules_", ")_", "\\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_", "get", "\\u", "app_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Tip", "fy_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tip", "fy", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dev", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "rules_", "=_", "get", "\\u", "url", "\\u", "rules_", "(_", ")_", ")_", "\\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_", "Task", "Test", "Model_", "(_", "db_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "number_", "=_", "db_", "._", "Integer", "Property_", "(_", ")_", "\\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_", "save", "\\u", "entities_", "(_", "numbers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entities_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "number_", "in_", "numbers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entities_", "._", "append_", "(_", "Task", "Test", "Model_", "(_", "key", "\\u", "name_", "=_", "str_", "(_", "number_", ")_", ",_", "number_", "=_", "number_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "db_", "._", "put_", "(_", "entities_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "res_", ")_", "\\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_", "Test", "Defe", "rre", "d", "Handler_", "(_", "test\\u", "utils_", "._", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "TOD", "O", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Defe", "rre", "d", "Handler_", "(_", "test\\u", "utils_", "._", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "simple", "\\u", "deferred_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "numbers_", "=_", "[_", "1234_", ",_", "157", "7_", ",_", "988", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keys_", "=_", "[_", "db_", "._", "Key_", "._", "from", "\\u", "path_", "(_", "'", "Task", "Test", "Model", "'_", ",_", "str_", "(_", "number_", ")_", ")_", "for_", "number_", "in_", "numbers_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entities_", "=_", "db_", "._", "get_", "(_", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "entities_", ",_", "[_", "None_", ",_", "None_", ",_", "None_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "deferred_", "._", "defer_", "(_", "save", "\\u", "entities_", ",_", "numbers_", ")_", "\\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", "Tasks_", "(_", "test\\u", "utils_", "._", "Base", "Test", "Case_", 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 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 ]
Except block handles 'BaseException'
GeoscienceAustralia/agdc/deprecated/dem_tiler.py
[ { "content": " def __init__(self, source_datacube=None, default_tile_type_id=1):\n \"\"\"Constructor\n Arguments:\n source_datacube: Optional DataCube object whose connection and data will be shared\n tile_type_id: Optional tile_type_id value (defaults to config file value = 1)\n \"\"\"\n \n if source_datacube:\n # Copy values from source_datacube and then override command line args\n self.__dict__ = copy(source_datacube.__dict__)\n \n args = self.parse_args()\n # Set instance attributes for every value in command line arguments file\n for attribute_name in args.__dict__.keys():\n attribute_value = args.__dict__[attribute_name]\n self.__setattr__(attribute_name, attribute_value)\n\n else:\n DataCube.__init__(self); # Call inherited constructor\n \n if self.debug:\n console_handler.setLevel(logging.DEBUG)\n\n # Turn autocommit OFF so that transaction can cover all queries for each dataset\n self.db_connection.autocommit = False\n self.db_connection.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_READ_COMMITTED)\n\n # Attempt to parse dates from command line arguments or config file\n try:\n self.default_tile_type_id = int(self.default_tile_type_id) \n except:\n self.default_tile_type_id = default_tile_type_id\n try:\n self.start_date = datetime.strptime(self.start_date, '%d/%m/%Y').date()\n except:\n self.start_date = None\n try:\n self.end_date = datetime.strptime(self.end_date, '%d/%m/%Y').date()\n except:\n self.end_date = None\n try:\n self.min_path = int(self.min_path) \n except:\n self.min_path = None\n try:\n self.max_path = int(self.max_path) \n except:\n self.max_path = None\n try:\n self.min_row = int(self.min_row) \n except:\n self.min_row = None\n try:\n self.max_row = int(self.max_row) \n except:\n self.max_row = None", "metadata": "root.DEMTiler.__init__", "header": "['class', 'DEMTiler', '(', 'DataCube', ')', ':', '___EOS___']", "index": 223 } ]
[ { "span": "except:", "start_line": 253, "start_column": 8, "end_line": 253, "end_column": 15 }, { "span": "except:", "start_line": 257, "start_column": 8, "end_line": 257, "end_column": 15 }, { "span": "except:", "start_line": 261, "start_column": 8, "end_line": 261, "end_column": 15 }, { "span": "except:", "start_line": 265, "start_column": 8, "end_line": 265, "end_column": 15 }, { "span": "except:", "start_line": 269, "start_column": 8, "end_line": 269, "end_column": 15 }, { "span": "except:", "start_line": 273, "start_column": 8, "end_line": 273, "end_column": 15 }, { "span": "except:", "start_line": 277, "start_column": 8, "end_line": 277, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "DEM", "Til", "er_", "(_", "Data", "Cube_", ")_", ":_", "\\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_", ",_", "source", "\\u", "datac", "ube", "_", "=_", "None_", ",_", "default", "\\u", "tile", "\\u", "type", "\\u", "id_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Constructor", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "source", "\\u", "datac", "ube", ":", " ", "Optio", "nal", " ", "Data", "Cub", "e", " ", "object", " ", "who", "se", " ", "connecti", "on", " ", "and", " ", "data", " ", "will", " ", "be", " ", "shared", "\\", "10", ";", " ", " ", " ", " ", "tile", "\\u", "type", "\\u", "id", ":", " ", "Optio", "nal", " ", "tile", "\\u", "type", "\\u", "id", " ", "value", " ", "(", "default", "s", " ", "to", " ", "config", " ", "file", " ", "value", " ", "=", " ", "1", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "source", "\\u", "datac", "ube", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Copy", " ", "values", " ", "from", " ", "source", "\\u", "datac", "ube", " ", "and", " ", "then", " ", "override", " ", "command", " ", "line", " ", "args_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "dict\\u\\u_", "=_", "copy_", "(_", "source", "\\u", "datac", "ube", "_", "._", "\\u\\u", "dict\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "self_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Set", " ", "instance", " ", "attribute", "s", " ", "for", " ", "every", " ", "value", " ", "in", " ", "command", " ", "line", " ", "argu", "ment", "s", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "attribute", "\\u", "name_", "in_", "args_", "._", "\\u\\u", "dict\\u\\u_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attribute", "\\u", "value_", "=_", "args_", "._", "\\u\\u", "dict\\u\\u_", "[_", "attribute", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "setattr\\u\\u_", "(_", "attribute", "\\u", "name_", ",_", "attribute", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\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 ", " _", "Data", "Cube_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ";_", "#", " ", "Call", " ", "inherited", " ", "constructor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "console", "\\u", "handler_", "._", "set", "Level_", "(_", "logging_", "._", "DEBUG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Turn", " ", "autoc", "ommit", " ", "OFF", " ", "so", " ", "tha", "t", " ", "transaction", " ", "can", " ", "cover", " ", "all", " ", "querie", "s", " ", "for", " ", "each", " ", "dataset_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "db", "\\u", "connection_", "._", "autocommit_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db", "\\u", "connection_", "._", "set\\u", "isolation", "\\u", "level_", "(_", "psycopg2_", "._", "extensions_", "._", "ISO", "LATI", "ON", "\\u", "LE", "VEL", "\\u", "READ", "\\u", "COMMIT", "TED_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Atte", "mpt", " ", "to", " ", "parse", " ", "dates", " ", "from", " ", "command", " ", "line", " ", "argu", "ment", "s", " ", "or", " ", "config", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "default", "\\u", "tile", "\\u", "type", "\\u", "id_", "=_", "int_", "(_", "self_", "._", "default", "\\u", "tile", "\\u", "type", "\\u", "id_", ")_", "\\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 ", " _", "self_", "._", "default", "\\u", "tile", "\\u", "type", "\\u", "id_", "=_", "default", "\\u", "tile", "\\u", "type", "\\u", "id_", "\\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 ", " _", "self_", "._", "start", "\\u", "date_", "=_", "datetime_", "._", "strptime_", "(_", "self_", "._", "start", "\\u", "date_", ",_", "'%", "d", "/", "%", "m", "/", "%", "Y", "'_", ")_", "._", "date_", "(_", ")_", "\\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 ", " _", "self_", "._", "start", "\\u", "date_", "=_", "None_", "\\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 ", " _", "self_", "._", "end", "\\u", "date_", "=_", "datetime_", "._", "strptime_", "(_", "self_", "._", "end", "\\u", "date_", ",_", "'%", "d", "/", "%", "m", "/", "%", "Y", "'_", ")_", "._", "date_", "(_", ")_", "\\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 ", " _", "self_", "._", "end", "\\u", "date_", "=_", "None_", "\\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 ", " _", "self_", "._", "min", "\\u", "path_", "=_", "int_", "(_", "self_", "._", "min", "\\u", "path_", ")_", "\\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 ", " _", "self_", "._", "min", "\\u", "path_", "=_", "None_", "\\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 ", " _", "self_", "._", "max", "\\u", "path_", "=_", "int_", "(_", "self_", "._", "max", "\\u", "path_", ")_", "\\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 ", " _", "self_", "._", "max", "\\u", "path_", "=_", "None_", "\\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 ", " _", "self_", "._", "min", "\\u", "row_", "=_", "int_", "(_", "self_", "._", "min", "\\u", "row_", ")_", "\\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 ", " _", "self_", "._", "min", "\\u", "row_", "=_", "None_", "\\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 ", " _", "self_", "._", "max", "\\u", "row_", "=_", "int_", "(_", "self_", "._", "max", "\\u", "row_", ")_", "\\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 ", " _", "self_", "._", "max", "\\u", "row_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4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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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
jrosebr1/imutils/imutils/video/pivideostream.py
[ { "content": "# import the necessary packages\nfrom picamera.array import PiRGBArray\nfrom picamera import PiCamera\nfrom threading import Thread\nimport cv2\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class PiVideoStream:\n\n\n\n", "metadata": "root.PiVideoStream", "header": "['module', '___EOS___']", "index": 6 }, { "content": "\tdef __init__(self, resolution=(320, 240), framerate=32):\n\t\t# initialize the camera and stream\n\t\tself.camera = PiCamera()\n\t\tself.camera.resolution = resolution\n\t\tself.camera.framerate = framerate\n\t\tself.rawCapture = PiRGBArray(self.camera, size=resolution)\n\t\tself.stream = self.camera.capture_continuous(self.rawCapture,\n\t\t\tformat=\"bgr\", use_video_port=True)\n\n\t\t# initialize the frame and the variable used to indicate\n\t\t# if the thread should be stopped\n\t\tself.frame = None\n\t\tself.stopped = False", "metadata": "root.PiVideoStream.__init__", "header": "['class', 'PiVideoStream', ':', '___EOS___']", "index": 7 }, { "content": "\tdef start(self):\n\t\t# start the thread to read frames from the video stream\n\t\tt = Thread(target=self.update, args=())\n\t\tt.daemon = True\n\t\tt.start()\n\t\treturn self", "metadata": "root.PiVideoStream.start", "header": "['class', 'PiVideoStream', ':', '___EOS___']", "index": 21 }, { "content": "\tdef update(self):\n\t\t# keep looping infinitely until the thread is stopped\n\t\tfor f in self.stream:\n\t\t\t# grab the frame from the stream and clear the stream in\n\t\t\t# preparation for the next frame\n\t\t\tself.frame = f.array\n\t\t\tself.rawCapture.truncate(0)\n\n\t\t\t# if the thread indicator variable is set, stop the thread\n\t\t\t# and resource camera resources\n\t\t\tif self.stopped:\n\t\t\t\tself.stream.close()\n\t\t\t\tself.rawCapture.close()\n\t\t\t\tself.camera.close()\n\t\t\t\treturn", "metadata": "root.PiVideoStream.update", "header": "['class', 'PiVideoStream', ':', '___EOS___']", "index": 28 }, { "content": "\tdef read(self):\n\t\t# return the frame most recently read\n\t\treturn self.frame", "metadata": "root.PiVideoStream.read", "header": "['class', 'PiVideoStream', ':', '___EOS___']", "index": 44 }, { "content": "\tdef stop(self):\n\t\t# indicate that the thread should be stopped\n\t\tself.stopped = True", "metadata": "root.PiVideoStream.stop", "header": "['class', 'PiVideoStream', ':', '___EOS___']", "index": 48 } ]
[ { "span": "import cv2", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "import", " ", "the", " ", "necessar", "y", " ", "packages_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pica", "mera", "_", "._", "array_", "import_", "Pi", "RGB", "Array_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pica", "mera", "_", "import_", "Pi", "Camera_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "threading_", "import_", "Thread_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "cv2_", "\\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_", "Pi", "Vid", "eo", "Stream_", ":_", "\\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_", "[SEP]_", "class_", "Pi", "Vid", "eo", "Stream_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "resolution_", "=_", "(_", "320_", ",_", "240_", ")_", ",_", "framerate", "_", "=_", "32_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "initialize", " ", "the", " ", "came", "ra", " ", "and", " ", "stream_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "self_", "._", "camera_", "=_", "Pi", "Camera_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "camera_", "._", "resolution_", "=_", "resolution_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "camera_", "._", "framerate", "_", "=_", "framerate", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "raw", "Capture_", "=_", "Pi", "RGB", "Array_", "(_", "self_", "._", "camera_", ",_", "size_", "=_", "resolution_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stream_", "=_", "self_", "._", "camera_", "._", "captur", "e\\u", "continuous", "_", "(_", "self_", "._", "raw", "Capture_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "format_", "=_", "\"", "bgr", "\"_", ",_", "use", "\\u", "video", "\\u", "port_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "initialize", " ", "the", " ", "frame", " ", "and", " ", "the", " ", "variab", "le", " ", "used", " ", "to", " ", "indicat", "e_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "the", " ", "thread", " ", "shou", "ld", " ", "be", " ", "stopped_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "frame_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stopped_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pi", "Vid", "eo", "Stream_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "start_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "start", " ", "the", " ", "thread", " ", "to", " ", "read", " ", "frames", " ", "from", " ", "the", " ", "video", " ", "stream_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "t_", "=_", "Thread_", "(_", "target_", "=_", "self_", "._", "update_", ",_", "args_", "=_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "daemon_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pi", "Vid", "eo", "Stream_", ":_", "\\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_", "#", " ", "keep", " ", "looping", " ", "infini", "tel", "y", " ", "unti", "l", " ", "the", " ", "thread", " ", "is", " ", "stopped_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "for_", "f_", "in_", "self_", "._", "stream_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "gra", "b", " ", "the", " ", "frame", " ", "from", " ", "the", " ", "stream", " ", "and", " ", "clear", " ", "the", " ", "stream", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "preparation", " ", "for", " ", "the", " ", "next", " ", "frame_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "frame_", "=_", "f_", "._", "array_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "raw", "Capture_", "._", "truncate_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "the", " ", "thread", " ", "indicat", "or", " ", "variab", "le", " ", "is", " ", "set", ",", " ", "stop", " ", "the", " ", "thread_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "resource", " ", "came", "ra", " ", "resources_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "stopped_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "self_", "._", "stream_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "raw", "Capture_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "camera_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pi", "Vid", "eo", "Stream_", ":_", "\\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_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "return", " ", "the", " ", "frame", " ", "most", " ", "recent", "ly", " ", "read_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "return_", "self_", "._", "frame_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pi", "Vid", "eo", "Stream_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "stop_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "indicat", "e", " ", "tha", "t", " ", "the", " ", "thread", " ", "shou", "ld", " ", "be", " ", "stopped_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "self_", "._", "stopped_", "=_", "True_" ]
[ 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, 0, 1, 2, 2, 2, 2, 4, 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, 4, 2, 2, 2, 2, 2, 2, 2, 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2013, Couchbase, Inc.\n# All Rights Reserved\n#\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#\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,\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#\n\n\"\"\"\nConstants defined in _libcouchbase module for use by users\n\"\"\"\nimport couchbase._bootstrap\nfrom couchbase._libcouchbase import (\n FMT_JSON,\n FMT_BYTES,\n FMT_UTF8,\n FMT_PICKLE,\n FMT_AUTO,\n FMT_COMMON_MASK,\n FMT_LEGACY_MASK,\n\n OBS_PERSISTED,\n OBS_FOUND,\n OBS_NOTFOUND,\n OBS_LOGICALLY_DELETED,\n\n OBS_MASK,\n\n LOCKMODE_WAIT,\n LOCKMODE_EXC,\n LOCKMODE_NONE\n)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import couchbase._bootstrap", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 27 }, { "span": "from couchbase._libcouchbase import (\n FMT_JSON,\n FMT_BYTES,\n FMT_UTF8,\n FMT_PICKLE,\n FMT_AUTO,\n FMT_COMMON_MASK,\n FMT_LEGACY_MASK,\n\n OBS_PERSISTED,\n OBS_FOUND,\n OBS_NOTFOUND,\n OBS_LOGICALLY_DELETED,\n\n OBS_MASK,\n\n LOCKMODE_WAIT,\n LOCKMODE_EXC,\n LOCKMODE_NONE\n)", "start_line": 21, "start_column": 0, "end_line": 40, "end_column": 1 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2013", ",", " ", "Cou", "ch", "base", ",", " ", "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", "\")", "_", "\\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_", "#", "_", "\\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", ",_", "\\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_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Const", "ant", "s", " ", "defin", "ed", " ", "in", " ", "\\u", "libc", "ouch", "base", " ", "module", " ", "for", " ", "use", " ", "by", " ", "users", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "couch", "base_", "._", "\\u", "bootstrap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "couch", "base_", "._", "\\u", "libc", "ouch", "base_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "FMT", "\\u", "JSON_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "FMT", "\\u", "BYTES_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "FMT", "\\u", "UT", "F8_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "FMT", "\\u", "PIC", "KL", "E_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "FMT", "\\u", "AUTO", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "FMT", "\\u", "COMMON", "\\u", "MASK_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "FMT", "\\u", "LEGA", "CY", "\\u", "MASK_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "OBS", "\\u", "PERS", "ISTE", "D_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "OBS", "\\u", "FOUND_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "OBS", "\\u", "NOT", "FOUND_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "OBS", "\\u", "LOGI", "CALL", "Y", "\\u", "DELETED", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "OBS", "\\u", "MASK_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "LO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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Unused local variable
wingify/superelasticsearch/tests/test_superelasticsearch.py
[ { "content": " def test_execute_must_call_bulk_with_correct_body_arg(self):\n body = dict(key1='val1')\n\n bulk = self.ss.bulk_operation()\n bulk._client.bulk = Mock()\n bulk.create(index='test_bulk', doc_type='test_bulk_doc_type', body=body,\n id=4, routing='abcd')\n bulk.index(index='test_bulk', doc_type='test_bulk_doc_type', body=body)\n\n expected_bulk_body = ''\n for action in bulk._actions:\n expected_bulk_body += action.es_op + '\\n'\n\n resp = bulk.execute()\n self.assertTrue(bulk._client.bulk.called)\n self.assertTrue(isinstance(bulk._client.bulk.call_args[1]['body'], str))\n self.assertEquals(bulk._client.bulk.call_args[1]['body'],\n expected_bulk_body)", "metadata": "root.TestBulkOperation.test_execute_must_call_bulk_with_correct_body_arg", "header": "['class', 'TestBulkOperation', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '# create a common Elasticsearch object', '___NL___', '___EOS___']", "index": 351 }, { "content": " def test_execute_must_use_kwargs_provided_at_the_creation_of_bulk_op(self):\n body = dict(key1='val1')\n\n bulk = self.ss.bulk_operation(index='default_index',\n doc_type='some_type',\n refresh=True)\n bulk._client.bulk = Mock()\n bulk.create(index='test_bulk', doc_type='test_bulk_doc_type', body=body,\n id=4, routing='abcd')\n bulk.index(index='test_bulk', doc_type='test_bulk_doc_type', body=body)\n resp = bulk.execute()\n self.assertTrue(bulk._client.bulk.called)\n self.assertEquals(bulk._client.bulk.call_args[1]['index'],\n 'default_index')\n self.assertEquals(bulk._client.bulk.call_args[1]['doc_type'],\n 'some_type')\n self.assertEquals(bulk._client.bulk.call_args[1]['refresh'],\n 'true')", "metadata": "root.TestBulkOperation.test_execute_must_use_kwargs_provided_at_the_creation_of_bulk_op", "header": "['class', 'TestBulkOperation', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '# create a common Elasticsearch object', '___NL___', '___EOS___']", "index": 370 }, { "content": " def test_execute_must_override_kwargs_provided_at_bulk_op_creation(self):\n body = dict(key1='val1')\n\n bulk = self.ss.bulk_operation(index='default_index',\n doc_type='some_type',\n refresh=True)\n bulk._client.bulk = Mock()\n bulk.create(index='test_bulk', doc_type='test_bulk_doc_type', body=body,\n id=4, routing='abcd')\n bulk.index(index='test_bulk', doc_type='test_bulk_doc_type', body=body)\n resp = bulk.execute(index='some_other_index', refresh=False)\n self.assertTrue(bulk._client.bulk.called)\n self.assertEquals(bulk._client.bulk.call_args[1]['index'],\n 'some_other_index')\n self.assertEquals(bulk._client.bulk.call_args[1]['doc_type'],\n 'some_type')\n self.assertEquals(bulk._client.bulk.call_args[1]['refresh'],\n 'false')", "metadata": "root.TestBulkOperation.test_execute_must_override_kwargs_provided_at_bulk_op_creation", "header": "['class', 'TestBulkOperation', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '# create a common Elasticsearch object', '___NL___', '___EOS___']", "index": 389 } ]
[ { "span": "resp ", "start_line": 364, "start_column": 8, "end_line": 364, "end_column": 12 }, { "span": "resp ", "start_line": 380, "start_column": 8, "end_line": 380, "end_column": 12 }, { "span": "resp ", "start_line": 399, "start_column": 8, "end_line": 399, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Bul", "k", "Operation_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "common", " ", "Elast", "ics", "ear", "ch", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "execute", "\\u", "must", "\\u", "call", "\\u", "bul", "k", "\\u", "with", "\\u", "correct", "\\u", "body", "\\u", "arg_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "body_", "=_", "dict_", "(_", "key1_", "=_", "'", "val", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bulk_", "=_", "self_", "._", "ss_", "._", "bul", "k", "\\u", "operation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bulk_", "._", "\\u", "client_", "._", "bulk_", "=_", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bulk_", "._", "create_", "(_", "index_", "=_", "'", "test\\u", "bul", "k", "'_", ",_", "doc", "\\u", "type_", "=_", "'", "test\\u", "bul", "k", "\\u", "doc", "\\u", "type", "'_", ",_", "body_", "=_", "body_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "id_", "=_", "4_", ",_", "routing_", "=_", "'", "abc", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bulk_", "._", "index_", "(_", "index_", "=_", "'", "test\\u", "bul", "k", "'_", ",_", "doc", "\\u", "type_", "=_", "'", "test\\u", "bul", "k", "\\u", "doc", "\\u", "type", "'_", ",_", "body_", "=_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected", "\\u", "bul", "k", "\\u", "body_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "action_", "in_", "bulk_", "._", "\\u", "actions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected", "\\u", "bul", "k", "\\u", "body_", "+=_", "action_", "._", "es", "\\u", "op_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resp_", "=_", "bulk_", "._", "execute_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "bulk_", "._", "\\u", "client_", "._", "bulk_", "._", "called_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "bulk_", "._", "\\u", "client_", "._", "bulk_", "._", "call", "\\u", "args_", "[_", "1_", "]_", "[_", "'", "body", "'_", "]_", ",_", "str_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "bulk_", "._", "\\u", "client_", "._", "bulk_", "._", "call", "\\u", "args_", "[_", "1_", "]_", "[_", "'", "body", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expected", "\\u", "bul", "k", "\\u", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Bul", "k", "Operation_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "common", " ", "Elast", "ics", "ear", "ch", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "execute", "\\u", "must", "\\u", "use", "\\u", "kwarg", "s", "\\u", "provided", "\\u", "at", "\\u", "the", "\\u", "creati", "on", "\\u", "of", "\\u", "bul", "k", "\\u", "op_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "body_", "=_", "dict_", "(_", "key1_", "=_", "'", "val", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bulk_", "=_", "self_", "._", "ss_", "._", "bul", "k", "\\u", "operation_", "(_", "index_", "=_", "'", "default", "\\u", "index", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "doc", "\\u", "type_", "=_", "'", "some", "\\u", "type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "refresh_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bulk_", "._", "\\u", "client_", "._", "bulk_", "=_", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bulk_", "._", "create_", "(_", "index_", "=_", "'", "test\\u", "bul", "k", "'_", ",_", "doc", "\\u", "type_", "=_", "'", "test\\u", "bul", "k", "\\u", "doc", "\\u", "type", "'_", ",_", "body_", "=_", "body_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "id_", "=_", "4_", ",_", "routing_", "=_", "'", "abc", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bulk_", "._", "index_", "(_", "index_", "=_", "'", "test\\u", "bul", "k", "'_", ",_", "doc", "\\u", "type_", "=_", "'", "test\\u", "bul", "k", "\\u", "doc", "\\u", "type", "'_", ",_", "body_", "=_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "bulk_", "._", "execute_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "bulk_", "._", "\\u", "client_", "._", "bulk_", "._", "called_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "bulk_", "._", "\\u", "client_", "._", "bulk_", "._", "call", "\\u", "args_", "[_", "1_", "]_", "[_", "'", "index", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "default", "\\u", "index", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "bulk_", "._", "\\u", "client_", "._", "bulk_", "._", "call", "\\u", "args_", "[_", "1_", "]_", "[_", "'", "doc", "\\u", "type", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "some", "\\u", "type", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "bulk_", "._", "\\u", "client_", "._", "bulk_", "._", "call", "\\u", "args_", "[_", "1_", "]_", "[_", "'", "refre", "sh", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "true", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Bul", "k", "Operation_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "common", " ", "Elast", "ics", "ear", "ch", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "execute", "\\u", "must", "\\u", "override", "\\u", "kwarg", "s", "\\u", "provided", "\\u", "at", "\\u", "bul", "k", "\\u", "op", "\\u", "creation_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "body_", "=_", "dict_", "(_", "key1_", "=_", "'", "val", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bulk_", "=_", "self_", "._", "ss_", "._", "bul", "k", "\\u", "operation_", "(_", "index_", "=_", "'", "default", "\\u", "index", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "doc", "\\u", "type_", "=_", "'", "some", "\\u", "type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "refresh_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bulk_", "._", "\\u", "client_", "._", "bulk_", "=_", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bulk_", "._", "create_", "(_", "index_", "=_", "'", "test\\u", "bul", "k", "'_", ",_", "doc", "\\u", "type_", "=_", "'", "test\\u", "bul", "k", "\\u", "doc", "\\u", "type", "'_", ",_", "body_", "=_", "body_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "id_", "=_", "4_", ",_", "routing_", "=_", "'", "abc", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bulk_", "._", "index_", "(_", "index_", "=_", "'", "test\\u", "bul", "k", "'_", ",_", "doc", "\\u", "type_", "=_", "'", "test\\u", "bul", "k", "\\u", "doc", "\\u", "type", "'_", ",_", "body_", "=_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "bulk_", "._", "execute_", "(_", "index_", "=_", "'", "some", "\\u", "other", "\\u", "index", "'_", ",_", "refresh_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "bulk_", "._", "\\u", "client_", "._", "bulk_", "._", "called_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "bulk_", "._", "\\u", "client_", "._", "bulk_", "._", "call", "\\u", "args_", "[_", "1_", "]_", "[_", "'", "index", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "some", "\\u", "other", "\\u", "index", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "bulk_", "._", "\\u", "client_", "._", "bulk_", "._", "call", "\\u", "args_", "[_", "1_", "]_", "[_", "'", "doc", "\\u", "type", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "some", "\\u", "type", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "bulk_", "._", "\\u", "client_", "._", "bulk_", "._", "call", "\\u", "args_", "[_", "1_", "]_", "[_", "'", "refre", "sh", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fal", "se", "'_", ")_", "\\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,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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 ]
Except block handles 'BaseException'
anandology/pyjamas/library/gwt/dnd/DNDHelper.py
[ { "content": " def onMouseMove(self, sender, x, y):\n event = DOM.eventGetCurrentEvent()\n self.mouseEvent = event\n button = DOM.eventGetButton(event)\n if not button == Event.BUTTON_LEFT:\n return\n## The following commented code lets the native dnd happen in IE. sucks.\n## But it may enable dragging our widgets out of IE into other apps.\n# else:\n# try:\n# self.dragWidget.getElement().dragDrop()\n# return\n# except:\n# pass\n\n # Adjust x and y to absolute coordinates.\n x, y = eventCoordinates(event)\n\n if self.dragging == DRAGGING_NO_MOVEMENT_YET:\n self.origMouseX = x\n self.origMouseY = y\n self.currentDragOperation = 'none'\n fromElement = self.dragWidget.getElement()\n # Is the widget itself draggable?\n try:\n draggable = fromElement.draggable\n except:\n draggable = False\n # if not, find the draggable element at (x, y) in the widget\n if not draggable:\n fromElement = findDraggable(sender.getElement(),\n self.origMouseX, self.origMouseY)\n # Nothing draggable found. return.\n if fromElement is None:\n self.dragging = NOT_DRAGGING\n return\n # Get the location for the dragging widget\n\n #self.absParent = None\n\n #self.absParent = self.dragWidget.getParent()\n #self.absLeft = DOM.getStyleAttribute(fromElement, 'left')\n\n #print self.absLeft\n #self.absTop = DOM.getStyleAttribute(fromElement, 'top')\n #print self.absTop\n #self.origTop = DOM.getAbsoluteTop(fromElement) + parent.getAbsoluteTop()\n #self.origLeft = DOM.getAbsoluteLeft(fromElement) + parent.getAbsoluteLeft()\n self.origTop = DOM.getAbsoluteTop(fromElement)\n self.origLeft = DOM.getAbsoluteLeft(fromElement)\n #self.glassTop = DOM.getAbsoluteTop(fromElement.offsetParent)\n #self.glassLeft = DOM.getAbsoluteTop(fromElement.offsetParent)\n position_absolute = DOM.getStyleAttribute(fromElement,\n 'position') == 'absolute'\n if position_absolute:\n self.dragLeftOffset = (self.origMouseX -\n DOM.getAbsoluteLeft(fromElement.offsetParent))\n self.dragTopOffset = (self.origMouseY -\n DOM.getAbsoluteTop(fromElement.offsetParent))\n else:\n self.dragLeftOffset = self.origMouseX - self.origLeft\n self.dragTopOffset = self.origMouseY - self.origTop\n\n# self.setDragImage(fromElement,\n# self.origMouseX - self.origLeft,\n# self.origMouseY - self.origTop)\n self.dragDataStore.elements = [fromElement]\n dragStartEvent = self.fireDNDEvent('dragstart', None,\n self.dragWidget)\n if not isCanceled(dragStartEvent):\n self.initFeedbackImage()\n RootPanel().add(self.draggingImage)\n self.setDragImageLocation(x, y)\n self.dragging = ACTIVELY_DRAGGING\n GlassWidget.show(self)\n elif self.dragging == ACTIVELY_DRAGGING:\n try:\n doc().selection.empty()\n except:\n wnd().getSelection().removeAllRanges()\n\n self.setDragImageLocation(x, y)\n\n # If we are still working on the previous iteration, or if we have\n # done this recently, we'll wait for the next event.\n if self.dragBusy or time.time() - self.drag_time < 0.25:\n return\n\n self.doDrag(event, x, y)\n self.drag_time = time.time()", "metadata": "root.DNDHelper.onMouseMove", "header": "['class', 'DNDHelper', '(', 'object', ')', ':', '___EOS___']", "index": 248 } ]
[ { "span": "except:", "start_line": 274, "start_column": 12, "end_line": 274, "end_column": 19 }, { "span": "except:", "start_line": 326, "start_column": 12, "end_line": 326, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "DN", "DH", "elp", "er_", "(_", "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_", "on", "Mouse", "Move_", "(_", "self_", ",_", "sender_", ",_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "event_", "=_", "DOM_", "._", "event", "Get", "Curr", "ent", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mouse", "Event_", "=_", "event_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "button_", "=_", "DOM_", "._", "event", "Get", "Button_", "(_", "event_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "button_", "==_", "Event_", "._", "BUTTON", "\\u", "LEFT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "##", " ", "The", " ", "follow", "ing", " ", "commente", "d", " ", "code", " ", "lets", " ", "the", " ", "nativ", "e", " ", "dnd", " ", "happ", "en", " ", "in", " ", "IE", ".", " ", "suc", "ks", "._", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Bu", "t", " ", "it", " ", "may", " ", "enable", " ", "dragg", "ing", " ", "our", " ", "widget", "s", " ", "out", " ", "of", " ", "IE", " ", "int", "o", " ", "other", " ", "apps", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "drag", "Wid", "get", ".", "get", "Element", "()", ".", "drag", "Drop", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "return_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "except", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Adjust", " ", "x", " ", "and", " ", "y", " ", "to", " ", "abs", "olute", " ", "coordinate", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "x_", ",_", "y_", "=_", "event", "Coordinates_", "(_", "event_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "dragg", "ing_", "==_", "DRA", "GG", "ING", "\\u", "NO", "\\u", "MOVE", "MENT", "\\u", "YE", "T_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "orig", "Mouse", "X_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "orig", "Mouse", "Y_", "=_", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "current", "Drag", "Operation_", "=_", "'", "none", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from", "Element_", "=_", "self_", "._", "drag", "Widget_", "._", "get", "Element_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Is", " ", "the", " ", "widget", " ", "its", "elf", " ", "dragg", "able", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dragg", "able_", "=_", "from", "Element_", "._", "dragg", "able_", "\\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 ", " _", "dragg", "able_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "not", ",", " ", "find", " ", "the", " ", "dragg", "able", " ", "element", " ", "at", " ", "(", "x", ",", " ", "y", ")", " ", "in", " ", "the", " ", "widget_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "dragg", "able_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from", "Element_", "=_", "find", "Drag", "gab", "le_", "(_", "sender_", "._", "get", "Element_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "orig", "Mouse", "X_", ",_", "self_", "._", "orig", "Mouse", "Y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", "hing", " ", "dragg", "able", " ", "found", ".", " ", "return", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "from", "Element_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "dragg", "ing_", "=_", "NOT", "\\u", "DRA", "GG", "ING_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "location", " ", "for", " ", "the", " ", "dragg", "ing", " ", "widget_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "abs", "Parent", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "abs", "Parent", " ", "=", " ", "self", ".", "drag", "Wid", "get", ".", "get", "Parent", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "abs", "Le", "ft", " ", "=", " ", "DOM", ".", "get", "Style", "Attribute", "(", "from", "Element", ",", " ", "'", "left", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "self", ".", "abs", "Left_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "abs", "Top", " ", "=", " ", "DOM", ".", "get", "Style", "Attribute", "(", "from", "Element", ",", " ", "'", "top", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "self", ".", "abs", "Top_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "orig", "Top", " ", "=", " ", "DOM", ".", "get", "Abs", "olute", "Top", "(", "from", "Element", ")", " ", "+", " ", "parent", ".", "get", "Abs", "olute", "Top", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "orig", "Le", "ft", " ", "=", " ", "DOM", ".", "get", "Abs", "olute", "Le", "ft", "(", "from", "Element", ")", " ", "+", " ", "parent", ".", "get", "Abs", "olute", "Le", "ft", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "orig", "Top_", "=_", "DOM_", "._", "get", "Abs", "olute", "Top_", "(_", "from", "Element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "orig", "Left_", "=_", "DOM_", "._", "get", "Abs", "olute", "Left_", "(_", "from", "Element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "glass", "Top", " ", "=", " ", "DOM", ".", "get", "Abs", "olute", "Top", "(", "from", "Element", ".", "offset", "Parent", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "glass", "Le", "ft", " ", "=", " ", "DOM", ".", "get", "Abs", "olute", "Top", "(", "from", "Element", ".", "offset", "Parent", ")_", "\\u\\u\\uNL\\u\\u\\u_", "position", "\\u", "absolute_", "=_", "DOM_", "._", "get", "Style", "Attribute_", "(_", "from", "Element_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "position", "'_", ")_", "==_", "'", "abs", "olute", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "position", "\\u", "absolute_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "drag", "Le", "ft", "Offset_", "=_", "(_", "self_", "._", "orig", "Mouse", "X_", "-_", "\\u\\u\\uNL\\u\\u\\u_", "DOM_", "._", "get", "Abs", "olute", "Left_", "(_", "from", "Element_", "._", "offset", "Parent_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "drag", "Top", "Offset_", "=_", "(_", "self_", "._", "orig", "Mouse", "Y_", "-_", "\\u\\u\\uNL\\u\\u\\u_", "DOM_", "._", "get", "Abs", "olute", "Top_", "(_", "from", "Element_", "._", "offset", "Parent_", ")_", ")_", "\\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_", "._", "drag", "Le", "ft", "Offset_", "=_", "self_", "._", "orig", "Mouse", "X_", "-_", "self_", "._", "orig", "Left_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "drag", "Top", "Offset_", "=_", "self_", "._", "orig", "Mouse", "Y_", "-_", "self_", "._", "orig", "Top_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "set", "Drag", "Image", "(", "from", "Element", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "self", ".", "orig", "Mouse", "X", " ", "-", " ", "self", ".", "orig", "Le", "ft", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "self", ".", "orig", "Mouse", "Y", " ", "-", " ", "self", ".", "orig", "Top", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "drag", "Data", "Store_", "._", "elements_", "=_", "[_", "from", "Element_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "drag", "Start", "Event_", "=_", "self_", "._", "fire", "DN", "DE", "vent_", "(_", "'", "drag", "start", "'_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "drag", "Widget_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "is", "Cancel", "ed_", "(_", "drag", "Start", "Event_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "init", "Feed", "back", "Image_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Roo", "t", "Panel_", "(_", ")_", "._", "add_", "(_", "self_", "._", "dragg", "ing", "Image_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Drag", "Image", "Location_", "(_", "x_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dragg", "ing_", "=_", "ACTI", "VEL", "Y", "\\u", "DRA", "GG", "ING_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Gla", "ss", "Widget_", "._", "show_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "dragg", "ing_", "==_", "ACTI", "VEL", "Y", "\\u", "DRA", "GG", "ING_", ":_", "\\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 ", " _", "doc_", "(_", ")_", "._", "selection_", "._", "empty_", "(_", ")_", "\\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 ", " _", "wnd", "_", "(_", ")_", "._", "get", "Selection_", "(_", ")_", "._", "remove", "All", "Ranges_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "set", "Drag", "Image", "Location_", "(_", "x_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", " ", "are", " ", "still", " ", "working", " ", "on", " ", "the", " ", "previ", "ous", " ", "iterati", "on", ",", " ", "or", " ", "if", " ", "we", " ", "have_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "don", "e", " ", "this", " ", "recent", "ly", ",", " ", "we", "'", "ll", " ", "wait", " ", "for", " ", "the", " ", "next", " ", "event", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "drag", "Busy", "_", "or_", "time_", "._", "time_", "(_", ")_", "-_", "self_", "._", "drag", "\\u", "time_", "<_", "0.25_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "do", "Drag", "_", "(_", "event_", ",_", "x_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "drag", "\\u", "time_", "=_", "time_", "._", "time_", "(_", ")_", "\\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,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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 ]
Unreachable code
yspanchal/docli/docli/commands/records.py
[ { "content": "def validate(dic):\n\toption_list = ['create', 'update', 'delete']\n\tfor option in option_list:\n\t\tif dic['getlist'] and dic[option]:\n\t\t\traise click.UsageError('Invalid option combination --getlist cannot be used with --%s' % option)\n\t\t\tbreak\n\n\toption_list = ['update', 'delete']\n\tfor option in option_list:\n\t\tif dic['create'] and dic[option]:\n\t\t\traise click.UsageError('Invalid option combination --create cannot be used with --%s' % option)\n\t\t\tbreak\n\n\tif dic['delete'] and dic['update']:\n\t\traise click.UsageError('Invalid option combination --delete cannot be used with --update')\n\n\toption_list = ['type', 'name', 'data', 'priority', 'port', 'weight', 'recordid']\n\tfor option in option_list:\n\t\tif dic['getlist'] and dic[option]:\n\t\t\traise click.UsageError('Invalid option combination --getlist cannot be used with --%s' % option)\n\t\t\tbreak\n\n\t\tif dic['delete'] and dic[option]:\n\t\t\traise click.UsageError('Invalid option combination --delete cannot be used with --%s' % option)\n\t\t\tbreak\n\n\toption_list = ['type', 'name', 'data']\n\tfor option in option_list:\n\t\tif dic['create'] and not dic[option]:\n\t\t\traise click.UsageError('--create requires --type, --name and --data options')\n\t\t\tbreak\n\n\tif dic['update'] and not dic['recordid']:\n\t\traise click.UsageError('--update requires --recordid to be updated')\n\n\n\tif dic['update'] and (not dic['type'] or not dic['name'] or not dic['data'] or not dic['priority'] or not dic['port'] or not dic['weight']):\n\t\traise click.UsageError('--update requires atleast one option from [--type, --name, --data, --priority, --port, --weight]')\n\n\tif (dic['name'] or dic['type'] or dic['data'] or dic['priority'] or dic['port'] or dic['weight']) and (not dic['create'] or not dic['update']):\n\t\traise click.UsageError('[--type, --name, --data, --priority, --port, --weight] options either use with --create or --update')\n\n\tif dic['recordid'] and not dic['update']:\n\t\traise click.UsageError('--recordid requires --update option')\n\n\treturn True", "metadata": "root.validate", "header": "['module', '___EOS___']", "index": 15 } ]
[ { "span": "break", "start_line": 20, "start_column": 3, "end_line": 20, "end_column": 8 }, { "span": "break", "start_line": 26, "start_column": 3, "end_line": 26, "end_column": 8 }, { "span": "break", "start_line": 35, "start_column": 3, "end_line": 35, "end_column": 8 }, { "span": "break", "start_line": 39, "start_column": 3, "end_line": 39, "end_column": 8 }, { "span": "break", "start_line": 45, "start_column": 3, "end_line": 45, "end_column": 8 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "dic_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "option", "\\u", "list_", "=_", "[_", "'", "create", "'_", ",_", "'", "update", "'_", ",_", "'", "delete", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "option_", "in_", "option", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "dic_", "[_", "'", "getl", "ist", "'_", "]_", "and_", "dic_", "[_", "option_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "click_", "._", "Us", "age", "Error_", "(_", "'", "Inva", "lid", " ", "option", " ", "combinat", "ion", " ", "--", "getl", "ist", " ", "cann", "ot", " ", "be", " ", "used", " ", "with", " ", "--", "%", "s", "'_", "%_", "option_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "option", "\\u", "list_", "=_", "[_", "'", "update", "'_", ",_", "'", "delete", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "option_", "in_", "option", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "dic_", "[_", "'", "create", "'_", "]_", "and_", "dic_", "[_", "option_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "click_", "._", "Us", "age", "Error_", "(_", "'", "Inva", "lid", " ", "option", " ", "combinat", "ion", " ", "--", "create", " ", "cann", "ot", " ", "be", " ", "used", " ", "with", " ", "--", "%", "s", "'_", "%_", "option_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\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_", "dic_", "[_", "'", "delete", "'_", "]_", "and_", "dic_", "[_", "'", "update", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "click_", "._", "Us", "age", "Error_", "(_", "'", "Inva", "lid", " ", "option", " ", "combinat", "ion", " ", "--", "delete", " ", "cann", "ot", " ", "be", " ", "used", " ", "with", " ", "--", "update", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "option", "\\u", "list_", "=_", "[_", "'", "type", "'_", ",_", "'", "name", "'_", ",_", "'", "data", "'_", ",_", "'", "priorit", "y", "'_", ",_", "'", "port", "'_", ",_", "'", "weight", "'_", ",_", "'", "record", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "option_", "in_", "option", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "dic_", "[_", "'", "getl", "ist", "'_", "]_", "and_", "dic_", "[_", "option_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "click_", "._", "Us", "age", "Error_", "(_", "'", "Inva", "lid", " ", "option", " ", "combinat", "ion", " ", "--", "getl", "ist", " ", "cann", "ot", " ", "be", " ", "used", " ", "with", " ", "--", "%", "s", "'_", "%_", "option_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "dic_", "[_", "'", "delete", "'_", "]_", "and_", "dic_", "[_", "option_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "click_", "._", "Us", "age", "Error_", "(_", "'", "Inva", "lid", " ", "option", " ", "combinat", "ion", " ", "--", "delete", " ", "cann", "ot", " ", "be", " ", "used", " ", "with", " ", "--", "%", "s", "'_", "%_", "option_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "option", "\\u", "list_", "=_", "[_", "'", "type", "'_", ",_", "'", "name", "'_", ",_", "'", "data", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "option_", "in_", "option", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "dic_", "[_", "'", "create", "'_", "]_", "and_", "not_", "dic_", "[_", "option_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "click_", "._", "Us", "age", "Error_", "(_", "'--", "create", " ", "require", "s", " ", "--", "type", ",", " ", "--", "name", " ", "and", " ", "--", "data", " ", "options", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\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_", "dic_", "[_", "'", "update", "'_", "]_", "and_", "not_", "dic_", "[_", "'", "record", "id", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "click_", "._", "Us", "age", "Error_", "(_", "'--", "update", " ", "require", "s", " ", "--", "record", "id", " ", "to", " ", "be", " ", "update", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "dic_", "[_", "'", "update", "'_", "]_", "and_", "(_", "not_", "dic_", "[_", "'", "type", "'_", "]_", "or_", "not_", "dic_", "[_", "'", "name", "'_", "]_", "or_", "not_", "dic_", "[_", "'", "data", "'_", "]_", "or_", "not_", "dic_", "[_", "'", "priorit", "y", "'_", "]_", "or_", "not_", "dic_", "[_", "'", "port", "'_", "]_", "or_", "not_", "dic_", "[_", "'", "weight", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "click_", "._", "Us", "age", "Error_", "(_", "'--", "update", " ", "require", "s", " ", "atl", "east", " ", "one", " ", "option", " ", "from", " ", "[-", "-", "type", ",", " ", "--", "name", ",", " ", "--", "data", ",", " ", "--", "priorit", "y", ",", " ", "--", "port", ",", " ", "--", "weight", "]'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "dic_", "[_", "'", "name", "'_", "]_", "or_", "dic_", "[_", "'", "type", "'_", "]_", "or_", "dic_", "[_", "'", "data", "'_", "]_", "or_", "dic_", "[_", "'", "priorit", "y", "'_", "]_", "or_", "dic_", "[_", "'", "port", "'_", "]_", "or_", "dic_", "[_", "'", "weight", "'_", "]_", ")_", "and_", "(_", "not_", "dic_", "[_", "'", "create", "'_", "]_", "or_", "not_", "dic_", "[_", "'", "update", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "click_", "._", "Us", "age", "Error_", "(_", "'[", "--", "type", ",", " ", "--", "name", ",", " ", "--", "data", ",", " ", "--", "priorit", "y", ",", " ", "--", "port", ",", " ", "--", "weight", "]", " ", "options", " ", "eit", "her", " ", "use", " ", "with", " ", "--", "create", " ", "or", " ", "--", "update", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "dic_", "[_", "'", "record", "id", "'_", "]_", "and_", "not_", "dic_", "[_", "'", "update", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "click_", "._", "Us", "age", "Error_", "(_", "'--", "record", "id", " ", "require", "s", " ", "--", "update", " ", "option", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "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, 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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 ]
Unused import
dimagi/commcare-hq/corehq/apps/accounting/migrations/0019_remove_softwareplanversion_product_rates.py
[ { "content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Migration(migrations.Migration):\n\n dependencies = [\n ('accounting', '0018_datamigration_product_rates_to_product_rate'),\n ]\n\n operations = [\n migrations.RemoveField(\n model_name='softwareplanversion',\n name='product_rates',\n ),\n ]", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 6 } ]
[ { "span": "from django.db import models, migrations", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 40 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\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_", "from_", "django_", "._", "db_", "import_", "models_", ",_", "migrations_", "\\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_", "Migration_", "(_", "migrations_", "._", "Migration_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dependencies_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "accounti", "ng", "'_", ",_", "'", "0018", "\\u", "datam", "igra", "tion", "\\u", "product", "\\u", "rate", "s", "\\u", "to", "\\u", "product", "\\u", "rate", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "operations_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "migrations_", "._", "Remove", "Field_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "model", "\\u", "name_", "=_", "'", "software", "plan", "version", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "product", "\\u", "rate", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 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 ]
Unused import
iskandr/parakeet/parakeet/ndtypes/__init__.py
[ { "content": "from array_type import (ArrayT, make_array_type,\n elt_type, elt_types, rank,\n get_rank, lower_rank,\n lower_rank, lower_ranks, increase_rank)\n\nfrom closure_type import make_closure_type, ClosureT \n\nfrom core_types import (Type, AnyT, Any, UnknownT, Unknown, \n TypeFailure, IncompatibleTypes, FieldNotFound,\n NoneT, NoneType, \n ConcreteT, ImmutableT, StructT, \n TypeValueT, combine_type_list)\n\nfrom fn_type import make_fn_type, FnT \n\nfrom ptr_type import PtrT, ptr_type \n\nfrom scalar_types import (ScalarT, \n IntT, FloatT, BoolT, SignedT, UnsignedT, \n Int8, Int16, Int24, Int32, Int64, \n UInt8, UInt16, UInt32, UInt64, \n Bool, Float32, Float64, \n is_scalar_subtype, is_scalar, all_scalars, \n from_dtype, from_char_code)\n \nfrom slice_type import SliceT, make_slice_type\n\nfrom tuple_type import TupleT, make_tuple_type, empty_tuple_t, repeat_tuple\n\nimport dtypes\nimport type_conv \nfrom type_conv import typeof\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from array_type import (ArrayT, make_array_type,\n elt_type, elt_types, rank,\n get_rank, lower_rank,\n lower_rank, lower_ranks, increase_rank)", "start_line": 0, "start_column": 0, "end_line": 3, "end_column": 63 }, { "span": "from closure_type import make_closure_type, ClosureT ", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 52 }, { "span": "from core_types import (Type, AnyT, Any, UnknownT, Unknown, \n TypeFailure, IncompatibleTypes, FieldNotFound,\n NoneT, NoneType, \n ConcreteT, ImmutableT, StructT, \n TypeValueT, combine_type_list)", "start_line": 7, "start_column": 0, "end_line": 11, "end_column": 54 }, { "span": "from fn_type import make_fn_type, FnT ", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 37 }, { "span": "from ptr_type import PtrT, ptr_type ", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 35 }, { "span": "from scalar_types import (ScalarT, \n IntT, FloatT, BoolT, SignedT, UnsignedT, \n Int8, Int16, Int24, Int32, Int64, \n UInt8, UInt16, UInt32, UInt64, \n Bool, Float32, Float64, \n is_scalar_subtype, is_scalar, all_scalars, \n from_dtype, from_char_code)", "start_line": 17, "start_column": 0, "end_line": 23, "end_column": 53 }, { "span": "from slice_type import SliceT, make_slice_type", "start_line": 25, "start_column": 0, "end_line": 25, "end_column": 46 }, { "span": "from tuple_type import TupleT, make_tuple_type, empty_tuple_t, repeat_tuple", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 75 }, { "span": "import dtypes", "start_line": 29, "start_column": 0, "end_line": 29, "end_column": 13 }, { "span": "import type_conv ", "start_line": 30, "start_column": 0, "end_line": 30, "end_column": 16 }, { "span": "from type_conv import typeof", "start_line": 31, "start_column": 0, "end_line": 31, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "array", "\\u", "type_", "import_", "(_", "Array", "T_", ",_", "make", "\\u", "array", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "elt", "\\u", "type_", ",_", "elt", "\\u", "types_", ",_", "rank_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "get", "\\u", "rank_", ",_", "lower", "\\u", "rank_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lower", "\\u", "rank_", ",_", "lower", "\\u", "ranks_", ",_", "increase", "\\u", "rank_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "clos", "ure", "\\u", "type_", "import_", "make", "\\u", "clos", "ure", "\\u", "type_", ",_", "Clos", "ure", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "core", "\\u", "types_", "import_", "(_", "Type_", ",_", "Any", "T_", ",_", "Any_", ",_", "Un", "know", "n", "T_", ",_", "Unknown_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Type", "Failure_", ",_", "Incomp", "atible", "Types_", ",_", "Field", "Not", "Found_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Non", "e", "T_", ",_", "Non", "e", "Type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Conc", "ret", "e", "T_", ",_", "Immu", "table", "T_", ",_", "Stru", "ct", "T_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Type", "Value", "T_", ",_", "combin", "e\\u", "type", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "fn", "\\u", "type_", "import_", "make", "\\u", "fn", "\\u", "type_", ",_", "Fn", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "ptr", "\\u", "type_", "import_", "Pt", "r", "T_", ",_", "ptr", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "scala", "r", "\\u", "types_", "import_", "(_", "Scala", "r", "T_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Int", "T_", ",_", "Float", "T_", ",_", "Boo", "l", "T_", ",_", "Signe", "d", "T_", ",_", "Unsigned", "T_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Int8_", ",_", "Int16_", ",_", "Int", "24_", ",_", "Int32_", ",_", "Int64", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "UI", "nt", "8_", ",_", "UI", "nt", "16_", ",_", "UI", "nt", "32_", ",_", "UI", "nt", "64_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Bool_", ",_", "Float", "32_", ",_", "Float", "64_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "scala", "r", "\\u", "subtype_", ",_", "is", "\\u", "scalar_", ",_", "all", "\\u", "scalars", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "from", "\\u", "dtype_", ",_", "from", "\\u", "char", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "slice", "\\u", "type_", "import_", "Slice", "T_", ",_", "make", "\\u", "slice", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "tuple", "\\u", "type_", "import_", "Tup", "le", "T_", ",_", "make", "\\u", "tuple", "\\u", "type_", ",_", "empty", "\\u", "tuple", "\\u", "t_", ",_", "repeat", "\\u", "tuple_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "dtypes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "type", "\\u", "conv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "type", "\\u", "conv_", "import_", "typeof", "_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1 ]
An assert statement has a side-effect
topazproject/topaz/tests/test_main.py
[ { "content": " def test_verbose(self, space, tmpdir, capfd):\n self.run(space, tmpdir, \"puts 5\", ruby_args=[\"-v\"])\n out, err = capfd.readouterr()\n [version, out] = out.splitlines()\n assert version.startswith(\"topaz\")\n assert \"1.9.3\" in version\n assert os.uname()[4] in version\n assert platform.system().lower() in version\n assert subprocess.check_output([\"git\", \"rev-parse\", \"--short\", \"HEAD\"]).rstrip() in version\n assert out == \"5\"\n\n self.run(space, tmpdir, ruby_args=[\"-v\"])\n out, err = capfd.readouterr()\n [version] = out.splitlines()\n assert version.startswith(\"topaz\")", "metadata": "root.TestMain.test_verbose", "header": "['class', 'TestMain', '(', 'object', ')', ':', '___EOS___']", "index": 57 }, { "content": " def test_version(self, space, tmpdir, capfd):\n self.run(space, tmpdir, ruby_args=[\"--version\"])\n out, _ = capfd.readouterr()\n [version] = out.splitlines()\n assert version.startswith(\"topaz\")\n assert \"1.9.3\" in version\n assert os.uname()[4] in version\n assert platform.system().lower() in version\n assert subprocess.check_output([\"git\", \"rev-parse\", \"--short\", \"HEAD\"]).rstrip() in version", "metadata": "root.TestMain.test_version", "header": "['class', 'TestMain', '(', 'object', ')', ':', '___EOS___']", "index": 115 } ]
[ { "span": "assert subprocess.check_output([\"git\", \"rev-parse\", \"--short\", \"HEAD\"]).rstrip() in version", "start_line": 65, "start_column": 8, "end_line": 65, "end_column": 99 }, { "span": "assert subprocess.check_output([\"git\", \"rev-parse\", \"--short\", \"HEAD\"]).rstrip() in version", "start_line": 123, "start_column": 8, "end_line": 123, "end_column": 99 } ]
[]
1
true
[ "[CLS]_", "An", "_", "assert_", "statement_", "has_", "a_", "side_", "-_", "effect_", "[SEP]_", "class_", "Test", "Main_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "verbose_", "(_", "self_", ",_", "space_", ",_", "tmpdir_", ",_", "cap", "fd_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "run_", "(_", "space_", ",_", "tmpdir_", ",_", "\"", "puts", " ", "5", "\"_", ",_", "rub", "y", "\\u", "args_", "=_", "[_", "\"-", "v", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", ",_", "err_", "=_", "cap", "fd_", "._", "readouterr_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "version_", ",_", "out_", "]_", "=_", "out_", "._", "splitlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "version_", "._", "startswith_", "(_", "\"", "top", "az", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\"", "1.9", ".3", "\"_", "in_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "os_", "._", "uname_", "(_", ")_", "[_", "4_", "]_", "in_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "platform_", "._", "system_", "(_", ")_", "._", "lower_", "(_", ")_", "in_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "subprocess_", "._", "check", "\\u", "output_", "(_", "[_", "\"", "git", "\"_", ",_", "\"", "rev", "-", "parse", "\"_", ",_", "\"--", "short", "\"_", ",_", "\"", "HEAD", "\"_", "]_", ")_", "._", "rstrip_", "(_", ")_", "in_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "out_", "==_", "\"", "5", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "run_", "(_", "space_", ",_", "tmpdir_", ",_", "rub", "y", "\\u", "args_", "=_", "[_", "\"-", "v", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", ",_", "err_", "=_", "cap", "fd_", "._", "readouterr_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "version_", "]_", "=_", "out_", "._", "splitlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "version_", "._", "startswith_", "(_", "\"", "top", "az", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Main_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "version_", "(_", "self_", ",_", "space_", ",_", "tmpdir_", ",_", "cap", "fd_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "run_", "(_", "space_", ",_", "tmpdir_", ",_", "rub", "y", "\\u", "args_", "=_", "[_", "\"--", "version", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", ",_", "\\u_", "=_", "cap", "fd_", "._", "readouterr_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "version_", "]_", "=_", "out_", "._", "splitlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "version_", "._", "startswith_", "(_", "\"", "top", "az", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\"", "1.9", ".3", "\"_", "in_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "os_", "._", "uname_", "(_", ")_", "[_", "4_", "]_", "in_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "platform_", "._", "system_", "(_", ")_", "._", "lower_", "(_", ")_", "in_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "subprocess_", "._", "check", "\\u", "output_", "(_", "[_", "\"", "git", "\"_", ",_", "\"", "rev", "-", "parse", "\"_", ",_", "\"--", "short", "\"_", ",_", "\"", "HEAD", "\"_", "]_", ")_", "._", "rstrip_", "(_", ")_", "in_", "version_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Special method has incorrect signature
fluentpython/example-code/attic/metaprog/plainpoint.py
[ { "content": " def __iter__(self, other): # support unpacking\n yield self.x\n yield self.y", "metadata": "root.Point.__iter__", "header": "['class', 'Point', '(', 'object', ')', ':', '___EOS___']", "index": 22 } ]
[ { "span": "def __iter__(self, other): ", "start_line": 22, "start_column": 4, "end_line": 22, "end_column": 30 } ]
[]
1
true
[ "[CLS]_", "Special", "_", "method_", "has_", "incorrect", "_", "signature_", "[SEP]_", "class_", "Point_", "(_", "object_", ")_", ":_", "\\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_", ",_", "other_", ")_", ":_", "#", " ", "support", " ", "unpack", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "self_", "._", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "self_", "._", "y_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
inpho/vsm/unit_tests/tests_corpusbuilders.py
[ { "content": " def test_empty_corpus(self):\n \n c = empty_corpus()\n self.assertTrue((np.array([]) == c.corpus).all())\n self.assertTrue(['document'] == c.context_types)\n self.assertTrue((np.array([]) == c.view_contexts('document')).all())", "metadata": "root.TestCorpusbuilders.test_empty_corpus", "header": "['class', 'TestCorpusbuilders', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 9 }, { "content": " def test_corpus_fromlist(self):\n\n l = [[],['Not','an','empty','document'],[],\n ['Another','non-empty','document'],[]]\n\n c = corpus_fromlist(l, context_type='sentence')\n\n self.assertTrue(c.context_types == ['sentence'])\n self.assertTrue((c.context_data[0]['idx'] == [4,7]).all())\n self.assertTrue((c.context_data[0]['sentence_label'] ==\n ['sentence_1', 'sentence_3']).all())", "metadata": "root.TestCorpusbuilders.test_corpus_fromlist", "header": "['class', 'TestCorpusbuilders', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 16 }, { "content": " def test_file_tokenize(self):\n\n text = 'foo foo foo\\n\\nfoo foo. Foo bar. Foo bar. foo\\n\\nfoo'\n\n words, context_data = file_tokenize(text)\n\n self.assertTrue(len(words) == 11)\n self.assertTrue(len(context_data['paragraph']) == 3)\n self.assertTrue(len(context_data['sentence']) == 6)\n \n self.assertTrue((context_data['paragraph']['idx'] == \n [3, 10, 11]).all())\n self.assertTrue((context_data['paragraph']['paragraph_label'] == \n ['0', '1', '2']).all())\n self.assertTrue((context_data['sentence']['idx'] == \n [3, 5, 7, 9, 10, 11]).all())\n self.assertTrue((context_data['sentence']['paragraph_label'] == \n ['0', '1', '1', '1', '1', '2']).all())\n self.assertTrue((context_data['sentence']['sentence_label'] == \n ['0', '1', '2', '3', '4', '5']).all())", "metadata": "root.TestCorpusbuilders.test_file_tokenize", "header": "['class', 'TestCorpusbuilders', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 65 }, { "content": " def test_dir_tokenize(self):\n\n chunks = ['foo foo foo\\n\\nfoo foo',\n 'Foo bar. Foo bar.', \n '',\n 'foo\\n\\nfoo']\n\n labels = [str(i) for i in xrange(len(chunks))]\n words, context_data = dir_tokenize(chunks, labels)\n\n print\n print context_data['sentence']['idx']\n print\n\n self.assertTrue(len(words) == 11)\n self.assertTrue(len(context_data['article']) == 4)\n self.assertTrue(len(context_data['paragraph']) == 6)\n self.assertTrue(len(context_data['sentence']) == 6)\n \n self.assertTrue((context_data['article']['idx'] == [5, 9, 9, 11]).all())\n self.assertTrue((context_data['article']['article_label'] == \n ['0', '1', '2', '3']).all())\n self.assertTrue((context_data['paragraph']['idx'] == \n [3, 5, 9, 9, 10, 11]).all())\n self.assertTrue((context_data['paragraph']['article_label'] == \n ['0', '0', '1', '2', '3', '3']).all())\n self.assertTrue((context_data['paragraph']['paragraph_label'] == \n ['0', '1', '2', '3', '4', '5']).all())\n self.assertTrue((context_data['sentence']['idx'] == \n [3, 5, 7, 9, 10, 11]).all())\n self.assertTrue((context_data['sentence']['article_label'] == \n ['0', '0', '1', '1', '3', '3']).all())\n self.assertTrue((context_data['sentence']['paragraph_label'] == \n ['0', '1', '2', '2', '4', '5']).all())\n self.assertTrue((context_data['sentence']['sentence_label'] == \n ['0', '1', '2', '3', '4', '5']).all())", "metadata": "root.TestCorpusbuilders.test_dir_tokenize", "header": "['class', 'TestCorpusbuilders', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 106 }, { "content": " def test_coll_tokenize(self):\n\n books = [[('foo foo foo.\\n\\nfoo foo', '1'),\n ('Foo bar. Foo bar.', '2')], \n [('','3'),\n ('foo.\\n\\nfoo', '4')]]\n\n book_names = [str(i) for i in xrange(len(books))]\n words, context_data = coll_tokenize(books, book_names)\n\n self.assertTrue(len(words) == 11)\n self.assertTrue(len(context_data['book']) == 2)\n self.assertTrue(len(context_data['page']) == 4)\n self.assertTrue(len(context_data['sentence']) == 6)\n self.assertTrue((context_data['book']['idx'] == [9, 11]).all())\n self.assertTrue((context_data['book']['book_label'] == ['0', '1']).all())\n self.assertTrue((context_data['page']['idx'] == [5, 9, 9, 11]).all())\n self.assertTrue((context_data['page']['page_label'] == \n ['0', '1', '2', '3']).all())\n self.assertTrue((context_data['page']['book_label'] == \n ['0', '0', '1', '1']).all())\n self.assertTrue((context_data['sentence']['idx'] == \n [3, 5, 7, 9, 10, 11]).all())\n self.assertTrue((context_data['sentence']['sentence_label'] == \n ['0', '1', '2', '3', '4', '5']).all())\n self.assertTrue((context_data['sentence']['page_label'] == \n ['0', '0', '1', '1', '3', '3']).all())\n self.assertTrue((context_data['sentence']['book_label'] == \n ['0', '0', '0', '0', '1', '1']).all())\n self.assertTrue((context_data['page']['file'] ==\n ['1','2','3','4']).all())\n self.assertTrue((context_data['sentence']['file'] ==\n ['1','1','2','2','4','4']).all()) ", "metadata": "root.TestCorpusbuilders.test_coll_tokenize", "header": "['class', 'TestCorpusbuilders', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 144 } ]
[ { "span": "self.assertTrue(['document'] == c.context_types)", "start_line": 13, "start_column": 8, "end_line": 13, "end_column": 56 }, { "span": "self.assertTrue(c.context_types == ['sentence'])", "start_line": 23, "start_column": 8, "end_line": 23, "end_column": 56 }, { "span": "self.assertTrue(len(words) == 11)", "start_line": 71, "start_column": 8, "end_line": 71, "end_column": 41 }, { "span": "self.assertTrue(len(context_data['paragraph']) == 3)", "start_line": 72, "start_column": 8, "end_line": 72, "end_column": 60 }, { "span": "self.assertTrue(len(context_data['sentence']) == 6)", "start_line": 73, "start_column": 8, "end_line": 73, "end_column": 59 }, { "span": "self.assertTrue(len(words) == 11)", "start_line": 120, "start_column": 8, "end_line": 120, "end_column": 41 }, { "span": "self.assertTrue(len(context_data['article']) == 4)", "start_line": 121, "start_column": 8, "end_line": 121, "end_column": 58 }, { "span": "self.assertTrue(len(context_data['paragraph']) == 6)", "start_line": 122, "start_column": 8, "end_line": 122, "end_column": 60 }, { "span": "self.assertTrue(len(context_data['sentence']) == 6)", "start_line": 123, "start_column": 8, "end_line": 123, "end_column": 59 }, { "span": "self.assertTrue(len(words) == 11)", "start_line": 154, "start_column": 8, "end_line": 154, "end_column": 41 }, { "span": "self.assertTrue(len(context_data['book']) == 2)", "start_line": 155, "start_column": 8, "end_line": 155, "end_column": 55 }, { "span": "self.assertTrue(len(context_data['page']) == 4)", "start_line": 156, "start_column": 8, "end_line": 156, "end_column": 55 }, { "span": "self.assertTrue(len(context_data['sentence']) == 6)", "start_line": 157, "start_column": 8, "end_line": 157, "end_column": 59 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Cor", "pus", "builders_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "empty", "\\u", "corpus_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "empty", "\\u", "corpus_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "np_", "._", "array_", "(_", "[_", "]_", ")_", "==_", "c_", "._", "corpus_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "[_", "'", "document", "'_", "]_", "==_", "c_", "._", "context", "\\u", "types_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "np_", "._", "array_", "(_", "[_", "]_", ")_", "==_", "c_", "._", "view", "\\u", "contexts_", "(_", "'", "document", "'_", ")_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cor", "pus", "builders_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "corp", "us", "\\u", "froml", "ist_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "=_", "[_", "[_", "]_", ",_", "[_", "'", "Not", "'_", ",_", "'", "an", "'_", ",_", "'", "empty", "'_", ",_", "'", "document", "'_", "]_", ",_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "Ano", "ther", "'_", ",_", "'", "non", "-", "empty", "'_", ",_", "'", "document", "'_", "]_", ",_", "[_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "=_", "corp", "us", "\\u", "froml", "ist_", "(_", "l_", ",_", "context", "\\u", "type_", "=_", "'", "sentence", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "c_", "._", "context", "\\u", "types_", "==_", "[_", "'", "sentence", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "c_", "._", "context", "\\u", "data_", "[_", "0_", "]_", "[_", "'", "idx", "'_", "]_", "==_", "[_", "4_", ",_", "7_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "c_", "._", "context", "\\u", "data_", "[_", "0_", "]_", "[_", "'", "sentence", "\\u", "label", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "sentence", "\\u", "1", "'_", ",_", "'", "sentence", "\\u", "3", "'_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cor", "pus", "builders_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "file", "\\u", "tokenize_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "'", "foo", " ", "foo", " ", "foo", "\\\\", "n", "\\\\", "nfo", "o", " ", "foo", ".", " ", "Foo", " ", "bar", ".", " ", "Foo", " ", "bar", ".", " ", "foo", "\\\\", "n", "\\\\", "nfo", "o", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "words_", ",_", "context", "\\u", "data_", "=_", "file", "\\u", "tokenize_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "words_", ")_", "==_", "11_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "context", "\\u", "data_", "[_", "'", "paragraph", "'_", "]_", ")_", "==_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "context", "\\u", "data_", "[_", "'", "sentence", "'_", "]_", ")_", "==_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "paragraph", "'_", "]_", "[_", "'", "idx", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "3_", ",_", "10_", ",_", "11_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "paragraph", "'_", "]_", "[_", "'", "paragraph", "\\u", "label", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "0", "'_", ",_", "'", "1", "'_", ",_", "'", "2", "'_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "sentence", "'_", "]_", "[_", "'", "idx", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "3_", ",_", "5_", ",_", "7_", ",_", "9_", ",_", "10_", ",_", "11_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "sentence", "'_", "]_", "[_", "'", "paragraph", "\\u", "label", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "0", "'_", ",_", "'", "1", "'_", ",_", "'", "1", "'_", ",_", "'", "1", "'_", ",_", "'", "1", "'_", ",_", "'", "2", "'_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "sentence", "'_", "]_", "[_", "'", "sentence", "\\u", "label", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "0", "'_", ",_", "'", "1", "'_", ",_", "'", "2", "'_", ",_", "'", "3", "'_", ",_", "'", "4", "'_", ",_", "'", "5", "'_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cor", "pus", "builders_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "dir\\u", "tokenize_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chunks_", "=_", "[_", "'", "foo", " ", "foo", " ", "foo", "\\\\", "n", "\\\\", "nfo", "o", " ", "foo", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Foo", " ", "bar", ".", " ", " ", "Foo", " ", "bar", ".'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "foo", "\\\\", "n", "\\\\", "nfo", "o", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "labels_", "=_", "[_", "str_", "(_", "i_", ")_", "for_", "i_", "in_", "xrange_", "(_", "len_", "(_", "chunks_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "words_", ",_", "context", "\\u", "data_", "=_", "dir\\u", "tokenize_", "(_", "chunks_", ",_", "labels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "context", "\\u", "data_", "[_", "'", "sentence", "'_", "]_", "[_", "'", "idx", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "words_", ")_", "==_", "11_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "context", "\\u", "data_", "[_", "'", "article", "'_", "]_", ")_", "==_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "context", "\\u", "data_", "[_", "'", "paragraph", "'_", "]_", ")_", "==_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "context", "\\u", "data_", "[_", "'", "sentence", "'_", "]_", ")_", "==_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "article", "'_", "]_", "[_", "'", "idx", "'_", "]_", "==_", "[_", "5_", ",_", "9_", ",_", "9_", ",_", "11_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "article", "'_", "]_", "[_", "'", "article", "\\u", "label", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "0", "'_", ",_", "'", "1", "'_", ",_", "'", "2", "'_", ",_", "'", "3", "'_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "paragraph", "'_", "]_", "[_", "'", "idx", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "3_", ",_", "5_", ",_", "9_", ",_", "9_", ",_", "10_", ",_", "11_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "paragraph", "'_", "]_", "[_", "'", "article", "\\u", "label", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "0", "'_", ",_", "'", "0", "'_", ",_", "'", "1", "'_", ",_", "'", "2", "'_", ",_", "'", "3", "'_", ",_", "'", "3", "'_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "paragraph", "'_", "]_", "[_", "'", "paragraph", "\\u", "label", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "0", "'_", ",_", "'", "1", "'_", ",_", "'", "2", "'_", ",_", "'", "3", "'_", ",_", "'", "4", "'_", ",_", "'", "5", "'_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "sentence", "'_", "]_", "[_", "'", "idx", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "3_", ",_", "5_", ",_", "7_", ",_", "9_", ",_", "10_", ",_", "11_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "sentence", "'_", "]_", "[_", "'", "article", "\\u", "label", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "0", "'_", ",_", "'", "0", "'_", ",_", "'", "1", "'_", ",_", "'", "1", "'_", ",_", "'", "3", "'_", ",_", "'", "3", "'_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "sentence", "'_", "]_", "[_", "'", "paragraph", "\\u", "label", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "0", "'_", ",_", "'", "1", "'_", ",_", "'", "2", "'_", ",_", "'", "2", "'_", ",_", "'", "4", "'_", ",_", "'", "5", "'_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "sentence", "'_", "]_", "[_", "'", "sentence", "\\u", "label", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "0", "'_", ",_", "'", "1", "'_", ",_", "'", "2", "'_", ",_", "'", "3", "'_", ",_", "'", "4", "'_", ",_", "'", "5", "'_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cor", "pus", "builders_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "coll", "\\u", "tokenize_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "books_", "=_", "[_", "[_", "(_", "'", "foo", " ", "foo", " ", "foo", ".\\\\", "n", "\\\\", "nfo", "o", " ", "foo", "'_", ",_", "'", "1", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Foo", " ", "bar", ".", " ", " ", "Foo", " ", "bar", ".'_", ",_", "'", "2", "'_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "''_", ",_", "'", "3", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "foo", ".\\\\", "n", "\\\\", "nfo", "o", "'_", ",_", "'", "4", "'_", ")_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "book", "\\u", "names_", "=_", "[_", "str_", "(_", "i_", ")_", "for_", "i_", "in_", "xrange_", "(_", "len_", "(_", "books_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "words_", ",_", "context", "\\u", "data_", "=_", "coll", "\\u", "tokenize_", "(_", "books_", ",_", "book", "\\u", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "words_", ")_", "==_", "11_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "context", "\\u", "data_", "[_", "'", "book", "'_", "]_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "context", "\\u", "data_", "[_", "'", "page", "'_", "]_", ")_", "==_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "context", "\\u", "data_", "[_", "'", "sentence", "'_", "]_", ")_", "==_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "book", "'_", "]_", "[_", "'", "idx", "'_", "]_", "==_", "[_", "9_", ",_", "11_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "book", "'_", "]_", "[_", "'", "book", "\\u", "label", "'_", "]_", "==_", "[_", "'", "0", "'_", ",_", "'", "1", "'_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "page", "'_", "]_", "[_", "'", "idx", "'_", "]_", "==_", "[_", "5_", ",_", "9_", ",_", "9_", ",_", "11_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "page", "'_", "]_", "[_", "'", "page", "\\u", "label", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "0", "'_", ",_", "'", "1", "'_", ",_", "'", "2", "'_", ",_", "'", "3", "'_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "page", "'_", "]_", "[_", "'", "book", "\\u", "label", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "0", "'_", ",_", "'", "0", "'_", ",_", "'", "1", "'_", ",_", "'", "1", "'_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "sentence", "'_", "]_", "[_", "'", "idx", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "3_", ",_", "5_", ",_", "7_", ",_", "9_", ",_", "10_", ",_", "11_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "sentence", "'_", "]_", "[_", "'", "sentence", "\\u", "label", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "0", "'_", ",_", "'", "1", "'_", ",_", "'", "2", "'_", ",_", "'", "3", "'_", ",_", "'", "4", "'_", ",_", "'", "5", "'_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "sentence", "'_", "]_", "[_", "'", "page", "\\u", "label", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "0", "'_", ",_", "'", "0", "'_", ",_", "'", "1", "'_", ",_", "'", "1", "'_", ",_", "'", "3", "'_", ",_", "'", "3", "'_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "sentence", "'_", "]_", "[_", "'", "book", "\\u", "label", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "0", "'_", ",_", "'", "0", "'_", ",_", "'", "0", "'_", ",_", "'", "0", "'_", ",_", "'", "1", "'_", ",_", "'", "1", "'_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "page", "'_", "]_", "[_", "'", "file", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "1", "'_", ",_", "'", "2", "'_", ",_", "'", "3", "'_", ",_", "'", "4", "'_", "]_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "context", "\\u", "data_", "[_", "'", "sentence", "'_", "]_", "[_", "'", "file", "'_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "1", "'_", ",_", "'", "1", "'_", ",_", "'", "2", "'_", ",_", "'", "2", "'_", ",_", "'", "4", "'_", ",_", "'", "4", "'_", "]_", ")_", "._", "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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 ]
Unnecessary pass
sunlightlabs/read_FEC/fecreader/fec_alerts/utils/filing_processors.py
[ { "content": "def process_new_filing(thisnewfiling, fp=None, filing_time=None, filing_time_is_exact=False):\n \"\"\" Enter the file header if needed. \"\"\"\n \n if not fp:\n fp = form_parser()\n \n #print \"Processing filing %s\" % (filingnum)\n f1 = filing(thisnewfiling.filing_number)\n if f1.get_error():\n return False\n \n form = f1.get_form_type()\n version = f1.get_version()\n\n ## leave the form if it's already been entered-- that's where it says if it is terminated. \n if not thisnewfiling.form_type:\n thisnewfiling.form_type = form\n \n # check if it's an amendment based on form types -- if so, mark it. Otherwise the F1's will look like they haven't been amended. \n try:\n if thisnewfiling.form_type[-1].upper() == 'A':\n thisnewfiling.is_amendment = True\n except IndexError:\n pass\n\n # only parse forms that we're set up to read\n if not fp.is_allowed_form(form):\n if verbose:\n print \"Not a parseable form: %s - %s\" % (form, thisnewfiling.filing_number)\n \n if thisnewfiling.is_amendment:\n thisnewfiling.save()\n return True\n\n header = f1.get_first_row()\n header_line = fp.parse_form_line(header, version)\n\n amended_filing=None\n if f1.is_amendment:\n amended_filing = f1.headers['filing_amended']\n\n\n \n from_date = None\n through_date = None\n #print \"header line is: %s \" % header_line\n try:\n # dateparse('') will give today, oddly\n if header_line['coverage_from_date']:\n from_date = dateparse(header_line['coverage_from_date'])\n if from_date:\n thisnewfiling.cycle = get_cycle_from_date(from_date)\n except KeyError:\n print \"problem with coverage_from_date\"\n pass\n \n try: \n if header_line['coverage_through_date']:\n through_date = dateparse(header_line['coverage_through_date'])\n if through_date:\n thisnewfiling.cycle = get_cycle_from_date(through_date)\n except KeyError:\n print \"coverage_through_date\"\n pass\n\n \n # Create the filing -- but don't mark it as being complete. \n \n\n \n \n \n thisnewfiling.fec_id = f1.headers['fec_id']\n thisnewfiling.coverage_from_date = from_date\n thisnewfiling.coverage_to_date = through_date\n thisnewfiling.is_amendment = f1.is_amendment\n thisnewfiling.amends_filing = amended_filing\n thisnewfiling.amendment_number = f1.headers['report_number'] or None\n thisnewfiling.header_data = header_line\n \n print thisnewfiling.__dict__\n\n thisnewfiling.save()\n \n return True", "metadata": "root.process_new_filing", "header": "['module', '___EOS___']", "index": 67 } ]
[ { "span": "pass", "start_line": 121, "start_column": 8, "end_line": 121, "end_column": 12 }, { "span": "pass", "start_line": 130, "start_column": 8, "end_line": 130, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "process", "\\u", "new", "\\u", "filing", "_", "(_", "this", "newf", "ilin", "g_", ",_", "fp_", "=_", "None_", ",_", "filing", "\\u", "time_", "=_", "None_", ",_", "filing", "\\u", "time", "\\u", "is", "\\u", "exact_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Enter", " ", "the", " ", "file", " ", "header", " ", "if", " ", "need", "ed", ".", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "fp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "=_", "form", "\\u", "parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "Process", "ing", " ", "filing", " ", "%", "s", "\"", " ", "%", " ", "(", "filing", "num", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f1_", "=_", "filing", "_", "(_", "this", "newf", "ilin", "g_", "._", "filing", "\\u", "number_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "f1_", "._", "get", "\\u", "error_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "form_", "=_", "f1_", "._", "get", "\\u", "form", "\\u", "type_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "version_", "=_", "f1_", "._", "get", "\\u", "version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "lea", "ve", " ", "the", " ", "form", " ", "if", " ", "it", "'", "s", " ", "alr", "ead", "y", " ", "bee", "n", " ", "enter", "ed", "--", " ", "tha", "t", "'", "s", " ", "where", " ", "it", " ", "say", "s", " ", "if", " ", "it", " ", "is", " ", "terminate", "d", ".", " _", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "this", "newf", "ilin", "g_", "._", "form", "\\u", "type_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "this", "newf", "ilin", "g_", "._", "form", "\\u", "type_", "=_", "form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "it", "'", "s", " ", "an", " ", "amend", "ment", " ", "based", " ", "on", " ", "form", " ", "types", " ", "--", " ", "if", " ", "so", ",", " ", "mark", " ", "it", ".", " ", "Ot", "her", "wis", "e", " ", "the", " ", "F1", "'", "s", " ", "will", " ", "look", " ", "like", " ", "the", "y", " ", "have", "n", "'", "t", " ", "bee", "n", " ", "amend", "ed", ".", " _", "\\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 ", " _", "if_", "this", "newf", "ilin", "g_", "._", "form", "\\u", "type_", "[_", "-_", "1_", "]_", "._", "upper_", "(_", ")_", "==_", "'", "A", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "this", "newf", "ilin", "g_", "._", "is", "\\u", "amend", "ment_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Index", "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_", "#", " ", "only", " ", "parse", " ", "forms", " ", "tha", "t", " ", "we", "'", "re", " ", "set", " ", "up", " ", "to", " ", "read_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "fp_", "._", "is", "\\u", "allow", "ed", "\\u", "form_", "(_", "form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Not", " ", "a", " ", "parse", "able", " ", "form", ":", " ", "%", "s", " ", "-", " ", "%", "s", "\"_", "%_", "(_", "form_", ",_", "this", "newf", "ilin", "g_", "._", "filing", "\\u", "number_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "this", "newf", "ilin", "g_", "._", "is", "\\u", "amend", "ment_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "this", "newf", "ilin", "g_", "._", "save_", "(_", ")_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "header_", "=_", "f1_", "._", "get", "\\u", "first", "\\u", "row_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header", "\\u", "line_", "=_", "fp_", "._", "parse", "\\u", "form", "\\u", "line_", "(_", "header_", ",_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "amend", "ed", "\\u", "filing", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "f1_", "._", "is", "\\u", "amend", "ment_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "amend", "ed", "\\u", "filing", "_", "=_", "f1_", "._", "headers_", "[_", "'", "filing", "\\u", "amend", "ed", "'_", "]_", "\\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_", "from", "\\u", "date_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "through", "\\u", "date_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "header", " ", "line", " ", "is", ":", " ", "%", "s", " ", "\"", " ", "%", " ", "header", "\\u", "line_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "date", "parse", "(''", ")", " ", "will", " ", "give", " ", "toda", "y", ",", " ", "odd", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "header", "\\u", "line_", "[_", "'", "covera", "ge", "\\u", "from", "\\u", "date", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from", "\\u", "date_", "=_", "date", "parse_", "(_", "header", "\\u", "line_", "[_", "'", "covera", "ge", "\\u", "from", "\\u", "date", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "from", "\\u", "date_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "this", "newf", "ilin", "g_", "._", "cycle_", "=_", "get", "\\u", "cycle", "\\u", "from", "\\u", "date_", "(_", "from", "\\u", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "problem", " ", "with", " ", "covera", "ge", "\\u", "from", "\\u", "date", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\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 ", " _", "if_", "header", "\\u", "line_", "[_", "'", "covera", "ge", "\\u", "through", "\\u", "date", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "through", "\\u", "date_", "=_", "date", "parse_", "(_", "header", "\\u", "line_", "[_", "'", "covera", "ge", "\\u", "through", "\\u", "date", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "through", "\\u", "date_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "this", "newf", "ilin", "g_", "._", "cycle_", "=_", "get", "\\u", "cycle", "\\u", "from", "\\u", "date_", "(_", "through", "\\u", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "covera", "ge", "\\u", "through", "\\u", "date", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "the", " ", "filing", " ", "--", " ", "but", " ", "don", "'", "t", " ", "mark", " ", "it", " ", "as", " ", "bei", "ng", " ", "complete", ".", " _", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "this", "newf", "ilin", "g_", "._", "fec", "\\u", "id_", "=_", "f1_", "._", "headers_", "[_", "'", "fec", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "this", "newf", "ilin", "g_", "._", "covera", "ge", "\\u", "from", "\\u", "date_", "=_", "from", "\\u", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "this", "newf", "ilin", "g_", "._", "covera", "ge", "\\u", "to", "\\u", "date_", "=_", "through", "\\u", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "this", "newf", "ilin", "g_", "._", "is", "\\u", "amend", "ment_", "=_", "f1_", "._", "is", "\\u", "amend", "ment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "this", "newf", "ilin", "g_", "._", "amend", "s", "\\u", "filing", "_", "=_", "amend", "ed", "\\u", "filing", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "this", "newf", "ilin", "g_", "._", "amend", "ment", "\\u", "number_", "=_", "f1_", "._", "headers_", "[_", "'", "report", "\\u", "number", "'_", "]_", "or_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "this", "newf", "ilin", "g_", "._", "header", "\\u", "data_", "=_", "header", "\\u", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "this", "newf", "ilin", "g_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "this", "newf", "ilin", "g_", "._", "save_", "(_", ")_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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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
MongoEngine/mongoengine/tests/fields/geo.py
[ { "content": " def test_indexes_2dsphere(self):\n \"\"\"Ensure that indexes are created automatically for GeoPointFields.\n \"\"\"\n class Event(Document):\n title = StringField()\n point = PointField()\n line = LineStringField()\n polygon = PolygonField()\n\n geo_indicies = Event._geo_indices()\n self.assertTrue({'fields': [('line', '2dsphere')]} in geo_indicies)\n self.assertTrue({'fields': [('polygon', '2dsphere')]} in geo_indicies)\n self.assertTrue({'fields': [('point', '2dsphere')]} in geo_indicies)", "metadata": "root.GeoFieldTest.test_indexes_2dsphere", "header": "['class', 'GeoFieldTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 293 }, { "content": " def test_indexes_2dsphere_embedded(self):\n \"\"\"Ensure that indexes are created automatically for GeoPointFields.\n \"\"\"\n class Venue(EmbeddedDocument):\n name = StringField()\n point = PointField()\n line = LineStringField()\n polygon = PolygonField()\n\n class Event(Document):\n title = StringField()\n venue = EmbeddedDocumentField(Venue)\n\n geo_indicies = Event._geo_indices()\n self.assertTrue({'fields': [('venue.line', '2dsphere')]} in geo_indicies)\n self.assertTrue({'fields': [('venue.polygon', '2dsphere')]} in geo_indicies)\n self.assertTrue({'fields': [('venue.point', '2dsphere')]} in geo_indicies)", "metadata": "root.GeoFieldTest.test_indexes_2dsphere_embedded", "header": "['class', 'GeoFieldTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 307 }, { "content": " def test_geo_indexes_recursion(self):\n\n class Location(Document):\n name = StringField()\n location = GeoPointField()\n\n class Parent(Document):\n name = StringField()\n location = ReferenceField(Location)\n\n Location.drop_collection()\n Parent.drop_collection()\n\n Parent(name='Berlin').save()\n info = Parent._get_collection().index_information()\n self.assertFalse('location_2d' in info)\n info = Location._get_collection().index_information()\n self.assertTrue('location_2d' in info)\n\n self.assertEqual(len(Parent._geo_indices()), 0)\n self.assertEqual(len(Location._geo_indices()), 1)", "metadata": "root.GeoFieldTest.test_geo_indexes_recursion", "header": "['class', 'GeoFieldTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 325 } ]
[ { "span": "self.assertTrue({'fields': [('line', '2dsphere')]} in geo_indicies)", "start_line": 303, "start_column": 8, "end_line": 303, "end_column": 75 }, { "span": "self.assertTrue({'fields': [('polygon', '2dsphere')]} in geo_indicies)", "start_line": 304, "start_column": 8, "end_line": 304, "end_column": 78 }, { "span": "self.assertTrue({'fields': [('point', '2dsphere')]} in geo_indicies)", "start_line": 305, "start_column": 8, "end_line": 305, "end_column": 76 }, { "span": "self.assertTrue({'fields': [('venue.line', '2dsphere')]} in geo_indicies)", "start_line": 321, "start_column": 8, "end_line": 321, "end_column": 81 }, { "span": "self.assertTrue({'fields': [('venue.polygon', '2dsphere')]} in geo_indicies)", "start_line": 322, "start_column": 8, "end_line": 322, "end_column": 84 }, { "span": "self.assertTrue({'fields': [('venue.point', '2dsphere')]} in geo_indicies)", "start_line": 323, "start_column": 8, "end_line": 323, "end_column": 82 }, { "span": "self.assertFalse('location_2d' in info)", "start_line": 340, "start_column": 8, "end_line": 340, "end_column": 47 }, { "span": "self.assertTrue('location_2d' in info)", "start_line": 342, "start_column": 8, "end_line": 342, "end_column": 46 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Geo", "Field", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "indexe", "s", "\\u", "2d", "sphere_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Ensur", "e", " ", "tha", "t", " ", "indexe", "s", " ", "are", " ", "created", " ", "automati", "call", "y", " ", "for", " ", "Geo", "Point", "Field", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Event_", "(_", "Document_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "title_", "=_", "String", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "point_", "=_", "Point", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "Line", "String", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "polygon_", "=_", "Polygon", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "geo", "\\u", "indic", "ies_", "=_", "Event_", "._", "\\u", "geo", "\\u", "indices_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "{_", "'", "fields", "'_", ":_", "[_", "(_", "'", "line", "'_", ",_", "'", "2d", "sphere", "'_", ")_", "]_", "}_", "in_", "geo", "\\u", "indic", "ies_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "{_", "'", "fields", "'_", ":_", "[_", "(_", "'", "poly", "gon", "'_", ",_", "'", "2d", "sphere", "'_", ")_", "]_", "}_", "in_", "geo", "\\u", "indic", "ies_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "{_", "'", "fields", "'_", ":_", "[_", "(_", "'", "point", "'_", ",_", "'", "2d", "sphere", "'_", ")_", "]_", "}_", "in_", "geo", "\\u", "indic", "ies_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Geo", "Field", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "indexe", "s", "\\u", "2d", "sphere", "\\u", "embedde", "d_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Ensur", "e", " ", "tha", "t", " ", "indexe", "s", " ", "are", " ", "created", " ", "automati", "call", "y", " ", "for", " ", "Geo", "Point", "Field", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Ven", "ue_", "(_", "Emb", "edd", "ed", "Document_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "String", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "point_", "=_", "Point", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "Line", "String", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "polygon_", "=_", "Polygon", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Event_", "(_", "Document_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "title_", "=_", "String", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "venue", "_", "=_", "Emb", "edd", "ed", "Document", "Field_", "(_", "Ven", "ue_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "geo", "\\u", "indic", "ies_", "=_", "Event_", "._", "\\u", "geo", "\\u", "indices_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "{_", "'", "fields", "'_", ":_", "[_", "(_", "'", "venue", ".", "line", "'_", ",_", "'", "2d", "sphere", "'_", ")_", "]_", "}_", "in_", "geo", "\\u", "indic", "ies_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "{_", "'", "fields", "'_", ":_", "[_", "(_", "'", "venue", ".", "poly", "gon", "'_", ",_", "'", "2d", "sphere", "'_", ")_", "]_", "}_", "in_", "geo", "\\u", "indic", "ies_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "{_", "'", "fields", "'_", ":_", "[_", "(_", "'", "venue", ".", "point", "'_", ",_", "'", "2d", "sphere", "'_", ")_", "]_", "}_", "in_", "geo", "\\u", "indic", "ies_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Geo", "Field", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "geo", "\\u", "indexe", "s", "\\u", "recursion", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Location_", "(_", "Document_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "String", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "location_", "=_", "Geo", "Point", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Parent_", "(_", "Document_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "String", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "location_", "=_", "Reference", "Field_", "(_", "Location_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Location_", "._", "drop", "\\u", "collection_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Parent_", "._", "drop", "\\u", "collection_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Parent_", "(_", "name_", "=_", "'", "Ber", "lin", "'_", ")_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "=_", "Parent_", "._", "\\u", "get", "\\u", "collection_", "(_", ")_", "._", "index", "\\u", "information_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "location", "\\u", "2d", "'_", "in_", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "=_", "Location_", "._", "\\u", "get", "\\u", "collection_", "(_", ")_", "._", "index", "\\u", "information_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "location", "\\u", "2d", "'_", "in_", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "Parent_", "._", "\\u", "geo", "\\u", "indices_", "(_", ")_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "Location_", "._", "\\u", "geo", "\\u", "indices_", "(_", ")_", ")_", ",_", "1_", ")_", "\\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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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
sassoftware/conary/conary_test/repositorytest/netclienttest.py
[ { "content": " def testFileContentsErrors(self):\n # set up two repositores. create a shadow of test:runtime from\n # the localhost repository into the localhost1 repository.\n # Ask the localhost1 for the file contents from a file that\n # resides on localhost. The file stream does not exist on\n # localhost1, so it should cause an exception.\n self.openRepository(1)\n t = self.addQuickTestComponent('test:runtime', '1.0-1-1')\n self.addCollection('test', '1.0-1-1', [':runtime'])\n # get the fileId and version of the file that we created.\n fileList = list(t.iterFileList())\n assert(len(fileList) == 1)\n fileId, version = fileList[0][2:4]\n # create the shadow in localhost1\n self.mkbranch(\"1.0-1-1\", \"localhost1@rpl:shadow\", \"test\",\n shadow = True, binaryOnly=True)\n # build up the version string that points at the shadow\n shadowVersion = versions.VersionFromString(\n '/localhost@rpl:linux//localhost1@rpl:shadow/1.0-1-1')\n # open the repository here when the proxy we use will be up to date\n repos = self.openRepository()\n try:\n repos.getFileContents([(fileId, shadowVersion)])\n except errors.FileStreamNotFound, e:\n assert((e.fileId, e.fileVer) == (fileId, shadowVersion))\n else:\n assert(0)\n\n # ask for a random fileId, should always fail\n bogusV = versions.VersionFromString('/localhost@rpl:linux/1.0-1-1')\n bogusFileId = '1' * 20\n bogusPathId = '2' * 16\n try:\n repos.getFileContents([(bogusFileId, bogusV)])\n except errors.FileStreamNotFound, e:\n assert((e.fileId, e.fileVer) == (bogusFileId, bogusV))\n else:\n assert(0)\n\n try:\n repos.getFileVersions([(bogusPathId, bogusFileId, bogusV)])\n except errors.FileStreamMissing, e:\n assert(e.fileId == bogusFileId)\n else:\n assert(0)\n\n # try getting the contents of a file which doesn't have contents\n t = self.addComponent('symtest:runtime', '1.0-1-1',\n fileContents = [ ('/symlink',\n rephelp.Symlink('something')) ])\n fileList = list(t.iterFileList())\n assert(len(fileList) == 1)\n linkFileId, linkVersion = fileList[0][2:4]\n try:\n repos.getFileContents([ (linkFileId, linkVersion) ])\n except errors.FileHasNoContents, e:\n assert((e.fileId, e.fileVer) == (linkFileId, linkVersion))\n else:\n assert(0)\n\n # play a nasty trick on the server by removing the contents\n # to test missing contents error handling. It's OK to do this\n # since the server is about to be reset anyway...\n server = self.servers.getServer(0)\n shutil.rmtree(server.contents.getPath())\n try:\n f = repos.getFileContents([ (fileId, version) ])\n except errors.FileContentsNotFound, e:\n assert((e.fileId, e.fileVer) == (fileId, version))\n else:\n assert(0)", "metadata": "root.NetclientTest.testFileContentsErrors", "header": "['class', 'NetclientTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 89 }, { "content": " def testAnonymousAccess(self):\n (built, d) = self.buildRecipe(recipes.testRecipe1, \"TestRecipe1\")\n repos = self.openRepository()\n items = repos.getTroveLeavesByLabel(\n { 'testcase' : { self.cfg.buildLabel : None } } )\n assert(len(items) == 1)\n\n port = self.cfg.repositoryMap['localhost'].split(':')[-1].split('/')[0]\n cfg = copy.copy(self.cfg)\n cfg.user = self.cfg.user.__class__()\n client = conaryclient.ConaryClient(cfg).getRepos()\n\n items = client.getTroveLeavesByLabel(\n { 'testcase' : { self.cfg.buildLabel : None } } )\n assert(len(items) == 1)", "metadata": "root.NetclientTest.testAnonymousAccess", "header": "['class', 'NetclientTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 161 }, { "content": " def testCreateChangeset2(self):\n self.openRepository()\n repos = self.openRepository(1)\n t1 = self.addComponent('foo:run', '1', '', [('/etc/foo', 'foo\\n'),\n ('/etc/bar', 'bam\\n')])\n t2 = self.addComponent('foo:run', '/localhost1@rpl:branch/1.0-1-1', '',\n [('/etc/foo', 'foo2\\n'),\n ('/etc/bar', 'bam2\\n')])\n cs = repos.createChangeSet([('foo:run',\n (t1.getVersion(), t1.getFlavor()),\n (t2.getVersion(), t2.getFlavor()),\n False)])", "metadata": "root.NetclientTest.testCreateChangeset2", "header": "['class', 'NetclientTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 253 }, { "content": " def testCreateChangesetViaHTTPProxy(self):\n # CNY-2058, CNY-2056\n self.openRepository()\n\n # first add test:runtime to the repository (not via HTTP proxy)\n ver = '/localhost@rpl:linux/1.0-1-1'\n self.addQuickTestComponent('test:runtime', ver)\n flavor = deps.parseFlavor('')\n version = versions.VersionFromString(ver)\n csfile = os.path.join(self.workDir, 'foo.ccs')\n\n # now switch to using a HTTP proxy\n h = rephelp.HTTPProxy(os.path.join(self.workDir, \"http-cache\"))\n proxyUri = h.start()\n if proxyUri is None:\n raise testhelp.SkipTestException('Squid is not installed')\n proxyUrl = \"http://\" + proxyUri\n proxies = dict(http = proxyUrl, https = proxyUrl)\n\n # switch client config to talk to the proxy\n self.cfg.configLine('proxy http://localhost:%s' % h.port)\n client = conaryclient.ConaryClient(self.cfg)\n repos = client.getRepos()\n\n # create the changeset and verify\n repos.createChangeSetFile(\n [('test:runtime', (None, flavor), (version, flavor), True)], csfile,\n primaryTroveList = [('test:runtime', version, flavor)])\n cs = changeset.ChangeSetFromFile(csfile)\n assert(cs.getPrimaryTroveList() == [('test:runtime', version, flavor)])", "metadata": "root.NetclientTest.testCreateChangesetViaHTTPProxy", "header": "['class', 'NetclientTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 266 }, { "content": " def testFind64BitTroves(self):\n self.cfg.flavorPreferences = arch.getFlavorPreferences(\n [[ deps.Dependency('x86_64') ]])\n\n self.addComponent('foo:run', '1-1-1', 'is:x86_64')\n trv = self.addComponent('foo:run', '1-1-2', 'is:x86')\n\n def _getFlavors(d, name):\n return [ str(x) for x in itertools.chain(*d[name].itervalues()) ]\n\n repos = self.openRepository()\n n = 'foo:run'\n l = trv.getVersion().trailingLabel()\n f = deps.parseFlavor('is:x86_64 x86')\n d = repos.getTroveLeavesByLabel({n: {l : [f]}}, bestFlavor = True)\n self.assertEqual(_getFlavors(d, n), ['is: x86_64'])\n\n self.resetRepository()\n repos = self.openRepository()\n\n self.addComponent('foo:run', '1-1-1', 'is:x86_64 x86')\n trv = self.addComponent('foo:run', '1-1-2', 'is:x86')\n d = repos.getTroveLeavesByLabel({n: {l : [f]}}, bestFlavor = True)\n self.assertEqual(_getFlavors(d, n), ['is: x86 x86_64'])", "metadata": "root.NetclientTest.testFind64BitTroves", "header": "['class', 'NetclientTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 385 }, { "content": " def testPrepareCallbackException(self):\n # CNY-1271\n\n class Callback(updatecmd.UpdateCallback):\n def preparingChangeSet(self):\n e = Exception(\"Except me\")\n e.errorIsUncatchable = True\n raise e\n\n self.addComponent('testcase:runtime', '1')\n self.addCollection('testcase', '1', [':runtime'])\n\n client = conaryclient.ConaryClient(self.cfg)\n applyList = conaryclient.cmdline.parseChangeList('testcase')\n client.setUpdateCallback(Callback(self.cfg))\n try:\n (updJob, suggMap) = client.updateChangeSet(applyList)\n except Exception, e:\n self.assertEqual(str(e), \"Except me\")\n else:\n self.fail(\"Exception not raised\")", "metadata": "root.NetclientTest.testPrepareCallbackException", "header": "['class', 'NetclientTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 503 }, { "content": " def testClientLog(self):\n p = self.workDir + '/client.log'\n os.environ['CONARY_CLIENT_LOG'] = p\n repos = self.openRepository()\n del os.environ['CONARY_CLIENT_LOG']\n\n log = calllog.ClientCallLogger(p)\n methods = [ x.methodName for x in log ]\n self.assertEqual(methods, ['checkVersion', 'addNewAsciiPGPKey'])", "metadata": "root.NetclientTest.testClientLog", "header": "['class', 'NetclientTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 779 }, { "content": " def testBadProtocol(self):\n # CNY-932\n port = self.cfg.repositoryMap['localhost'] = 'httsp://localhost/'\n repos = conaryclient.ConaryClient(self.cfg).getRepos()\n try:\n repos.troveNamesOnServer('localhost')\n except errors.OpenError, e:\n self.assertEqual(str(e),\n 'Error occurred opening repository '\n 'httsp://test:<PASSWD>@localhost/: '\n \"ParameterError: Unknown URL scheme 'httsp'\")\n else:\n self.fail('expected exception not raised')", "metadata": "root.ServerProxyTest.testBadProtocol", "header": "['class', 'ServerProxyTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 831 }, { "content": " def testJobSizes(self):\n def _check(job, size):\n fn = self.workDir + '/foo.ccs'\n cs1 = repos.createChangeSetFile(job, fn)\n assert(os.stat(fn).st_size == size)\n\n first = self.addComponent('first:run', '1')\n firstJob = ('first:run', (None, None),\n (first.getVersion(), first.getFlavor() ), True)\n\n second = self.addComponent('second:run', '1',\n fileContents = [ '/some/file/name' ] )\n secondJob = ('second:run', (None, None),\n (second.getVersion(), second.getFlavor() ), True)\n\n removeJob = ('second:run', (second.getVersion(), second.getFlavor() ),\n (None, None), True)\n\n repos = self.openRepository()\n\n # CNY-3876: use old version to determine repo name\n assert(repos.getChangeSetSize([ removeJob ])[0] == 0)\n\n sizes = repos.getChangeSetSize([ firstJob, removeJob, secondJob ])\n _check([ firstJob ], sizes[0])\n assert(sizes[1] == 0)\n _check([ secondJob ], sizes[2])\n\n # try this for a the pre-infoOnly protocol\n repos.c['localhost'].setProtocolVersion(50)\n otherSizes = repos.getChangeSetSize([ firstJob, removeJob, secondJob ])\n assert(sizes == otherSizes)", "metadata": "root.ServerProxyTest.testJobSizes", "header": "['class', 'ServerProxyTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 908 } ]
[ { "span": "f ", "start_line": 155, "start_column": 12, "end_line": 155, "end_column": 13 }, { "span": "built,", "start_line": 162, "start_column": 9, "end_line": 162, "end_column": 14 }, { "span": "d)", "start_line": 162, "start_column": 16, "end_line": 162, "end_column": 17 }, { "span": "port ", "start_line": 168, "start_column": 8, "end_line": 168, "end_column": 12 }, { "span": "cs ", "start_line": 261, "start_column": 8, "end_line": 261, "end_column": 10 }, { "span": "proxies ", "start_line": 283, "start_column": 8, "end_line": 283, "end_column": 15 }, { "span": "trv ", "start_line": 406, "start_column": 8, "end_line": 406, "end_column": 11 }, { "span": "updJob,", "start_line": 519, "start_column": 13, "end_line": 519, "end_column": 19 }, { "span": "suggMap)", "start_line": 519, "start_column": 21, "end_line": 519, "end_column": 28 }, { "span": "repos ", "start_line": 782, "start_column": 8, "end_line": 782, "end_column": 13 }, { "span": "port ", "start_line": 833, "start_column": 8, "end_line": 833, "end_column": 12 }, { "span": "cs1 ", "start_line": 911, "start_column": 12, "end_line": 911, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Net", "client", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "File", "Conten", "ts", "Errors_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "up", " ", "two", " ", "repos", "itor", "es", ".", " ", "create", " ", "a", " ", "shadow", " ", "of", " ", "test", ":", "runt", "ime", " ", "from_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "local", "host", " ", "repos", "itor", "y", " ", "int", "o", " ", "the", " ", "local", "host", "1", " ", "repos", "itor", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "As", "k", " ", "the", " ", "local", "host", "1", " ", "for", " ", "the", " ", "file", " ", "content", "s", " ", "from", " ", "a", " ", "file", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "reside", "s", " ", "on", " ", "local", "host", ".", " ", " ", "The", " ", "file", " ", "stream", " ", "doe", "s", " ", "not", " ", "exist", " ", "on_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "local", "host", "1", ",", " ", "so", " ", "it", " ", "shou", "ld", " ", "caus", "e", " ", "an", " ", "exception", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "open", "Repository_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "self_", "._", "add", "Qui", "ck", "Test", "Component_", "(_", "'", "test", ":", "runt", "ime", "'_", ",_", "'", "1.0", "-1", "-1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Collection_", "(_", "'", "test", "'_", ",_", "'", "1.0", "-1", "-1", "'_", ",_", "[_", "':", "runt", "ime", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "the", " ", "file", "Id", " ", "and", " ", "version", " ", "of", " ", "the", " ", "file", " ", "tha", "t", " ", "we", " ", "created", "._", "\\u\\u\\uNL\\u\\u\\u_", "file", "List_", "=_", "list_", "(_", "t_", "._", "iter", "File", "List_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "len_", "(_", "file", "List_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "Id_", ",_", "version_", "=_", "file", "List_", "[_", "0_", "]_", "[_", "2_", ":_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "the", " ", "shadow", " ", "in", " ", "local", "host", "1_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mk", "branch_", "(_", "\"", "1.0", "-1", "-1", "\"_", ",_", "\"", "local", "host", "1", "@", "rpl", ":", "shadow", "\"_", ",_", "\"", "test", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shadow_", "=_", "True_", ",_", "binar", "y", "Only_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "build", " ", "up", " ", "the", " ", "version", " ", "string", " ", "tha", "t", " ", "points", " ", "at", " ", "the", " ", "shadow_", "\\u\\u\\uNL\\u\\u\\u_", "shadow", "Version_", "=_", "versions_", "._", "Version", "Fro", "m", "String_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'/", "local", "host", "@", "rpl", ":", "linux", "//", "local", "host", "1", "@", "rpl", ":", "shadow", "/", "1.0", "-1", "-1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "open", " ", "the", " ", "repos", "itor", "y", " ", "here", " ", "whe", "n", " ", "the", " ", "proxy", " ", "we", " ", "use", " ", "will", " ", "be", " ", "up", " ", "to", " ", "date_", "\\u\\u\\uNL\\u\\u\\u_", "repos_", "=_", "self_", "._", "open", "Repository_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "repos_", "._", "get", "File", "Contents_", "(_", "[_", "(_", "file", "Id_", ",_", "shadow", "Version_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "errors_", "._", "File", "Stream", "Not", "Found_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "(_", "(_", "e_", "._", "file", "Id_", ",_", "e_", "._", "file", "Ver", "_", ")_", "==_", "(_", "file", "Id_", ",_", "shadow", "Version_", ")_", ")_", "\\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 ", " _", "assert_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ask", " ", "for", " ", "a", " ", "random", " ", "file", "Id", ",", " ", "shou", "ld", " ", "alw", "ay", "s", " ", "fail_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bog", "us", "V_", "=_", "versions_", "._", "Version", "Fro", "m", "String_", "(_", "'/", "local", "host", "@", "rpl", ":", "linux", "/", "1.0", "-1", "-1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bog", "us", "File", "Id_", "=_", "'", "1", "'_", "*_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bog", "us", "Path", "Id_", "=_", "'", "2", "'_", "*_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "repos_", "._", "get", "File", "Contents_", "(_", "[_", "(_", "bog", "us", "File", "Id_", ",_", "bog", "us", "V_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "errors_", "._", "File", "Stream", "Not", "Found_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "(_", "(_", "e_", "._", "file", "Id_", ",_", "e_", "._", "file", "Ver", "_", ")_", "==_", "(_", "bog", "us", "File", "Id_", ",_", "bog", "us", "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 ", " _", "assert_", "(_", "0_", ")_", "\\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 ", " _", "repos_", "._", "get", "File", "Version", "s_", "(_", "[_", "(_", "bog", "us", "Path", "Id_", ",_", "bog", "us", "File", "Id_", ",_", "bog", "us", "V_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "errors_", "._", "File", "Stream", "Missing", "_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "(_", "e_", "._", "file", "Id_", "==_", "bog", "us", "File", "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 ", " _", "assert_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", " ", "getti", "ng", " ", "the", " ", "content", "s", " ", "of", " ", "a", " ", "file", " ", "whi", "ch", " ", "doe", "sn", "'", "t", " ", "have", " ", "contents_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "t_", "=_", "self_", "._", "add", "Component_", "(_", "'", "symt", "est", ":", "runt", "ime", "'_", ",_", "'", "1.0", "-1", "-1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "file", "Contents_", "=_", "[_", "(_", "'/", "symlink", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rep", "help_", "._", "Sym", "link_", "(_", "'", "somet", "hing", "'_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "List_", "=_", "list_", "(_", "t_", "._", "iter", "File", "List_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "len_", "(_", "file", "List_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link", "File", "Id_", ",_", "link", "Version_", "=_", "file", "List_", "[_", "0_", "]_", "[_", "2_", ":_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "repos_", "._", "get", "File", "Contents_", "(_", "[_", "(_", "link", "File", "Id_", ",_", "link", "Version_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "errors_", "._", "File", "Has", "No", "Contents_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "(_", "(_", "e_", "._", "file", "Id_", ",_", "e_", "._", "file", "Ver", "_", ")_", "==_", "(_", "link", "File", "Id_", ",_", "link", "Version_", ")_", ")_", "\\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 ", " _", "assert_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "play", " ", "a", " ", "nas", "ty", " ", "trick", " ", "on", " ", "the", " ", "server", " ", "by", " ", "remo", "ving", " ", "the", " ", "contents_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "test", " ", "missi", "ng", " ", "content", "s", " ", "error", " ", "handling", ".", " ", " ", "It", "'", "s", " ", "OK", " ", "to", " ", "do", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sinc", "e", " ", "the", " ", "server", " ", "is", " ", "abo", "ut", " ", "to", " ", "be", " ", "reset", " ", "anyway", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "server_", "=_", "self_", "._", "servers_", "._", "get", "Server_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shutil_", "._", "rmtree_", "(_", "server_", "._", "contents_", "._", "get", "Path_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "repos_", "._", "get", "File", "Contents_", "(_", "[_", "(_", "file", "Id_", ",_", "version_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "errors_", "._", "File", "Conten", "ts", "Not", "Found_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "(_", "(_", "e_", "._", "file", "Id_", ",_", "e_", "._", "file", "Ver", "_", ")_", "==_", "(_", "file", "Id_", ",_", "version_", ")_", ")_", "\\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 ", " _", "assert_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Net", "client", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\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", "Ano", "nym", "ous", "Access_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "built_", ",_", "d_", ")_", "=_", "self_", "._", "build", "Recipe_", "(_", "recipes_", "._", "test", "Recip", "e1_", ",_", "\"", "Test", "Recip", "e1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repos_", "=_", "self_", "._", "open", "Repository_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "items_", "=_", "repos_", "._", "get", "Trove", "Leav", "es", "By", "Label_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "testc", "ase", "'_", ":_", "{_", "self_", "._", "cfg_", "._", "build", "Label_", ":_", "None_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "len_", "(_", "items_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "port_", "=_", "self_", "._", "cfg_", "._", "repos", "itor", "y", "Map_", "[_", "'", "local", "host", "'_", "]_", "._", "split_", "(_", "':'_", ")_", "[_", "-_", "1_", "]_", "._", "split_", "(_", "'/'_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cfg_", "=_", "copy_", "._", "copy_", "(_", "self_", "._", "cfg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cfg_", "._", "user_", "=_", "self_", "._", "cfg_", "._", "user_", "._", "\\u\\u", "class\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "=_", "cona", "ry", "client_", "._", "Con", "ary", "Client_", "(_", "cfg_", ")_", "._", "get", "Repos", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "items_", "=_", "client_", "._", "get", "Trove", "Leav", "es", "By", "Label_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "testc", "ase", "'_", ":_", "{_", "self_", "._", "cfg_", "._", "build", "Label_", ":_", "None_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "len_", "(_", "items_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Net", "client", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Creat", "e", "Change", "set", "2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "open", "Repository_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repos_", "=_", "self_", "._", "open", "Repository_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t1_", "=_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "run", "'_", ",_", "'", "1", "'_", ",_", "''_", ",_", "[_", "(_", "'/", "etc", "/", "foo", "'_", ",_", "'", "foo", "\\\\", "n", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'/", "etc", "/", "bar", "'_", ",_", "'", "bam", "\\\\", "n", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "run", "'_", ",_", "'/", "local", "host", "1", "@", "rpl", ":", "branch", "/", "1.0", "-1", "-1", "'_", ",_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'/", "etc", "/", "foo", "'_", ",_", "'", "foo", "2", "\\\\", "n", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'/", "etc", "/", "bar", "'_", ",_", "'", "bam", "2", "\\\\", "n", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cs_", "=_", "repos_", "._", "create", "Change", "Set_", "(_", "[_", "(_", "'", "foo", ":", "run", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "t1_", "._", "get", "Version_", "(_", ")_", ",_", "t1_", "._", "get", "Flavor_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "t2_", "._", "get", "Version_", "(_", ")_", ",_", "t2_", "._", "get", "Flavor_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "False_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Net", "client", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Creat", "e", "Change", "set", "Via", "HTTP", "Proxy_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "CN", "Y", "-", "205", "8", ",", " ", "CN", "Y", "-", "205", "6_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "open", "Repository_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "first", " ", "add", " ", "test", ":", "runt", "ime", " ", "to", " ", "the", " ", "repos", "itor", "y", " ", "(", "not", " ", "via", " ", "HTTP", " ", "proxy", ")_", "\\u\\u\\uNL\\u\\u\\u_", "ver_", "=_", "'/", "local", "host", "@", "rpl", ":", "linux", "/", "1.0", "-1", "-1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Qui", "ck", "Test", "Component_", "(_", "'", "test", ":", "runt", "ime", "'_", ",_", "ver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flavor_", "=_", "deps_", "._", "parse", "Flavor_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "version_", "=_", "versions_", "._", "Version", "Fro", "m", "String_", "(_", "ver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cs", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "work", "Dir_", ",_", "'", "foo", ".", "ccs", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "switch", " ", "to", " ", "usi", "ng", " ", "a", " ", "HTTP", " ", "proxy_", "\\u\\u\\uNL\\u\\u\\u_", "h_", "=_", "rep", "help_", "._", "HTTP", "Proxy_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "work", "Dir_", ",_", "\"", "http", "-", "cache", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proxy", "Uri_", "=_", "h_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "proxy", "Uri_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "testh", "elp", "_", "._", "Ski", "p", "Test", "Exception_", "(_", "'", "Squ", "id", " ", "is", " ", "not", " ", "install", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "proxy", "Url_", "=_", "\"", "http", "://\"_", "+_", "proxy", "Uri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proxies_", "=_", "dict_", "(_", "http_", "=_", "proxy", "Url_", ",_", "https_", "=_", "proxy", "Url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "switch", " ", "client", " ", "config", " ", "to", " ", "talk", " ", "to", " ", "the", " ", "proxy_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg_", "._", "config", "Line_", "(_", "'", "proxy", " ", "http", "://", "local", "host", ":", "%", "s", "'_", "%_", "h_", "._", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "=_", "cona", "ry", "client_", "._", "Con", "ary", "Client_", "(_", "self_", "._", "cfg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repos_", "=_", "client_", "._", "get", "Repos", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "the", " ", "changeset", " ", "and", " ", "verify_", "\\u\\u\\uNL\\u\\u\\u_", "repos_", "._", "create", "Change", "Set", "File_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "'", "test", ":", "runt", "ime", "'_", ",_", "(_", "None_", ",_", "flavor_", ")_", ",_", "(_", "version_", ",_", "flavor_", ")_", ",_", "True_", ")_", "]_", ",_", "cs", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "primary", "Trove", "List_", "=_", "[_", "(_", "'", "test", ":", "runt", "ime", "'_", ",_", "version_", ",_", "flavor_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cs_", "=_", "changeset_", "._", "Change", "Set", "Fro", "m", "File_", "(_", "cs", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "cs_", "._", "get", "Prim", "ary", "Trove", "List_", "(_", ")_", "==_", "[_", "(_", "'", "test", ":", "runt", "ime", "'_", ",_", "version_", ",_", "flavor_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Net", "client", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\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", "Fin", "d6", "4", "Bit", "Trove", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "cfg_", "._", "flavor", "Preferences_", "=_", "arch_", "._", "get", "Fla", "vor", "Preferences_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "[_", "deps_", "._", "Dependency_", "(_", "'", "x8", "6", "\\u", "64", "'_", ")_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "run", "'_", ",_", "'", "1", "-1", "-1", "'_", ",_", "'", "is", ":", "x8", "6", "\\u", "64", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tr", "v_", "=_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "run", "'_", ",_", "'", "1", "-1", "-", "2", "'_", ",_", "'", "is", ":", "x8", "6", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "get", "Fla", "vor", "s_", "(_", "d_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "str_", "(_", "x_", ")_", "for_", "x_", "in_", "itertools_", "._", "chain_", "(_", "*_", "d_", "[_", "name_", "]_", "._", "itervalues_", "(_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "repos_", "=_", "self_", "._", "open", "Repository_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "'", "foo", ":", "run", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "tr", "v_", "._", "get", "Version_", "(_", ")_", "._", "trail", "ing", "Label_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "deps_", "._", "parse", "Flavor_", "(_", "'", "is", ":", "x8", "6", "\\u", "64", " ", "x8", "6", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "repos_", "._", "get", "Trove", "Leav", "es", "By", "Label_", "(_", "{_", "n_", ":_", "{_", "l_", ":_", "[_", "f_", "]_", "}_", "}_", ",_", "best", "Flavor_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u", "get", "Fla", "vor", "s_", "(_", "d_", ",_", "n_", ")_", ",_", "[_", "'", "is", ":", " ", "x8", "6", "\\u", "64", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "reset", "Repository_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repos_", "=_", "self_", "._", "open", "Repository_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "run", "'_", ",_", "'", "1", "-1", "-1", "'_", ",_", "'", "is", ":", "x8", "6", "\\u", "64", " ", "x8", "6", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tr", "v_", "=_", "self_", "._", "add", "Component_", "(_", "'", "foo", ":", "run", "'_", ",_", "'", "1", "-1", "-", "2", "'_", ",_", "'", "is", ":", "x8", "6", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "repos_", "._", "get", "Trove", "Leav", "es", "By", "Label_", "(_", "{_", "n_", ":_", "{_", "l_", ":_", "[_", "f_", "]_", "}_", "}_", ",_", "best", "Flavor_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u", "get", "Fla", "vor", "s_", "(_", "d_", ",_", "n_", ")_", ",_", "[_", "'", "is", ":", " ", "x8", "6", " ", "x8", "6", "\\u", "64", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Net", "client", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Prepare", "Call", "back", "Exception_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "CN", "Y", "-1", "271", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Callback_", "(_", "update", "cmd_", "._", "Update", "Callback_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "prepar", "ing", "Change", "Set_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "=_", "Exception_", "(_", "\"", "Except", " ", "me", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "._", "error", "Is", "Unc", "atch", "able_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "e_", "\\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_", "._", "add", "Component_", "(_", "'", "testc", "ase", ":", "runt", "ime", "'_", ",_", "'", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Collection_", "(_", "'", "testc", "ase", "'_", ",_", "'", "1", "'_", ",_", "[_", "':", "runt", "ime", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "=_", "cona", "ry", "client_", "._", "Con", "ary", "Client_", "(_", "self_", "._", "cfg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "appl", "y", "List_", "=_", "cona", "ry", "client_", "._", "cmdline_", "._", "parse", "Change", "List_", "(_", "'", "testc", "ase", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "set", "Update", "Callback_", "(_", "Callback_", "(_", "self_", "._", "cfg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "upd", "Job_", ",_", "su", "gg", "Map_", ")_", "=_", "client_", "._", "update", "Change", "Set_", "(_", "appl", "y", "List_", ")_", "\\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 ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "e_", ")_", ",_", "\"", "Except", " ", "me", "\"_", ")_", "\\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_", "._", "fail_", "(_", "\"", "Except", "ion", " ", "not", " ", "raise", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Net", "client", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Client", "Log_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "work", "Dir_", "+_", "'/", "client", ".", "log", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "environ_", "[_", "'", "CON", "ARY", "\\u", "CLIENT", "\\u", "LOG", "'_", "]_", "=_", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repos_", "=_", "self_", "._", "open", "Repository_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "os_", "._", "environ_", "[_", "'", "CON", "ARY", "\\u", "CLIENT", "\\u", "LOG", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "=_", "call", "log_", "._", "Client", "Call", "Logger_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "methods_", "=_", "[_", "x_", "._", "method", "Name_", "for_", "x_", "in_", "log_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "methods_", ",_", "[_", "'", "check", "Version", "'_", ",_", "'", "add", "New", "Asc", "ii", "PGP", "Key", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Server", "Pro", "xy", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test", "Ba", "d", "Protocol_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "CN", "Y", "-", "932", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "port_", "=_", "self_", "._", "cfg_", "._", "repos", "itor", "y", "Map_", "[_", "'", "local", "host", "'_", "]_", "=_", "'", "ht", "tsp", "://", "local", "host", "/'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repos_", "=_", "cona", "ry", "client_", "._", "Con", "ary", "Client_", "(_", "self_", "._", "cfg_", ")_", "._", "get", "Repos", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "repos_", "._", "trove", "Names", "On", "Server_", "(_", "'", "local", "host", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "errors_", "._", "Open", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "e_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Error", " ", "occur", "red", " ", "opening", " ", "repos", "itor", "y", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ht", "tsp", "://", "test", ":", "<", "PASS", "WD", ">", "@", "local", "host", "/", ":", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Parameter", "Error", ":", " ", "Un", "know", "n", " ", "URL", " ", "sche", "me", " ", "'", "ht", "tsp", "'\"_", ")_", "\\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_", "._", "fail_", "(_", "'", "expected", " ", "exception", " ", "not", " ", "raise", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Server", "Pro", "xy", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Jo", "b", "Sizes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "check_", "(_", "job_", ",_", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fn_", "=_", "self_", "._", "work", "Dir_", "+_", "'/", "foo", ".", "ccs", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cs", "1_", "=_", "repos_", "._", "create", "Change", "Set", "File_", "(_", "job_", ",_", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "os_", "._", "stat_", "(_", "fn_", ")_", "._", "st", "\\u", "size_", "==_", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "first_", "=_", "self_", "._", "add", "Component_", "(_", "'", "first", ":", "run", "'_", ",_", "'", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first", "Job_", "=_", "(_", "'", "first", ":", "run", "'_", ",_", "(_", "None_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "first_", "._", "get", "Version_", "(_", ")_", ",_", "first_", "._", "get", "Flavor_", "(_", ")_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "second_", "=_", "self_", "._", "add", "Component_", "(_", "'", "second", ":", "run", "'_", ",_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "file", "Contents_", "=_", "[_", "'/", "some", "/", "file", "/", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "second", "Job_", "=_", "(_", "'", "second", ":", "run", "'_", ",_", "(_", "None_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "second_", "._", "get", "Version_", "(_", ")_", ",_", "second_", "._", "get", "Flavor_", "(_", ")_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "remove", "Job_", "=_", "(_", "'", "second", ":", "run", "'_", ",_", "(_", "second_", "._", "get", "Version_", "(_", ")_", ",_", "second_", "._", "get", "Flavor_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "None_", ",_", "None_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "repos_", "=_", "self_", "._", "open", "Repository_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CN", "Y", "-", "387", "6", ":", " ", "use", " ", "old", " ", "version", " ", "to", " ", "dete", "rmin", "e", " ", "repo", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "(_", "repos_", "._", "get", "Change", "Set", "Size_", "(_", "[_", "remove", "Job_", "]_", ")_", "[_", "0_", "]_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sizes_", "=_", "repos_", "._", "get", "Change", "Set", "Size_", "(_", "[_", "first", "Job_", ",_", "remove", "Job_", ",_", "second", "Job_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "check_", "(_", "[_", "first", "Job_", "]_", ",_", "sizes_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "sizes_", "[_", "1_", "]_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "check_", "(_", "[_", "second", "Job_", "]_", ",_", "sizes_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", " ", "this", " ", "for", " ", "a", " ", "the", " ", "pre", "-", "info", "On", "ly", " ", "protocol_", "\\u\\u\\uNL\\u\\u\\u_", "repos_", "._", "c_", "[_", "'", "local", "host", "'_", "]_", "._", "set", "Proto", "col", "Version_", "(_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "Sizes_", "=_", "repos_", "._", "get", "Change", "Set", "Size_", "(_", "[_", "first", "Job_", ",_", "remove", "Job_", ",_", "second", "Job_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "sizes_", "==_", "other", "Sizes_", ")_", "\\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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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 ]
Unused import
sippy/b2bua/sippy/SipRequest.py
[ { "content": "# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.\n# Copyright (c) 2006-2014 Sippy Software, Inc. All rights reserved.\n#\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification,\n# are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of conditions and the following disclaimer.\n#\n# 2. Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions and the following disclaimer in the documentation and/or\n# other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nfrom SipMsg import SipMsg\nfrom SipHeader import SipHeader\nfrom SipCSeq import SipCSeq\nfrom SipTo import SipTo\nfrom SipResponse import SipResponse\nfrom SipURL import SipURL\nfrom SipAddress import SipAddress\nfrom SipExpires import SipExpires\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class SipRequest(SipMsg):\n method = None\n ruri = None\n sipver = None\n user_agent = None\n\n\n\n\n\n\n\n\n\n", "metadata": "root.SipRequest", "header": "['module', '___EOS___']", "index": 35 }, { "content": " def __init__(self, buf = None, method = None, ruri = None, sipver = 'SIP/2.0', to = None, fr0m = None, via = None, cseq = None, \\\n callid = None, maxforwards = None, body = None, contact = None, routes = (), target = None, cguid = None,\n user_agent = None, expires = None):\n SipMsg.__init__(self, buf)\n if buf != None:\n return\n self.method = method\n self.ruri = ruri\n if target == None:\n if len(routes) == 0:\n self.setTarget(self.ruri.getAddr())\n else:\n self.setTarget(routes[0].getAddr())\n else:\n self.setTarget(target)\n self.sipver = sipver\n self.appendHeader(SipHeader(name = 'via', body = via))\n if via == None:\n self.getHFBody('via').genBranch()\n self.appendHeaders([SipHeader(name = 'route', body = x) for x in routes])\n self.appendHeader(SipHeader(name = 'max-forwards', body = maxforwards))\n self.appendHeader(SipHeader(name = 'from', body = fr0m))\n if to == None:\n to = SipTo(address = SipAddress(url = ruri))\n self.appendHeader(SipHeader(name = 'to', body = to))\n self.appendHeader(SipHeader(name = 'call-id', body = callid))\n self.appendHeader(SipHeader(name = 'cseq', body = SipCSeq(cseq = cseq, method = method)))\n if contact != None:\n self.appendHeader(SipHeader(name = 'contact', body = contact))\n if expires == None and method == 'INVITE':\n expires = SipHeader(name = 'expires')\n self.appendHeader(expires)\n elif expires != None:\n expires = SipHeader(name = 'expires', body = expires)\n self.appendHeader(expires)\n if user_agent != None:\n self.user_agent = user_agent\n self.appendHeader(SipHeader(name = 'user-agent', bodys = user_agent))\n else:\n self.appendHeader(SipHeader(name = 'user-agent'))\n if cguid != None:\n self.appendHeader(SipHeader(name = 'cisco-guid', body = cguid))\n self.appendHeader(SipHeader(name = 'h323-conf-id', body = cguid))\n if body != None:\n self.setBody(body)", "metadata": "root.SipRequest.__init__", "header": "['class', 'SipRequest', '(', 'SipMsg', ')', ':', '___EOS___']", "index": 41 }, { "content": " def setSL(self, startline):\n self.method, ruri, self.sipver = startline.split()\n self.ruri = SipURL(ruri)", "metadata": "root.SipRequest.setSL", "header": "['class', 'SipRequest', '(', 'SipMsg', ')', ':', '___EOS___']", "index": 87 }, { "content": " def getSL(self):\n return self.method + ' ' + str(self.ruri) + ' ' + self.sipver", "metadata": "root.SipRequest.getSL", "header": "['class', 'SipRequest', '(', 'SipMsg', ')', ':', '___EOS___']", "index": 91 }, { "content": " def getMethod(self):\n return self.method", "metadata": "root.SipRequest.getMethod", "header": "['class', 'SipRequest', '(', 'SipMsg', ')', ':', '___EOS___']", "index": 94 }, { "content": " def getRURI(self):\n return self.ruri", "metadata": "root.SipRequest.getRURI", "header": "['class', 'SipRequest', '(', 'SipMsg', ')', ':', '___EOS___']", "index": 97 }, { "content": " def setRURI(self, ruri):\n self.ruri = ruri", "metadata": "root.SipRequest.setRURI", "header": "['class', 'SipRequest', '(', 'SipMsg', ')', ':', '___EOS___']", "index": 100 }, { "content": " def genResponse(self, scode, reason, body = None, server = None):\n # Should be done at the transaction level\n # to = self.getHF('to').getBody().getCopy()\n # if code > 100 and to.getTag() == None:\n # to.genTag()\n return SipResponse(scode = scode, reason = reason, sipver = self.sipver, fr0m = self.getHFBCopy('from'), \\\n callid = self.getHFBCopy('call-id'), vias = self.getHFBCopys('via'), \\\n to = self.getHFBCopy('to'), cseq = self.getHFBCopy('cseq'), \\\n rrs = self.getHFBCopys('record-route'), body = body, \\\n server = server)", "metadata": "root.SipRequest.genResponse", "header": "['class', 'SipRequest', '(', 'SipMsg', ')', ':', '___EOS___']", "index": 103 }, { "content": " def genACK(self, to = None):\n if to == None:\n to = self.getHFBody('to').getCopy()\n maxforwards = self.getHFBodys('max-forwards')\n if len(maxforwards) > 0:\n maxforward = maxforwards[0].getCopy()\n else:\n maxforward = None\n return SipRequest(method = 'ACK', ruri = self.ruri.getCopy(), sipver = self.sipver, \\\n fr0m = self.getHFBCopy('from'), to = to, \\\n via = self.getHFBCopy('via'), callid = self.getHFBCopy('call-id'), \\\n cseq = self.getHFBody('cseq').getCSeqNum(), maxforwards = maxforward, \\\n user_agent = self.user_agent)", "metadata": "root.SipRequest.genACK", "header": "['class', 'SipRequest', '(', 'SipMsg', ')', ':', '___EOS___']", "index": 114 }, { "content": " def genCANCEL(self):\n maxforwards = self.getHFBodys('max-forwards')\n if len(maxforwards) > 0:\n maxforward = maxforwards[0].getCopy()\n else:\n maxforward = None\n return SipRequest(method = 'CANCEL', ruri = self.ruri.getCopy(), sipver = self.sipver, \\\n fr0m = self.getHFBCopy('from'), to = self.getHFBCopy('to'), \\\n via = self.getHFBCopy('via'), callid = self.getHFBCopy('call-id'), \\\n cseq = self.getHFBody('cseq').getCSeqNum(), maxforwards = maxforward, \\\n routes = self.getHFBCopys('route'), target = self.getTarget(), \\\n user_agent = self.user_agent)", "metadata": "root.SipRequest.genCANCEL", "header": "['class', 'SipRequest', '(', 'SipMsg', ')', ':', '___EOS___']", "index": 128 }, { "content": " def genRequest(self, method, cseq = None):\n if cseq == None:\n cseq = self.getHFBody('cseq').getCSeqNum()\n maxforwards = self.getHFBodys('max-forwards')\n if len(maxforwards) > 0:\n maxforward = maxforwards[0].getCopy()\n else:\n maxforward = None\n expires = self.getHFBodys('expires')\n if len(expires) > 0:\n expires = expires[0].getCopy()\n else:\n expires = None\n return SipRequest(method = method, ruri = self.ruri.getCopy(), sipver = self.sipver, \\\n fr0m = self.getHFBCopy('from'), to = self.getHFBCopy('to'), \\\n via = self.getHFBCopy('via'), callid = self.getHFBCopy('call-id'), \\\n cseq = cseq, maxforwards = maxforward, \\\n user_agent = self.user_agent, expires = expires)", "metadata": "root.SipRequest.genRequest", "header": "['class', 'SipRequest', '(', 'SipMsg', ')', ':', '___EOS___']", "index": 141 } ]
[ { "span": "from SipExpires import SipExpires", "start_line": 33, "start_column": 0, "end_line": 33, "end_column": 33 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2003", "-", "2005", " ", "Maxim", " ", "So", "bol", "ev", ".", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2006", "-", "2014", " ", "Si", "ppy", " ", "Sof", "twa", "re", ",", " ", "Inc", ".", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\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", " ", "modification", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "are", " ", "permit", "ted", " ", "provided", " ", "tha", "t", " ", "the", " ", "follow", "ing", " ", "condition", "s", " ", "are", " ", "met", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1", ".", " ", "Redistributi", "ons", " ", "of", " ", "source", " ", "code", " ", "must", " ", "retain", " ", "the", " ", "above", " ", "copyr", "ight", " ", "notice", ",", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2", ".", " ", "Redistributi", "ons", " ", "in", " ", "binar", "y", " ", "form", " ", "must", " ", "reproduce", " ", "the", " ", "above", " ", "copyr", "ight", " ", "notice", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", " ", "in", " ", "the", " ", "documentation", " ", "and", "/", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", " ", "material", "s", " ", "provided", " ", "with", " ", "the", " ", "distribu", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THIS", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "BY", " ", "THE", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "AND", " ", "CONTRIB", "UTO", "RS", " ", "\"", "AS", " ", "IS", "\"", " ", "AND_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ANY", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", ",", " ", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "THE", " ", "IMPL", "IED", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "AND", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "ARE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "DISC", "LAI", "MED", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "COPY", "RIG", "HT", " ", "HOLD", "ER", " ", "OR", " ", "CONTRIB", "UTO", "RS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ANY", " ", "DIRECT", ",", " ", "INDI", "RECT", ",", " ", "INC", "IDENT", "AL", ",", " ", "SPECIAL", ",", " ", "EXE", "MPL", "ARY", ",", " ", "OR", " ", "CONS", "EQU", "ENTI", "AL", " ", "DA", "MAGE", "S_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "PROC", "URE", "MENT", " ", "OF", " ", "SUBST", "ITU", "TE", " ", "GOOD", "S", " ", "OR", " ", "SERVICES", ";_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LOSS", " ", "OF", " ", "USE", ",", " ", "DATA", ",", " ", "OR", " ", "PROF", "IT", "S", ";", " ", "OR", " ", "BUS", "INE", "SS", " ", "INTER", "RU", "PTION", ")", " ", "HO", "WE", "VER", " ", "CAU", "SED", " ", "AND", " ", "ON_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ANY", " ", "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", " ", "THIS", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "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_", "from_", "Si", "p", "Msg_", "import_", "Si", "p", "Msg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Si", "p", "Header_", "import_", "Si", "p", "Header_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Si", "p", "CS", "eq_", "import_", "Si", "p", "CS", "eq_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Si", "p", "To_", "import_", "Si", "p", "To_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Si", "p", "Response_", "import_", "Si", "p", "Response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Si", "p", "URL_", "import_", "Si", "p", "URL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Si", "p", "Address_", "import_", "Si", "p", "Address_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Si", "p", "Expire", "s_", "import_", "Si", "p", "Expire", "s_", "\\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_", "Si", "p", "Request_", "(_", "Si", "p", "Msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "method_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ru", "ri_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sip", "ver_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "agent_", "=_", "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_", "\\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_", "Si", "p", "Request_", "(_", "Si", "p", "Msg_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "buf_", "=_", "None_", ",_", "method_", "=_", "None_", ",_", "ru", "ri_", "=_", "None_", ",_", "sip", "ver_", "=_", "'", "SI", "P", "/", "2.0", "'_", ",_", "to_", "=_", "None_", ",_", "fr", "0", "m_", "=_", "None_", ",_", "via_", "=_", "None_", ",_", "cse", "q_", "=_", "None_", ",_", "call", "id_", "=_", "None_", ",_", "maxf", "or", "ward", "s_", "=_", "None_", ",_", "body_", "=_", "None_", ",_", "contact_", "=_", "None_", ",_", "routes_", "=_", "(_", ")_", ",_", "target_", "=_", "None_", ",_", "cg", "uid_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "agent_", "=_", "None_", ",_", "expires_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Si", "p", "Msg_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "buf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "buf_", "!=_", "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_", "self_", "._", "method_", "=_", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ru", "ri_", "=_", "ru", "ri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "target_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "routes_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set", "Target_", "(_", "self_", "._", "ru", "ri_", "._", "get", "Addr_", "(_", ")_", ")_", "\\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_", "._", "set", "Target_", "(_", "routes_", "[_", "0_", "]_", "._", "get", "Addr_", "(_", ")_", ")_", "\\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_", "._", "set", "Target_", "(_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "sip", "ver_", "=_", "sip", "ver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "Header_", "(_", "Si", "p", "Header_", "(_", "name_", "=_", "'", "via", "'_", ",_", "body_", "=_", "via_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "via_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "get", "HF", "Body_", "(_", "'", "via", "'_", ")_", "._", "gen", "Branch_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "append", "Headers_", "(_", "[_", "Si", "p", "Header_", "(_", "name_", "=_", "'", "route", "'_", ",_", "body_", "=_", "x_", ")_", "for_", "x_", "in_", "routes_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "Header_", "(_", "Si", "p", "Header_", "(_", "name_", "=_", "'", "max", "-", "forward", "s", "'_", ",_", "body_", "=_", "maxf", "or", "ward", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "Header_", "(_", "Si", "p", "Header_", "(_", "name_", "=_", "'", "from", "'_", ",_", "body_", "=_", "fr", "0", "m_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "to_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "to_", "=_", "Si", "p", "To_", "(_", "address_", "=_", "Si", "p", "Address_", "(_", "url_", "=_", "ru", "ri_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "append", "Header_", "(_", "Si", "p", "Header_", "(_", "name_", "=_", "'", "to", "'_", ",_", "body_", "=_", "to_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "Header_", "(_", "Si", "p", "Header_", "(_", "name_", "=_", "'", "call", "-", "id", "'_", ",_", "body_", "=_", "call", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "Header_", "(_", "Si", "p", "Header_", "(_", "name_", "=_", "'", "cse", "q", "'_", ",_", "body_", "=_", "Si", "p", "CS", "eq_", "(_", "cse", "q_", "=_", "cse", "q_", ",_", "method_", "=_", "method_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "contact_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "Header_", "(_", "Si", "p", "Header_", "(_", "name_", "=_", "'", "contact", "'_", ",_", "body_", "=_", "contact_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "expires_", "==_", "None_", "and_", "method_", "==_", "'", "INVI", "TE", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expires_", "=_", "Si", "p", "Header_", "(_", "name_", "=_", "'", "expir", "es", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "Header_", "(_", "expires_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "expires_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expires_", "=_", "Si", "p", "Header_", "(_", "name_", "=_", "'", "expir", "es", "'_", ",_", "body_", "=_", "expires_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "Header_", "(_", "expires_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "user", "\\u", "agent_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "user", "\\u", "agent_", "=_", "user", "\\u", "agent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "Header_", "(_", "Si", "p", "Header_", "(_", "name_", "=_", "'", "user", "-", "agent", "'_", ",_", "body", "s_", "=_", "user", "\\u", "agent_", ")_", ")_", "\\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", "Header_", "(_", "Si", "p", "Header_", "(_", "name_", "=_", "'", "user", "-", "agent", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cg", "uid_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "Header_", "(_", "Si", "p", "Header_", "(_", "name_", "=_", "'", "cis", "co", "-", "guid", "'_", ",_", "body_", "=_", "cg", "uid_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "Header_", "(_", "Si", "p", "Header_", "(_", "name_", "=_", "'", "h", "323", "-", "conf", "-", "id", "'_", ",_", "body_", "=_", "cg", "uid_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "body_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set", "Body_", "(_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Si", "p", "Request_", "(_", "Si", "p", "Msg_", ")_", ":_", "\\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", "SL", "_", "(_", "self_", ",_", "start", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "method_", ",_", "ru", "ri_", ",_", "self_", "._", "sip", "ver_", "=_", "start", "line_", "._", "split_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ru", "ri_", "=_", "Si", "p", "URL_", "(_", "ru", "ri_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Si", "p", "Request_", "(_", "Si", "p", "Msg_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "SL", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "method_", "+_", "'", " ", "'_", "+_", "str_", "(_", "self_", "._", "ru", "ri_", ")_", "+_", "'", " ", "'_", "+_", "self_", "._", "sip", "ver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Si", "p", "Request_", "(_", "Si", "p", "Msg_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Method_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Si", "p", "Request_", "(_", "Si", "p", "Msg_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "RU", "RI", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "ru", "ri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Si", "p", "Request_", "(_", "Si", "p", "Msg_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "RU", "RI", "_", "(_", "self_", ",_", "ru", "ri_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "ru", "ri_", "=_", "ru", "ri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Si", "p", "Request_", "(_", "Si", "p", "Msg_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gen", "Response_", "(_", "self_", ",_", "sco", "de_", ",_", "reason_", ",_", "body_", "=_", "None_", ",_", "server_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sho", "ul", "d", " ", "be", " ", "don", "e", " ", "at", " ", "the", " ", "transaction", " ", "level_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "=", " ", "self", ".", "get", "HF", "('", "to", "')", ".", "get", "Bod", "y", "()", ".", "get", "Copy", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "code", " ", ">", " ", "100", " ", "and", " ", "to", ".", "get", "Ta", "g", "()", " ", "==", " ", "Non", "e", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "to", ".", "gen", "Ta", "g", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Si", "p", "Response_", "(_", "sco", "de_", "=_", "sco", "de_", ",_", "reason_", "=_", "reason_", ",_", "sip", "ver_", "=_", "self_", "._", "sip", "ver_", ",_", "fr", "0", "m_", "=_", "self_", "._", "get", "HF", "BC", "opy_", "(_", "'", "from", "'_", ")_", ",_", "call", "id_", "=_", "self_", "._", "get", "HF", "BC", "opy_", "(_", "'", "call", "-", "id", "'_", ")_", ",_", "via", "s_", "=_", "self_", "._", "get", "HF", "BC", "opy", "s_", "(_", "'", "via", "'_", ")_", ",_", "to_", "=_", "self_", "._", "get", "HF", "BC", "opy_", "(_", "'", "to", "'_", ")_", ",_", "cse", "q_", "=_", "self_", "._", "get", "HF", "BC", "opy_", "(_", "'", "cse", "q", "'_", ")_", ",_", "rr", "s_", "=_", "self_", "._", "get", "HF", "BC", "opy", "s_", "(_", "'", "record", "-", "route", "'_", ")_", ",_", "body_", "=_", "body_", ",_", "server_", "=_", "server_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Si", "p", "Request_", "(_", "Si", "p", "Msg_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gen", "ACK_", "(_", "self_", ",_", "to_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "to_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "to_", "=_", "self_", "._", "get", "HF", "Body_", "(_", "'", "to", "'_", ")_", "._", "get", "Copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "maxf", "or", "ward", "s_", "=_", "self_", "._", "get", "HF", "Bod", "ys_", "(_", "'", "max", "-", "forward", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "maxf", "or", "ward", "s_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "maxf", "or", "ward", "_", "=_", "maxf", "or", "ward", "s_", "[_", "0_", "]_", "._", "get", "Copy_", "(_", ")_", "\\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 ", " _", "maxf", "or", "ward", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Si", "p", "Request_", "(_", "method_", "=_", "'", "AC", "K", "'_", ",_", "ru", "ri_", "=_", "self_", "._", "ru", "ri_", "._", "get", "Copy_", "(_", ")_", ",_", "sip", "ver_", "=_", "self_", "._", "sip", "ver_", ",_", "fr", "0", "m_", "=_", "self_", "._", "get", "HF", "BC", "opy_", "(_", "'", "from", "'_", ")_", ",_", "to_", "=_", "to_", ",_", "via_", "=_", "self_", "._", "get", "HF", "BC", "opy_", "(_", "'", "via", "'_", ")_", ",_", "call", "id_", "=_", "self_", "._", "get", "HF", "BC", "opy_", "(_", "'", "call", "-", "id", "'_", ")_", ",_", "cse", "q_", "=_", "self_", "._", "get", "HF", "Body_", "(_", "'", "cse", "q", "'_", ")_", "._", "get", "CS", "eq", "Num_", "(_", ")_", ",_", "maxf", "or", "ward", "s_", "=_", "maxf", "or", "ward", "_", ",_", "user", "\\u", "agent_", "=_", "self_", "._", "user", "\\u", "agent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Si", "p", "Request_", "(_", "Si", "p", "Msg_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gen", "CANCEL_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "maxf", "or", "ward", "s_", "=_", "self_", "._", "get", "HF", "Bod", "ys_", "(_", "'", "max", "-", "forward", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "maxf", "or", "ward", "s_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "maxf", "or", "ward", "_", "=_", "maxf", "or", "ward", "s_", "[_", "0_", "]_", "._", "get", "Copy_", "(_", ")_", "\\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 ", " _", "maxf", "or", "ward", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Si", "p", "Request_", "(_", "method_", "=_", "'", "CANCEL", "'_", ",_", "ru", "ri_", "=_", "self_", "._", "ru", "ri_", "._", "get", "Copy_", "(_", ")_", ",_", "sip", "ver_", "=_", "self_", "._", "sip", "ver_", ",_", "fr", "0", "m_", "=_", "self_", "._", "get", "HF", "BC", "opy_", "(_", "'", "from", "'_", ")_", ",_", "to_", "=_", "self_", "._", "get", "HF", "BC", "opy_", "(_", "'", "to", "'_", ")_", ",_", "via_", "=_", "self_", "._", "get", "HF", "BC", "opy_", "(_", "'", "via", "'_", ")_", ",_", "call", "id_", "=_", "self_", "._", "get", "HF", "BC", "opy_", "(_", "'", "call", "-", "id", "'_", ")_", ",_", "cse", "q_", "=_", "self_", "._", "get", "HF", "Body_", "(_", "'", "cse", "q", "'_", ")_", "._", "get", "CS", "eq", "Num_", "(_", ")_", ",_", "maxf", "or", "ward", "s_", "=_", "maxf", "or", "ward", "_", ",_", "routes_", "=_", "self_", "._", "get", "HF", "BC", "opy", "s_", "(_", "'", "route", "'_", ")_", ",_", "target_", "=_", "self_", "._", "get", "Target_", "(_", ")_", ",_", "user", "\\u", "agent_", "=_", "self_", "._", "user", "\\u", "agent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Si", "p", "Request_", "(_", "Si", "p", "Msg_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gen", "Request_", "(_", "self_", ",_", "method_", ",_", "cse", "q_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "cse", "q_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cse", "q_", "=_", "self_", "._", "get", "HF", "Body_", "(_", "'", "cse", "q", "'_", ")_", "._", "get", "CS", "eq", "Num_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "maxf", "or", "ward", "s_", "=_", "self_", "._", "get", "HF", "Bod", "ys_", "(_", "'", "max", "-", "forward", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "maxf", "or", "ward", "s_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "maxf", "or", "ward", "_", "=_", "maxf", "or", "ward", "s_", "[_", "0_", "]_", "._", "get", "Copy_", "(_", ")_", "\\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 ", " _", "maxf", "or", "ward", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expires_", "=_", "self_", "._", "get", "HF", "Bod", "ys_", "(_", "'", "expir", "es", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "expires_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expires_", "=_", "expires_", "[_", "0_", "]_", "._", "get", "Copy_", "(_", ")_", "\\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 ", " _", "expires_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Si", "p", "Request_", "(_", "method_", "=_", "method_", ",_", "ru", "ri_", "=_", "self_", "._", "ru", "ri_", "._", "get", "Copy_", "(_", ")_", ",_", "sip", "ver_", "=_", "self_", "._", "sip", "ver_", ",_", "fr", "0", "m_", "=_", "self_", "._", "get", "HF", "BC", "opy_", "(_", "'", "from", "'_", ")_", ",_", "to_", "=_", "self_", "._", "get", "HF", "BC", "opy_", "(_", "'", "to", "'_", ")_", ",_", "via_", "=_", "self_", "._", "get", "HF", "BC", "opy_", "(_", "'", "via", "'_", ")_", ",_", "call", "id_", "=_", "self_", "._", "get", "HF", "BC", "opy_", "(_", "'", "call", "-", "id", "'_", ")_", ",_", "cse", "q_", "=_", "cse", "q_", ",_", "maxf", "or", "ward", "s_", "=_", "maxf", "or", "ward", "_", ",_", "user", "\\u", "agent_", "=_", "self_", "._", "user", "\\u", "agent_", ",_", "expires_", "=_", "expires_", ")_" ]
[ 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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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 ]
Unused local variable
neuropoly/spinalcordtoolbox/scripts/sct_create_mask.py
[ { "content": "def create_mask():\n fsloutput = 'export FSLOUTPUTTYPE=NIFTI; ' # for faster processing, all outputs are in NIFTI\n\n # parse argument for method\n method_type = param.process[0]\n # check method val\n if not method_type == 'center':\n method_val = param.process[1]\n\n # check existence of input files\n if method_type == 'centerline':\n sct.check_file_exist(method_val, param.verbose)\n\n # Extract path/file/extension\n path_data, file_data, ext_data = sct.extract_fname(param.fname_data)\n\n # Get output folder and file name\n if param.fname_out == '':\n param.fname_out = param.file_prefix+file_data+ext_data\n\n # create temporary folder\n sct.printv('\\nCreate temporary folder...', param.verbose)\n path_tmp = sct.slash_at_the_end('tmp.'+time.strftime(\"%y%m%d%H%M%S\"), 1)\n sct.run('mkdir '+path_tmp, param.verbose)\n\n sct.printv('\\nCheck orientation...', param.verbose)\n orientation_input = get_orientation_3d(param.fname_data, filename=True)\n sct.printv('.. '+orientation_input, param.verbose)\n reorient_coordinates = False\n\n # copy input data to tmp folder\n convert(param.fname_data, path_tmp+'data.nii')\n if method_type == 'centerline':\n convert(method_val, path_tmp+'centerline.nii.gz')\n if method_type == 'point':\n convert(method_val, path_tmp+'point.nii.gz')\n\n # go to tmp folder\n os.chdir(path_tmp)\n\n # reorient to RPI\n sct.printv('\\nReorient to RPI...', param.verbose)\n # if not orientation_input == 'RPI':\n sct.run('sct_image -i data.nii -o data_RPI.nii -setorient RPI -v 0', verbose=False)\n if method_type == 'centerline':\n sct.run('sct_image -i centerline.nii.gz -o centerline_RPI.nii.gz -setorient RPI -v 0', verbose=False)\n if method_type == 'point':\n sct.run('sct_image -i point.nii.gz -o point_RPI.nii.gz -setorient RPI -v 0', verbose=False)\n #\n # if method_type == 'centerline':\n # orientation_centerline = get_orientation_3d(method_val, filename=True)\n # if not orientation_centerline == 'RPI':\n # sct.run('sct_image -i ' + method_val + ' -o ' + path_tmp + 'centerline.nii.gz' + ' -setorient RPI -v 0', verbose=False)\n # else:\n # convert(method_val, path_tmp+'centerline.nii.gz')\n\n # Get dimensions of data\n sct.printv('\\nGet dimensions of data...', param.verbose)\n nx, ny, nz, nt, px, py, pz, pt = Image('data_RPI.nii').dim\n sct.printv(' ' + str(nx) + ' x ' + str(ny) + ' x ' + str(nz)+ ' x ' + str(nt), param.verbose)\n # in case user input 4d data\n if nt != 1:\n sct.printv('WARNING in '+os.path.basename(__file__)+': Input image is 4d but output mask will 3D.', param.verbose, 'warning')\n # extract first volume to have 3d reference\n nii = Image('data_RPI.nii')\n data3d = nii.data[:,:,:,0]\n nii.data = data3d\n nii.save()\n\n if method_type == 'coord':\n # parse to get coordinate\n coord = map(int, method_val.split('x'))\n\n if method_type == 'point':\n # get file name\n fname_point = method_val\n # extract coordinate of point\n sct.printv('\\nExtract coordinate of point...', param.verbose)\n # TODO: change this way to remove dependence to sct.run. ProcessLabels.display_voxel returns list of coordinates\n status, output = sct.run('sct_label_utils -i point_RPI.nii.gz -p display-voxel', param.verbose)\n # parse to get coordinate\n coord = output[output.find('Position=')+10:-17].split(',')\n\n if method_type == 'center':\n # set coordinate at center of FOV\n coord = round(float(nx)/2), round(float(ny)/2)\n\n if method_type == 'centerline':\n # get name of centerline from user argument\n fname_centerline = 'centerline_RPI.nii.gz'\n else:\n # generate volume with line along Z at coordinates 'coord'\n sct.printv('\\nCreate line...', param.verbose)\n fname_centerline = create_line('data_RPI.nii', coord, nz)\n\n # create mask\n sct.printv('\\nCreate mask...', param.verbose)\n centerline = nibabel.load(fname_centerline) # open centerline\n hdr = centerline.get_header() # get header\n hdr.set_data_dtype('uint8') # set imagetype to uint8\n spacing = hdr.structarr['pixdim']\n data_centerline = centerline.get_data() # get centerline\n z_centerline = [iz for iz in range(0, nz, 1) if data_centerline[:, :, iz].any()]\n nz = len(z_centerline)\n # get center of mass of the centerline\n cx = [0] * nz\n cy = [0] * nz\n for iz in range(0, nz, 1):\n cx[iz], cy[iz] = ndimage.measurements.center_of_mass(numpy.array(data_centerline[:, :, z_centerline[iz]]))\n # create 2d masks\n file_mask = 'data_mask'\n for iz in range(nz):\n center = numpy.array([cx[iz], cy[iz]])\n mask2d = create_mask2d(center, param.shape, param.size, nx, ny, even=param.even, spacing=spacing)\n # Write NIFTI volumes\n img = nibabel.Nifti1Image(mask2d, None, hdr)\n nibabel.save(img, (file_mask+str(iz)+'.nii'))\n # merge along Z\n # cmd = 'fslmerge -z mask '\n\n # CHANGE THAT CAN IMPACT SPEED:\n # related to issue #755, we cannot open more than 256 files at one time.\n # to solve this issue, we do not open more than 100 files\n '''\n im_list = []\n im_temp = []\n for iz in range(nz):\n if iz != 0 and iz % 100 == 0:\n im_temp.append(concat_data(im_list, 2))\n im_list = [Image(file_mask + str(iz) + '.nii')]\n else:\n im_list.append(Image(file_mask+str(iz)+'.nii'))\n\n if im_temp:\n im_temp.append(concat_data(im_list, 2))\n im_out = concat_data(im_temp, 2, no_expand=True)\n else:\n im_out = concat_data(im_list, 2)\n '''\n fname_list = [file_mask + str(iz) + '.nii' for iz in range(nz)]\n im_out = concat_data(fname_list, dim=2)\n im_out.setFileName('mask_RPI.nii.gz')\n im_out.save()\n\n # reorient if necessary\n # if not orientation_input == 'RPI':\n sct.run('sct_image -i mask_RPI.nii.gz -o mask.nii.gz -setorient ' + orientation_input, param.verbose)\n\n # copy header input --> mask\n im_dat = Image('data.nii')\n im_mask = Image('mask.nii.gz')\n im_mask = copy_header(im_dat, im_mask)\n im_mask.save()\n\n # come back to parent folder\n os.chdir('..')\n\n # Generate output files\n sct.printv('\\nGenerate output files...', param.verbose)\n sct.generate_output_file(path_tmp+'mask.nii.gz', param.fname_out)\n\n # Remove temporary files\n if param.remove_tmp_files == 1:\n sct.printv('\\nRemove temporary files...', param.verbose)\n sct.run('rm -rf '+path_tmp, param.verbose, error_exit='warning')\n\n # to view results\n sct.printv('\\nDone! To view results, type:', param.verbose)\n sct.printv('fslview '+param.fname_data+' '+param.fname_out+' -l Red -t 0.5 &', param.verbose, 'info')\n print", "metadata": "root.create_mask", "header": "['module', '___EOS___']", "index": 94 } ]
[ { "span": "fsloutput ", "start_line": 95, "start_column": 4, "end_line": 95, "end_column": 13 }, { "span": "reorient_coordinates ", "start_line": 122, "start_column": 4, "end_line": 122, "end_column": 24 }, { "span": "fname_point ", "start_line": 169, "start_column": 8, "end_line": 169, "end_column": 19 } ]
[]
1
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_", "def_", "create", "\\u", "mask_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs", "lou", "tpu", "t_", "=_", "'", "export", " ", "FS", "LO", "UT", "PU", "TTY", "PE", "=", "NI", "FT", "I", ";", " ", "'_", "#", " ", "for", " ", "faste", "r", " ", "process", "ing", ",", " ", "all", " ", "output", "s", " ", "are", " ", "in", " ", "NI", "FT", "I_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parse", " ", "argu", "ment", " ", "for", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "method", "\\u", "type_", "=_", "param_", "._", "process_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "method", " ", "val_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "method", "\\u", "type_", "==_", "'", "center", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "method", "\\u", "val_", "=_", "param_", "._", "process_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "existence", " ", "of", " ", "input", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "method", "\\u", "type_", "==_", "'", "center", "line", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "check", "\\u", "file", "\\u", "exist_", "(_", "method", "\\u", "val_", ",_", "param_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Extract", " ", "path", "/", "file", "/", "extension_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "path", "\\u", "data_", ",_", "file", "\\u", "data_", ",_", "ext", "\\u", "data_", "=_", "sct", "_", "._", "extract", "\\u", "fname_", "(_", "param_", "._", "fname", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "output", " ", "folder", " ", "and", " ", "file", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "param_", "._", "fname", "\\u", "out_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param_", "._", "fname", "\\u", "out_", "=_", "param_", "._", "file", "\\u", "prefix_", "+_", "file", "\\u", "data_", "+_", "ext", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "temporar", "y", " ", "folder_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Creat", "e", " ", "temporar", "y", " ", "folder", "...'_", ",_", "param_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "\\u", "tmp_", "=_", "sct", "_", "._", "slash", "\\u", "at", "\\u", "the", "\\u", "end_", "(_", "'", "tmp", ".'_", "+_", "time_", "._", "strftime_", "(_", "\"%", "y", "%", "m", "%", "d", "%", "H", "%", "M", "%", "S", "\"_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "mkd", "ir", " ", "'_", "+_", "path", "\\u", "tmp_", ",_", "param_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Check", " ", "orientation", "...'_", ",_", "param_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "orientation", "\\u", "input_", "=_", "get", "\\u", "orientation", "\\u", "3d_", "(_", "param_", "._", "fname", "\\u", "data_", ",_", "filename_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'..", " ", "'_", "+_", "orientation", "\\u", "input_", ",_", "param_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reo", "rien", "t", "\\u", "coordinates_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "copy", " ", "input", " ", "data", " ", "to", " ", "tmp", " ", "folder_", "\\u\\u\\uNL\\u\\u\\u_", "convert_", "(_", "param_", "._", "fname", "\\u", "data_", ",_", "path", "\\u", "tmp_", "+_", "'", "data", ".", "ni", "i", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "method", "\\u", "type_", "==_", "'", "center", "line", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "convert_", "(_", "method", "\\u", "val_", ",_", "path", "\\u", "tmp_", "+_", "'", "center", "line", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "method", "\\u", "type_", "==_", "'", "point", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "convert_", "(_", "method", "\\u", "val_", ",_", "path", "\\u", "tmp_", "+_", "'", "point", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "go", " ", "to", " ", "tmp", " ", "folder_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "chdir_", "(_", "path", "\\u", "tmp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "reo", "rien", "t", " ", "to", " ", "RP", "I_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Re", "orient", " ", "to", " ", "RP", "I", "...'_", ",_", "param_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "not", " ", "orientation", "\\u", "input", " ", "==", " ", "'", "RP", "I", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "image", " ", "-", "i", " ", "data", ".", "ni", "i", " ", "-", "o", " ", "data\\u", "RP", "I", ".", "ni", "i", " ", "-", "seto", "rien", "t", " ", "RP", "I", " ", "-", "v", " ", "0", "'_", ",_", "verbose_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "method", "\\u", "type_", "==_", "'", "center", "line", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "image", " ", "-", "i", " ", "center", "line", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "center", "line", "\\u", "RP", "I", ".", "ni", "i", ".", "gz", " ", "-", "seto", "rien", "t", " ", "RP", "I", " ", "-", "v", " ", "0", "'_", ",_", "verbose_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "method", "\\u", "type_", "==_", "'", "point", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "image", " ", "-", "i", " ", "point", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "point", "\\u", "RP", "I", ".", "ni", "i", ".", "gz", " ", "-", "seto", "rien", "t", " ", "RP", "I", " ", "-", "v", " ", "0", "'_", ",_", "verbose_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "method", "\\u", "type", " ", "==", " ", "'", "center", "line", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "orientation", "\\u", "center", "line", " ", "=", " ", "get", "\\u", "orientation", "\\u", "3d", "(", "method", "\\u", "val", ",", " ", "filename", "=", "Tru", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "not", " ", "orientation", "\\u", "center", "line", " ", "==", " ", "'", "RP", "I", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "sct", ".", "run", "('", "sct", "\\u", "image", " ", "-", "i", " ", "'", " ", "+", " ", "method", "\\u", "val", " ", "+", " ", "'", " ", "-", "o", " ", "'", " ", "+", " ", "path", "\\u", "tmp", " ", "+", " ", "'", "center", "line", ".", "ni", "i", ".", "gz", "'", " ", "+", " ", "'", " ", "-", "seto", "rien", "t", " ", "RP", "I", " ", "-", "v", " ", "0", "',", " ", "verbo", "se", "=", "Fal", "se", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "convert", "(", "method", "\\u", "val", ",", " ", "path", "\\u", "tmp", "+'", "center", "line", ".", "ni", "i", ".", "gz", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "dimension", "s", " ", "of", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Get", " ", "dimension", "s", " ", "of", " ", "data", "...'_", ",_", "param_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nx_", ",_", "ny_", ",_", "nz_", ",_", "nt_", ",_", "px_", ",_", "py_", ",_", "pz", "_", ",_", "pt_", "=_", "Image_", "(_", "'", "data\\u", "RP", "I", ".", "ni", "i", "'_", ")_", "._", "dim_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'", " ", " ", "'_", "+_", "str_", "(_", "nx_", ")_", "+_", "'", " ", "x", " ", "'_", "+_", "str_", "(_", "ny_", ")_", "+_", "'", " ", "x", " ", "'_", "+_", "str_", "(_", "nz_", ")_", "+_", "'", " ", "x", " ", "'_", "+_", "str_", "(_", "nt_", ")_", ",_", "param_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "in", " ", "case", " ", "user", " ", "input", " ", "4d", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "nt_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'", "WARN", "ING", " ", "in", " ", "'_", "+_", "os_", "._", "path_", "._", "basename_", "(_", "\\u\\u", "file\\u\\u_", ")_", "+_", "':", " ", "Inp", "ut", " ", "image", " ", "is", " ", "4d", " ", "but", " ", "output", " ", "mask", " ", "will", " ", "3", "D", ".'_", ",_", "param_", "._", "verbose_", ",_", "'", "warn", "ing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "extract", " ", "first", " ", "volume", " ", "to", " ", "have", " ", "3d", " ", "reference_", "\\u\\u\\uNL\\u\\u\\u_", "ni", "i_", "=_", "Image_", "(_", "'", "data\\u", "RP", "I", ".", "ni", "i", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data", "3d_", "=_", "ni", "i_", "._", "data_", "[_", ":_", ",_", ":_", ",_", ":_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ni", "i_", "._", "data_", "=_", "data", "3d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ni", "i_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "method", "\\u", "type_", "==_", "'", "coord", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "parse", " ", "to", " ", "get", " ", "coordinate_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "coord_", "=_", "map_", "(_", "int_", ",_", "method", "\\u", "val_", "._", "split_", "(_", "'", "x", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "method", "\\u", "type_", "==_", "'", "point", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "file", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fname", "\\u", "point_", "=_", "method", "\\u", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "extract", " ", "coordinate", " ", "of", " ", "point_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Extract", " ", "coordinate", " ", "of", " ", "point", "...'_", ",_", "param_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "change", " ", "this", " ", "way", " ", "to", " ", "remove", " ", "dependen", "ce", " ", "to", " ", "sct", ".", "run", ".", " ", "Process", "Label", "s", ".", "display", "\\u", "voxel", " ", "return", "s", " ", "list", " ", "of", " ", "coordinates_", "\\u\\u\\uNL\\u\\u\\u_", "status_", ",_", "output_", "=_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "label", "\\u", "util", "s", " ", "-", "i", " ", "point", "\\u", "RP", "I", ".", "ni", "i", ".", "gz", " ", "-", "p", " ", "display", "-", "voxel", "'_", ",_", "param_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "parse", " ", "to", " ", "get", " ", "coordinate_", "\\u\\u\\uNL\\u\\u\\u_", "coord_", "=_", "output_", "[_", "output_", "._", "find_", "(_", "'", "Position", "='_", ")_", "+_", "10_", ":_", "-_", "17_", "]_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "method", "\\u", "type_", "==_", "'", "center", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "coordinate", " ", "at", " ", "center", " ", "of", " ", "FO", "V_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "coord_", "=_", "round_", "(_", "float_", "(_", "nx_", ")_", "/_", "2_", ")_", ",_", "round_", "(_", "float_", "(_", "ny_", ")_", "/_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "method", "\\u", "type_", "==_", "'", "center", "line", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "name", " ", "of", " ", "center", "line", " ", "from", " ", "user", " ", "argument_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fname", "\\u", "center", "line_", "=_", "'", "center", "line", "\\u", "RP", "I", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "generat", "e", " ", "volume", " ", "with", " ", "line", " ", "along", " ", "Z", " ", "at", " ", "coordinate", "s", " ", "'", "coord", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Creat", "e", " ", "line", "...'_", ",_", "param_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fname", "\\u", "center", "line_", "=_", "create", "\\u", "line_", "(_", "'", "data\\u", "RP", "I", ".", "ni", "i", "'_", ",_", "coord_", ",_", "nz_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "mask_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Creat", "e", " ", "mask", "...'_", ",_", "param_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "center", "line_", "=_", "nib", "abel_", "._", "load_", "(_", "fname", "\\u", "center", "line_", ")_", "#", " ", "open", " ", "center", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hdr_", "=_", "center", "line_", "._", "get", "\\u", "header_", "(_", ")_", "#", " ", "get", " ", "header_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hdr_", "._", "set\\u", "data\\u", "dtype_", "(_", "'", "uint", "8", "'_", ")_", "#", " ", "set", " ", "image", "type", " ", "to", " ", "uint8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spacing_", "=_", "hdr_", "._", "struct", "arr_", "[_", "'", "pix", "dim", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "center", "line_", "=_", "center", "line_", "._", "get", "\\u", "data_", "(_", ")_", "#", " ", "get", " ", "center", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z", "\\u", "center", "line_", "=_", "[_", "iz_", "for_", "iz_", "in_", "range_", "(_", "0_", ",_", "nz_", ",_", "1_", ")_", "if_", "data\\u", "center", "line_", "[_", ":_", ",_", ":_", ",_", "iz_", "]_", "._", "any_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nz_", "=_", "len_", "(_", "z", "\\u", "center", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "center", " ", "of", " ", "mass", " ", "of", " ", "the", " ", "center", "line_", "\\u\\u\\uNL\\u\\u\\u_", "cx_", "=_", "[_", "0_", "]_", "*_", "nz_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cy_", "=_", "[_", "0_", "]_", "*_", "nz_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "iz_", "in_", "range_", "(_", "0_", ",_", "nz_", ",_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cx_", "[_", "iz_", "]_", ",_", "cy_", "[_", "iz_", "]_", "=_", "ndimage_", "._", "measurements_", "._", "center", "\\u", "of", "\\u", "mass_", "(_", "numpy_", "._", "array_", "(_", "data\\u", "center", "line_", "[_", ":_", ",_", ":_", ",_", "z", "\\u", "center", "line_", "[_", "iz_", "]_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "2d", " ", "masks_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "file", "\\u", "mask_", "=_", "'", "data\\u", "mask", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "iz_", "in_", "range_", "(_", "nz_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "center_", "=_", "numpy_", "._", "array_", "(_", "[_", "cx_", "[_", "iz_", "]_", ",_", "cy_", "[_", "iz_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mask", "2d_", "=_", "create", "\\u", "mask", "2d_", "(_", "center_", ",_", "param_", "._", "shape_", ",_", "param_", "._", "size_", ",_", "nx_", ",_", "ny_", ",_", "even_", "=_", "param_", "._", "even_", ",_", "spacing_", "=_", "spacing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Write", " ", "NI", "FT", "I", " ", "volumes_", "\\u\\u\\uNL\\u\\u\\u_", "img_", "=_", "nib", "abel_", "._", "Ni", "fti", "1", "Image_", "(_", "mask", "2d_", ",_", "None_", ",_", "hdr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nib", "abel_", "._", "save_", "(_", "img_", ",_", "(_", "file", "\\u", "mask_", "+_", "str_", "(_", "iz_", ")_", "+_", "'.", "ni", "i", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "merge", " ", "along", " ", "Z_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "cmd", " ", "=", " ", "'", "fs", "lm", "erge", " ", "-", "z", " ", "mask", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CHANGE", " ", "THA", "T", " ", "CAN", " ", "IMP", "ACT", " ", "SPEED", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "relate", "d", " ", "to", " ", "issue", " ", "#", "755", ",", " ", "we", " ", "cann", "ot", " ", "open", " ", "more", " ", "than", " ", "256", " ", "files", " ", "at", " ", "one", " ", "time", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "solve", " ", "this", " ", "issue", ",", " ", "we", " ", "do", " ", "not", " ", "open", " ", "more", " ", "than", " ", "100", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "'''", "\\", "10", ";", " ", " ", " ", " ", "im", "\\u", "list", " ", "=", " ", "[]", "\\", "10", ";", " ", " ", " ", " ", "im", "\\u", "temp", " ", "=", " ", "[]", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "iz", " ", "in", " ", "range", "(", "nz", "):", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "iz", " ", "!=", " ", "0", " ", "and", " ", "iz", " ", "%", " ", "100", " ", "==", " ", "0", ":", "\\", "10", ";", " ", " ", " ", " ", "im", "\\u", "temp", ".", "append", "(", "conc", "at", "\\u", "data", "(", "im", "\\u", "list", ",", " ", "2", "))\\", "10", ";", " ", " ", " ", " ", "im", "\\u", "list", " ", "=", " ", "[", "Image", "(", "file", "\\u", "mask", " ", "+", " ", "str", "(", "iz", ")", " ", "+", " ", "'.", "ni", "i", "')]", "\\", "10", ";", " ", " ", " ", " ", "else", ":", "\\", "10", ";", " ", " ", " ", " ", "im", "\\u", "list", ".", "append", "(", "Image", "(", "file", "\\u", "mask", "+", "str", "(", "iz", ")+", "'.", "ni", "i", "'))", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "im", "\\u", "temp", ":", "\\", "10", ";", " ", " ", " ", " ", "im", "\\u", "temp", ".", "append", "(", "conc", "at", "\\u", "data", "(", "im", "\\u", "list", ",", " ", "2", "))\\", "10", ";", " ", " ", " ", " ", "im", "\\u", "out", " ", "=", " ", "conc", "at", "\\u", "data", "(", "im", "\\u", "temp", ",", " ", "2", ",", " ", "no", "\\u", "expand", "=", "Tru", "e", ")", "\\", "10", ";", " ", " ", " ", " ", "else", ":", "\\", "10", ";", " ", " ", " ", " ", "im", "\\u", "out", " ", "=", " ", "conc", "at", "\\u", "data", "(", "im", "\\u", "list", ",", " ", "2", ")", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fname", "\\u", "list_", "=_", "[_", "file", "\\u", "mask_", "+_", "str_", "(_", "iz_", ")_", "+_", "'.", "ni", "i", "'_", "for_", "iz_", "in_", "range_", "(_", "nz_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "im", "\\u", "out_", "=_", "conc", "at", "\\u", "data_", "(_", "fname", "\\u", "list_", ",_", "dim_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "im", "\\u", "out_", "._", "set", "File", "Name_", "(_", "'", "mask", "\\u", "RP", "I", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "im", "\\u", "out_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "reo", "rien", "t", " ", "if", " ", "necessar", "y_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "not", " ", "orientation", "\\u", "input", " ", "==", " ", "'", "RP", "I", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "image", " ", "-", "i", " ", "mask", "\\u", "RP", "I", ".", "ni", "i", ".", "gz", " ", "-", "o", " ", "mask", ".", "ni", "i", ".", "gz", " ", "-", "seto", "rien", "t", " ", "'_", "+_", "orientation", "\\u", "input_", ",_", "param_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "copy", " ", "header", " ", "input", " ", "-->", " ", "mask_", "\\u\\u\\uNL\\u\\u\\u_", "im", "\\u", "dat_", "=_", "Image_", "(_", "'", "data", ".", "ni", "i", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "im", "\\u", "mask_", "=_", "Image_", "(_", "'", "mask", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "im", "\\u", "mask_", "=_", "copy", "\\u", "header_", "(_", "im", "\\u", "dat_", ",_", "im", "\\u", "mask_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "im", "\\u", "mask_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "come", " ", "back", " ", "to", " ", "parent", " ", "folder_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "chdir_", "(_", "'..'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Generate", " ", "output", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Generate", " ", "output", " ", "files", "...'_", ",_", "param_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "generat", "e\\u", "output", "\\u", "file_", "(_", "path", "\\u", "tmp_", "+_", "'", "mask", ".", "ni", "i", ".", "gz", "'_", ",_", "param_", "._", "fname", "\\u", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remove", " ", "temporar", "y", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "param_", "._", "remove", "\\u", "tmp", "\\u", "files_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Remove", " ", "temporar", "y", " ", "files", "...'_", ",_", "param_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "rm", " ", "-", "rf", " ", "'_", "+_", "path", "\\u", "tmp_", ",_", "param_", "._", "verbose_", ",_", "error", "\\u", "exit_", "=_", "'", "warn", "ing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "view", " ", "results_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Don", "e", "!", " ", "To", " ", "view", " ", "results", ",", " ", "type", ":'_", ",_", "param_", "._", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'", "fs", "lv", "iew", " ", "'_", "+_", "param_", "._", "fname", "\\u", "data_", "+_", "'", " ", "'_", "+_", "param_", "._", "fname", "\\u", "out_", "+_", "'", " ", "-", "l", " ", "Red", " ", "-", "t", " ", "0.", "5", " ", "&'_", ",_", "param_", "._", "verbose_", ",_", "'", "info", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\\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, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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_shared_paths.py
[ { "content": " def test_shared_paths_forward(self):\n g1 = LineString([(0, 0), (10, 0), (10, 5), (20, 5)])\n g2 = LineString([(5, 0), (15, 0)])\n result = shared_paths(g1, g2)\n \n self.assertTrue(isinstance(result, GeometryCollection))\n self.assertTrue(len(result) == 2)\n a, b = result\n self.assertTrue(isinstance(a, MultiLineString))\n self.assertTrue(len(a) == 1)\n self.assertEqual(a[0].coords[:], [(5, 0), (10, 0)])\n self.assertTrue(b.is_empty)", "metadata": "root.SharedPaths.test_shared_paths_forward", "header": "['class', 'SharedPaths', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 9 }, { "content": " def test_shared_paths_forward(self):\n g1 = LineString([(0, 0), (10, 0), (10, 5), (20, 5)])\n g2 = LineString([(15, 0), (5, 0)])\n result = shared_paths(g1, g2)\n \n self.assertTrue(isinstance(result, GeometryCollection))\n self.assertTrue(len(result) == 2)\n a, b = result\n self.assertTrue(isinstance(b, MultiLineString))\n self.assertTrue(len(b) == 1)\n self.assertEqual(b[0].coords[:], [(5, 0), (10, 0)])\n self.assertTrue(a.is_empty)", "metadata": "root.SharedPaths.test_shared_paths_forward", "header": "['class', 'SharedPaths', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 22 } ]
[ { "span": "self.assertTrue(len(result) == 2)", "start_line": 15, "start_column": 8, "end_line": 15, "end_column": 41 }, { "span": "self.assertTrue(len(a) == 1)", "start_line": 18, "start_column": 8, "end_line": 18, "end_column": 36 }, { "span": "self.assertTrue(len(result) == 2)", "start_line": 28, "start_column": 8, "end_line": 28, "end_column": 41 }, { "span": "self.assertTrue(len(b) == 1)", "start_line": 31, "start_column": 8, "end_line": 31, "end_column": 36 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Share", "d", "Paths_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "shared", "\\u", "path", "s", "\\u", "forward_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "g1_", "=_", "Line", "String_", "(_", "[_", "(_", "0_", ",_", "0_", ")_", ",_", "(_", "10_", ",_", "0_", ")_", ",_", "(_", "10_", ",_", "5_", ")_", ",_", "(_", "20_", ",_", "5_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g2_", "=_", "Line", "String_", "(_", "[_", "(_", "5_", ",_", "0_", ")_", ",_", "(_", "15_", ",_", "0_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "shared", "\\u", "paths_", "(_", "g1_", ",_", "g2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "result_", ",_", "Geometr", "y", "Collection_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "result_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", ",_", "b_", "=_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "a_", ",_", "Multi", "Line", "String_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "a_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a_", "[_", "0_", "]_", "._", "coords_", "[_", ":_", "]_", ",_", "[_", "(_", "5_", ",_", "0_", ")_", ",_", "(_", "10_", ",_", "0_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "b_", "._", "is", "\\u", "empty_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Share", "d", "Paths_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "shared", "\\u", "path", "s", "\\u", "forward_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "g1_", "=_", "Line", "String_", "(_", "[_", "(_", "0_", ",_", "0_", ")_", ",_", "(_", "10_", ",_", "0_", ")_", ",_", "(_", "10_", ",_", "5_", ")_", ",_", "(_", "20_", ",_", "5_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g2_", "=_", "Line", "String_", "(_", "[_", "(_", "15_", ",_", "0_", ")_", ",_", "(_", "5_", ",_", "0_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "shared", "\\u", "paths_", "(_", "g1_", ",_", "g2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "result_", ",_", "Geometr", "y", "Collection_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "result_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", ",_", "b_", "=_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "b_", ",_", "Multi", "Line", "String_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "b_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "b_", "[_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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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
lsbardel/python-stdnet/tests/all/query/manytomany.py
[ { "content": " def addsome(self, role1='admin', role2='coder'):\n models = self.mapper\n session = models.session()\n with session.begin() as t:\n profile = t.add(models.profile(name='p1'))\n profile2 = t.add(models.profile(name='p2'))\n profile3 = t.add(models.profile(name='p3'))\n role1 = t.add(models.role(name=role1))\n role2 = t.add(models.role(name=role2))\n yield t.on_result\n with session.begin() as t:\n pr1 = profile.roles.add(role1)\n pr2 = profile.roles.add(role2)\n yield t.on_result\n self.assertEqual(len(t.saved), 1)\n self.assertEqual(len(list(t.saved.values())[0]), 2)\n # Check role \n t1 = yield role1.profiles.throughquery().load_related('role').all()\n t2 = yield role2.profiles.throughquery().load_related('role').all()\n self.assertEqual(len(t1), 1)\n self.assertEqual(len(t2), 1)\n self.assertEqual(t1[0].role, role1)\n self.assertEqual(t2[0].role, role2)\n #\n p1 = yield role1.profiles.query().all()\n p2 = yield role2.profiles.query().all()\n self.assertEqual(len(p1), 1)\n self.assertEqual(len(p2), 1)\n self.assertEqual(p1[0], profile)\n self.assertEqual(p2[0], profile)\n #\n # Check profile\n t1 = yield profile.roles.throughquery().all()\n self.assertEqual(len(t1), 2)\n p1, p2 = yield self.multi_async((t1[0].profile, t1[1].profile))\n self.assertEqual(p1, profile)\n self.assertEqual(p2, profile)\n #\n # Check with load_only\n t1 = yield profile.roles.throughquery().load_related('profile').all()\n self.assertEqual(len(t1), 2)\n self.assertEqual(t1[0].profile, profile)\n self.assertEqual(t1[1].profile, profile)\n #\n r = yield profile.roles.query().all()\n self.assertEqual(len(r), 2)\n self.assertEqual(set(r), set((role1,role2)))\n yield role1, role2", "metadata": "root.TestManyToManyBase.addsome", "header": "['class', 'TestManyToManyBase', '(', 'object', ')', ':', '___EOS___']", "index": 10 } ]
[ { "span": "profile2 ", "start_line": 15, "start_column": 12, "end_line": 15, "end_column": 20 }, { "span": "profile3 ", "start_line": 16, "start_column": 12, "end_line": 16, "end_column": 20 }, { "span": "pr1 ", "start_line": 21, "start_column": 12, "end_line": 21, "end_column": 15 }, { "span": "pr2 ", "start_line": 22, "start_column": 12, "end_line": 22, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Many", "To", "Many", "Base_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "adds", "ome_", "(_", "self_", ",_", "role", "1_", "=_", "'", "admin", "'_", ",_", "role", "2_", "=_", "'", "coder", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "models_", "=_", "self_", "._", "mapper_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "=_", "models_", "._", "session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "session_", "._", "begin_", "(_", ")_", "as_", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "profile_", "=_", "t_", "._", "add_", "(_", "models_", "._", "profile_", "(_", "name_", "=_", "'", "p1", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "profile", "2_", "=_", "t_", "._", "add_", "(_", "models_", "._", "profile_", "(_", "name_", "=_", "'", "p2", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "profile", "3_", "=_", "t_", "._", "add_", "(_", "models_", "._", "profile_", "(_", "name_", "=_", "'", "p3", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "role", "1_", "=_", "t_", "._", "add_", "(_", "models_", "._", "role_", "(_", "name_", "=_", "role", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "role", "2_", "=_", "t_", "._", "add_", "(_", "models_", "._", "role_", "(_", "name_", "=_", "role", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "t_", "._", "on", "\\u", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "session_", "._", "begin_", "(_", ")_", "as_", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pr", "1_", "=_", "profile_", "._", "roles_", "._", "add_", "(_", "role", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pr", "2_", "=_", "profile_", "._", "roles_", "._", "add_", "(_", "role", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "t_", "._", "on", "\\u", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "t_", "._", "saved_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "list_", "(_", "t_", "._", "saved_", "._", "values_", "(_", ")_", ")_", "[_", "0_", "]_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "role", " _", "\\u\\u\\uNL\\u\\u\\u_", "t1_", "=_", "yield_", "role", "1_", "._", "profiles_", "._", "through", "query_", "(_", ")_", "._", "load", "\\u", "related_", "(_", "'", "role", "'_", ")_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "yield_", "role", "2_", "._", "profiles_", "._", "through", "query_", "(_", ")_", "._", "load", "\\u", "related_", "(_", "'", "role", "'_", ")_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "t1_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "t2_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t1_", "[_", "0_", "]_", "._", "role_", ",_", "role", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t2_", "[_", "0_", "]_", "._", "role_", ",_", "role", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "p1_", "=_", "yield_", "role", "1_", "._", "profiles_", "._", "query_", "(_", ")_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "=_", "yield_", "role", "2_", "._", "profiles_", "._", "query_", "(_", ")_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "p1_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "p2_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "p1_", "[_", "0_", "]_", ",_", "profile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "p2_", "[_", "0_", "]_", ",_", "profile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "profile_", "\\u\\u\\uNL\\u\\u\\u_", "t1_", "=_", "yield_", "profile_", "._", "roles_", "._", "through", "query_", "(_", ")_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "t1_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p1_", ",_", "p2_", "=_", "yield_", "self_", "._", "multi", "\\u", "async_", "(_", "(_", "t1_", "[_", "0_", "]_", "._", "profile_", ",_", "t1_", "[_", "1_", "]_", "._", "profile_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "p1_", ",_", "profile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "p2_", ",_", "profile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "with", " ", "load", "\\u", "only_", "\\u\\u\\uNL\\u\\u\\u_", "t1_", "=_", "yield_", "profile_", "._", "roles_", "._", "through", "query_", "(_", ")_", "._", "load", "\\u", "related_", "(_", "'", "profile", "'_", ")_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "t1_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t1_", "[_", "0_", "]_", "._", "profile_", ",_", "profile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t1_", "[_", "1_", "]_", "._", "profile_", ",_", "profile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "yield_", "profile_", "._", "roles_", "._", "query_", "(_", ")_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "r_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "set_", "(_", "r_", ")_", ",_", "set_", "(_", "(_", "role", "1_", ",_", "role", "2_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "role", "1_", ",_", "role", "2_", "\\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, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
ejeschke/ginga/ginga/web/pgw/Viewers.py
[ { "content": "from ginga.web.pgw.ImageViewPg import CanvasView, ImageViewCanvas\nfrom ginga.web.pgw import Widgets\nfrom ginga.misc import Bunch\n\n\n\n#END\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class GingaViewerWidget(Widgets.Canvas):\n \"\"\"\n This class implements the server-side backend of the surface for a\n web-based Ginga viewer. It uses a web socket to connect to an HTML5\n canvas with javascript callbacks in a web browser on the client.\n\n The viewer is created separately on the backend and connects to this\n surface via the set_viewer() method.\n \"\"\"\n\n\n\n\n\n\n\n", "metadata": "root.GingaViewerWidget", "header": "['module', '___EOS___']", "index": 4 }, { "content": " def __init__(self, viewer=None, width=600, height=600):\n super(GingaViewerWidget, self).__init__(width=600, height=600)\n\n if viewer is None:\n viewer = CanvasView(logger)\n self.logger = viewer.logger\n\n self._configured = False\n self.refresh_delay = 0.010\n\n self.set_viewer(viewer)", "metadata": "root.GingaViewerWidget.__init__", "header": "['class', 'GingaViewerWidget', '(', 'Widgets', '.', 'Canvas', ')', ':', '___EOS___']", "index": 14 }, { "content": " def set_viewer(self, viewer):\n self.logger.debug(\"set_viewer called\")\n self.viewer = viewer\n #self.logger = viewer.get_logger()\n\n self._dispatch_event_table = {\n \"activate\": self.ignore_event,\n \"setbounds\": self.map_event_cb,\n \"mousedown\": viewer.button_press_event,\n \"mouseup\": viewer.button_release_event,\n \"mousemove\": viewer.motion_notify_event,\n \"mouseout\": viewer.leave_notify_event,\n \"mouseover\": viewer.enter_notify_event,\n \"mousewheel\": viewer.scroll_event,\n \"wheel\": viewer.scroll_event,\n \"click\": self.ignore_event,\n \"dblclick\": self.ignore_event,\n \"keydown\": viewer.key_down_event,\n \"keyup\": viewer.key_up_event,\n \"keypress\": viewer.key_press_event,\n \"resize\": viewer.resize_event,\n \"focus\": lambda event: viewer.focus_event(event, True),\n \"focusout\": lambda event: viewer.focus_event(event, False),\n \"blur\": lambda event: viewer.focus_event(event, False),\n \"drop\": viewer.drop_event,\n \"paste\": self.ignore_event,\n # Hammer.js events\n \"pinch\": viewer.pinch_event,\n \"pinchstart\": viewer.pinch_event,\n \"pinchend\": viewer.pinch_event,\n \"rotate\": viewer.rotate_event,\n \"rotatestart\": viewer.rotate_event,\n \"rotateend\": viewer.rotate_event,\n \"tap\": viewer.tap_event,\n \"pan\": viewer.pan_event,\n \"panstart\": viewer.pan_event,\n \"panend\": viewer.pan_event,\n \"swipe\": viewer.swipe_event,\n }\n\n self.add_timer('refresh', self.refresh_cb)\n self.add_timer('redraw', self.viewer.delayed_redraw)\n self.add_timer('msg', self.viewer.clear_onscreen_message)\n\n self.viewer.set_widget(self)", "metadata": "root.GingaViewerWidget.set_viewer", "header": "['class', 'GingaViewerWidget', '(', 'Widgets', '.', 'Canvas', ')', ':', '___EOS___']", "index": 26 }, { "content": " def get_viewer(self):\n return self.viewer", "metadata": "root.GingaViewerWidget.get_viewer", "header": "['class', 'GingaViewerWidget', '(', 'Widgets', '.', 'Canvas', ')', ':', '___EOS___']", "index": 72 }, { "content": " def ignore_event(self, event):\n pass", "metadata": "root.GingaViewerWidget.ignore_event", "header": "['class', 'GingaViewerWidget', '(', 'Widgets', '.', 'Canvas', ')', ':', '___EOS___']", "index": 75 }, { "content": " def map_event_cb(self, event):\n self.viewer.map_event(event)\n self.reset_timer('refresh', self.refresh_delay)", "metadata": "root.GingaViewerWidget.map_event_cb", "header": "['class', 'GingaViewerWidget', '(', 'Widgets', '.', 'Canvas', ')', ':', '___EOS___']", "index": 78 }, { "content": " def refresh_cb(self, *args):\n app = self.get_app()\n app.do_operation('refresh_canvas', id=self.id)\n self.reset_timer('refresh', self.refresh_delay)", "metadata": "root.GingaViewerWidget.refresh_cb", "header": "['class', 'GingaViewerWidget', '(', 'Widgets', '.', 'Canvas', ')', ':', '___EOS___']", "index": 82 }, { "content": " def do_update(self, buf):\n self.clear_rect(0, 0, self.width, self.height)\n\n self.logger.debug(\"drawing image\")\n self.draw_image(buf, 0, 0, self.width, self.height)\n self.logger.debug(\"drew image\")", "metadata": "root.GingaViewerWidget.do_update", "header": "['class', 'GingaViewerWidget', '(', 'Widgets', '.', 'Canvas', ')', ':', '___EOS___']", "index": 87 }, { "content": " def _cb_redirect(self, event):\n method = self._dispatch_event_table[event.type]\n try:\n method(event)\n\n except Exception as e:\n self.logger.error(\"error redirecting '%s' event: %s\" % (\n event.type, str(e)))\n # TODO: dump traceback to debug log", "metadata": "root.GingaViewerWidget._cb_redirect", "header": "['class', 'GingaViewerWidget', '(', 'Widgets', '.', 'Canvas', ')', ':', '___EOS___']", "index": 94 } ]
[ { "span": "from ginga.web.pgw.ImageViewPg import CanvasView, ImageViewCanvas", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 65 }, { "span": "from ginga.misc import Bunch", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "ging", "a_", "._", "web_", "._", "pg", "w_", "._", "Image", "View", "Pg", "_", "import_", "Can", "vas", "View_", ",_", "Image", "View", "Canvas_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ging", "a_", "._", "web_", "._", "pg", "w_", "import_", "Widgets_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ging", "a_", "._", "misc_", "import_", "Bun", "ch_", "\\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_", "#", "END_", "\\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_", "Gi", "nga", "View", "er", "Widget_", "(_", "Widgets_", "._", "Canvas_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "class", " ", "implement", "s", " ", "the", " ", "server", "-", "side", " ", "back", "end", " ", "of", " ", "the", " ", "surf", "ace", " ", "for", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "web", "-", "based", " ", "Gi", "nga", " ", "viewer", ".", " ", " ", "It", " ", "use", "s", " ", "a", " ", "web", " ", "socket", " ", "to", " ", "connect", " ", "to", " ", "an", " ", "HTM", "L", "5", "\\", "10", ";", " ", " ", " ", " ", "canv", "as", " ", "with", " ", "javascript", " ", "callback", "s", " ", "in", " ", "a", " ", "web", " ", "browse", "r", " ", "on", " ", "the", " ", "client", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "viewer", " ", "is", " ", "created", " ", "separately", " ", "on", " ", "the", " ", "back", "end", " ", "and", " ", "connects", " ", "to", " ", "this", "\\", "10", ";", " ", " ", " ", " ", "surf", "ace", " ", "via", " ", "the", " ", "set\\u", "viewer", "()", " ", "method", ".", "\\", "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_", "Gi", "nga", "View", "er", "Widget_", "(_", "Widgets_", "._", "Canvas_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "viewer_", "=_", "None_", ",_", "width_", "=_", "600_", ",_", "height_", "=_", "600_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Gi", "nga", "View", "er", "Widget_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "width_", "=_", "600_", ",_", "height_", "=_", "600_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "viewer_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "viewer_", "=_", "Can", "vas", "View_", "(_", "logger_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "logger_", "=_", "viewer_", "._", "logger_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "configured_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "refre", "sh", "\\u", "delay_", "=_", "0.010", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "set\\u", "viewer_", "(_", "viewer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gi", "nga", "View", "er", "Widget_", "(_", "Widgets_", "._", "Canvas_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "viewer_", "(_", "self_", ",_", "viewer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "debug_", "(_", "\"", "set\\u", "viewer", " ", "call", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "viewer_", "=_", "viewer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "logg", "er", " ", "=", " ", "viewer", ".", "get", "\\u", "logg", "er", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "dispatch", "\\u", "event", "\\u", "table_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "activat", "e", "\"_", ":_", "self_", "._", "ignore", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "setb", "ound", "s", "\"_", ":_", "self_", "._", "map", "\\u", "event", "\\u", "cb_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "mouse", "down", "\"_", ":_", "viewer_", "._", "button", "\\u", "press", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "mouse", "up", "\"_", ":_", "viewer_", "._", "button", "\\u", "release", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "mouse", "move", "\"_", ":_", "viewer_", "._", "moti", "on", "\\u", "notif", "y", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "mouse", "out", "\"_", ":_", "viewer_", "._", "lea", "ve", "\\u", "notif", "y", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "mouse", "over", "\"_", ":_", "viewer_", "._", "enter", "\\u", "notif", "y", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "mouse", "wheel", "\"_", ":_", "viewer_", "._", "scroll", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "wheel", "\"_", ":_", "viewer_", "._", "scroll", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "click", "\"_", ":_", "self_", "._", "ignore", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "dbl", "click", "\"_", ":_", "self_", "._", "ignore", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "keyd", "own", "\"_", ":_", "viewer_", "._", "key", "\\u", "down", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "key", "up", "\"_", ":_", "viewer_", "._", "key", "\\u", "up", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "keypress", "\"_", ":_", "viewer_", "._", "key", "\\u", "press", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "resiz", "e", "\"_", ":_", "viewer_", "._", "resiz", "e\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "foc", "us", "\"_", ":_", "lambda_", "event_", ":_", "viewer_", "._", "foc", "us", "\\u", "event_", "(_", "event_", ",_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "foc", "uso", "ut", "\"_", ":_", "lambda_", "event_", ":_", "viewer_", "._", "foc", "us", "\\u", "event_", "(_", "event_", ",_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "blur", "\"_", ":_", "lambda_", "event_", ":_", "viewer_", "._", "foc", "us", "\\u", "event_", "(_", "event_", ",_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "drop", "\"_", ":_", "viewer_", "._", "drop", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "paste", "\"_", ":_", "self_", "._", "ignore", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ham", "mer", ".", "js", " ", "events_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pin", "ch", "\"_", ":_", "viewer_", "._", "pin", "ch", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pin", "chs", "tart", "\"_", ":_", "viewer_", "._", "pin", "ch", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pin", "chen", "d", "\"_", ":_", "viewer_", "._", "pin", "ch", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "rota", "te", "\"_", ":_", "viewer_", "._", "rota", "te", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "rota", "testa", "rt", "\"_", ":_", "viewer_", "._", "rota", "te", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "rota", "teen", "d", "\"_", ":_", "viewer_", "._", "rota", "te", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tap", "\"_", ":_", "viewer_", "._", "tap", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pan", "\"_", ":_", "viewer_", "._", "pan", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pan", "start", "\"_", ":_", "viewer_", "._", "pan", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pane", "nd", "\"_", ":_", "viewer_", "._", "pan", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "swi", "pe", "\"_", ":_", "viewer_", "._", "swi", "pe", "\\u", "event_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "\\u", "timer_", "(_", "'", "refre", "sh", "'_", ",_", "self_", "._", "refre", "sh", "\\u", "cb_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "timer_", "(_", "'", "redraw", "'_", ",_", "self_", "._", "viewer_", "._", "delayed", "\\u", "redraw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "timer_", "(_", "'", "msg", "'_", ",_", "self_", "._", "viewer_", "._", "clear", "\\u", "ons", "creen", "\\u", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "viewer_", "._", "set\\u", "widget_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gi", "nga", "View", "er", "Widget_", "(_", "Widgets_", "._", "Canvas_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "viewer_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "viewer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gi", "nga", "View", "er", "Widget_", "(_", "Widgets_", "._", "Canvas_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ignore", "\\u", "event_", "(_", "self_", ",_", "event_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gi", "nga", "View", "er", "Widget_", "(_", "Widgets_", "._", "Canvas_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "map", "\\u", "event", "\\u", "cb_", "(_", "self_", ",_", "event_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "viewer_", "._", "map", "\\u", "event_", "(_", "event_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reset", "\\u", "timer_", "(_", "'", "refre", "sh", "'_", ",_", "self_", "._", "refre", "sh", "\\u", "delay_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gi", "nga", "View", "er", "Widget_", "(_", "Widgets_", "._", "Canvas_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "refre", "sh", "\\u", "cb_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "self_", "._", "get", "\\u", "app_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "do", "\\u", "operation_", "(_", "'", "refre", "sh", "\\u", "canv", "as", "'_", ",_", "id_", "=_", "self_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reset", "\\u", "timer_", "(_", "'", "refre", "sh", "'_", ",_", "self_", "._", "refre", "sh", "\\u", "delay_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gi", "nga", "View", "er", "Widget_", "(_", "Widgets_", "._", "Canvas_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "update_", "(_", "self_", ",_", "buf_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "clear", "\\u", "rect_", "(_", "0_", ",_", "0_", ",_", "self_", "._", "width_", ",_", "self_", "._", "height_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "logger_", "._", "debug_", "(_", "\"", "drawing", " ", "image", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "draw", "\\u", "image_", "(_", "buf_", ",_", "0_", ",_", "0_", ",_", "self_", "._", "width_", ",_", "self_", "._", "height_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "logger_", "._", "debug_", "(_", "\"", "dre", "w", " ", "image", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gi", "nga", "View", "er", "Widget_", "(_", "Widgets_", "._", "Canvas_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "cb", "\\u", "redirect_", "(_", "self_", ",_", "event_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "method_", "=_", "self_", "._", "\\u", "dispatch", "\\u", "event", "\\u", "table_", "[_", "event_", "._", "type_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "method_", "(_", "event_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "logger_", "._", "error_", "(_", "\"", "error", " ", "redirec", "ting", " ", "'%", "s", "'", " ", "event", ":", " ", "%", "s", "\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "event_", "._", "type_", ",_", "str_", "(_", "e_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "dump", " ", "traceback", " ", "to", " ", "debug", " ", "log_", "\\u\\u\\uNL\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 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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, 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 ]
Conflicting attributes in base classes
lmorchard/badg.us/vendor-local/lib/python/taggit/models.py
[ { "content": "class ItemBase(models.Model):\n\n class Meta:\n abstract = True\n\n\n\n", "metadata": "root.ItemBase", "header": "['module', '___EOS___']", "index": 60 }, { "content": " def __unicode__(self):\n return ugettext(\"%(object)s tagged with %(tag)s\") % {\n \"object\": self.content_object,\n \"tag\": self.tag\n }", "metadata": "root.ItemBase.__unicode__", "header": "['class', 'ItemBase', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 61 }, { "content": " @classmethod\n def tag_model(cls):\n return cls._meta.get_field_by_name(\"tag\")[0].rel.to", "metadata": "root.ItemBase.tag_model", "header": "['class', 'ItemBase', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 70 }, { "content": " @classmethod\n def tag_relname(cls):\n return cls._meta.get_field_by_name('tag')[0].rel.related_name", "metadata": "root.ItemBase.tag_relname", "header": "['class', 'ItemBase', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 74 }, { "content": " @classmethod\n def lookup_kwargs(cls, instance):\n return {\n 'content_object': instance\n }", "metadata": "root.ItemBase.lookup_kwargs", "header": "['class', 'ItemBase', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 78 }, { "content": " @classmethod\n def bulk_lookup_kwargs(cls, instances):\n return {\n \"content_object__in\": instances,\n }", "metadata": "root.ItemBase.bulk_lookup_kwargs", "header": "['class', 'ItemBase', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 84 }, { "content": "class TaggedItemBase(ItemBase):\n if django.VERSION < (1, 2):\n tag = models.ForeignKey(Tag, related_name=\"%(class)s_items\")\n else:\n tag = models.ForeignKey(Tag, related_name=\"%(app_label)s_%(class)s_items\")\n\n class Meta:\n abstract = True\n", "metadata": "root.TaggedItemBase", "header": "['module', '___EOS___']", "index": 91 }, { "content": " @classmethod\n def tags_for(cls, model, instance=None):\n if instance is not None:\n return cls.tag_model().objects.filter(**{\n '%s__content_object' % cls.tag_relname(): instance\n })\n return cls.tag_model().objects.filter(**{\n '%s__content_object__isnull' % cls.tag_relname(): False\n }).distinct()", "metadata": "root.TaggedItemBase.tags_for", "header": "['class', 'TaggedItemBase', '(', 'ItemBase', ')', ':', '___EOS___']", "index": 100 }, { "content": "class GenericTaggedItemBase(ItemBase):\n object_id = models.IntegerField(verbose_name=_('Object id'), db_index=True)\n if django.VERSION < (1, 2):\n content_type = models.ForeignKey(\n ContentType,\n verbose_name=_('Content type'),\n related_name=\"%(class)s_tagged_items\"\n )\n else:\n content_type = models.ForeignKey(\n ContentType,\n verbose_name=_('Content type'),\n related_name=\"%(app_label)s_%(class)s_tagged_items\"\n )\n content_object = GenericForeignKey()\n\n class Meta:\n abstract=True\n\n\n", "metadata": "root.GenericTaggedItemBase", "header": "['module', '___EOS___']", "index": 111 }, { "content": " @classmethod\n def lookup_kwargs(cls, instance):\n return {\n 'object_id': instance.pk,\n 'content_type': ContentType.objects.get_for_model(instance)\n }", "metadata": "root.GenericTaggedItemBase.lookup_kwargs", "header": "['class', 'GenericTaggedItemBase', '(', 'ItemBase', ')', ':', '___EOS___']", "index": 130 }, { "content": " @classmethod\n def bulk_lookup_kwargs(cls, instances):\n # TODO: instances[0], can we assume there are instances.\n return {\n \"object_id__in\": [instance.pk for instance in instances],\n \"content_type\": ContentType.objects.get_for_model(instances[0]),\n }", "metadata": "root.GenericTaggedItemBase.bulk_lookup_kwargs", "header": "['class', 'GenericTaggedItemBase', '(', 'ItemBase', ')', ':', '___EOS___']", "index": 137 }, { "content": " @classmethod\n def tags_for(cls, model, instance=None):\n ct = ContentType.objects.get_for_model(model)\n kwargs = {\n \"%s__content_type\" % cls.tag_relname(): ct\n }\n if instance is not None:\n kwargs[\"%s__object_id\" % cls.tag_relname()] = instance.pk\n return cls.tag_model().objects.filter(**kwargs).distinct()", "metadata": "root.GenericTaggedItemBase.tags_for", "header": "['class', 'GenericTaggedItemBase', '(', 'ItemBase', ')', ':', '___EOS___']", "index": 145 }, { "content": "class TaggedItem(GenericTaggedItemBase, TaggedItemBase):\n class Meta:\n verbose_name = _(\"Tagged Item\")\n verbose_name_plural = _(\"Tagged Items\")", "metadata": "root.TaggedItem", "header": "['module', '___EOS___']", "index": 156 } ]
[ { "span": "class TaggedItem(GenericTaggedItemBase, TaggedItemBase):", "start_line": 156, "start_column": 0, "end_line": 156, "end_column": 56 } ]
[ { "span": "classmethod", "start_line": 100, "start_column": 5, "end_line": 100, "end_column": 16 }, { "span": "classmethod", "start_line": 145, "start_column": 5, "end_line": 145, "end_column": 16 } ]
1
false
[ "[CLS]_", "Confl", "ict", "ing_", "attributes_", "in_", "base_", "classes_", "[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_", "Item", "Base_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "abstract_", "=_", "True_", "\\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_", "Item", "Base_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "unicode\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ugettext_", "(_", "\"%", "(", "object", ")", "s", " ", "tagg", "ed", " ", "with", " ", "%", "(", "tag", ")", "s", "\"_", ")_", "%_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "object", "\"_", ":_", "self_", "._", "content", "\\u", "object_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tag", "\"_", ":_", "self_", "._", "tag_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Item", "Base_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "tag", "\\u", "model_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cls_", "._", "\\u", "meta_", "._", "get", "\\u", "field", "\\u", "by", "\\u", "name_", "(_", "\"", "tag", "\"_", ")_", "[_", "0_", "]_", "._", "rel_", "._", "to_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Item", "Base_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "tag", "\\u", "rel", "name_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cls_", "._", "\\u", "meta_", "._", "get", "\\u", "field", "\\u", "by", "\\u", "name_", "(_", "'", "tag", "'_", ")_", "[_", "0_", "]_", "._", "rel_", "._", "relate", "d\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Item", "Base_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "look", "up", "\\u", "kwargs_", "(_", "cls_", ",_", "instance_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "object", "'_", ":_", "instance_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Item", "Base_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "bul", "k", "\\u", "look", "up", "\\u", "kwargs_", "(_", "cls_", ",_", "instances_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "content", "\\u", "object\\u", "\\u", "in", "\"_", ":_", "instances_", ",_", "\\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_", "Tagg", "ed", "Item", "Base_", "(_", "Item", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "django_", "._", "VERSION_", "<_", "(_", "1_", ",_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tag_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "Tag_", ",_", "relate", "d\\u", "name_", "=_", "\"%", "(", "class", ")", "s", "\\u", "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 ", " _", "tag_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "Tag_", ",_", "relate", "d\\u", "name_", "=_", "\"%", "(", "app", "\\u", "label", ")", "s", "\\u", "%", "(", "class", ")", "s", "\\u", "items", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "abstract_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Tagg", "ed", "Item", "Base_", "(_", "Item", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "tags", "\\u", "for_", "(_", "cls_", ",_", "model_", ",_", "instance_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "instance_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cls_", "._", "tag", "\\u", "model_", "(_", ")_", "._", "objects_", "._", "filter_", "(_", "**_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'%", "s", "\\u\\u", "content", "\\u", "object", "'_", "%_", "cls_", "._", "tag", "\\u", "rel", "name_", "(_", ")_", ":_", "instance_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cls_", "._", "tag", "\\u", "model_", "(_", ")_", "._", "objects_", "._", "filter_", "(_", "**_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'%", "s", "\\u\\u", "content", "\\u", "object\\u", "\\u", "isn", "ull", "'_", "%_", "cls_", "._", "tag", "\\u", "rel", "name_", "(_", ")_", ":_", "False_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "._", "distinct_", "(_", ")_", "\\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_", "Gene", "ric", "Tagg", "ed", "Item", "Base_", "(_", "Item", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "object\\u", "id_", "=_", "models_", "._", "Integer", "Field_", "(_", "verbo", "se", "\\u", "name_", "=_", "\\u_", "(_", "'", "Object", " ", "id", "'_", ")_", ",_", "db", "\\u", "index_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "django_", "._", "VERSION_", "<_", "(_", "1_", ",_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content", "\\u", "type_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Conten", "t", "Type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "verbo", "se", "\\u", "name_", "=_", "\\u_", "(_", "'", "Conten", "t", " ", "type", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "relate", "d\\u", "name_", "=_", "\"%", "(", "class", ")", "s", "\\u", "tagg", "ed", "\\u", "items", "\"_", "\\u\\u\\uNL\\u\\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 ", " _", "content", "\\u", "type_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Conten", "t", "Type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "verbo", "se", "\\u", "name_", "=_", "\\u_", "(_", "'", "Conten", "t", " ", "type", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "relate", "d\\u", "name_", "=_", "\"%", "(", "app", "\\u", "label", ")", "s", "\\u", "%", "(", "class", ")", "s", "\\u", "tagg", "ed", "\\u", "items", "\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "content", "\\u", "object_", "=_", "Gene", "ric", "Fore", "ign", "Key_", "(_", ")_", "\\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 ", " _", "abstract_", "=_", "True_", "\\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_", "Gene", "ric", "Tagg", "ed", "Item", "Base_", "(_", "Item", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "look", "up", "\\u", "kwargs_", "(_", "cls_", ",_", "instance_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "id", "'_", ":_", "instance_", "._", "pk_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "Conten", "t", "Type_", "._", "objects_", "._", "get", "\\u", "for", "\\u", "model_", "(_", "instance_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Tagg", "ed", "Item", "Base_", "(_", "Item", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "bul", "k", "\\u", "look", "up", "\\u", "kwargs_", "(_", "cls_", ",_", "instances_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "instance", "s", "[", "0", "],", " ", "can", " ", "we", " ", "assume", " ", "there", " ", "are", " ", "instance", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "object\\u", "id", "\\u\\u", "in", "\"_", ":_", "[_", "instance_", "._", "pk_", "for_", "instance_", "in_", "instances_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "content", "\\u", "type", "\"_", ":_", "Conten", "t", "Type_", "._", "objects_", "._", "get", "\\u", "for", "\\u", "model_", "(_", "instances_", "[_", "0_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Tagg", "ed", "Item", "Base_", "(_", "Item", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "tags", "\\u", "for_", "(_", "cls_", ",_", "model_", ",_", "instance_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ct_", "=_", "Conten", "t", "Type_", "._", "objects_", "._", "get", "\\u", "for", "\\u", "model_", "(_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "s", "\\u\\u", "content", "\\u", "type", "\"_", "%_", "cls_", "._", "tag", "\\u", "rel", "name_", "(_", ")_", ":_", "ct_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "instance_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "\"%", "s", "\\u\\u", "object\\u", "id", "\"_", "%_", "cls_", "._", "tag", "\\u", "rel", "name_", "(_", ")_", "]_", "=_", "instance_", "._", "pk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cls_", "._", "tag", "\\u", "model_", "(_", ")_", "._", "objects_", "._", "filter_", "(_", "**_", "kwargs_", ")_", "._", "distinct_", "(_", ")_", "\\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_", "Tagg", "ed", "Item_", "(_", "Gene", "ric", "Tagg", "ed", "Item", "Base_", ",_", "Tagg", "ed", "Item", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "verbo", "se", "\\u", "name_", "=_", "\\u_", "(_", "\"", "Tagg", "ed", " ", "Item", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verbo", "se", "\\u", "name", "\\u", "plural_", "=_", "\\u_", "(_", "\"", "Tagg", "ed", " ", "Item", "s", "\"_", ")_" ]
[ 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
mwean/sublime_jump_along_indent/tests/test_jump_prev_indent.py
[ { "content": " def test_maintain_column(self):\n lines = [\n 'Lorem ipsum dolor sit amet',\n 'Lorem ipsum dolor sit amet',\n 'Lorem ipsum dolor sit amet'\n ]\n\n starting_selection = [66, 66]\n ending_selection = [12, 12]", "metadata": "root.TestJumpPrevIndent.test_maintain_column", "header": "['class', 'TestJumpPrevIndent', '(', 'TestHelper', ')', ':', '___EOS___']", "index": 44 } ]
[ { "span": "lines ", "start_line": 45, "start_column": 4, "end_line": 45, "end_column": 9 }, { "span": "starting_selection ", "start_line": 51, "start_column": 4, "end_line": 51, "end_column": 22 }, { "span": "ending_selection ", "start_line": 52, "start_column": 4, "end_line": 52, "end_column": 20 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Jum", "p", "Prev", "Indent_", "(_", "Test", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "maintain", "\\u", "column_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lines_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Lore", "m", " ", "ips", "um", " ", "dolor", " ", "sit", " ", "amet", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Lore", "m", " ", "ips", "um", " ", "dolor", " ", "sit", " ", "amet", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Lore", "m", " ", "ips", "um", " ", "dolor", " ", "sit", " ", "amet", "'_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "startin", "g", "\\u", "selection_", "=_", "[_", "66_", ",_", "66_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ending", "\\u", "selection_", "=_", "[_", "12_", ",_", "12_", "]_", "\\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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
wecatch/app-turbo/turbo/test/util.py
[ { "content": "#-*- coding:utf-8 -*-\nfrom __future__ import absolute_import, division, print_function, with_statement\n\nimport sys\n\n\nif sys.version_info < (2, 7):\n import unittest2 as unittest\nelse:\n import unittest", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import unittest", "start_line": 9, "start_column": 4, "end_line": 9, "end_column": 19 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#-", "*-", " ", "codi", "ng", ":", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", ",_", "division_", ",_", "print", "\\u", "function_", ",_", "with", "\\u", "statement_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sys_", "._", "version", "\\u", "info_", "<_", "(_", "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_" ]
[ 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, 0, 1 ]
Unused local variable
amorphic/braubuddy/braubuddy/tests/output/test_graphiteapi.py
[ { "content": " @patch('braubuddy.output.graphiteapi.graphitesend.init')\n def test_graphitesend_initialised(self, mk_graphitesend_init):\n \"\"\"Graphitesend is initialised on GraphiteAPIOutput init.\"\"\"\n\n output = graphiteapi.GraphiteAPIOutput(\n units='celsius', host='testhost.example.com', port=2003,\n prefix='testprefix')\n mk_graphitesend_init.assert_called_with(\n graphite_server='testhost.example.com', graphite_port=2003,\n prefix='testprefix', system_name='')", "metadata": "root.GraphiteAPIOutput.test_graphitesend_initialised", "header": "['class', 'GraphiteAPIOutput', '(', 'BraubuddyTestCase', ')', ':', '___EOS___']", "index": 11 } ]
[ { "span": "output ", "start_line": 15, "start_column": 8, "end_line": 15, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Graph", "ite", "API", "Output_", "(_", "Bra", "ubu", "dd", "y", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "patch_", "(_", "'", "bra", "ubu", "dd", "y", ".", "output", ".", "graphite", "api", ".", "graphite", "send", ".", "init", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "graphite", "send", "\\u", "initialise", "d_", "(_", "self_", ",_", "mk", "\\u", "graphite", "send", "\\u", "init_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Graph", "ites", "end", " ", "is", " ", "initialise", "d", " ", "on", " ", "Graph", "ite", "API", "Output", " ", "init", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "output_", "=_", "graphite", "api_", "._", "Graph", "ite", "API", "Output_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "units_", "=_", "'", "cel", "sius", "'_", ",_", "host_", "=_", "'", "testh", "ost", ".", "example", ".", "com", "'_", ",_", "port_", "=_", "2003", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prefix_", "=_", "'", "testp", "refix", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mk", "\\u", "graphite", "send", "\\u", "init_", "._", "assert", "\\u", "call", "ed", "\\u", "with_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "graphite", "\\u", "server_", "=_", "'", "testh", "ost", ".", "example", ".", "com", "'_", ",_", "graphite", "\\u", "port_", "=_", "2003", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prefix_", "=_", "'", "testp", "refix", "'_", ",_", "system", "\\u", "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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
Miserlou/django-easy-split/easy_split/tests/test_daily_report.py
[ { "content": " def testDailyEngagementReport(self):\n users_test = []\n users_control = []\n \n num_control1 = 0\n num_test1 = 0\n num_control2 = 0\n num_test2 = 0\n \n #create users\n for i in range(5):\n users_control.append(create_user_in_group(self.experiment, i,\n Participant.CONTROL_GROUP,\n date.today() - timedelta(days=i)))\n users_test.append(create_user_in_group(self.experiment, i,\n Participant.TEST_GROUP,\n date.today() - timedelta(days=i)))\n \n # users_<test|control>[0] were enrolled today, [1] 1 day ago, etc.\n \n report_date = date.today() - timedelta(days=1)\n expected_engagement_score_calls = {\n (users_test[1], date.today() - timedelta(days=1), report_date): 3.2,\n (users_test[2], date.today() - timedelta(days=2), report_date): 2.5,\n (users_test[3], date.today() - timedelta(days=3), report_date): 4.1,\n (users_test[4], date.today() - timedelta(days=4), report_date): 0,\n (users_control[1], date.today() - timedelta(days=1), report_date): 0,\n (users_control[2], date.today() - timedelta(days=2), report_date): 0,\n (users_control[3], date.today() - timedelta(days=3), report_date): 0,\n (users_control[4], date.today() - timedelta(days=4), report_date): 0}\n \n test_case = self\n \n class EngagementScoreCalculatorStub(object):\n def calculate_user_engagement_score(self, user,\n start_date, end_date):\n test_case.assertNotEquals(user, None)\n test_case.assertTrue(expected_engagement_score_calls.\n has_key((user, start_date, end_date)))\n return expected_engagement_score_calls[(user,\n start_date, end_date)]\n \n (EngagementReportGenerator(EngagementScoreCalculatorStub()).\n generate_daily_report_for_experiment(self.experiment, report_date))\n\n \n experiment_report = DailyEngagementReport.objects.get(\n experiment=self.experiment, date=report_date)\n self.assertAlmostEqual((3.2 + 2.5 + 4.1 + 0)/4.0,\n experiment_report.test_score)\n self.assertAlmostEqual(0.0, experiment_report.control_score)\n self.assertEquals(4, experiment_report.test_group_size)\n self.assertEquals(4, experiment_report.control_group_size)\n self.assertAlmostEqual(96.819293337188498, experiment_report.confidence)", "metadata": "root.TestDailyReports.testDailyEngagementReport", "header": "['class', 'TestDailyReports', '(', 'TestCase', ')', ':', '___EOS___']", "index": 51 }, { "content": " def testExperimentGroupParticipantFinder(self):\n days = [datetime.combine(date.today() + timedelta(days=i), time(hour=12))\n for i in range(-7, 0)]\n \n experiment = Experiment(name=\"experiment1\")\n experiment.save()\n experiment.state = Experiment.ENABLED_STATE\n experiment.save()\n experiment.start_date = days[2].date()\n experiment.save()\n \n other_experiment = Experiment(name=\"experiment2\")\n other_experiment.save()\n other_experiment.state = Experiment.DISABLED_STATE\n other_experiment.save()\n other_experiment.start_date = days[0].date()\n other_experiment.end_date = days[4].date()\n other_experiment.save()\n \n anonymous_visitors = [AnonymousVisitor.objects.create() for i in range(10)]\n \n experiment_participant_groups = [\n [\n self.create_participant(anonymous_visitor=anonymous_visitors[0],\n experiment=experiment,\n enrollment_date=days[2],\n group=Participant.TEST_GROUP),\n self.create_participant(anonymous_visitor=anonymous_visitors[1],\n experiment=experiment,\n enrollment_date=days[2],\n group=Participant.CONTROL_GROUP),\n self.create_participant(anonymous_visitor=anonymous_visitors[3],\n experiment=experiment,\n enrollment_date=days[3],\n group=Participant.TEST_GROUP),\n self.create_participant(anonymous_visitor=anonymous_visitors[4],\n experiment=experiment,\n enrollment_date=days[4],\n group=Participant.CONTROL_GROUP),\n self.create_participant(anonymous_visitor=anonymous_visitors[6],\n experiment=experiment,\n enrollment_date=days[6],\n group=Participant.TEST_GROUP)\n ],\n [\n self.create_participant(anonymous_visitor=anonymous_visitors[0],\n experiment=other_experiment,\n enrollment_date=days[0],\n group=Participant.CONTROL_GROUP),\n self.create_participant(anonymous_visitor=anonymous_visitors[2],\n experiment=other_experiment,\n enrollment_date=days[0],\n group=Participant.TEST_GROUP),\n self.create_participant(anonymous_visitor=anonymous_visitors[5],\n experiment=other_experiment,\n enrollment_date=days[4],\n group=Participant.TEST_GROUP)\n ]\n ]\n \n ex1day2 = find_experiment_group_participants(Participant.TEST_GROUP, experiment, days[2])\n ex1day2visitors = [p.anonymous_visitor for p in ex1day2]\n self.assertTrue(anonymous_visitors[0] in ex1day2visitors)\n self.assertEquals(1, len(ex1day2visitors))\n \n ex1day4test = find_experiment_group_participants(Participant.TEST_GROUP, experiment, days[4])\n ex1day4testvisitors = [p.anonymous_visitor for p in ex1day4test]\n self.assertTrue(anonymous_visitors[0] in ex1day4testvisitors)\n self.assertTrue(anonymous_visitors[3] in ex1day4testvisitors)\n self.assertEquals(2, len(ex1day4testvisitors))\n \n ex1day4control = find_experiment_group_participants(Participant.CONTROL_GROUP, experiment, days[4])\n ex1day4controlvisitors = [p.anonymous_visitor for p in ex1day4control]\n self.assertTrue(anonymous_visitors[1] in ex1day4controlvisitors)\n self.assertTrue(anonymous_visitors[4] in ex1day4controlvisitors)\n self.assertEquals(2, len(ex1day4controlvisitors))\n \n ex2day5test = find_experiment_group_participants(Participant.TEST_GROUP, other_experiment, days[5])\n ex2day5testvisitors = [p.anonymous_visitor for p in ex2day5test]\n self.assertTrue(anonymous_visitors[2] in ex2day5testvisitors)\n self.assertTrue(anonymous_visitors[5] in ex2day5testvisitors)\n self.assertEquals(2, len(ex2day5testvisitors))", "metadata": "root.TestDailyReports.testExperimentGroupParticipantFinder", "header": "['class', 'TestDailyReports', '(', 'TestCase', ')', ':', '___EOS___']", "index": 252 }, { "content": " def testGetConversionData(self):\n days = [datetime.combine(date.today() + timedelta(days=i), time(hour=12))\n for i in range(-7, 0)]\n \n yesterday = date.today() - timedelta(days=1)\n experiment = Experiment(name=\"experiment1\")\n experiment.save()\n experiment.state = Experiment.ENABLED_STATE\n experiment.save()\n experiment.start_date = yesterday\n experiment.save()\n \n goal_types = [GoalType.objects.create(name=\"%s\" % i) for i in range(4)]\n \n report = DailyConversionReport.objects.create(experiment=experiment,\n date=yesterday,\n overall_test_conversion=17,\n overall_control_conversion=12,\n test_group_size=139,\n control_group_size=142,\n confidence=87.3)\n \n DailyConversionReportGoalData.objects.create(report=report,\n goal_type=goal_types[0],\n test_conversion=11,\n control_conversion=0,\n confidence=65.3)\n DailyConversionReportGoalData.objects.create(report=report,\n goal_type=goal_types[1],\n test_conversion=0,\n control_conversion=21,\n confidence=None)\n DailyConversionReportGoalData.objects.create(report=report,\n goal_type=goal_types[2],\n test_conversion=23,\n control_conversion=21,\n confidence=100)\n \n data = get_conversion_data(experiment, yesterday)\n \n self.assertEquals(data['date'], yesterday)\n self.assertTrue(\"totals\" in data)\n self.assertTrue(\"goal_types\" in data)\n self.assertEquals(4, len(data[\"goal_types\"].keys()))\n \n for goal_type in goal_types[0:3]:\n self.assertTrue(goal_type.name in data[\"goal_types\"])\n \n goal_type_data = data[\"goal_types\"][goal_type.name]\n self.assertTrue(\"test_count\" in goal_type_data)\n self.assertTrue(\"control_count\" in goal_type_data)\n self.assertTrue(\"test_rate\" in goal_type_data)\n self.assertTrue(\"control_rate\" in goal_type_data)\n self.assertTrue(\"improvement\" in goal_type_data)\n self.assertTrue(\"confidence\" in goal_type_data)\n \n self.assertEquals(None, data[\"goal_types\"][goal_types[3].name])\n \n self.assertEquals(139, data[\"test_group_size\"])\n self.assertEquals(142, data[\"control_group_size\"])\n \n totals = data[\"totals\"]\n \n expected_test_rate = 17. / 139. * 100.\n expected_control_rate = 12. / 142. * 100.\n expected_improvement = (expected_test_rate - expected_control_rate) / expected_control_rate * 100.\n \n self.assertAlmostEquals(expected_test_rate, totals[\"test_rate\"])\n self.assertAlmostEquals(expected_control_rate, totals[\"control_rate\"])\n self.assertAlmostEquals(expected_improvement, totals[\"improvement\"])\n self.assertAlmostEquals(87.3, totals[\"confidence\"])\n self.assertEquals(17, totals[\"test_count\"])\n self.assertEquals(12, totals[\"control_count\"])\n \n self.assertEquals(0, data[\"goal_types\"][goal_types[0].name][\"control_rate\"])\n self.assertAlmostEquals(11./139*100., data[\"goal_types\"][goal_types[0].name][\"test_rate\"])\n self.assertEquals(None, data[\"goal_types\"][goal_types[0].name][\"improvement\"])\n self.assertAlmostEquals(65.3, data[\"goal_types\"][goal_types[0].name][\"confidence\"])\n self.assertEquals(11, data[\"goal_types\"][goal_types[0].name][\"test_count\"])\n self.assertEquals(0, data[\"goal_types\"][goal_types[0].name][\"control_count\"])\n \n self.assertAlmostEquals(21./142*100., data[\"goal_types\"][goal_types[1].name][\"control_rate\"])\n self.assertEquals(None, data[\"goal_types\"][goal_types[1].name][\"confidence\"])\n self.assertEquals(None, data[\"goal_types\"][goal_types[1].name][\"improvement\"])\n \n self.assertAlmostEquals((23./139-21./142)/(21./142)*100.,\n data[\"goal_types\"][goal_types[2].name][\"improvement\"])", "metadata": "root.TestDailyReports.testGetConversionData", "header": "['class', 'TestDailyReports', '(', 'TestCase', ')', ':', '___EOS___']", "index": 335 } ]
[ { "span": "num_control1 ", "start_line": 55, "start_column": 8, "end_line": 55, "end_column": 20 }, { "span": "num_test1 ", "start_line": 56, "start_column": 8, "end_line": 56, "end_column": 17 }, { "span": "num_control2 ", "start_line": 57, "start_column": 8, "end_line": 57, "end_column": 20 }, { "span": "num_test2 ", "start_line": 58, "start_column": 8, "end_line": 58, "end_column": 17 }, { "span": "experiment_participant_groups ", "start_line": 273, "start_column": 8, "end_line": 273, "end_column": 37 }, { "span": "days ", "start_line": 336, "start_column": 8, "end_line": 336, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Da", "il", "y", "Report", "s_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Da", "il", "y", "Eng", "agem", "ent", "Report_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "users", "\\u", "test_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "users", "\\u", "control_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "control", "1_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "test1_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "control", "2_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "test2_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "create", " ", "users_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "users", "\\u", "control_", "._", "append_", "(_", "create", "\\u", "user", "\\u", "in", "\\u", "group_", "(_", "self_", "._", "experiment_", ",_", "i_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Participant", "_", "._", "CONTR", "OL", "\\u", "GROUP_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "date_", "._", "today_", "(_", ")_", "-_", "timedelta_", "(_", "days_", "=_", "i_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "users", "\\u", "test_", "._", "append_", "(_", "create", "\\u", "user", "\\u", "in", "\\u", "group_", "(_", "self_", "._", "experiment_", ",_", "i_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Participant", "_", "._", "TEST", "\\u", "GROUP_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "date_", "._", "today_", "(_", ")_", "-_", "timedelta_", "(_", "days_", "=_", "i_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "users", "\\u", "<", "test", "|", "control", ">[", "0", "]", " ", "wer", "e", " ", "enroll", "ed", " ", "toda", "y", ",", " ", "[", "1", "]", " ", "1", " ", "day", " ", "ago", ",", " ", "etc", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "report", "\\u", "date_", "=_", "date_", "._", "today_", "(_", ")_", "-_", "timedelta_", "(_", "days_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "engage", "ment", "\\u", "score", "\\u", "calls_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "users", "\\u", "test_", "[_", "1_", "]_", ",_", "date_", "._", "today_", "(_", ")_", "-_", "timedelta_", "(_", "days_", "=_", "1_", ")_", ",_", "report", "\\u", "date_", ")_", ":_", "3.2", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "users", "\\u", "test_", "[_", "2_", "]_", ",_", "date_", "._", "today_", "(_", ")_", "-_", "timedelta_", "(_", "days_", "=_", "2_", ")_", ",_", "report", "\\u", "date_", ")_", ":_", "2.5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "users", "\\u", "test_", "[_", "3_", "]_", ",_", "date_", "._", "today_", "(_", ")_", "-_", "timedelta_", "(_", "days_", "=_", "3_", ")_", ",_", "report", "\\u", "date_", ")_", ":_", "4.1", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "users", "\\u", "test_", "[_", "4_", "]_", ",_", "date_", "._", "today_", "(_", ")_", "-_", "timedelta_", "(_", "days_", "=_", "4_", ")_", ",_", "report", "\\u", "date_", ")_", ":_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "users", "\\u", "control_", "[_", "1_", "]_", ",_", "date_", "._", "today_", "(_", ")_", "-_", "timedelta_", "(_", "days_", "=_", "1_", ")_", ",_", "report", "\\u", "date_", ")_", ":_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "users", "\\u", "control_", "[_", "2_", "]_", ",_", "date_", "._", "today_", "(_", ")_", "-_", "timedelta_", "(_", "days_", "=_", "2_", ")_", ",_", "report", "\\u", "date_", ")_", ":_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "users", "\\u", "control_", "[_", "3_", "]_", ",_", "date_", "._", "today_", "(_", ")_", "-_", "timedelta_", "(_", "days_", "=_", "3_", ")_", ",_", "report", "\\u", "date_", ")_", ":_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "users", "\\u", "control_", "[_", "4_", "]_", ",_", "date_", "._", "today_", "(_", ")_", "-_", "timedelta_", "(_", "days_", "=_", "4_", ")_", ",_", "report", "\\u", "date_", ")_", ":_", "0_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "case_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Eng", "agem", "ent", "Score", "Calculat", "or", "Stub_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "calcul", "ate", "\\u", "user", "\\u", "engage", "ment", "\\u", "score_", "(_", "self_", ",_", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "date_", ",_", "end", "\\u", "date_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "case_", "._", "assert", "Not", "Equals_", "(_", "user_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "case_", "._", "assert", "True_", "(_", "expected", "\\u", "engage", "ment", "\\u", "score", "\\u", "calls_", "._", "\\u\\u\\uNL\\u\\u\\u_", "has", "\\u", "key_", "(_", "(_", "user_", ",_", "start", "\\u", "date_", ",_", "end", "\\u", "date_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "expected", "\\u", "engage", "ment", "\\u", "score", "\\u", "calls_", "[_", "(_", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "date_", ",_", "end", "\\u", "date_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "(_", "Eng", "agem", "ent", "Report", "Generator_", "(_", "Eng", "agem", "ent", "Score", "Calculat", "or", "Stub_", "(_", ")_", ")_", "._", "\\u\\u\\uNL\\u\\u\\u_", "generat", "e\\u", "daily", "\\u", "report", "\\u", "for", "\\u", "experiment_", "(_", "self_", "._", "experiment_", ",_", "report", "\\u", "date_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "experiment", "\\u", "report_", "=_", "Da", "il", "y", "Eng", "agem", "ent", "Report_", "._", "objects_", "._", "get_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "self_", "._", "experiment_", ",_", "date_", "=_", "report", "\\u", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "(_", "3.2", "_", "+_", "2.5_", "+_", "4.1", "_", "+_", "0_", ")_", "/_", "4.0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experiment", "\\u", "report_", "._", "test\\u", "score_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "0.0_", ",_", "experiment", "\\u", "report_", "._", "control", "\\u", "score_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "4_", ",_", "experiment", "\\u", "report_", "._", "test\\u", "group", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "4_", ",_", "experiment", "\\u", "report_", "._", "control", "\\u", "group", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "96", ".8", "192", "933", "371", "884", "98_", ",_", "experiment", "\\u", "report_", "._", "confidence_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Da", "il", "y", "Report", "s_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Experiment", "Group", "Participant", "Finder_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "days_", "=_", "[_", "datetime_", "._", "combine_", "(_", "date_", "._", "today_", "(_", ")_", "+_", "timedelta_", "(_", "days_", "=_", "i_", ")_", ",_", "time_", "(_", "hour_", "=_", "12_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "-_", "7_", ",_", "0_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "Experiment_", "(_", "name_", "=_", "\"", "experiment", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "state_", "=_", "Experiment_", "._", "ENABLE", "D", "\\u", "STATE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "start", "\\u", "date_", "=_", "days_", "[_", "2_", "]_", "._", "date_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "other", "\\u", "experiment_", "=_", "Experiment_", "(_", "name_", "=_", "\"", "experiment", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "experiment_", "._", "state_", "=_", "Experiment_", "._", "DISABLED", "\\u", "STATE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "experiment_", "._", "start", "\\u", "date_", "=_", "days_", "[_", "0_", "]_", "._", "date_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "experiment_", "._", "end", "\\u", "date_", "=_", "days_", "[_", "4_", "]_", "._", "date_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "anonym", "ous", "\\u", "visitor", "s_", "=_", "[_", "Ano", "nym", "ous", "Visitor_", "._", "objects_", "._", "create_", "(_", ")_", "for_", "i_", "in_", "range_", "(_", "10_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "experiment", "\\u", "participa", "nt", "\\u", "groups_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "participant_", "(_", "anonym", "ous", "\\u", "visitor_", "=_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enrollment", "\\u", "date_", "=_", "days_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "Participant", "_", "._", "TEST", "\\u", "GROUP_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "participant_", "(_", "anonym", "ous", "\\u", "visitor_", "=_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enrollment", "\\u", "date_", "=_", "days_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "Participant", "_", "._", "CONTR", "OL", "\\u", "GROUP_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "participant_", "(_", "anonym", "ous", "\\u", "visitor_", "=_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "3_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enrollment", "\\u", "date_", "=_", "days_", "[_", "3_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "Participant", "_", "._", "TEST", "\\u", "GROUP_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "participant_", "(_", "anonym", "ous", "\\u", "visitor_", "=_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "4_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enrollment", "\\u", "date_", "=_", "days_", "[_", "4_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "Participant", "_", "._", "CONTR", "OL", "\\u", "GROUP_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "participant_", "(_", "anonym", "ous", "\\u", "visitor_", "=_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "6_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enrollment", "\\u", "date_", "=_", "days_", "[_", "6_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "Participant", "_", "._", "TEST", "\\u", "GROUP_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "participant_", "(_", "anonym", "ous", "\\u", "visitor_", "=_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "other", "\\u", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enrollment", "\\u", "date_", "=_", "days_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "Participant", "_", "._", "CONTR", "OL", "\\u", "GROUP_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "participant_", "(_", "anonym", "ous", "\\u", "visitor_", "=_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "other", "\\u", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enrollment", "\\u", "date_", "=_", "days_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "Participant", "_", "._", "TEST", "\\u", "GROUP_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "participant_", "(_", "anonym", "ous", "\\u", "visitor_", "=_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "5_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "experiment_", "=_", "other", "\\u", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "enrollment", "\\u", "date_", "=_", "days_", "[_", "4_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "Participant", "_", "._", "TEST", "\\u", "GROUP_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ex", "1d", "ay", "2_", "=_", "find", "\\u", "experiment", "\\u", "group", "\\u", "participants_", "(_", "Participant", "_", "._", "TEST", "\\u", "GROUP_", ",_", "experiment_", ",_", "days_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ex", "1d", "ay", "2v", "isi", "tors_", "=_", "[_", "p_", "._", "anonym", "ous", "\\u", "visitor_", "for_", "p_", "in_", "ex", "1d", "ay", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "0_", "]_", "in_", "ex", "1d", "ay", "2v", "isi", "tors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "1_", ",_", "len_", "(_", "ex", "1d", "ay", "2v", "isi", "tors_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ex", "1d", "ay", "4", "test_", "=_", "find", "\\u", "experiment", "\\u", "group", "\\u", "participants_", "(_", "Participant", "_", "._", "TEST", "\\u", "GROUP_", ",_", "experiment_", ",_", "days_", "[_", "4_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ex", "1d", "ay", "4", "testv", "isi", "tors_", "=_", "[_", "p_", "._", "anonym", "ous", "\\u", "visitor_", "for_", "p_", "in_", "ex", "1d", "ay", "4", "test_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "0_", "]_", "in_", "ex", "1d", "ay", "4", "testv", "isi", "tors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "3_", "]_", "in_", "ex", "1d", "ay", "4", "testv", "isi", "tors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "2_", ",_", "len_", "(_", "ex", "1d", "ay", "4", "testv", "isi", "tors_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ex", "1d", "ay", "4c", "ontr", "ol_", "=_", "find", "\\u", "experiment", "\\u", "group", "\\u", "participants_", "(_", "Participant", "_", "._", "CONTR", "OL", "\\u", "GROUP_", ",_", "experiment_", ",_", "days_", "[_", "4_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ex", "1d", "ay", "4c", "ontr", "ol", "visitor", "s_", "=_", "[_", "p_", "._", "anonym", "ous", "\\u", "visitor_", "for_", "p_", "in_", "ex", "1d", "ay", "4c", "ontr", "ol_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "1_", "]_", "in_", "ex", "1d", "ay", "4c", "ontr", "ol", "visitor", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "4_", "]_", "in_", "ex", "1d", "ay", "4c", "ontr", "ol", "visitor", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "2_", ",_", "len_", "(_", "ex", "1d", "ay", "4c", "ontr", "ol", "visitor", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ex", "2d", "ay", "5", "test_", "=_", "find", "\\u", "experiment", "\\u", "group", "\\u", "participants_", "(_", "Participant", "_", "._", "TEST", "\\u", "GROUP_", ",_", "other", "\\u", "experiment_", ",_", "days_", "[_", "5_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ex", "2d", "ay", "5", "testv", "isi", "tors_", "=_", "[_", "p_", "._", "anonym", "ous", "\\u", "visitor_", "for_", "p_", "in_", "ex", "2d", "ay", "5", "test_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "2_", "]_", "in_", "ex", "2d", "ay", "5", "testv", "isi", "tors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "anonym", "ous", "\\u", "visitor", "s_", "[_", "5_", "]_", "in_", "ex", "2d", "ay", "5", "testv", "isi", "tors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "2_", ",_", "len_", "(_", "ex", "2d", "ay", "5", "testv", "isi", "tors_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Da", "il", "y", "Report", "s_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Get", "Conversion", "Data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "days_", "=_", "[_", "datetime_", "._", "combine_", "(_", "date_", "._", "today_", "(_", ")_", "+_", "timedelta_", "(_", "days_", "=_", "i_", ")_", ",_", "time_", "(_", "hour_", "=_", "12_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "-_", "7_", ",_", "0_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "yesterday", "_", "=_", "date_", "._", "today_", "(_", ")_", "-_", "timedelta_", "(_", "days_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "=_", "Experiment_", "(_", "name_", "=_", "\"", "experiment", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "state_", "=_", "Experiment_", "._", "ENABLE", "D", "\\u", "STATE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "start", "\\u", "date_", "=_", "yesterday", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "goal", "\\u", "types_", "=_", "[_", "Goal", "Type_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "\"%", "s", "\"_", "%_", "i_", ")_", "for_", "i_", "in_", "range_", "(_", "4_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "report_", "=_", "Da", "il", "y", "Conversion", "Report_", "._", "objects_", "._", "create_", "(_", "experiment_", "=_", "experiment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "date_", "=_", "yesterday", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "over", "all", "\\u", "test\\u", "conversion_", "=_", "17_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "over", "all", "\\u", "control", "\\u", "conversion_", "=_", "12_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "group", "\\u", "size_", "=_", "139_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "control", "\\u", "group", "\\u", "size_", "=_", "142_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "confidence_", "=_", "87", ".3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Da", "il", "y", "Conversion", "Report", "Goal", "Data_", "._", "objects_", "._", "create_", "(_", "report_", "=_", "report_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "goal", "\\u", "type_", "=_", "goal", "\\u", "types_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "conversion_", "=_", "11_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "control", "\\u", "conversion_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "confidence_", "=_", "65.", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Da", "il", "y", "Conversion", "Report", "Goal", "Data_", "._", "objects_", "._", "create_", "(_", "report_", "=_", "report_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "goal", "\\u", "type_", "=_", "goal", "\\u", "types_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "conversion_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "control", "\\u", "conversion_", "=_", "21_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "confidence_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Da", "il", "y", "Conversion", "Report", "Goal", "Data_", "._", "objects_", "._", "create_", "(_", "report_", "=_", "report_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "goal", "\\u", "type_", "=_", "goal", "\\u", "types_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "conversion_", "=_", "23_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "control", "\\u", "conversion_", "=_", "21_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "confidence_", "=_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "get", "\\u", "conve", "rsi", "on", "\\u", "data_", "(_", "experiment_", ",_", "yesterday", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "data_", "[_", "'", "date", "'_", "]_", ",_", "yesterday", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "totals", "\"_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "goal", "\\u", "types", "\"_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "4_", ",_", "len_", "(_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "._", "keys_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "goal", "\\u", "type_", "in_", "goal", "\\u", "types_", "[_", "0_", ":_", "3_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "goal", "\\u", "type_", "._", "name_", "in_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "goal", "\\u", "type", "\\u", "data_", "=_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "type_", "._", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "test\\u", "count", "\"_", "in_", "goal", "\\u", "type", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "control", "\\u", "count", "\"_", "in_", "goal", "\\u", "type", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "test\\u", "rate", "\"_", "in_", "goal", "\\u", "type", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "control", "\\u", "rate", "\"_", "in_", "goal", "\\u", "type", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "improvement", "\"_", "in_", "goal", "\\u", "type", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "confidence", "\"_", "in_", "goal", "\\u", "type", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "None_", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "3_", "]_", "._", "name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "139_", ",_", "data_", "[_", "\"", "test\\u", "group", "\\u", "size", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "142_", ",_", "data_", "[_", "\"", "control", "\\u", "group", "\\u", "size", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "totals_", "=_", "data_", "[_", "\"", "totals", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected", "\\u", "test\\u", "rate_", "=_", "17.", "_", "/_", "139", "._", "*_", "100._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "control", "\\u", "rate_", "=_", "12.", "_", "/_", "142", "._", "*_", "100._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "improvement", "_", "=_", "(_", "expected", "\\u", "test\\u", "rate_", "-_", "expected", "\\u", "control", "\\u", "rate_", ")_", "/_", "expected", "\\u", "control", "\\u", "rate_", "*_", "100._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equals_", "(_", "expected", "\\u", "test\\u", "rate_", ",_", "totals_", "[_", "\"", "test\\u", "rate", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equals_", "(_", "expected", "\\u", "control", "\\u", "rate_", ",_", "totals_", "[_", "\"", "control", "\\u", "rate", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equals_", "(_", "expected", "\\u", "improvement", "_", ",_", "totals_", "[_", "\"", "improvement", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equals_", "(_", "87", ".3_", ",_", "totals_", "[_", "\"", "confidence", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "17_", ",_", "totals_", "[_", "\"", "test\\u", "count", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "12_", ",_", "totals_", "[_", "\"", "control", "\\u", "count", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "0_", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "0_", "]_", "._", "name_", "]_", "[_", "\"", "control", "\\u", "rate", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equals_", "(_", "11.", "_", "/_", "139_", "*_", "100._", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "0_", "]_", "._", "name_", "]_", "[_", "\"", "test\\u", "rate", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "None_", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "0_", "]_", "._", "name_", "]_", "[_", "\"", "improvement", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equals_", "(_", "65.", "3_", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "0_", "]_", "._", "name_", "]_", "[_", "\"", "confidence", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "11_", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "0_", "]_", "._", "name_", "]_", "[_", "\"", "test\\u", "count", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "0_", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "0_", "]_", "._", "name_", "]_", "[_", "\"", "control", "\\u", "count", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equals_", "(_", "21.", "_", "/_", "142_", "*_", "100._", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "1_", "]_", "._", "name_", "]_", "[_", "\"", "control", "\\u", "rate", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "None_", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "1_", "]_", "._", "name_", "]_", "[_", "\"", "confidence", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "None_", ",_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "1_", "]_", "._", "name_", "]_", "[_", "\"", "improvement", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equals_", "(_", "(_", "23.", "_", "/_", "139_", "-_", "21.", "_", "/_", "142_", ")_", "/_", "(_", "21.", "_", "/_", "142_", ")_", "*_", "100._", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "[_", "\"", "goal", "\\u", "types", "\"_", "]_", "[_", "goal", "\\u", "types_", "[_", "2_", "]_", "._", "name_", "]_", "[_", "\"", "improvement", "\"_", "]_", ")_", "\\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, 0, 1, 1, 1, 2, 2, 2, 0, 1, 1, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 0, 1, 1, 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 ]
Unused import
mozilla/inventory/api_v2/keyvalue_handler.py
[ { "content": "from piston.handler import BaseHandler, rc\nfrom systems.models import System, SystemRack,SystemStatus,NetworkAdapter,KeyValue\nfrom truth.models import Truth, KeyValue as TruthKeyValue\nfrom dhcp.DHCP import DHCP as DHCPInterface\nfrom dhcp.models import DHCP\nfrom MacroExpansion import MacroExpansion\nfrom KeyValueTree import KeyValueTree\nimport re\ntry:\n import json\nexcept:\n from django.utils import simplejson as json\nfrom django.test.client import Client\n\nfrom MozInvAuthorization.KeyValueACL import KeyValueACL \n\nfrom settings import API_ACCESS\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class KeyValueHandler(BaseHandler):\n allowed_methods = API_ACCESS\n\n\n\n\n", "metadata": "root.KeyValueHandler", "header": "['module', '___EOS___']", "index": 18 }, { "content": " def create(self, request, key_value_id=None):\n if 'system_id' in request.POST:\n post_key = request.POST.get('key')\n post_value = request.POST.get('value')\n system_id = request.POST.get('system_id')\n n = KeyValue()\n system = System.objects.get(id=system_id)\n if re.search('^nic\\.(\\d+)\\.ipv4_address', str(post_key).strip() ):\n try:\n acl = KeyValueACL(request)\n acl.check_ip_not_exist_other_system(system, post_value)\n except Exception, e:\n resp = rc.FORBIDDEN\n resp.write(e)\n return resp\n try:\n n.obj = system\n if 'key' in request.POST:\n n.key = request.POST['key']\n if 'value' in request.POST:\n n.value = request.POST['value']\n n.save()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":%i}' % (n.id))\n except:\n resp = rc.NOT_FOUND\n resp.write('Unable to Create Key/Value Pair')\n return resp\n elif 'truth_name' in request.POST:\n n = TruthKeyValue()\n truth = Truth.objects.get(name=request.POST['truth_name'])\n n.truth = truth\n if 'key' in request.POST:\n n.key = request.POST['key']\n if 'value' in request.POST:\n n.value = request.POST['value']\n try:\n n.save()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":%i}' % (n.id))\n except:\n resp = rc.NOT_FOUND\n resp.write('Unable to Create Key/Value Pair')\n return resp\n else:\n resp = rc.NOT_FOUND\n resp.write('system_id or truth_name required')", "metadata": "root.KeyValueHandler.create", "header": "['class', 'KeyValueHandler', '(', 'BaseHandler', ')', ':', '___EOS___']", "index": 20 }, { "content": " def build_validation_array(self):\n input_regex_array = []\n output_regex_array = []\n error_message_array = []\n\n ipv4_regex = re.compile(r'((2[0-5]|1[0-9]|[0-9])?[0-9]\\.){3}((2[0-5]|1[0-9]|[0-9])?[0-9])')\n true_false_regex = re.compile('(^True$|^False$)')\n\n input_regex_array.append(re.compile('nic\\.\\d+\\.ipv4_address\\.\\d+'))\n output_regex_array.append(ipv4_regex)\n error_message_array.append('Requires IP Address')\n\n input_regex_array.append(re.compile('^dhcp\\.scope\\.netmask$'))\n output_regex_array.append(ipv4_regex)\n error_message_array.append('Requires Subnet Mask')\n\n input_regex_array.append(re.compile('^is_dhcp_scope$'))\n output_regex_array.append(re.compile(true_false_regex))\n error_message_array.append('Requires True|False')\n\n input_regex_array.append(re.compile('^dhcp\\.scope\\.start$'))\n output_regex_array.append(re.compile(ipv4_regex))\n error_message_array.append('Requires IP Address')\n \n input_regex_array.append(re.compile('^dhcp\\.scope\\.end$'))\n output_regex_array.append(re.compile(ipv4_regex))\n error_message_array.append('Requires IP Address')\n\n input_regex_array.append(re.compile('^dhcp\\.pool\\.start$'))\n output_regex_array.append(re.compile(ipv4_regex))\n error_message_array.append('Requires IP Address')\n\n input_regex_array.append(re.compile('^dhcp\\.pool\\.end$'))\n output_regex_array.append(re.compile(ipv4_regex))\n error_message_array.append('Requires IP Address')\n\n input_regex_array.append(re.compile('^dhcp\\.option\\.ntp_server\\.\\d+$'))\n output_regex_array.append(re.compile(ipv4_regex))\n error_message_array.append('Requires IP Address')\n\n input_regex_array.append(re.compile('^dhcp\\.dns_server\\.\\d+$'))\n output_regex_array.append(re.compile(ipv4_regex))\n error_message_array.append('Requires IP Address')\n\n input_regex_array.append(re.compile('^dhcp\\.option_router\\.\\d+$'))\n output_regex_array.append(re.compile(ipv4_regex))\n error_message_array.append('Requires IP Address')\n\n input_regex_array.append(re.compile('^dhcp\\.option\\.subnet_mask\\.\\d+$'))\n output_regex_array.append(re.compile(ipv4_regex))\n error_message_array.append('Requires IP Address')\n\n input_regex_array.append(re.compile('^dhcp\\.pool\\.allow_booting\\.\\d+$'))\n output_regex_array.append(re.compile(true_false_regex))\n error_message_array.append('Requires True|False')\n \n input_regex_array.append(re.compile('^dhcp\\.pool\\.allow_bootp\\.\\d+$'))\n output_regex_array.append(re.compile(true_false_regex))\n error_message_array.append('Requires True|False')\n\n input_regex_array.append(re.compile('^nic\\.\\d+\\.mac_address\\.\\d+$'))\n output_regex_array.append(re.compile('^([0-9a-f]{2}([:-]|$)){6}$', re.I))\n error_message_array.append('Requires Mac Address XX:XX:XX:XX:XX:XX')\n\n return input_regex_array, output_regex_array, error_message_array", "metadata": "root.KeyValueHandler.build_validation_array", "header": "['class', 'KeyValueHandler', '(', 'BaseHandler', ')', ':', '___EOS___']", "index": 67 }, { "content": " def validate(self, key, passed_value):\n error_message = None\n return_regex = None\n return_bool = True\n\n\n input_regex_array, output_regex_array, error_message_array = self.build_validation_array()\n ## Here we loop through all of the possible input validation array. If they key matches one, then we need to validate the value for the key/value pair\n for i in range(0, len(input_regex_array)):\n if input_regex_array[i].match(key):\n return_regex = output_regex_array[i]\n error_message = error_message_array[i];\n continue\n\n ## Check if we should validate the value portion of the key/value pair. No use validating it if the key doesn't require it\n if return_regex is not None:\n if return_regex.match(passed_value) is None:\n return_bool = False\n else:\n error_message = None\n\n\n return return_bool, error_message", "metadata": "root.KeyValueHandler.validate", "header": "['class', 'KeyValueHandler', '(', 'BaseHandler', ')', ':', '___EOS___']", "index": 133 }, { "content": " def update(self, request, key_value_id=None):\n ###TODO This whole method is not functioning correctly. Just for version 2. Not getting the system_id or truth_id from the poster firefox plugin\n if 'system_id' in request.POST:\n n = None\n found = False\n post_key = request.POST.get('key')\n post_value = request.POST.get('value')\n system_id = request.POST.get('system_id')\n key_validated, validation_error_string = self.validate(post_key, post_value) \n if re.search('^nic\\.(\\d+)\\.ipv4_address', str(post_key).strip() ):\n try:\n acl = KeyValueACL(request)\n system = System.objects.get(id=system_id)\n acl.check_ip_not_exist_other_system(system, post_value)\n except Exception, e:\n resp = rc.FORBIDDEN\n resp.write(e)\n return resp\n if key_validated is False:\n resp = rc.FORBIDDEN\n resp.write('Validation Failed for %s %s' % (request.POST['key'], validation_error_string) )\n return resp\n\n try:\n n = KeyValue.objects.get(id=key_value_id,key=request.POST['key'])\n system = System.objects.get(id=request.POST['system_id'])\n found = True\n except Exception, e:\n #print e\n found = False\n\n if found is False:\n try:\n system = System.objects.get(id=request.POST['system_id'])\n n = KeyValue.objects.get(obj=system,key=request.POST['key'])\n found = True\n except:\n found = False\n\n if found is False:\n resp = rc.NOT_FOUND\n resp.write('Neither system_id or truth_id found')\n return resp\n\n if n is not None:\n n.obj = system\n if 'value' in request.POST and n is not None:\n n.value = request.POST['value']\n if n is not None:\n try:\n n.save()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":%i}' % (n.id))\n except:\n resp = rc.NOT_FOUND\n resp.write('Unable to Create Key/Value Pair')\n return resp\n elif 'truth_id' in request.POST or 'truth_id' in request.PUT:\n try:\n truth = Truth.objects.get(name=key_value_id)\n n = TruthKeyValue.objects.get(truth=truth,key=request.POST['key'])\n if 'value' in request.POST:\n n.value = request.POST['value']\n except:\n pass\n try:\n n.save()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":%i}' % (n.id))\n except Exception, e:\n resp = rc.NOT_FOUND\n resp.write('Unable to Update Key/Value Pair %s' % e)\n return resp\n else:\n resp = rc.NOT_FOUND\n resp.write('Neither system_id or truth_id found')\n return resp", "metadata": "root.KeyValueHandler.update", "header": "['class', 'KeyValueHandler', '(', 'BaseHandler', ')', ':', '___EOS___']", "index": 158 }, { "content": " def read(self, request, key_value_id=None):\n #if keystore get var is set return the whole keystore\n if 'keystore' in request.GET:\n #if key get var is set return the keystore based on the existance of this key\n if 'key' in request.GET:\n base = KeyValue.objects.filter(key=request.GET['keystore']).filter(keyvalue_set__contains=request.GET['key'])\n tmp_list = []\n for row in base:\n matches = re.match(\"\\$\\{(.*)\\}\", row.value)\n if matches is not None:\n m = MacroExpansion(matches.group(1))\n row.value = m.output()\n for r in base:\n key_name = 'host:%s:%s' % (r.obj.hostname, r.key)\n tmp_list[key_name] = r.value\n if 'key' not in request.GET:\n tree = KeyValueTree(request.GET['keystore']).final\n return tree\n elif 'key_type' in request.GET:\n key_type = request.GET['key_type']\n tmp_list = []\n if key_type == 'dhcp_scopes':\n #Get keystores from truth that have dhcp.is_scope = True\n base = TruthKeyValue.objects.filter(key='dhcp.is_scope',value='True')\n #Iterate through the list and get all of the key/value pairs\n for row in base:\n keyvalue = TruthKeyValue.objects.filter(truth=row.truth)\n tmp_dict = {}\n for kv in keyvalue:\n tmp_dict[kv.key] = kv.value\n tmp_list.append(tmp_dict)\n return tmp_list\n\n if key_type == 'system_by_reverse_dns_zone':\n\n #Get keystores from truth that have dhcp.is_scope = True\n keyvalue_pairs = KeyValue.objects.filter(key__contains='reverse_dns_zone',value=request.GET['zone']).filter(key__startswith='nic.')\n #Iterate through the list and get all of the key/value pairs\n tmp_list = []\n for row in keyvalue_pairs:\n keyvalue = KeyValue.objects.filter(obj=row.obj)\n tmp_dict = {}\n for kv in keyvalue:\n tmp_dict[kv.key] = kv.value\n tmp_dict['hostname'] = row.obj.hostname\n appendable = True\n for the_items in tmp_list:\n if 'hostname' not in the_items:\n appendable = True\n elif the_items['hostname'] == row.obj.hostname:\n appendable = False\n if appendable is True:\n tmp_list.append(tmp_dict)\n #tmp_list = list(set(tmp_list))\n return tmp_list\n if key_type == 'system_by_scope':\n #Get keystores from truth that have dhcp.is_scope = True\n keyvalue_pairs = KeyValue.objects.filter(key__contains='dhcp_scope',value=request.GET['scope']).filter(key__startswith='nic.')\n #Iterate through the list and get all of the key/value pairs\n tmp_list = []\n for row in keyvalue_pairs:\n keyvalue = KeyValue.objects.filter(obj=row.obj)\n tmp_dict = {}\n for kv in keyvalue:\n tmp_dict[kv.key] = kv.value\n tmp_dict['hostname'] = row.obj.hostname\n appendable = True\n for the_items in tmp_list:\n if 'hostname' not in the_items:\n appendable = True\n elif the_items['hostname'] == row.obj.hostname:\n appendable = False\n if appendable is True:\n tmp_list.append(tmp_dict)\n #tmp_list = list(set(tmp_list))\n return tmp_list\n if key_type == 'adapters_by_system':\n #Get keystores from truth that have dhcp.is_scope = True\n system = None\n try:\n system = System.objects.get(hostname=request.GET['system'])\n except:\n system = None\n if not system:\n try:\n system = System.objects.get(id=request.GET['system'])\n except:\n system = None\n if not system:\n resp = rc.NOT_FOUND\n resp.write('json = {\"error_message\":\"Unable to find system\"}')\n return resp\n\n keyvalue_pairs = KeyValue.objects.filter(key__startswith='nic.').filter(obj=system).order_by('key')\n #Iterate through the list and get all of the key/value pairs\n tmp_dict = {}\n adapter_ids = []\n final_list = []\n for kv in keyvalue_pairs:\n tmp_dict[kv.key] = kv.value\n for k in tmp_dict.iterkeys():\n matches = re.match('nic\\.(\\d+).*',k)\n if matches.group is not None:\n if matches.group(1) not in adapter_ids:\n adapter_ids.append(matches.group(1))\n adapter_ids.sort()\n for a in adapter_ids:\n adapter_name = ''\n mac_address = ''\n dhcp_hostname = ''\n dhcp_scope = ''\n dhcp_filename = ''\n ipv4_address = ''\n dhcp_domain_name_servers = ''\n option_hostname = \"\"\n if 'nic.%s.ipv4_address.0' % a in tmp_dict:\n ipv4_address = tmp_dict['nic.%s.ipv4_address.0' % a]\n if 'nic.%s.name.0' % a in tmp_dict:\n adapter_name = tmp_dict['nic.%s.name.0' % a]\n if 'nic.%s.mac_address.0' % a in tmp_dict:\n mac_address = tmp_dict['nic.%s.mac_address.0' % a]\n if 'nic.%s.option_hostname.0' % a in tmp_dict:\n option_hostname = tmp_dict['nic.%s.option_hostname.0' % a]\n if 'nic.%s.dhcp_scope.0' % a in tmp_dict:\n dhcp_scope = tmp_dict['nic.%s.dhcp_scope.0' % a]\n if 'nic.%s.dhcp_filename.0' % a in tmp_dict:\n dhcp_filename = tmp_dict['nic.%s.dhcp_filename.0' % a]\n if 'nic.%s.dhcp_domain_name_servers.0' % a in tmp_dict:\n dhcp_domain_name_servers = tmp_dict['nic.%s.dhcp_domain_name_servers.0' % a]\n try:\n final_list.append({\n 'system_hostname':system.hostname,\n 'ipv4_address':ipv4_address,\n 'adapter_name':adapter_name,\n 'mac_address':mac_address,\n 'option_hostname':option_hostname,\n 'dhcp_scope':dhcp_scope,\n 'dhcp_filename':dhcp_filename,\n 'dhcp_domain_name_servers':dhcp_domain_name_servers,\n }\n )\n except Exception, e:\n pass\n #tmp_list.append(tmp_dict)\n return final_list\n if key_type == 'adapters_by_system_and_zone':\n #Get keystores from truth that have dhcp.is_scope = True\n zone = request.GET['zone']\n system = System.objects.get(hostname=request.GET['system'])\n keyvalue_pairs = KeyValue.objects.filter(key__startswith='nic.').filter(obj=system).order_by('key')\n #Iterate through the list and get all of the key/value pairs\n tmp_dict = {}\n adapter_ids = []\n final_list = []\n for kv in keyvalue_pairs:\n tmp_dict[kv.key] = kv.value\n for k in tmp_dict.iterkeys():\n matches = re.match('nic\\.(\\d+).*',k)\n if matches.group is not None:\n dhcp_scope_match = 'nic.%s.reverse_dns_zone.0' % matches.group(1)\n if matches.group(1) not in adapter_ids and dhcp_scope_match in tmp_dict and tmp_dict[dhcp_scope_match] == zone:\n #if matches.group(1) not in adapter_ids and 'nic.%s.dhcp_scope.0' % matches.group(1) in tmp_dict and tmp_dict['nic.%s.dhcp_scope.0' % matches.group(1)] == dhcp_scope:\n adapter_ids.append(matches.group(1))\n adapter_ids.sort()\n for a in adapter_ids:\n adapter_name = ''\n mac_address = ''\n dhcp_hostname = ''\n dhcp_filename = ''\n dhcp_domain_name = ''\n ipv4_address = ''\n if 'nic.%s.ipv4_address.0' % a in tmp_dict:\n ipv4_address = tmp_dict['nic.%s.ipv4_address.0' % a]\n if 'nic.%s.name.0' % a in tmp_dict:\n adapter_name = tmp_dict['nic.%s.name.0' % a]\n if 'nic.%s.mac_address.0' % a in tmp_dict:\n mac_address = tmp_dict['nic.%s.mac_address.0' % a]\n if 'nic.%s.dhcp_hostname.0' % a in tmp_dict:\n dhcp_hostname = tmp_dict['nic.%s.dhcp_hostname.0' % a]\n if 'nic.%s.dhcp_filename.0' % a in tmp_dict:\n dhcp_filename = tmp_dict['nic.%s.dhcp_filename.0' % a]\n if 'nic.%s.dhcp_domain_name.0' % a in tmp_dict:\n dhcp_domain_name = tmp_dict['nic.%s.dhcp_domain_name.0' % a]\n final_list.append({'system_hostname':system.hostname, 'ipv4_address':ipv4_address})\n #tmp_list.append(tmp_dict)\n return final_list\n if 'key_type' in request.GET and request.GET['key_type'] == 'key_by_system':\n try:\n hostname = request.GET.get('hostname')\n key = request.GET.get('key')\n system = System.objects.get(hostname=hostname)\n objects = KeyValue.objects.filter(key=key, obj=system)\n tmp = []\n for obj in objects:\n tmp.append({'key': obj.key, 'value': obj.value})\n resp = rc.ALL_OK\n resp.write(\"json = {'data': %s}\" % json.dumps(tmp))\n except:\n resp = rc.NOT_FOUND\n resp.write('json = {\"error_message\":\"Unable to find Key or system\"}')\n\n return resp\n if key_type == 'adapters_by_system_and_scope':\n #Get keystores from truth that have dhcp.is_scope = True\n dhcp_scope = request.GET['dhcp_scope']\n system = System.objects.get(hostname=request.GET['system'])\n keyvalue_pairs = KeyValue.objects.filter(key__startswith='nic.').filter(obj=system).order_by('key')\n #Iterate through the list and get all of the key/value pairs\n tmp_dict = {}\n adapter_ids = []\n final_list = []\n for kv in keyvalue_pairs:\n tmp_dict[kv.key] = kv.value\n for k in tmp_dict.iterkeys():\n matches = re.match('nic\\.(\\d+).*',k)\n if matches.group is not None:\n dhcp_scope_match = 'nic.%s.dhcp_scope.0' % matches.group(1)\n ip_address_match = 'nic.%s.ipv4_address.0' % matches.group(1)\n if matches.group(1) not in adapter_ids and ip_address_match in tmp_dict and dhcp_scope_match in tmp_dict and tmp_dict[dhcp_scope_match] == dhcp_scope:\n #if matches.group(1) not in adapter_ids and 'nic.%s.dhcp_scope.0' % matches.group(1) in tmp_dict and tmp_dict['nic.%s.dhcp_scope.0' % matches.group(1)] == dhcp_scope:\n adapter_ids.append(matches.group(1))\n adapter_ids.sort()\n for a in adapter_ids:\n adapter_name = ''\n mac_address = ''\n dhcp_hostname = ''\n dhcp_filename = ''\n dhcp_domain_name = ''\n ipv4_address = ''\n dhcp_domain_name_servers = ''\n if 'nic.%s.ipv4_address.0' % a in tmp_dict:\n ipv4_address = tmp_dict['nic.%s.ipv4_address.0' % a]\n if 'nic.%s.name.0' % a in tmp_dict:\n adapter_name = tmp_dict['nic.%s.name.0' % a]\n if 'nic.%s.mac_address.0' % a in tmp_dict:\n mac_address = tmp_dict['nic.%s.mac_address.0' % a]\n if 'nic.%s.dhcp_hostname.0' % a in tmp_dict and 'nic.%s.option_hostname.0' % a not in tmp_dict:\n dhcp_hostname = tmp_dict['nic.%s.dhcp_hostname.0' % a]\n if 'nic.%s.option_hostname.0' % a in tmp_dict:\n dhcp_hostname = tmp_dict['nic.%s.option_hostname.0' % a]\n if 'nic.%s.dhcp_filename.0' % a in tmp_dict:\n dhcp_filename = tmp_dict['nic.%s.dhcp_filename.0' % a]\n if 'nic.%s.dhcp_domain_name.0' % a in tmp_dict:\n dhcp_domain_name = tmp_dict['nic.%s.dhcp_domain_name.0' % a]\n if 'nic.%s.dhcp_domain_name_servers.0' % a in tmp_dict:\n dhcp_domain_name_servers = tmp_dict['nic.%s.dhcp_domain_name_servers.0' % a]\n final_list.append({'system_hostname':system.hostname, 'ipv4_address':ipv4_address, 'adapter_name':adapter_name, 'mac_address':mac_address, 'option_hostname': dhcp_hostname, 'dhcp_hostname':dhcp_hostname, 'dhcp_filename':dhcp_filename, 'dhcp_domain_name':dhcp_domain_name, 'dhcp_domain_name_servers':dhcp_domain_name_servers})\n #tmp_list.append(tmp_dict)\n return final_list\n elif 'key' in request.GET and request.GET['key'] > '':\n tmp_list = {}\n try:\n base = KeyValue.objects.filter(key=request.GET['key'])\n for row in base:\n matches = re.match(\"\\$\\{(.*)\\}\", row.value)\n if matches is not None:\n m = MacroExpansion(matches.group(1))\n row.value = m.output()\n for r in base:\n key_name = 'host:%s:%s' % (r.obj.hostname, r.key)\n tmp_list[key_name] = r.value\n except Exception, e:\n pass\n try:\n base = TruthKeyValue.objects.filter(key=request.GET['key'])\n for row in base:\n matches = re.match(\"\\$\\{(.*)\\}\", row.value)\n if matches is not None:\n m = MacroExpansion(matches.group(1))\n row.value = m.output()\n for r in base:\n key_name = 'truth:%s:%s' % (r.truth.name, r.key)\n tmp_list[key_name] = r.value\n except Exception, e:\n pass\n\n return tmp_list\n elif 'value' in request.GET:\n tmp_list = {}\n try:\n base = KeyValue.objects.filter(value=request.GET['value'])\n for row in base:\n matches = re.match(\"\\$\\{(.*)\\}\", row.value)\n if matches is not None:\n m = MacroExpansion(matches.group(1))\n row.value = m.output()\n for r in base:\n key_name = 'host:%s:%s' % (r.obj.hostname, r.key)\n tmp_list[key_name] = r.value\n except Exception, e:\n pass\n try:\n base = TruthKeyValue.objects.filter(value=request.GET['value'])\n for row in base:\n matches = re.match(\"\\$\\{(.*)\\}\", row.value)\n if matches is not None:\n m = MacroExpansion(matches.group(1))\n row.value = m.output()\n for r in base:\n key_name = 'truth:%s:%s' % (r.truth.name, r.key)\n tmp_list[key_name] = r.value\n except Exception, e:\n pass\n\n return tmp_list", "metadata": "root.KeyValueHandler.read", "header": "['class', 'KeyValueHandler', '(', 'BaseHandler', ')', ':', '___EOS___']", "index": 236 }, { "content": " def delete(self, request, key_value_id=None):\n if 'key_type' in request.GET and request.GET['key_type'] == 'delete_all_network_adapters':\n #Get keystores from truth that have dhcp.is_scope = True\n try:\n system_hostname = request.GET['system_hostname']\n system = System.objects.get(hostname=system_hostname)\n KeyValue.objects.filter(key__startswith='nic', obj=system).delete()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":\"0\"}')\n except:\n resp = rc.NOT_FOUND\n resp.write('json = {\"error_message\":\"Unable to Delete}')\n\n return resp\n if 'key_type' in request.GET and request.GET['key_type'] == 'delete_network_adapter':\n #Get keystores from truth that have dhcp.is_scope = True\n try:\n adapter_number = request.GET['adapter_number']\n system_hostname = request.GET['system_hostname']\n system = System.objects.get(hostname=system_hostname)\n KeyValue.objects.filter(key__startswith='nic.%s' % adapter_number, obj=system).delete()\n #KeyValue.objects.filter(key__startswith='nic.0', system=system).delete()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":\"14\"}')\n except:\n resp = rc.NOT_FOUND\n resp.write('json = {\"error_message\":\"Unable to Delete}')\n\n return resp\n if 'key_type' in request.GET and request.GET['key_type'] == 'delete_key_by_system':\n try:\n system_hostname = request.GET.get('system')\n key = request.GET.get('key')\n system = System.objects.get(hostname=system_hostname)\n KeyValue.objects.filter(key=key, obj=system).delete()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":\"14\"}')\n except:\n resp = rc.NOT_FOUND\n resp.write('json = {\"error_message\":\"Unable to Delete}')\n\n return resp\n if 'key_type' not in request.GET:\n if 'system_id' in request.GET:\n try:\n n = KeyValue.objects.get(id=key_value_id)\n n.delete()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":\"%s\"}' % str(key_value_id))\n except:\n resp = rc.NOT_FOUND\n return resp\n if 'truth_id' in request.GET:\n try:\n n = TruthKeyValue.objects.get(id=key_value_id)\n n.delete()\n resp = rc.ALL_OK\n resp.write('json = {\"id\":\"%s\"}' % str(key_value_id))\n except:\n resp = rc.NOT_FOUND\n return resp\n \n resp = rc.ALL_OK\n resp.write('json = {\"id\":\"1\"}')\n return resp", "metadata": "root.KeyValueHandler.delete", "header": "['class', 'KeyValueHandler', '(', 'BaseHandler', ')', ':', '___EOS___']", "index": 542 } ]
[ { "span": "from systems.models import System, SystemRack,SystemStatus,NetworkAdapter,KeyValue", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 82 }, { "span": "from dhcp.DHCP import DHCP as DHCPInterface", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 43 }, { "span": "from dhcp.models import DHCP", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 28 }, { "span": "from django.test.client import Client", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 37 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "pis", "ton_", "._", "handler_", "import_", "Base", "Handler_", ",_", "rc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "systems_", "._", "models_", "import_", "System_", ",_", "System", "Rack", "_", ",_", "System", "Status_", ",_", "Network", "Adapter_", ",_", "Key", "Value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "truth_", "._", "models_", "import_", "Tru", "th_", ",_", "Key", "Value_", "as_", "Tru", "th", "Key", "Value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "dhcp_", "._", "DHC", "P_", "import_", "DHC", "P_", "as_", "DHC", "PI", "nter", "face_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "dhcp_", "._", "models_", "import_", "DHC", "P_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Macro", "Expa", "nsion", "_", "import_", "Macro", "Expa", "nsion", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Key", "Value", "Tree_", "import_", "Key", "Value", "Tree_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "json_", "\\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 ", " _", "from_", "django_", "._", "utils_", "import_", "simplejson_", "as_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "django_", "._", "test_", "._", "client_", "import_", "Client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Mo", "z", "Inv", "Authorization_", "._", "Key", "Value", "ACL", "_", "import_", "Key", "Value", "ACL", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "settings_", "import_", "API", "\\u", "ACCESS", "_", "\\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_", "Key", "Value", "Handler_", "(_", "Base", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "allow", "ed", "\\u", "methods_", "=_", "API", "\\u", "ACCESS", "_", "\\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\\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_", "Key", "Value", "Handler_", "(_", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "create_", "(_", "self_", ",_", "request_", ",_", "key", "\\u", "value", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "system", "\\u", "id", "'_", "in_", "request_", "._", "POST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "post", "\\u", "key_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post", "\\u", "value_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system", "\\u", "id_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "system", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "Key", "Value_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "system", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "re_", "._", "search_", "(_", "'", "^", "nic", "\\\\.(", "\\\\", "d", "+)\\\\", ".", "ipv", "4", "\\u", "address", "'_", ",_", "str_", "(_", "post", "\\u", "key_", ")_", "._", "strip_", "(_", ")_", ")_", ":_", "\\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 ", " ", "_", "acl_", "=_", "Key", "Value", "ACL", "_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "acl_", "._", "check", "\\u", "ip", "\\u", "not", "\\u", "exist", "\\u", "other", "\\u", "system_", "(_", "system_", ",_", "post", "\\u", "value_", ")_", "\\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 ", " ", "_", "resp_", "=_", "rc_", "._", "FORB", "IDD", "EN_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\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 ", " _", "n_", "._", "obj_", "=_", "system_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "key", "'_", "in_", "request_", "._", "POST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "n_", "._", "key_", "=_", "request_", "._", "POST_", "[_", "'", "key", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "value", "'_", "in_", "request_", "._", "POST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "n_", "._", "value_", "=_", "request_", "._", "POST_", "[_", "'", "value", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "n_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":", "%", "i", "}'_", "%_", "(_", "n_", "._", "id_", ")_", ")_", "\\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 ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "Una", "ble", " ", "to", " ", "Creat", "e", " ", "Key", "/", "Value", " ", "Pair", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "truth", "\\u", "name", "'_", "in_", "request_", "._", "POST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "Tru", "th", "Key", "Value_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "truth_", "=_", "Tru", "th_", "._", "objects_", "._", "get_", "(_", "name_", "=_", "request_", "._", "POST_", "[_", "'", "truth", "\\u", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "._", "truth_", "=_", "truth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "key", "'_", "in_", "request_", "._", "POST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "._", "key_", "=_", "request_", "._", "POST_", "[_", "'", "key", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "value", "'_", "in_", "request_", "._", "POST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "._", "value_", "=_", "request_", "._", "POST_", "[_", "'", "value", "'_", "]_", "\\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 ", " _", "n_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":", "%", "i", "}'_", "%_", "(_", "n_", "._", "id_", ")_", ")_", "\\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 ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "Una", "ble", " ", "to", " ", "Creat", "e", " ", "Key", "/", "Value", " ", "Pair", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\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 ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "system", "\\u", "id", " ", "or", " ", "truth", "\\u", "name", " ", "require", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "Value", "Handler_", "(_", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "validation", "\\u", "array_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input", "\\u", "regex", "\\u", "array_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "regex", "\\u", "array_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "message", "\\u", "array_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ipv", "4", "\\u", "regex_", "=_", "re_", "._", "compile_", "(_", "r", "'((", "2", "[", "0", "-", "5", "]|", "1", "[", "0", "-", "9", "]|", "[", "0", "-", "9", "])", "?", "[", "0", "-", "9", "]\\\\", ".)", "{", "3", "}(", "(", "2", "[", "0", "-", "5", "]|", "1", "[", "0", "-", "9", "]|", "[", "0", "-", "9", "])", "?", "[", "0", "-", "9", "])'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "true", "\\u", "fal", "se", "\\u", "regex_", "=_", "re_", "._", "compile_", "(_", "'(", "^", "Tru", "e", "$", "|", "^", "Fal", "se", "$)", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "'", "nic", "\\\\.\\\\", "d", "+\\\\.", "ipv", "4", "\\u", "address", "\\\\.\\\\", "d", "+'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "ipv", "4", "\\u", "regex_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "message", "\\u", "array_", "._", "append_", "(_", "'", "Requ", "ires", " ", "IP", " ", "Address", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "'", "^", "dhcp", "\\\\.", "scope", "\\\\.", "net", "mask", "$'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "ipv", "4", "\\u", "regex_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "message", "\\u", "array_", "._", "append_", "(_", "'", "Requ", "ires", " ", "Subnet", " ", "Mask", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "'", "^", "is", "\\u", "dhcp", "\\u", "scope", "$'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "true", "\\u", "fal", "se", "\\u", "regex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "message", "\\u", "array_", "._", "append_", "(_", "'", "Requ", "ires", " ", "Tru", "e", "|", "Fal", "se", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "'", "^", "dhcp", "\\\\.", "scope", "\\\\.", "start", "$'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "ipv", "4", "\\u", "regex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "message", "\\u", "array_", "._", "append_", "(_", "'", "Requ", "ires", " ", "IP", " ", "Address", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "'", "^", "dhcp", "\\\\.", "scope", "\\\\.", "end", "$'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "ipv", "4", "\\u", "regex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "message", "\\u", "array_", "._", "append_", "(_", "'", "Requ", "ires", " ", "IP", " ", "Address", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "'", "^", "dhcp", "\\\\.", "pool", "\\\\.", "start", "$'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "ipv", "4", "\\u", "regex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "message", "\\u", "array_", "._", "append_", "(_", "'", "Requ", "ires", " ", "IP", " ", "Address", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "'", "^", "dhcp", "\\\\.", "pool", "\\\\.", "end", "$'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "ipv", "4", "\\u", "regex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "message", "\\u", "array_", "._", "append_", "(_", "'", "Requ", "ires", " ", "IP", " ", "Address", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "'", "^", "dhcp", "\\\\.", "option", "\\\\.", "ntp", "\\u", "server", "\\\\.\\\\", "d", "+$", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "ipv", "4", "\\u", "regex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "message", "\\u", "array_", "._", "append_", "(_", "'", "Requ", "ires", " ", "IP", " ", "Address", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "'", "^", "dhcp", "\\\\.", "dns", "\\u", "server", "\\\\.\\\\", "d", "+$", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "ipv", "4", "\\u", "regex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "message", "\\u", "array_", "._", "append_", "(_", "'", "Requ", "ires", " ", "IP", " ", "Address", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "'", "^", "dhcp", "\\\\.", "option", "\\u", "router", "\\\\.\\\\", "d", "+$", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "ipv", "4", "\\u", "regex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "message", "\\u", "array_", "._", "append_", "(_", "'", "Requ", "ires", " ", "IP", " ", "Address", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "'", "^", "dhcp", "\\\\.", "option", "\\\\.", "subnet", "\\u", "mask", "\\\\.\\\\", "d", "+$", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "ipv", "4", "\\u", "regex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "message", "\\u", "array_", "._", "append_", "(_", "'", "Requ", "ires", " ", "IP", " ", "Address", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "'", "^", "dhcp", "\\\\.", "pool", "\\\\.", "allow", "\\u", "boot", "ing", "\\\\.\\\\", "d", "+$", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "true", "\\u", "fal", "se", "\\u", "regex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "message", "\\u", "array_", "._", "append_", "(_", "'", "Requ", "ires", " ", "Tru", "e", "|", "Fal", "se", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "'", "^", "dhcp", "\\\\.", "pool", "\\\\.", "allow", "\\u", "boot", "p", "\\\\.\\\\", "d", "+$", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "true", "\\u", "fal", "se", "\\u", "regex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "message", "\\u", "array_", "._", "append_", "(_", "'", "Requ", "ires", " ", "Tru", "e", "|", "Fal", "se", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "'", "^", "nic", "\\\\.\\\\", "d", "+\\\\.", "mac", "\\u", "address", "\\\\.\\\\", "d", "+$", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "regex", "\\u", "array_", "._", "append_", "(_", "re_", "._", "compile_", "(_", "'", "^", "([", "0", "-", "9", "a", "-", "f", "]{", "2", "}([", ":-", "]|", "$)", "){", "6", "}$'_", ",_", "re_", "._", "I_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "message", "\\u", "array_", "._", "append_", "(_", "'", "Requ", "ires", " ", "Mac", " ", "Address", " ", "XX", ":", "XX", ":", "XX", ":", "XX", ":", "XX", ":", "XX", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "input", "\\u", "regex", "\\u", "array_", ",_", "output", "\\u", "regex", "\\u", "array_", ",_", "error", "\\u", "message", "\\u", "array_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "Value", "Handler_", "(_", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ",_", "key_", ",_", "pass", "ed", "\\u", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error", "\\u", "message_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "regex_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "bool_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "regex", "\\u", "array_", ",_", "output", "\\u", "regex", "\\u", "array_", ",_", "error", "\\u", "message", "\\u", "array_", "=_", "self_", "._", "build", "\\u", "validation", "\\u", "array_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "##", " ", "Her", "e", " ", "we", " ", "loop", " ", "through", " ", "all", " ", "of", " ", "the", " ", "possib", "le", " ", "input", " ", "validation", " ", "array", ".", " ", "If", " ", "the", "y", " ", "key", " ", "matche", "s", " ", "one", ",", " ", "then", " ", "we", " ", "need", " ", "to", " ", "validat", "e", " ", "the", " ", "value", " ", "for", " ", "the", " ", "key", "/", "value", " ", "pair_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "len_", "(_", "input", "\\u", "regex", "\\u", "array_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "input", "\\u", "regex", "\\u", "array_", "[_", "i_", "]_", "._", "match_", "(_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return", "\\u", "regex_", "=_", "output", "\\u", "regex", "\\u", "array_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "message_", "=_", "error", "\\u", "message", "\\u", "array_", "[_", "i_", "]_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Check", " ", "if", " ", "we", " ", "shou", "ld", " ", "validat", "e", " ", "the", " ", "value", " ", "porti", "on", " ", "of", " ", "the", " ", "key", "/", "value", " ", "pair", ".", " ", "No", " ", "use", " ", "validat", "ing", " ", "it", " ", "if", " ", "the", " ", "key", " ", "doe", "sn", "'", "t", " ", "require", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "return", "\\u", "regex_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "return", "\\u", "regex_", "._", "match_", "(_", "pass", "ed", "\\u", "value_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return", "\\u", "bool_", "=_", "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 ", " _", "error", "\\u", "message_", "=_", "None_", "\\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_", "return_", "return", "\\u", "bool_", ",_", "error", "\\u", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "Value", "Handler_", "(_", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update_", "(_", "self_", ",_", "request_", ",_", "key", "\\u", "value", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "###", "TOD", "O", " ", "Thi", "s", " ", "whole", " ", "method", " ", "is", " ", "not", " ", "function", "ing", " ", "correct", "ly", ".", " ", "Ju", "st", " ", "for", " ", "version", " ", "2", ".", " ", "Not", " ", "getti", "ng", " ", "the", " ", "system", "\\u", "id", " ", "or", " ", "truth", "\\u", "id", " ", "from", " ", "the", " ", "poster", " ", "firefox", " ", "plugin_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "system", "\\u", "id", "'_", "in_", "request_", "._", "POST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post", "\\u", "key_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post", "\\u", "value_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system", "\\u", "id_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "system", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key", "\\u", "validated_", ",_", "validation", "\\u", "error", "\\u", "string_", "=_", "self_", "._", "validate_", "(_", "post", "\\u", "key_", ",_", "post", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "re_", "._", "search_", "(_", "'", "^", "nic", "\\\\.(", "\\\\", "d", "+)\\\\", ".", "ipv", "4", "\\u", "address", "'_", ",_", "str_", "(_", "post", "\\u", "key_", ")_", "._", "strip_", "(_", ")_", ")_", ":_", "\\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 ", " ", "_", "acl_", "=_", "Key", "Value", "ACL", "_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "system", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "acl_", "._", "check", "\\u", "ip", "\\u", "not", "\\u", "exist", "\\u", "other", "\\u", "system_", "(_", "system_", ",_", "post", "\\u", "value_", ")_", "\\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 ", " ", "_", "resp_", "=_", "rc_", "._", "FORB", "IDD", "EN_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "key", "\\u", "validated_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "rc_", "._", "FORB", "IDD", "EN_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "Validat", "ion", " ", "Fail", "ed", " ", "for", " ", "%", "s", " ", "%", "s", "'_", "%_", "(_", "request_", "._", "POST_", "[_", "'", "key", "'_", "]_", ",_", "validation", "\\u", "error", "\\u", "string_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "resp_", "\\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 ", " _", "n_", "=_", "Key", "Value_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "key", "\\u", "value", "\\u", "id_", ",_", "key_", "=_", "request_", "._", "POST_", "[_", "'", "key", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "request_", "._", "POST_", "[_", "'", "system", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "e_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "found_", "is_", "False_", ":_", "\\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 ", " ", "_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "request_", "._", "POST_", "[_", "'", "system", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "Key", "Value_", "._", "objects_", "._", "get_", "(_", "obj_", "=_", "system_", ",_", "key_", "=_", "request_", "._", "POST_", "[_", "'", "key", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "True_", "\\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 ", " ", "_", "found_", "=_", "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_", "if_", "found_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "Nei", "ther", " ", "system", "\\u", "id", " ", "or", " ", "truth", "\\u", "id", " ", "found", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "n_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "._", "obj_", "=_", "system_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "value", "'_", "in_", "request_", "._", "POST_", "and_", "n_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "._", "value_", "=_", "request_", "._", "POST_", "[_", "'", "value", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "n_", "is_", "not_", "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 ", " ", "_", "n_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":", "%", "i", "}'_", "%_", "(_", "n_", "._", "id_", ")_", ")_", "\\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 ", " ", "_", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "Una", "ble", " ", "to", " ", "Creat", "e", " ", "Key", "/", "Value", " ", "Pair", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "truth", "\\u", "id", "'_", "in_", "request_", "._", "POST_", "or_", "'", "truth", "\\u", "id", "'_", "in_", "request_", "._", "PUT_", ":_", "\\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 ", " _", "truth_", "=_", "Tru", "th_", "._", "objects_", "._", "get_", "(_", "name_", "=_", "key", "\\u", "value", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "Tru", "th", "Key", "Value_", "._", "objects_", "._", "get_", "(_", "truth_", "=_", "truth_", ",_", "key_", "=_", "request_", "._", "POST_", "[_", "'", "key", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "value", "'_", "in_", "request_", "._", "POST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "n_", "._", "value_", "=_", "request_", "._", "POST_", "[_", "'", "value", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\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 ", " _", "n_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":", "%", "i", "}'_", "%_", "(_", "n_", "._", "id_", ")_", ")_", "\\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 ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "Una", "ble", " ", "to", " ", "Update", " ", "Key", "/", "Value", " ", "Pair", " ", "%", "s", "'_", "%_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\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 ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "Nei", "ther", " ", "system", "\\u", "id", " ", "or", " ", "truth", "\\u", "id", " ", "found", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "Value", "Handler_", "(_", "Base", "Handler_", ")_", ":_", "\\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_", "read_", "(_", "self_", ",_", "request_", ",_", "key", "\\u", "value", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "keystore", " ", "get", " ", "var", " ", "is", " ", "set", " ", "return", " ", "the", " ", "whole", " ", "keystore", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "keystore", "'_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "key", " ", "get", " ", "var", " ", "is", " ", "set", " ", "return", " ", "the", " ", "keystore", " ", "based", " ", "on", " ", "the", " ", "exist", "anc", "e", " ", "of", " ", "this", " ", "key_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "key", "'_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key_", "=_", "request_", "._", "GET_", "[_", "'", "keystore", "'_", "]_", ")_", "._", "filter_", "(_", "keyval", "ue", "\\u", "set\\u", "\\u", "contains_", "=_", "request_", "._", "GET_", "[_", "'", "key", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "matches_", "=_", "re_", "._", "match_", "(_", "\"\\\\", "$", "\\\\{", "(.*)", "\\\\}", "\"_", ",_", "row_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "m_", "=_", "Macro", "Expa", "nsion", "_", "(_", "matches_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "._", "value_", "=_", "m_", "._", "output_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "r_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "key", "\\u", "name_", "=_", "'", "host", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "r_", "._", "obj_", "._", "hostname_", ",_", "r_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "list_", "[_", "key", "\\u", "name_", "]_", "=_", "r_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "key", "'_", "not_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tree_", "=_", "Key", "Value", "Tree_", "(_", "request_", "._", "GET_", "[_", "'", "keystore", "'_", "]_", ")_", "._", "final_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "tree_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "key", "\\u", "type", "'_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key", "\\u", "type_", "=_", "request_", "._", "GET_", "[_", "'", "key", "\\u", "type", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "key", "\\u", "type_", "==_", "'", "dhcp", "\\u", "scope", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Get", " ", "keystore", "s", " ", "from", " ", "truth", " ", "tha", "t", " ", "have", " ", "dhcp", ".", "is", "\\u", "scope", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base_", "=_", "Tru", "th", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key_", "=_", "'", "dhcp", ".", "is", "\\u", "scope", "'_", ",_", "value_", "=_", "'", "Tru", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Iterat", "e", " ", "through", " ", "the", " ", "list", " ", "and", " ", "get", " ", "all", " ", "of", " ", "the", " ", "key", "/", "value", " ", "pairs_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "row_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "keyval", "ue_", "=_", "Tru", "th", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "truth_", "=_", "row_", "._", "truth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "kv_", "in_", "keyval", "ue_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "tmp", "\\u", "dict_", "[_", "kv_", "._", "key_", "]_", "=_", "kv_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tmp", "\\u", "list_", "._", "append_", "(_", "tmp", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "tmp", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "key", "\\u", "type_", "==_", "'", "system", "\\u", "by", "\\u", "reverse", "\\u", "dns", "\\u", "zone", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Get", " ", "keystore", "s", " ", "from", " ", "truth", " ", "tha", "t", " ", "have", " ", "dhcp", ".", "is", "\\u", "scope", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keyval", "ue", "\\u", "pairs_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key", "\\u\\u", "contains_", "=_", "'", "reverse", "\\u", "dns", "\\u", "zone", "'_", ",_", "value_", "=_", "request_", "._", "GET_", "[_", "'", "zone", "'_", "]_", ")_", "._", "filter_", "(_", "key", "\\u\\u", "startswith_", "=_", "'", "nic", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Iterat", "e", " ", "through", " ", "the", " ", "list", " ", "and", " ", "get", " ", "all", " ", "of", " ", "the", " ", "key", "/", "value", " ", "pairs_", "\\u\\u\\uNL\\u\\u\\u_", "tmp", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "keyval", "ue", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "keyval", "ue_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "obj_", "=_", "row_", "._", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "kv_", "in_", "keyval", "ue_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "tmp", "\\u", "dict_", "[_", "kv_", "._", "key_", "]_", "=_", "kv_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tmp", "\\u", "dict_", "[_", "'", "host", "name", "'_", "]_", "=_", "row_", "._", "obj_", "._", "hostname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "append", "able_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "the", "\\u", "items_", "in_", "tmp", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "'", "host", "name", "'_", "not_", "in_", "the", "\\u", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "append", "able_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "the", "\\u", "items_", "[_", "'", "host", "name", "'_", "]_", "==_", "row_", "._", "obj_", "._", "hostname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "append", "able_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "append", "able_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "tmp", "\\u", "list_", "._", "append_", "(_", "tmp", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "tmp", "\\u", "list", " ", "=", " ", "list", "(", "set", "(", "tmp", "\\u", "list", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "tmp", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "key", "\\u", "type_", "==_", "'", "system", "\\u", "by", "\\u", "scope", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Get", " ", "keystore", "s", " ", "from", " ", "truth", " ", "tha", "t", " ", "have", " ", "dhcp", ".", "is", "\\u", "scope", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keyval", "ue", "\\u", "pairs_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key", "\\u\\u", "contains_", "=_", "'", "dhcp", "\\u", "scope", "'_", ",_", "value_", "=_", "request_", "._", "GET_", "[_", "'", "scope", "'_", "]_", ")_", "._", "filter_", "(_", "key", "\\u\\u", "startswith_", "=_", "'", "nic", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Iterat", "e", " ", "through", " ", "the", " ", "list", " ", "and", " ", "get", " ", "all", " ", "of", " ", "the", " ", "key", "/", "value", " ", "pairs_", "\\u\\u\\uNL\\u\\u\\u_", "tmp", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "keyval", "ue", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "keyval", "ue_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "obj_", "=_", "row_", "._", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "kv_", "in_", "keyval", "ue_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "tmp", "\\u", "dict_", "[_", "kv_", "._", "key_", "]_", "=_", "kv_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tmp", "\\u", "dict_", "[_", "'", "host", "name", "'_", "]_", "=_", "row_", "._", "obj_", "._", "hostname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "append", "able_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "the", "\\u", "items_", "in_", "tmp", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "'", "host", "name", "'_", "not_", "in_", "the", "\\u", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "append", "able_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "the", "\\u", "items_", "[_", "'", "host", "name", "'_", "]_", "==_", "row_", "._", "obj_", "._", "hostname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "append", "able_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "append", "able_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "tmp", "\\u", "list_", "._", "append_", "(_", "tmp", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "tmp", "\\u", "list", " ", "=", " ", "list", "(", "set", "(", "tmp", "\\u", "list", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "tmp", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "key", "\\u", "type_", "==_", "'", "adapter", "s", "\\u", "by", "\\u", "system", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Get", " ", "keystore", "s", " ", "from", " ", "truth", " ", "tha", "t", " ", "have", " ", "dhcp", ".", "is", "\\u", "scope", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "system_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "request_", "._", "GET_", "[_", "'", "system", "'_", "]_", ")_", "\\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 ", " ", "_", "system_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "system_", ":_", "\\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 ", " ", " _", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "request_", "._", "GET_", "[_", "'", "system", "'_", "]_", ")_", "\\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 ", " ", " _", "system_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "system_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "error", "\\u", "message", "\":\"", "Una", "ble", " ", "to", " ", "find", " ", "system", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "keyval", "ue", "\\u", "pairs_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key", "\\u\\u", "startswith_", "=_", "'", "nic", ".'_", ")_", "._", "filter_", "(_", "obj_", "=_", "system_", ")_", "._", "order", "\\u", "by_", "(_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Iterat", "e", " ", "through", " ", "the", " ", "list", " ", "and", " ", "get", " ", "all", " ", "of", " ", "the", " ", "key", "/", "value", " ", "pairs_", "\\u\\u\\uNL\\u\\u\\u_", "tmp", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adapter", "\\u", "ids_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "final", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "kv_", "in_", "keyval", "ue", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tmp", "\\u", "dict_", "[_", "kv_", "._", "key_", "]_", "=_", "kv_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "k_", "in_", "tmp", "\\u", "dict_", "._", "iterkeys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "matches_", "=_", "re_", "._", "match_", "(_", "'", "nic", "\\\\.(", "\\\\", "d", "+)", ".*'_", ",_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "._", "group_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "matches_", "._", "group_", "(_", "1_", ")_", "not_", "in_", "adapter", "\\u", "ids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "adapter", "\\u", "ids_", "._", "append_", "(_", "matches_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "adapter", "\\u", "ids_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "a_", "in_", "adapter", "\\u", "ids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "adapter", "\\u", "name_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mac", "\\u", "address_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "hostname_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "scope_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "filename_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ipv", "4", "\\u", "address_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "servers_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "option", "\\u", "hostname_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "ipv", "4", "\\u", "address", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ipv", "4", "\\u", "address_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "ipv", "4", "\\u", "address", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "adapter", "\\u", "name_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "mac", "\\u", "address", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "mac", "\\u", "address_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "mac", "\\u", "address", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "option", "\\u", "host", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "option", "\\u", "hostname_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "option", "\\u", "host", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "scope", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "scope_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "scope", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "filename", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "filename_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "filename", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "server", "s", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "servers_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "server", "s", ".0", "'_", "%_", "a_", "]_", "\\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 ", " ", " _", "final", "\\u", "list_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "system", "\\u", "host", "name", "'_", ":_", "system_", "._", "hostname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ipv", "4", "\\u", "address", "'_", ":_", "ipv", "4", "\\u", "address_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "adapter", "\\u", "name", "'_", ":_", "adapter", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mac", "\\u", "address", "'_", ":_", "mac", "\\u", "address_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "option", "\\u", "host", "name", "'_", ":_", "option", "\\u", "hostname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dhcp", "\\u", "scope", "'_", ":_", "dhcp", "\\u", "scope_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dhcp", "\\u", "filename", "'_", ":_", "dhcp", "\\u", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "server", "s", "'_", ":_", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "servers_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\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 ", " ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "tmp", "\\u", "list", ".", "append", "(", "tmp", "\\u", "dict", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "final", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "key", "\\u", "type_", "==_", "'", "adapter", "s", "\\u", "by", "\\u", "system", "\\u", "and", "\\u", "zone", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Get", " ", "keystore", "s", " ", "from", " ", "truth", " ", "tha", "t", " ", "have", " ", "dhcp", ".", "is", "\\u", "scope", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "zone_", "=_", "request_", "._", "GET_", "[_", "'", "zone", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "request_", "._", "GET_", "[_", "'", "system", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keyval", "ue", "\\u", "pairs_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key", "\\u\\u", "startswith_", "=_", "'", "nic", ".'_", ")_", "._", "filter_", "(_", "obj_", "=_", "system_", ")_", "._", "order", "\\u", "by_", "(_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Iterat", "e", " ", "through", " ", "the", " ", "list", " ", "and", " ", "get", " ", "all", " ", "of", " ", "the", " ", "key", "/", "value", " ", "pairs_", "\\u\\u\\uNL\\u\\u\\u_", "tmp", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adapter", "\\u", "ids_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "final", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "kv_", "in_", "keyval", "ue", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tmp", "\\u", "dict_", "[_", "kv_", "._", "key_", "]_", "=_", "kv_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "k_", "in_", "tmp", "\\u", "dict_", "._", "iterkeys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "matches_", "=_", "re_", "._", "match_", "(_", "'", "nic", "\\\\.(", "\\\\", "d", "+)", ".*'_", ",_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "._", "group_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "scope", "\\u", "match_", "=_", "'", "nic", ".", "%", "s", ".", "reverse", "\\u", "dns", "\\u", "zone", ".0", "'_", "%_", "matches_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "._", "group_", "(_", "1_", ")_", "not_", "in_", "adapter", "\\u", "ids_", "and_", "dhcp", "\\u", "scope", "\\u", "match_", "in_", "tmp", "\\u", "dict_", "and_", "tmp", "\\u", "dict_", "[_", "dhcp", "\\u", "scope", "\\u", "match_", "]_", "==_", "zone_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "matche", "s", ".", "group", "(", "1", ")", " ", "not", " ", "in", " ", "adapter", "\\u", "ids", " ", "and", " ", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "scope", ".0", "'", " ", "%", " ", "matche", "s", ".", "group", "(", "1", ")", " ", "in", " ", "tmp", "\\u", "dict", " ", "and", " ", "tmp", "\\u", "dict", "['", "nic", ".", "%", "s", ".", "dhcp", "\\u", "scope", ".0", "'", " ", "%", " ", "matche", "s", ".", "group", "(", "1", ")]", " ", "==", " ", "dhcp", "\\u", "scope", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "adapter", "\\u", "ids_", "._", "append_", "(_", "matches_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "adapter", "\\u", "ids_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "a_", "in_", "adapter", "\\u", "ids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "adapter", "\\u", "name_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mac", "\\u", "address_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "hostname_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "filename_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "domain", "\\u", "name_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ipv", "4", "\\u", "address_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "ipv", "4", "\\u", "address", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ipv", "4", "\\u", "address_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "ipv", "4", "\\u", "address", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "adapter", "\\u", "name_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "mac", "\\u", "address", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "mac", "\\u", "address_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "mac", "\\u", "address", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "host", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "hostname_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "host", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "filename", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "filename_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "filename", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "domain", "\\u", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "domain", "\\u", "name_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "domain", "\\u", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "final", "\\u", "list_", "._", "append_", "(_", "{_", "'", "system", "\\u", "host", "name", "'_", ":_", "system_", "._", "hostname_", ",_", "'", "ipv", "4", "\\u", "address", "'_", ":_", "ipv", "4", "\\u", "address_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "tmp", "\\u", "list", ".", "append", "(", "tmp", "\\u", "dict", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "final", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "key", "\\u", "type", "'_", "in_", "request_", "._", "GET_", "and_", "request_", "._", "GET_", "[_", "'", "key", "\\u", "type", "'_", "]_", "==_", "'", "key", "\\u", "by", "\\u", "system", "'_", ":_", "\\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 ", " ", "_", "hostname_", "=_", "request_", "._", "GET_", "._", "get_", "(_", "'", "host", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "request_", "._", "GET_", "._", "get_", "(_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "hostname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "objects_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key_", "=_", "key_", ",_", "obj_", "=_", "system_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "obj_", "in_", "objects_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "tmp_", "._", "append_", "(_", "{_", "'", "key", "'_", ":_", "obj_", "._", "key_", ",_", "'", "value", "'_", ":_", "obj_", "._", "value_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "\"", "json", " ", "=", " ", "{", "'", "data", "':", " ", "%", "s", "}\"_", "%_", "json_", "._", "dumps_", "(_", "tmp_", ")_", ")_", "\\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 ", " ", "_", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "error", "\\u", "message", "\":\"", "Una", "ble", " ", "to", " ", "find", " ", "Key", " ", "or", " ", "system", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "key", "\\u", "type_", "==_", "'", "adapter", "s", "\\u", "by", "\\u", "system", "\\u", "and", "\\u", "scope", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Get", " ", "keystore", "s", " ", "from", " ", "truth", " ", "tha", "t", " ", "have", " ", "dhcp", ".", "is", "\\u", "scope", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dhcp", "\\u", "scope_", "=_", "request_", "._", "GET_", "[_", "'", "dhcp", "\\u", "scope", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "request_", "._", "GET_", "[_", "'", "system", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keyval", "ue", "\\u", "pairs_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key", "\\u\\u", "startswith_", "=_", "'", "nic", ".'_", ")_", "._", "filter_", "(_", "obj_", "=_", "system_", ")_", "._", "order", "\\u", "by_", "(_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Iterat", "e", " ", "through", " ", "the", " ", "list", " ", "and", " ", "get", " ", "all", " ", "of", " ", "the", " ", "key", "/", "value", " ", "pairs_", "\\u\\u\\uNL\\u\\u\\u_", "tmp", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adapter", "\\u", "ids_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "final", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "kv_", "in_", "keyval", "ue", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tmp", "\\u", "dict_", "[_", "kv_", "._", "key_", "]_", "=_", "kv_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "k_", "in_", "tmp", "\\u", "dict_", "._", "iterkeys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "matches_", "=_", "re_", "._", "match_", "(_", "'", "nic", "\\\\.(", "\\\\", "d", "+)", ".*'_", ",_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "._", "group_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "scope", "\\u", "match_", "=_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "scope", ".0", "'_", "%_", "matches_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "\\u", "address", "\\u", "match_", "=_", "'", "nic", ".", "%", "s", ".", "ipv", "4", "\\u", "address", ".0", "'_", "%_", "matches_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "._", "group_", "(_", "1_", ")_", "not_", "in_", "adapter", "\\u", "ids_", "and_", "ip", "\\u", "address", "\\u", "match_", "in_", "tmp", "\\u", "dict_", "and_", "dhcp", "\\u", "scope", "\\u", "match_", "in_", "tmp", "\\u", "dict_", "and_", "tmp", "\\u", "dict_", "[_", "dhcp", "\\u", "scope", "\\u", "match_", "]_", "==_", "dhcp", "\\u", "scope_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "matche", "s", ".", "group", "(", "1", ")", " ", "not", " ", "in", " ", "adapter", "\\u", "ids", " ", "and", " ", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "scope", ".0", "'", " ", "%", " ", "matche", "s", ".", "group", "(", "1", ")", " ", "in", " ", "tmp", "\\u", "dict", " ", "and", " ", "tmp", "\\u", "dict", "['", "nic", ".", "%", "s", ".", "dhcp", "\\u", "scope", ".0", "'", " ", "%", " ", "matche", "s", ".", "group", "(", "1", ")]", " ", "==", " ", "dhcp", "\\u", "scope", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "adapter", "\\u", "ids_", "._", "append_", "(_", "matches_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "adapter", "\\u", "ids_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "a_", "in_", "adapter", "\\u", "ids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "adapter", "\\u", "name_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mac", "\\u", "address_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "hostname_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "filename_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "domain", "\\u", "name_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ipv", "4", "\\u", "address_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "servers_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "ipv", "4", "\\u", "address", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ipv", "4", "\\u", "address_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "ipv", "4", "\\u", "address", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "adapter", "\\u", "name_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "mac", "\\u", "address", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "mac", "\\u", "address_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "mac", "\\u", "address", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "host", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", "and_", "'", "nic", ".", "%", "s", ".", "option", "\\u", "host", "name", ".0", "'_", "%_", "a_", "not_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "hostname_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "host", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "option", "\\u", "host", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "hostname_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "option", "\\u", "host", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "filename", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "filename_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "filename", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "domain", "\\u", "name", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "domain", "\\u", "name_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "domain", "\\u", "name", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "server", "s", ".0", "'_", "%_", "a_", "in_", "tmp", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "servers_", "=_", "tmp", "\\u", "dict_", "[_", "'", "nic", ".", "%", "s", ".", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "server", "s", ".0", "'_", "%_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "final", "\\u", "list_", "._", "append_", "(_", "{_", "'", "system", "\\u", "host", "name", "'_", ":_", "system_", "._", "hostname_", ",_", "'", "ipv", "4", "\\u", "address", "'_", ":_", "ipv", "4", "\\u", "address_", ",_", "'", "adapter", "\\u", "name", "'_", ":_", "adapter", "\\u", "name_", ",_", "'", "mac", "\\u", "address", "'_", ":_", "mac", "\\u", "address_", ",_", "'", "option", "\\u", "host", "name", "'_", ":_", "dhcp", "\\u", "hostname_", ",_", "'", "dhcp", "\\u", "host", "name", "'_", ":_", "dhcp", "\\u", "hostname_", ",_", "'", "dhcp", "\\u", "filename", "'_", ":_", "dhcp", "\\u", "filename_", ",_", "'", "dhcp", "\\u", "domain", "\\u", "name", "'_", ":_", "dhcp", "\\u", "domain", "\\u", "name_", ",_", "'", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "server", "s", "'_", ":_", "dhcp", "\\u", "domain", "\\u", "name", "\\u", "servers_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "tmp", "\\u", "list", ".", "append", "(", "tmp", "\\u", "dict", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "final", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "key", "'_", "in_", "request_", "._", "GET_", "and_", "request_", "._", "GET_", "[_", "'", "key", "'_", "]_", ">_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp", "\\u", "list_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key_", "=_", "request_", "._", "GET_", "[_", "'", "key", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "matches_", "=_", "re_", "._", "match_", "(_", "\"\\\\", "$", "\\\\{", "(.*)", "\\\\}", "\"_", ",_", "row_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "m_", "=_", "Macro", "Expa", "nsion", "_", "(_", "matches_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "._", "value_", "=_", "m_", "._", "output_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "r_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "key", "\\u", "name_", "=_", "'", "host", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "r_", "._", "obj_", "._", "hostname_", ",_", "r_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "list_", "[_", "key", "\\u", "name_", "]_", "=_", "r_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\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 ", " _", "base_", "=_", "Tru", "th", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key_", "=_", "request_", "._", "GET_", "[_", "'", "key", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "matches_", "=_", "re_", "._", "match_", "(_", "\"\\\\", "$", "\\\\{", "(.*)", "\\\\}", "\"_", ",_", "row_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "m_", "=_", "Macro", "Expa", "nsion", "_", "(_", "matches_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "._", "value_", "=_", "m_", "._", "output_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "r_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "key", "\\u", "name_", "=_", "'", "truth", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "r_", "._", "truth_", "._", "name_", ",_", "r_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "list_", "[_", "key", "\\u", "name_", "]_", "=_", "r_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\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_", "return_", "tmp", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "value", "'_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp", "\\u", "list_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base_", "=_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "value_", "=_", "request_", "._", "GET_", "[_", "'", "value", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "matches_", "=_", "re_", "._", "match_", "(_", "\"\\\\", "$", "\\\\{", "(.*)", "\\\\}", "\"_", ",_", "row_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "m_", "=_", "Macro", "Expa", "nsion", "_", "(_", "matches_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "._", "value_", "=_", "m_", "._", "output_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "r_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "key", "\\u", "name_", "=_", "'", "host", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "r_", "._", "obj_", "._", "hostname_", ",_", "r_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "list_", "[_", "key", "\\u", "name_", "]_", "=_", "r_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\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 ", " _", "base_", "=_", "Tru", "th", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "value_", "=_", "request_", "._", "GET_", "[_", "'", "value", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "matches_", "=_", "re_", "._", "match_", "(_", "\"\\\\", "$", "\\\\{", "(.*)", "\\\\}", "\"_", ",_", "row_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matches_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "m_", "=_", "Macro", "Expa", "nsion", "_", "(_", "matches_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "._", "value_", "=_", "m_", "._", "output_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "r_", "in_", "base_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "key", "\\u", "name_", "=_", "'", "truth", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "r_", "._", "truth_", "._", "name_", ",_", "r_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "list_", "[_", "key", "\\u", "name_", "]_", "=_", "r_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\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_", "return_", "tmp", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Key", "Value", "Handler_", "(_", "Base", "Handler_", ")_", ":_", "\\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_", "delete_", "(_", "self_", ",_", "request_", ",_", "key", "\\u", "value", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "key", "\\u", "type", "'_", "in_", "request_", "._", "GET_", "and_", "request_", "._", "GET_", "[_", "'", "key", "\\u", "type", "'_", "]_", "==_", "'", "delete", "\\u", "all", "\\u", "network", "\\u", "adapter", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Get", " ", "keystore", "s", " ", "from", " ", "truth", " ", "tha", "t", " ", "have", " ", "dhcp", ".", "is", "\\u", "scope", " ", "=", " ", "True_", "\\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 ", " _", "system", "\\u", "hostname_", "=_", "request_", "._", "GET_", "[_", "'", "system", "\\u", "host", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "system", "\\u", "hostname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key", "\\u\\u", "startswith_", "=_", "'", "nic", "'_", ",_", "obj_", "=_", "system_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":\"", "0", "\"}'_", ")_", "\\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 ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "error", "\\u", "message", "\":\"", "Una", "ble", " ", "to", " ", "Delete", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "key", "\\u", "type", "'_", "in_", "request_", "._", "GET_", "and_", "request_", "._", "GET_", "[_", "'", "key", "\\u", "type", "'_", "]_", "==_", "'", "delete", "\\u", "network", "\\u", "adapter", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Get", " ", "keystore", "s", " ", "from", " ", "truth", " ", "tha", "t", " ", "have", " ", "dhcp", ".", "is", "\\u", "scope", " ", "=", " ", "True_", "\\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 ", " _", "adapter", "\\u", "number_", "=_", "request_", "._", "GET_", "[_", "'", "adapter", "\\u", "number", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system", "\\u", "hostname_", "=_", "request_", "._", "GET_", "[_", "'", "system", "\\u", "host", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "system", "\\u", "hostname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key", "\\u\\u", "startswith_", "=_", "'", "nic", ".", "%", "s", "'_", "%_", "adapter", "\\u", "number_", ",_", "obj_", "=_", "system_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Key", "Value", ".", "object", "s", ".", "filter", "(", "key", "\\u\\u", "startswith", "='", "nic", ".0", "',", " ", "system", "=", "system", ").", "delete", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":\"", "14", "\"}'_", ")_", "\\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 ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "error", "\\u", "message", "\":\"", "Una", "ble", " ", "to", " ", "Delete", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "key", "\\u", "type", "'_", "in_", "request_", "._", "GET_", "and_", "request_", "._", "GET_", "[_", "'", "key", "\\u", "type", "'_", "]_", "==_", "'", "delete", "\\u", "key", "\\u", "by", "\\u", "system", "'_", ":_", "\\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 ", " _", "system", "\\u", "hostname_", "=_", "request_", "._", "GET_", "._", "get_", "(_", "'", "system", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "request_", "._", "GET_", "._", "get_", "(_", "'", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "system_", "=_", "System_", "._", "objects_", "._", "get_", "(_", "hostname_", "=_", "system", "\\u", "hostname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "key_", "=_", "key_", ",_", "obj_", "=_", "system_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":\"", "14", "\"}'_", ")_", "\\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 ", " _", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "error", "\\u", "message", "\":\"", "Una", "ble", " ", "to", " ", "Delete", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "key", "\\u", "type", "'_", "not_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "system", "\\u", "id", "'_", "in_", "request_", "._", "GET_", ":_", "\\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 ", " ", "_", "n_", "=_", "Key", "Value_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "key", "\\u", "value", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":\"", "%", "s", "\"}'_", "%_", "str_", "(_", "key", "\\u", "value", "\\u", "id_", ")_", ")_", "\\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 ", " ", "_", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "truth", "\\u", "id", "'_", "in_", "request_", "._", "GET_", ":_", "\\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 ", " ", "_", "n_", "=_", "Tru", "th", "Key", "Value_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "key", "\\u", "value", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":\"", "%", "s", "\"}'_", "%_", "str_", "(_", "key", "\\u", "value", "\\u", "id_", ")_", ")_", "\\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 ", " ", "_", "resp_", "=_", "rc_", "._", "NOT", "\\u", "FOUND_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resp_", "=_", "rc_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "write_", "(_", "'", "json", " ", "=", " ", "{", "\"", "id", "\":\"", "1", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "resp_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 ]
Unused local variable
sahana/eden/controllers/doc.py
[ { "content": "def upload_bulk():\n \"\"\"\n Receive the Uploaded data from bulk_upload()\n\n https://github.com/valums/file-uploader/blob/master/server/readme.txt\n\n @ToDo: Read EXIF headers to geolocate the Photos\n \"\"\"\n\n tablename = \"doc_image\"\n table = s3db[tablename]\n\n import cgi\n\n source = request.post_vars.get(\"qqfile\", None)\n if isinstance(source, cgi.FieldStorage) and source.filename:\n # For IE6-8, Opera, older versions of other browsers you get the file as you normally do with regular form-base uploads.\n name = source.filename\n image = source.file\n\n else:\n # For browsers which upload file with progress bar, you will need to get the raw post data and write it to the file.\n if \"name\" in request.vars:\n name = request.vars.name\n else:\n HTTP(400, \"Invalid Request: Need a Name!\")\n\n image = request.body.read()\n # Convert to StringIO for onvalidation/import\n import cStringIO\n image = cStringIO.StringIO(image)\n source = Storage()\n source.filename = name\n source.file = image\n\n form = SQLFORM(table)\n vars = Storage()\n vars.name = name\n vars.image = source\n vars._formname = \"%s_create\" % tablename\n\n # onvalidation callback\n onvalidation = s3db.get_config(tablename, \"create_onvalidation\",\n s3db.get_config(tablename, \"onvalidation\"))\n\n if form.accepts(vars, onvalidation=onvalidation):\n msg = Storage(success = True)\n # onaccept callback\n onaccept = s3db.get_config(tablename, \"create_onaccept\",\n s3db.get_config(tablename, \"onaccept\"))\n from gluon.tools import callback\n callback(onaccept, form, tablename=tablename)\n else:\n error_msg = \"\"\n for error in form.errors:\n error_msg = \"%s\\n%s:%s\" % (error_msg, error, form.errors[error])\n msg = Storage(error = error_msg)\n\n response.headers[\"Content-Type\"] = \"text/html\" # This is what the file-uploader widget expects\n return json.dumps(msg)", "metadata": "root.upload_bulk", "header": "['module', '___EOS___']", "index": 148 }, { "content": "def ck_upload():\n \"\"\"\n Controller to handle uploads to CKEditor\n\n Based on https://github.com/timrichardson/web2py_ckeditor4\n \"\"\"\n\n upload = request.vars.upload\n\n if upload is None:\n raise HTTP(401, \"Missing required upload.\")\n\n if not hasattr(upload, \"file\"):\n raise HTTP(401, \"Upload is not proper type.\")\n\n path = os.path.join(request.folder, \"uploads\")\n\n # Load Model\n table = s3db.doc_ckeditor\n\n form = SQLFORM.factory(Field(\"upload\", \"upload\",\n requires = IS_NOT_EMPTY(),\n #uploadfs = self.settings.uploadfs,\n uploadfolder = path,\n ),\n table_name = \"doc_ckeditor\",\n )\n\n old_filename = upload.filename\n new_filename = table.upload.store(upload.file,\n upload.filename)\n #if self.settings.uploadfs:\n # length = self.settings.uploadfs.getsize(new_filename)\n #else:\n length = os.path.getsize(os.path.join(path, new_filename))\n\n mime_type = upload.headers[\"content-type\"]\n\n title = os.path.splitext(old_filename)[0]\n\n result = table.validate_and_insert(\n title=title,\n filename=old_filename,\n upload=new_filename,\n flength=length,\n mime_type=mime_type\n )\n\n if result.id:\n text = \"\"\n else:\n text = result.errors\n\n url = URL(c=\"default\", f=\"download\",\n args=[new_filename])\n\n return dict(text=text, cknum=request.vars.CKEditorFuncNum, url=url)", "metadata": "root.ck_upload", "header": "['module', '___EOS___']", "index": 216 } ]
[ { "span": "image ", "start_line": 166, "start_column": 8, "end_line": 166, "end_column": 13 }, { "span": "form ", "start_line": 236, "start_column": 4, "end_line": 236, "end_column": 8 } ]
[]
1
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_", "def_", "upload", "\\u", "bulk_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Receive", " ", "the", " ", "Upload", "ed", " ", "data", " ", "from", " ", "bul", "k", "\\u", "upload", "()", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "https", "://", "git", "hub", ".", "com", "/", "valu", "ms", "/", "file", "-", "uploade", "r", "/", "blob", "/", "master", "/", "server", "/", "readme", ".", "txt", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "To", "Do", ":", " ", "Read", " ", "EX", "IF", " ", "header", "s", " ", "to", " ", "geoloca", "te", " ", "the", " ", "Photos", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tablename_", "=_", "\"", "doc", "\\u", "image", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "=_", "s3db_", "[_", "tablename_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "cgi_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "source_", "=_", "request_", "._", "post", "\\u", "vars_", "._", "get_", "(_", "\"", "qq", "file", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "source_", ",_", "cgi_", "._", "Field", "Storage_", ")_", "and_", "source_", "._", "filename_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "For", " ", "IE", "6", "-", "8", ",", " ", "Opera", ",", " ", "older", " ", "version", "s", " ", "of", " ", "other", " ", "browsers", " ", "you", " ", "get", " ", "the", " ", "file", " ", "as", " ", "you", " ", "normal", "ly", " ", "do", " ", "with", " ", "regular", " ", "form", "-", "base", " ", "uploads", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "source_", "._", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image_", "=_", "source_", "._", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "For", " ", "browsers", " ", "whi", "ch", " ", "upload", " ", "file", " ", "with", " ", "progress", " ", "bar", ",", " ", "you", " ", "will", " ", "need", " ", "to", " ", "get", " ", "the", " ", "raw", " ", "post", " ", "data", " ", "and", " ", "write", " ", "it", " ", "to", " ", "the", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\"", "name", "\"_", "in_", "request_", "._", "vars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "request_", "._", "vars_", "._", "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 ", " _", "HTTP_", "(_", "400_", ",_", "\"", "Inva", "lid", " ", "Request", ":", " ", "Ne", "ed", " ", "a", " ", "Name", "!\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "image_", "=_", "request_", "._", "body_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Convert", " ", "to", " ", "String", "IO", " ", "for", " ", "onv", "alid", "ation", "/", "import_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "c", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image_", "=_", "c", "String", "IO_", "._", "String", "IO_", "(_", "image_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "=_", "Storage_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "._", "filename_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "._", "file_", "=_", "image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "form_", "=_", "SQL", "FORM", "_", "(_", "table_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vars_", "=_", "Storage_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vars_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vars_", "._", "image_", "=_", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vars_", "._", "\\u", "form", "name_", "=_", "\"%", "s", "\\u", "create", "\"_", "%_", "tablename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "onv", "alid", "ation", " ", "callback_", "\\u\\u\\uNL\\u\\u\\u_", "onv", "alid", "ation_", "=_", "s3db_", "._", "get", "\\u", "config_", "(_", "tablename_", ",_", "\"", "create", "\\u", "onv", "alid", "ation", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s3db_", "._", "get", "\\u", "config_", "(_", "tablename_", ",_", "\"", "onv", "alid", "ation", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "form_", "._", "accepts", "_", "(_", "vars_", ",_", "onv", "alid", "ation_", "=_", "onv", "alid", "ation_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "Storage_", "(_", "success_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "onac", "cept", " ", "callback_", "\\u\\u\\uNL\\u\\u\\u_", "onac", "cept", "_", "=_", "s3db_", "._", "get", "\\u", "config_", "(_", "tablename_", ",_", "\"", "create", "\\u", "onac", "cept", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s3db_", "._", "get", "\\u", "config_", "(_", "tablename_", ",_", "\"", "onac", "cept", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gluon_", "._", "tools_", "import_", "callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "callback_", "(_", "onac", "cept", "_", ",_", "form_", ",_", "tablename_", "=_", "tablename_", ")_", "\\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 ", " _", "error", "\\u", "msg_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "error_", "in_", "form_", "._", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error", "\\u", "msg_", "=_", "\"%", "s", "\\\\", "n", "%", "s", ":", "%", "s", "\"_", "%_", "(_", "error", "\\u", "msg_", ",_", "error_", ",_", "form_", "._", "errors_", "[_", "error_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "Storage_", "(_", "error_", "=_", "error", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "._", "headers_", "[_", "\"", "Conten", "t", "-", "Type", "\"_", "]_", "=_", "\"", "text", "/", "html", "\"_", "#", " ", "Thi", "s", " ", "is", " ", "what", " ", "the", " ", "file", "-", "uploade", "r", " ", "widget", " ", "expect", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "json_", "._", "dumps_", "(_", "msg_", ")_", "\\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_", "ck", "\\u", "upload_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Controlle", "r", " ", "to", " ", "handle", " ", "uploads", " ", "to", " ", "CK", "Edit", "or", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Base", "d", " ", "on", " ", "https", "://", "git", "hub", ".", "com", "/", "tim", "rich", "ards", "on", "/", "web", "2py", "\\u", "cked", "itor", "4", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "upload_", "=_", "request_", "._", "vars_", "._", "upload_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "upload_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "HTTP_", "(_", "401_", ",_", "\"", "Missing", " ", "require", "d", " ", "upload", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "hasattr_", "(_", "upload_", ",_", "\"", "file", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "HTTP_", "(_", "401_", ",_", "\"", "Upload", " ", "is", " ", "not", " ", "proper", " ", "type", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "request_", "._", "folder_", ",_", "\"", "uploads", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Load", " ", "Model_", "\\u\\u\\uNL\\u\\u\\u_", "table_", "=_", "s3db_", "._", "doc", "\\u", "cked", "itor", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "form_", "=_", "SQL", "FORM", "_", "._", "factory_", "(_", "Field_", "(_", "\"", "upload", "\"_", ",_", "\"", "upload", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "requires_", "=_", "IS", "\\u", "NOT", "\\u", "EMPTY_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", "upload", "fs", " ", "=", " ", "self", ".", "settings", ".", "upload", "fs", ",_", "\\u\\u\\uNL\\u\\u\\u_", "upload", "folder_", "=_", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "table", "\\u", "name_", "=_", "\"", "doc", "\\u", "cked", "itor", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "old", "\\u", "filename_", "=_", "upload_", "._", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "filename_", "=_", "table_", "._", "upload_", "._", "store_", "(_", "upload_", "._", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "upload_", "._", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "self", ".", "settings", ".", "upload", "fs", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "length", " ", "=", " ", "self", ".", "settings", ".", "upload", "fs", ".", "gets", "ize", "(", "new", "\\u", "filename", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "length_", "=_", "os_", "._", "path_", "._", "getsize_", "(_", "os_", "._", "path_", "._", "join_", "(_", "path_", ",_", "new", "\\u", "filename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mime", "\\u", "type_", "=_", "upload_", "._", "headers_", "[_", "\"", "content", "-", "type", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "os_", "._", "path_", "._", "splitext_", "(_", "old", "\\u", "filename_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "table_", "._", "validat", "e\\u", "and", "\\u", "insert_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "title_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filename_", "=_", "old", "\\u", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "upload_", "=_", "new", "\\u", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fle", "ngt", "h_", "=_", "length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mime", "\\u", "type_", "=_", "mime", "\\u", "type_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "result_", "._", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "\"\"_", "\\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 ", " _", "text_", "=_", "result_", "._", "errors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "url_", "=_", "URL_", "(_", "c_", "=_", "\"", "default", "\"_", ",_", "f_", "=_", "\"", "download", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "new", "\\u", "filename_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "dict_", "(_", "text_", "=_", "text_", ",_", "ck", "num_", "=_", "request_", "._", "vars_", "._", "CK", "Edit", "or", "Func", "Num_", ",_", "url_", "=_", "url_", ")_", "\\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, 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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 ]
Unused import
open-cloud/xos/xos/synchronizers/base/steps/sync_roles.py
[ { "content": "import os\nimport base64\nfrom django.db.models import F, Q\nfrom xos.config import Config\nfrom synchronizers.base.openstacksyncstep import OpenStackSyncStep\nfrom core.models.role import Role\nfrom core.models.site import SiteRole, Controller, ControllerRole\nfrom core.models.slice import SliceRole\nfrom xos.logger import observer_logger as logger\n\n \n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class SyncRoles(OpenStackSyncStep):\n provides=[Role]\n requested_interval=0\n observes=[SiteRole,SliceRole,ControllerRole]\n", "metadata": "root.SyncRoles", "header": "['module', '___EOS___']", "index": 10 }, { "content": " def sync_record(self, role):\n if not role.enacted:\n controllers = Controller.objects.all()\n \t for controller in controllers:\n driver = self.driver.admin_driver(controller=controller)\n driver.create_role(role.role)\n role.save()", "metadata": "root.SyncRoles.sync_record", "header": "['class', 'SyncRoles', '(', 'OpenStackSyncStep', ')', ':', '___EOS___']", "index": 15 } ]
[ { "span": "import os", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 9 }, { "span": "import base64", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 13 }, { "span": "from django.db.models import F, Q", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 33 }, { "span": "from xos.config import Config", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 29 }, { "span": "from xos.logger import observer_logger as logger", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 48 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "base64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "import_", "F_", ",_", "Q_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "xo", "s_", "._", "config_", "import_", "Config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "synchronize", "rs_", "._", "base_", "._", "openst", "ack", "sync", "step_", "import_", "Open", "Stack", "Sync", "Step_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "models_", "._", "role_", "import_", "Role_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "models_", "._", "site_", "import_", "Site", "Role_", ",_", "Controller_", ",_", "Controlle", "r", "Role_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "models_", "._", "slice_", "import_", "Slice", "Role_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "xo", "s_", "._", "logger_", "import_", "observer", "\\u", "logger_", "as_", "logger_", "\\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_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Sync", "Roles_", "(_", "Open", "Stack", "Sync", "Step_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "provides_", "=_", "[_", "Role_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request", "ed", "\\u", "interval_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "observe", "s_", "=_", "[_", "Site", "Role_", ",_", "Slice", "Role_", ",_", "Controlle", "r", "Role_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Sync", "Roles_", "(_", "Open", "Stack", "Sync", "Step_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "sync", "\\u", "record_", "(_", "self_", ",_", "role_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "role_", "._", "ena", "cte", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "controllers_", "=_", "Controller_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "controller_", "in_", "controllers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "driver_", "=_", "self_", "._", "driver_", "._", "admin", "\\u", "driver_", "(_", "controller_", "=_", "controller_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "driver_", "._", "create", "\\u", "role_", "(_", "role_", "._", "role_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "role_", "._", "save_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 0, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 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 ]
Unreachable code
iovisor/bcc/tools/filelife.py
[ { "content": "#!/usr/bin/python\n# @lint-avoid-python-3-compatibility-imports\n#\n# filelife Trace the lifespan of short-lived files.\n# For Linux, uses BCC, eBPF. Embedded C.\n#\n# This traces the creation and deletion of files, providing information\n# on who deleted the file, the file age, and the file name. The intent is to\n# provide information on short-lived files, for debugging or performance\n# analysis.\n#\n# USAGE: filelife [-h] [-p PID]\n#\n# Copyright 2016 Netflix, Inc.\n# Licensed under the Apache License, Version 2.0 (the \"License\")\n#\n# 08-Feb-2015 Brendan Gregg Created this.\n# 17-Feb-2016 Allan McAleavy updated for BPF_PERF_OUTPUT\n\nfrom __future__ import print_function\nfrom bcc import BPF\nimport argparse\nfrom time import strftime\nimport ctypes as ct\n\n# arguments\nexamples = \"\"\"examples:\n ./filelife # trace all stat() syscalls\n ./filelife -p 181 # only trace PID 181\n\"\"\"\nparser = argparse.ArgumentParser(\n description=\"Trace stat() syscalls\",\n formatter_class=argparse.RawDescriptionHelpFormatter,\n epilog=examples)\nparser.add_argument(\"-p\", \"--pid\",\n help=\"trace this PID only\")\nargs = parser.parse_args()\ndebug = 0\n\n# define BPF program\nbpf_text = \"\"\"\n#include <uapi/linux/ptrace.h>\n#include <linux/fs.h>\n#include <linux/sched.h>\n\nstruct data_t {\n u32 pid;\n u64 delta;\n char comm[TASK_COMM_LEN];\n char fname[DNAME_INLINE_LEN];\n};\n\nBPF_HASH(birth, struct dentry *);\nBPF_PERF_OUTPUT(events);\n\n// trace file creation time\nint trace_create(struct pt_regs *ctx, struct inode *dir, struct dentry *dentry)\n{\n u32 pid = bpf_get_current_pid_tgid();\n FILTER\n\n u64 ts = bpf_ktime_get_ns();\n birth.update(&dentry, &ts);\n\n return 0;\n};\n\n// trace file deletion and output details\nint trace_unlink(struct pt_regs *ctx, struct inode *dir, struct dentry *dentry)\n{\n struct data_t data = {};\n u32 pid = bpf_get_current_pid_tgid();\n\n FILTER\n\n u64 *tsp, delta;\n tsp = birth.lookup(&dentry);\n if (tsp == 0) {\n return 0; // missed create\n }\n\n delta = (bpf_ktime_get_ns() - *tsp) / 1000000;\n birth.delete(&dentry);\n\n if (dentry->d_iname[0] == 0)\n return 0;\n\n if (bpf_get_current_comm(&data.comm, sizeof(data.comm)) == 0) {\n data.pid = pid;\n data.delta = delta;\n bpf_probe_read(&data.fname, sizeof(data.fname), dentry->d_iname);\n }\n\n events.perf_submit(ctx, &data, sizeof(data));\n\n return 0;\n}\n\"\"\"\n\nTASK_COMM_LEN = 16 # linux/sched.h\nDNAME_INLINE_LEN = 255 # linux/dcache.h\n\n\nif args.pid:\n bpf_text = bpf_text.replace('FILTER',\n 'if (pid != %s) { return 0; }' % args.pid)\nelse:\n bpf_text = bpf_text.replace('FILTER', '')\nif debug:\n print(bpf_text)\n\n# initialize BPF\nb = BPF(text=bpf_text)\nb.attach_kprobe(event=\"vfs_create\", fn_name=\"trace_create\")\nb.attach_kprobe(event=\"vfs_unlink\", fn_name=\"trace_unlink\")\n\n# header\nprint(\"%-8s %-6s %-16s %-7s %s\" % (\"TIME\", \"PID\", \"COMM\", \"AGE(s)\", \"FILE\"))\n\n# process event\n\nb[\"events\"].open_perf_buffer(print_event)\nwhile 1:\n b.kprobe_poll()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "print(bpf_text)", "start_line": 116, "start_column": 4, "end_line": 116, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "@", "lint", "-", "avoid", "-", "python", "-", "3", "-", "compatibility", "-", "imports_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fileli", "fe", " ", " ", " ", " ", "Trace", " ", "the", " ", "life", "span", " ", "of", " ", "short", "-", "live", "d", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "For", " ", "Lin", "ux", ",", " ", "use", "s", " ", "BC", "C", ",", " ", "e", "BP", "F", ".", " ", "Emb", "edd", "ed", " ", "C", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "trace", "s", " ", "the", " ", "creati", "on", " ", "and", " ", "deletion", " ", "of", " ", "files", ",", " ", "provi", "ding", " ", "information_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "on", " ", "who", " ", "delete", "d", " ", "the", " ", "file", ",", " ", "the", " ", "file", " ", "age", ",", " ", "and", " ", "the", " ", "file", " ", "name", ".", " ", "The", " ", "intent", " ", "is", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "provide", " ", "informati", "on", " ", "on", " ", "short", "-", "live", "d", " ", "files", ",", " ", "for", " ", "debugg", "ing", " ", "or", " ", "performance_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "analys", "is", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "USAGE", ":", " ", "fileli", "fe", " ", "[-", "h", "]", " ", "[-", "p", " ", "PID", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2016", " ", "Net", "fli", "x", ",", " ", "Inc", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "0", "8", "-", "Fe", "b", "-", "201", "5", " ", " ", " ", "Bre", "ndan", " ", "Gre", "gg", " ", " ", " ", "Creat", "ed", " ", "this", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1", "7", "-", "Fe", "b", "-", "2016", " ", " ", " ", "All", "an", " ", "Mc", "Ale", "av", "y", " ", "update", "d", " ", "for", " ", "BP", "F", "\\u", "PERF", "\\u", "OUTPUT_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bcc", "_", "import_", "BP", "F_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "time_", "import_", "strftime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ctypes_", "as_", "ct_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "arguments_", "\\u\\u\\uNL\\u\\u\\u_", "examples_", "=_", "\"\"\"", "example", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "./", "fileli", "fe", " ", " ", " ", "#", " ", "trace", " ", "all", " ", "stat", "()", " ", "syscall", "s", "\\", "10", ";", " ", " ", " ", " ", "./", "fileli", "fe", " ", "-", "p", " ", "181", " ", " ", " ", " ", "#", " ", "only", " ", "trace", " ", "PID", " ", "181", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "\"", "Trace", " ", "stat", "()", " ", "syscall", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "formatter", "\\u", "class_", "=_", "argparse_", "._", "Ra", "w", "Descripti", "on", "Help", "Formatter_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "epilog_", "=_", "examples_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\"-", "p", "\"_", ",_", "\"--", "pid", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "trace", " ", "this", " ", "PID", " ", "only", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "debug_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "defin", "e", " ", "BP", "F", " ", "program_", "\\u\\u\\uNL\\u\\u\\u_", "bpf", "\\u", "text_", "=_", "\"\"\"", "\\", "10", ";", "#", "include", " ", "<", "ua", "pi", "/", "linux", "/", "ptr", "ace", ".", "h", ">", "\\", "10", ";", "#", "include", " ", "<", "linux", "/", "fs", ".", "h", ">", "\\", "10", ";", "#", "include", " ", "<", "linux", "/", "sched", ".", "h", ">", "\\", "10", ";", "\\", "10", ";", "struct", " ", "data\\u", "t", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "u32", " ", "pid", ";", "\\", "10", ";", " ", " ", " ", " ", "u", "64", " ", "delta", ";", "\\", "10", ";", " ", " ", " ", " ", "char", " ", "comm", "[", "TASK", "\\u", "COMM", "\\u", "LEN", "];", "\\", "10", ";", " ", " ", " ", " ", "char", " ", "fname", "[", "DNA", "ME", "\\u", "IN", "LINE", "\\u", "LEN", "];", "\\", "10", ";}", ";", "\\", "10", ";", "\\", "10", ";", "BP", "F", "\\u", "HAS", "H", "(", "birth", ",", " ", "struct", " ", "dent", "ry", " ", "*)", ";", "\\", "10", ";", "BP", "F", "\\u", "PERF", "\\u", "OUTPU", "T", "(", "events", ");", "\\", "10", ";", "\\", "10", ";", "//", " ", "trace", " ", "file", " ", "creati", "on", " ", "time", "\\", "10", ";", "int", " ", "trace", "\\u", "create", "(", "struct", " ", "pt", "\\u", "regs", " ", "*", "ctx", ",", " ", "struct", " ", "inode", " ", "*", "dir", ",", " ", "struct", " ", "dent", "ry", " ", "*", "dent", "ry", ")", "\\", "10", ";", "{", "\\", "10", ";", " ", " ", " ", " ", "u32", " ", "pid", " ", "=", " ", "bpf", "\\u", "get", "\\u", "current", "\\u", "pid", "\\u", "tg", "id", "();", "\\", "10", ";", " ", " ", " ", " ", "FILTER", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "u", "64", " ", "ts", " ", "=", " ", "bpf", "\\u", "kti", "me", "\\u", "get", "\\u", "ns", "();", "\\", "10", ";", " ", " ", " ", " ", "birth", ".", "update", "(", "&", "dent", "ry", ",", " ", "&", "ts", ");", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "0", ";", "\\", "10", ";}", ";", "\\", "10", ";", "\\", "10", ";", "//", " ", "trace", " ", "file", " ", "deletion", " ", "and", " ", "output", " ", "deta", "il", "s", "\\", "10", ";", "int", " ", "trace", "\\u", "unlink", "(", "struct", " ", "pt", "\\u", "regs", " ", "*", "ctx", ",", " ", "struct", " ", "inode", " ", "*", "dir", ",", " ", "struct", " ", "dent", "ry", " ", "*", "dent", "ry", ")", "\\", "10", ";", "{", "\\", "10", ";", " ", " ", " ", " ", "struct", " ", "data\\u", "t", " ", "data", " ", "=", " ", "{};", "\\", "10", ";", " ", " ", " ", " ", "u32", " ", "pid", " ", "=", " ", "bpf", "\\u", "get", "\\u", "current", "\\u", "pid", "\\u", "tg", "id", "();", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "FILTER", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "u", "64", " ", "*", "tsp", ",", " ", "delta", ";", "\\", "10", ";", " ", " ", " ", " ", "tsp", " ", "=", " ", "birth", ".", "look", "up", "(", "&", "dent", "ry", ");", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "(", "tsp", " ", "==", " ", "0", ")", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "0", ";", " ", " ", " ", "//", " ", "missed", " ", "create", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "delta", " ", "=", " ", "(", "bpf", "\\u", "kti", "me", "\\u", "get", "\\u", "ns", "()", " ", "-", " ", "*", "tsp", ")", " ", "/", " ", "1000000", ";", "\\", "10", ";", " ", " ", " ", " ", "birth", ".", "delete", "(", "&", "dent", "ry", ");", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "(", "dent", "ry", "->", "d\\u", "iname", "[", "0", "]", " ", "==", " ", "0", ")", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "0", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "(", "bpf", "\\u", "get", "\\u", "current", "\\u", "comm", "(", "&", "data", ".", "comm", ",", " ", "size", "of", "(", "data", ".", "comm", "))", " ", "==", " ", "0", ")", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "data", ".", "pid", " ", "=", " ", "pid", ";", "\\", "10", ";", " ", " ", " ", " ", "data", ".", "delta", " ", "=", " ", "delta", ";", "\\", "10", ";", " ", " ", " ", " ", "bpf", "\\u", "prob", "e\\u", "read", "(", "&", "data", ".", "fname", ",", " ", "size", "of", "(", "data", ".", "fname", "),", " ", "dent", "ry", "->", "d\\u", "iname", ");", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "events", ".", "perf", "\\u", "submit", "(", "ctx", ",", " ", "&", "data", ",", " ", "size", "of", "(", "data", "))", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "0", ";", "\\", "10", ";}", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TASK", "\\u", "COMM", "\\u", "LEN_", "=_", "16_", "#", " ", "linux", "/", "sched", ".", "h_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DNA", "ME", "\\u", "IN", "LINE", "\\u", "LEN_", "=_", "255_", "#", " ", "linux", "/", "dca", "che", ".", "h_", "\\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_", "args_", "._", "pid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bpf", "\\u", "text_", "=_", "bpf", "\\u", "text_", "._", "replace_", "(_", "'", "FILTER", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "if", " ", "(", "pid", " ", "!=", " ", "%", "s", ")", " ", "{", " ", "return", " ", "0", ";", " ", "}'_", "%_", "args_", "._", "pid_", ")_", "\\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 ", " _", "bpf", "\\u", "text_", "=_", "bpf", "\\u", "text_", "._", "replace_", "(_", "'", "FILTER", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "bpf", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "initialize", " ", "BP", "F_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "b_", "=_", "BP", "F_", "(_", "text_", "=_", "bpf", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "attach", "\\u", "kp", "robe", "_", "(_", "event_", "=_", "\"", "vf", "s", "\\u", "create", "\"_", ",_", "fn", "\\u", "name_", "=_", "\"", "trace", "\\u", "create", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "attach", "\\u", "kp", "robe", "_", "(_", "event_", "=_", "\"", "vf", "s", "\\u", "unlink", "\"_", ",_", "fn", "\\u", "name_", "=_", "\"", "trace", "\\u", "unlink", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "header_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"%", "-", "8s", " ", "%", "-", "6", "s", " ", "%", "-1", "6", "s", " ", "%", "-", "7", "s", " ", "%", "s", "\"_", "%_", "(_", "\"", "TIME", "\"_", ",_", "\"", "PID", "\"_", ",_", "\"", "COMM", "\"_", ",_", "\"", "AGE", "(", "s", ")\"_", ",_", "\"", "FILE", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "process", " ", "event_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "b_", "[_", "\"", "events", "\"_", "]_", "._", "open", "\\u", "perf", "\\u", "buffer_", "(_", "print", "\\u", "event_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "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, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
Pylons/pylons/tests/test_units/test_decorator_jsonify.py
[ { "content": "def make_cache_controller_app():\n from pylons.testutil import ControllerWrap, SetupCacheGlobal\n from pylons.decorators import jsonify\n from pylons.controllers import WSGIController\n \n class CacheController(WSGIController):\n\n @jsonify\n def test_bad_json(self):\n return [\"this is neat\"]\n\n @jsonify\n def test_bad_json2(self):\n return (\"this is neat\",)\n \n @jsonify\n def test_good_json(self):\n return dict(fred=42)\n\n environ = {}\n app = ControllerWrap(CacheController)\n app = sap = SetupCacheGlobal(app, environ)\n app = RegistryManager(app)\n app = TestApp(app)\n return app, environ", "metadata": "root.make_cache_controller_app", "header": "['module', '___EOS___']", "index": 7 }, { "content": " def test_bad_json(self):\n for action in 'test_bad_json', 'test_bad_json2':\n try:\n response = self.get_response(action=action)\n except Warning, msg:\n assert 'JSON responses with Array envelopes are' in msg[0]", "metadata": "root.TestJsonifyDecorator.test_bad_json", "header": "['class', 'TestJsonifyDecorator', '(', 'TestWSGIController', ')', ':', '___EOS___']", "index": 44 } ]
[ { "span": "sap ", "start_line": 28, "start_column": 10, "end_line": 28, "end_column": 13 }, { "span": "response ", "start_line": 47, "start_column": 16, "end_line": 47, "end_column": 24 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "make", "\\u", "cache", "\\u", "controlle", "r", "\\u", "app_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "pylon", "s_", "._", "testu", "til_", "import_", "Controlle", "r", "Wrap_", ",_", "Set", "up", "Cache", "Global_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pylon", "s_", "._", "decorators_", "import_", "jsonify_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pylon", "s_", "._", "controllers_", "import_", "WS", "GI", "Controller_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Cache", "Controller_", "(_", "WS", "GI", "Controller_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "jsonify_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "bad", "\\u", "json_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "\"", "this", " ", "is", " ", "nea", "t", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "jsonify_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "bad", "\\u", "json", "2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "\"", "this", " ", "is", " ", "nea", "t", "\"_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "jsonify_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "good", "\\u", "json_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "dict_", "(_", "fre", "d_", "=_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "environ_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "=_", "Controlle", "r", "Wrap_", "(_", "Cache", "Controller_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "=_", "sap", "_", "=_", "Set", "up", "Cache", "Global_", "(_", "app_", ",_", "environ_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "=_", "Regi", "stry", "Manager_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "=_", "Test", "App_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "app_", ",_", "environ_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Js", "oni", "fy", "Decorator_", "(_", "Test", "WS", "GI", "Controller_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "bad", "\\u", "json_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "action_", "in_", "'", "test\\u", "bad", "\\u", "json", "'_", ",_", "'", "test\\u", "bad", "\\u", "json", "2", "'_", ":_", "\\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 ", " _", "response_", "=_", "self_", "._", "get", "\\u", "response_", "(_", "action_", "=_", "action_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Warning_", ",_", "msg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "'", "JSO", "N", " ", "response", "s", " ", "with", " ", "Array", " ", "envelop", "es", " ", "are", "'_", "in_", "msg_", "[_", "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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Incomplete ordering
google/grr/grr/lib/rdfvalue.py
[ { "content": "class RDFBytes(RDFValue):\n \"\"\"An attribute which holds bytes.\"\"\"\n data_store_type = \"bytes\"\n\n _value = \"\"\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.RDFBytes", "header": "['module', '___EOS___']", "index": 200 }, { "content": " def ParseFromString(self, string):\n # TODO(user): this needs some more test coverage, particularly around\n # submitting unicode strings and byte literals in the UI forms.\n if isinstance(string, unicode):\n self._value = utils.SmartStr(string)\n else:\n self._value = string", "metadata": "root.RDFBytes.ParseFromString", "header": "['class', 'RDFBytes', '(', 'RDFValue', ')', ':', '___EOS___']", "index": 206 }, { "content": " def SerializeToString(self):\n return self._value", "metadata": "root.RDFBytes.SerializeToString", "header": "['class', 'RDFBytes', '(', 'RDFValue', ')', ':', '___EOS___']", "index": 214 }, { "content": " def __str__(self):\n return utils.SmartStr(self._value)", "metadata": "root.RDFBytes.__str__", "header": "['class', 'RDFBytes', '(', 'RDFValue', ')', ':', '___EOS___']", "index": 217 }, { "content": " def __lt__(self, other):\n if isinstance(other, self.__class__):\n return self._value < other._value # pylint: disable=protected-access\n else:\n return self._value < other", "metadata": "root.RDFBytes.__lt__", "header": "['class', 'RDFBytes', '(', 'RDFValue', ')', ':', '___EOS___']", "index": 220 }, { "content": " def __gt__(self, other):\n if isinstance(other, self.__class__):\n return self._value > other._value # pylint: disable=protected-access\n else:\n return self._value > other", "metadata": "root.RDFBytes.__gt__", "header": "['class', 'RDFBytes', '(', 'RDFValue', ')', ':', '___EOS___']", "index": 226 }, { "content": " def __eq__(self, other):\n if isinstance(other, self.__class__):\n return self._value == other._value # pylint: disable=protected-access\n else:\n return self._value == other", "metadata": "root.RDFBytes.__eq__", "header": "['class', 'RDFBytes', '(', 'RDFValue', ')', ':', '___EOS___']", "index": 232 }, { "content": " def __ne__(self, other):\n return not self.__eq__(other)", "metadata": "root.RDFBytes.__ne__", "header": "['class', 'RDFBytes', '(', 'RDFValue', ')', ':', '___EOS___']", "index": 238 }, { "content": " def __hash__(self):\n return hash(self._value)", "metadata": "root.RDFBytes.__hash__", "header": "['class', 'RDFBytes', '(', 'RDFValue', ')', ':', '___EOS___']", "index": 241 }, { "content": " def __bool__(self):\n return bool(self._value)", "metadata": "root.RDFBytes.__bool__", "header": "['class', 'RDFBytes', '(', 'RDFValue', ')', ':', '___EOS___']", "index": 244 }, { "content": " def __nonzero__(self):\n return bool(self._value)", "metadata": "root.RDFBytes.__nonzero__", "header": "['class', 'RDFBytes', '(', 'RDFValue', ')', ':', '___EOS___']", "index": 247 }, { "content": " def __len__(self):\n return len(self._value)", "metadata": "root.RDFBytes.__len__", "header": "['class', 'RDFBytes', '(', 'RDFValue', ')', ':', '___EOS___']", "index": 250 } ]
[ { "span": "class RDFBytes(RDFValue):", "start_line": 200, "start_column": 0, "end_line": 200, "end_column": 25 } ]
[ { "span": "def __lt__(self, other):", "start_line": 220, "start_column": 2, "end_line": 220, "end_column": 26 }, { "span": "def __gt__(self, other):", "start_line": 226, "start_column": 2, "end_line": 226, "end_column": 26 } ]
1
false
[ "[CLS]_", "Incomp", "lete", "_", "ordering_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "RDF", "Bytes_", "(_", "RDF", "Value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "An", " ", "attribute", " ", "whi", "ch", " ", "hold", "s", " ", "bytes", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "store", "\\u", "type_", "=_", "\"", "bytes", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "value_", "=_", "\"\"_", "\\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_", "RDF", "Bytes_", "(_", "RDF", "Value_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "Pars", "e", "Fro", "m", "String_", "(_", "self_", ",_", "string_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", "(", "user", "):", " ", "this", " ", "need", "s", " ", "some", " ", "more", " ", "test", " ", "covera", "ge", ",", " ", "partic", "ular", "ly", " ", "around_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "submit", "ting", " ", "unicode", " ", "string", "s", " ", "and", " ", "byte", " ", "literal", "s", " ", "in", " ", "the", " ", "UI", " ", "forms", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "string_", ",_", "unicode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "value_", "=_", "utils_", "._", "Sma", "rt", "Str_", "(_", "string_", ")_", "\\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", "value_", "=_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDF", "Bytes_", "(_", "RDF", "Value_", ")_", ":_", "\\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_", "Seriali", "ze", "To", "String_", "(_", "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_", "RDF", "Bytes_", "(_", "RDF", "Value_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "utils_", "._", "Sma", "rt", "Str_", "(_", "self_", "._", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDF", "Bytes_", "(_", "RDF", "Value_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "lt\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "value_", "<_", "other_", "._", "\\u", "value_", "#", " ", "pylint", ":", " ", "disable", "=", "protect", "ed", "-", "access_", "\\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", "value_", "<_", "other_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDF", "Bytes_", "(_", "RDF", "Value_", ")_", ":_", "\\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", "gt", "\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "value_", ">_", "other_", "._", "\\u", "value_", "#", " ", "pylint", ":", " ", "disable", "=", "protect", "ed", "-", "access_", "\\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", "value_", ">_", "other_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDF", "Bytes_", "(_", "RDF", "Value_", ")_", ":_", "\\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", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "other_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "value_", "==_", "other_", "._", "\\u", "value_", "#", " ", "pylint", ":", " ", "disable", "=", "protect", "ed", "-", "access_", "\\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", "value_", "==_", "other_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDF", "Bytes_", "(_", "RDF", "Value_", ")_", ":_", "\\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", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "self_", "._", "\\u\\u", "eq\\u\\u_", "(_", "other_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDF", "Bytes_", "(_", "RDF", "Value_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "hash\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "hash_", "(_", "self_", "._", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDF", "Bytes_", "(_", "RDF", "Value_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "bool\\u", "\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "bool_", "(_", "self_", "._", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDF", "Bytes_", "(_", "RDF", "Value_", ")_", ":_", "\\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 ", " _", "return_", "bool_", "(_", "self_", "._", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "RDF", "Bytes_", "(_", "RDF", "Value_", ")_", ":_", "\\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 ", " _", "return_", "len_", "(_", "self_", "._", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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 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, 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, 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 ]
Unused import
SheffieldML/GPy/GPy/testing/__init__.py
[ { "content": "# Copyright (c) 2014, Max Zwiessele, GPy Authors\n# Licensed under the BSD 3-clause license (see LICENSE.txt)\nimport unittest\nimport sys\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def deepTest(reason):\n if reason:\n return lambda x:x\n return unittest.skip(\"Not deep scanning, enable deepscan by adding 'deep' argument to unittest call\")", "metadata": "root.deepTest", "header": "['module', '___EOS___']", "index": 5 } ]
[ { "span": "import sys", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2014", ",", " ", "Max", " ", "Zw", "ies", "sele", ",", " ", "GP", "y", " ", "Author", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "BS", "D", " ", "3", "-", "clause", " ", "license", " ", "(", "see", " ", "LICENSE", ".", "txt", ")_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\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_", "deep", "Test_", "(_", "reason_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "reason_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "lambda_", "x_", ":_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "unittest_", "._", "skip_", "(_", "\"", "Not", " ", "deep", " ", "scanning", ",", " ", "enable", " ", "deep", "scan", " ", "by", " ", "addin", "g", " ", "'", "deep", "'", " ", "argu", "ment", " ", "to", " ", "unittest", " ", "call", "\"_", ")_" ]
[ 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, 0, 1, 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 ]
Duplicate key in dict literal
cloudera/hue/desktop/core/ext-py/Pygments-1.3.1/scripts/vim2pygments.py
[ { "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n Vim Colorscheme Converter\n ~~~~~~~~~~~~~~~~~~~~~~~~~\n\n This script converts vim colorscheme files to valid pygments\n style classes meant for putting into modules.\n\n :copyright 2006 by Armin Ronacher.\n :license: BSD, see LICENSE for details.\n\"\"\"\n\nimport sys\nimport re\nfrom os import path\nfrom cStringIO import StringIO\n\nsplit_re = re.compile(r'(?<!\\\\)\\s+')\n\nSCRIPT_NAME = 'Vim Colorscheme Converter'\nSCRIPT_VERSION = '0.1'\n\n\nCOLORS = {\n # Numeric Colors\n '0': '#000000',\n '1': '#c00000',\n '2': '#008000',\n '3': '#808000',\n '4': '#0000c0',\n '5': '#c000c0',\n '6': '#008080',\n '7': '#c0c0c0',\n '8': '#808080',\n '9': '#ff6060',\n '10': '#00ff00',\n '11': '#ffff00',\n '12': '#8080ff',\n '13': '#ff40ff',\n '14': '#00ffff',\n '15': '#ffffff',\n # Named Colors\n 'alice': '#f0f8ff',\n 'aliceblue': '#f0f8ff',\n 'antique': '#faebd7',\n 'antiquewhite': '#faebd7',\n 'antiquewhite1': '#ffefdb',\n 'antiquewhite2': '#eedfcc',\n 'antiquewhite3': '#cdc0b0',\n 'antiquewhite4': '#8b8378',\n 'aquamarine': '#7fffd4',\n 'aquamarine1': '#7fffd4',\n 'aquamarine2': '#76eec6',\n 'aquamarine3': '#66cdaa',\n 'aquamarine4': '#458b74',\n 'azure': '#f0ffff',\n 'azure1': '#f0ffff',\n 'azure2': '#e0eeee',\n 'azure3': '#c1cdcd',\n 'azure4': '#838b8b',\n 'beige': '#f5f5dc',\n 'bisque': '#ffe4c4',\n 'bisque1': '#ffe4c4',\n 'bisque2': '#eed5b7',\n 'bisque3': '#cdb79e',\n 'bisque4': '#8b7d6b',\n 'black': '#000000',\n 'blanched': '#ffebcd',\n 'blanchedalmond': '#ffebcd',\n 'blue': '#8a2be2',\n 'blue1': '#0000ff',\n 'blue2': '#0000ee',\n 'blue3': '#0000cd',\n 'blue4': '#00008b',\n 'blueviolet': '#8a2be2',\n 'brown': '#a52a2a',\n 'brown1': '#ff4040',\n 'brown2': '#ee3b3b',\n 'brown3': '#cd3333',\n 'brown4': '#8b2323',\n 'burlywood': '#deb887',\n 'burlywood1': '#ffd39b',\n 'burlywood2': '#eec591',\n 'burlywood3': '#cdaa7d',\n 'burlywood4': '#8b7355',\n 'cadet': '#5f9ea0',\n 'cadetblue': '#5f9ea0',\n 'cadetblue1': '#98f5ff',\n 'cadetblue2': '#8ee5ee',\n 'cadetblue3': '#7ac5cd',\n 'cadetblue4': '#53868b',\n 'chartreuse': '#7fff00',\n 'chartreuse1': '#7fff00',\n 'chartreuse2': '#76ee00',\n 'chartreuse3': '#66cd00',\n 'chartreuse4': '#458b00',\n 'chocolate': '#d2691e',\n 'chocolate1': '#ff7f24',\n 'chocolate2': '#ee7621',\n 'chocolate3': '#cd661d',\n 'chocolate4': '#8b4513',\n 'coral': '#ff7f50',\n 'coral1': '#ff7256',\n 'coral2': '#ee6a50',\n 'coral3': '#cd5b45',\n 'coral4': '#8b3e2f',\n 'cornflower': '#6495ed',\n 'cornflowerblue': '#6495ed',\n 'cornsilk': '#fff8dc',\n 'cornsilk1': '#fff8dc',\n 'cornsilk2': '#eee8cd',\n 'cornsilk3': '#cdc8b1',\n 'cornsilk4': '#8b8878',\n 'cyan': '#00ffff',\n 'cyan1': '#00ffff',\n 'cyan2': '#00eeee',\n 'cyan3': '#00cdcd',\n 'cyan4': '#008b8b',\n 'dark': '#8b0000',\n 'darkblue': '#00008b',\n 'darkcyan': '#008b8b',\n 'darkgoldenrod': '#b8860b',\n 'darkgoldenrod1': '#ffb90f',\n 'darkgoldenrod2': '#eead0e',\n 'darkgoldenrod3': '#cd950c',\n 'darkgoldenrod4': '#8b6508',\n 'darkgray': '#a9a9a9',\n 'darkgreen': '#006400',\n 'darkgrey': '#a9a9a9',\n 'darkkhaki': '#bdb76b',\n 'darkmagenta': '#8b008b',\n 'darkolivegreen': '#556b2f',\n 'darkolivegreen1': '#caff70',\n 'darkolivegreen2': '#bcee68',\n 'darkolivegreen3': '#a2cd5a',\n 'darkolivegreen4': '#6e8b3d',\n 'darkorange': '#ff8c00',\n 'darkorange1': '#ff7f00',\n 'darkorange2': '#ee7600',\n 'darkorange3': '#cd6600',\n 'darkorange4': '#8b4500',\n 'darkorchid': '#9932cc',\n 'darkorchid1': '#bf3eff',\n 'darkorchid2': '#b23aee',\n 'darkorchid3': '#9a32cd',\n 'darkorchid4': '#68228b',\n 'darkred': '#8b0000',\n 'darksalmon': '#e9967a',\n 'darkseagreen': '#8fbc8f',\n 'darkseagreen1': '#c1ffc1',\n 'darkseagreen2': '#b4eeb4',\n 'darkseagreen3': '#9bcd9b',\n 'darkseagreen4': '#698b69',\n 'darkslateblue': '#483d8b',\n 'darkslategray': '#2f4f4f',\n 'darkslategray1': '#97ffff',\n 'darkslategray2': '#8deeee',\n 'darkslategray3': '#79cdcd',\n 'darkslategray4': '#528b8b',\n 'darkslategrey': '#2f4f4f',\n 'darkturquoise': '#00ced1',\n 'darkviolet': '#9400d3',\n 'deep': '#ff1493',\n 'deeppink': '#ff1493',\n 'deeppink1': '#ff1493',\n 'deeppink2': '#ee1289',\n 'deeppink3': '#cd1076',\n 'deeppink4': '#8b0a50',\n 'deepskyblue': '#00bfff',\n 'deepskyblue1': '#00bfff',\n 'deepskyblue2': '#00b2ee',\n 'deepskyblue3': '#009acd',\n 'deepskyblue4': '#00688b',\n 'dim': '#696969',\n 'dimgray': '#696969',\n 'dimgrey': '#696969',\n 'dodger': '#1e90ff',\n 'dodgerblue': '#1e90ff',\n 'dodgerblue1': '#1e90ff',\n 'dodgerblue2': '#1c86ee',\n 'dodgerblue3': '#1874cd',\n 'dodgerblue4': '#104e8b',\n 'firebrick': '#b22222',\n 'firebrick1': '#ff3030',\n 'firebrick2': '#ee2c2c',\n 'firebrick3': '#cd2626',\n 'firebrick4': '#8b1a1a',\n 'floral': '#fffaf0',\n 'floralwhite': '#fffaf0',\n 'forest': '#228b22',\n 'forestgreen': '#228b22',\n 'gainsboro': '#dcdcdc',\n 'ghost': '#f8f8ff',\n 'ghostwhite': '#f8f8ff',\n 'gold': '#ffd700',\n 'gold1': '#ffd700',\n 'gold2': '#eec900',\n 'gold3': '#cdad00',\n 'gold4': '#8b7500',\n 'goldenrod': '#daa520',\n 'goldenrod1': '#ffc125',\n 'goldenrod2': '#eeb422',\n 'goldenrod3': '#cd9b1d',\n 'goldenrod4': '#8b6914',\n 'gray': '#bebebe',\n 'gray0': '#000000',\n 'gray1': '#030303',\n 'gray10': '#1a1a1a',\n 'gray100': '#ffffff',\n 'gray11': '#1c1c1c',\n 'gray12': '#1f1f1f',\n 'gray13': '#212121',\n 'gray14': '#242424',\n 'gray15': '#262626',\n 'gray16': '#292929',\n 'gray17': '#2b2b2b',\n 'gray18': '#2e2e2e',\n 'gray19': '#303030',\n 'gray2': '#050505',\n 'gray20': '#333333',\n 'gray21': '#363636',\n 'gray22': '#383838',\n 'gray23': '#3b3b3b',\n 'gray24': '#3d3d3d',\n 'gray25': '#404040',\n 'gray26': '#424242',\n 'gray27': '#454545',\n 'gray28': '#474747',\n 'gray29': '#4a4a4a',\n 'gray3': '#080808',\n 'gray30': '#4d4d4d',\n 'gray31': '#4f4f4f',\n 'gray32': '#525252',\n 'gray33': '#545454',\n 'gray34': '#575757',\n 'gray35': '#595959',\n 'gray36': '#5c5c5c',\n 'gray37': '#5e5e5e',\n 'gray38': '#616161',\n 'gray39': '#636363',\n 'gray4': '#0a0a0a',\n 'gray40': '#666666',\n 'gray41': '#696969',\n 'gray42': '#6b6b6b',\n 'gray43': '#6e6e6e',\n 'gray44': '#707070',\n 'gray45': '#737373',\n 'gray46': '#757575',\n 'gray47': '#787878',\n 'gray48': '#7a7a7a',\n 'gray49': '#7d7d7d',\n 'gray5': '#0d0d0d',\n 'gray50': '#7f7f7f',\n 'gray51': '#828282',\n 'gray52': '#858585',\n 'gray53': '#878787',\n 'gray54': '#8a8a8a',\n 'gray55': '#8c8c8c',\n 'gray56': '#8f8f8f',\n 'gray57': '#919191',\n 'gray58': '#949494',\n 'gray59': '#969696',\n 'gray6': '#0f0f0f',\n 'gray60': '#999999',\n 'gray61': '#9c9c9c',\n 'gray62': '#9e9e9e',\n 'gray63': '#a1a1a1',\n 'gray64': '#a3a3a3',\n 'gray65': '#a6a6a6',\n 'gray66': '#a8a8a8',\n 'gray67': '#ababab',\n 'gray68': '#adadad',\n 'gray69': '#b0b0b0',\n 'gray7': '#121212',\n 'gray70': '#b3b3b3',\n 'gray71': '#b5b5b5',\n 'gray72': '#b8b8b8',\n 'gray73': '#bababa',\n 'gray74': '#bdbdbd',\n 'gray75': '#bfbfbf',\n 'gray76': '#c2c2c2',\n 'gray77': '#c4c4c4',\n 'gray78': '#c7c7c7',\n 'gray79': '#c9c9c9',\n 'gray8': '#141414',\n 'gray80': '#cccccc',\n 'gray81': '#cfcfcf',\n 'gray82': '#d1d1d1',\n 'gray83': '#d4d4d4',\n 'gray84': '#d6d6d6',\n 'gray85': '#d9d9d9',\n 'gray86': '#dbdbdb',\n 'gray87': '#dedede',\n 'gray88': '#e0e0e0',\n 'gray89': '#e3e3e3',\n 'gray9': '#171717',\n 'gray90': '#e5e5e5',\n 'gray91': '#e8e8e8',\n 'gray92': '#ebebeb',\n 'gray93': '#ededed',\n 'gray94': '#f0f0f0',\n 'gray95': '#f2f2f2',\n 'gray96': '#f5f5f5',\n 'gray97': '#f7f7f7',\n 'gray98': '#fafafa',\n 'gray99': '#fcfcfc',\n 'green': '#adff2f',\n 'green1': '#00ff00',\n 'green2': '#00ee00',\n 'green3': '#00cd00',\n 'green4': '#008b00',\n 'greenyellow': '#adff2f',\n 'grey': '#bebebe',\n 'grey0': '#000000',\n 'grey1': '#030303',\n 'grey10': '#1a1a1a',\n 'grey100': '#ffffff',\n 'grey11': '#1c1c1c',\n 'grey12': '#1f1f1f',\n 'grey13': '#212121',\n 'grey14': '#242424',\n 'grey15': '#262626',\n 'grey16': '#292929',\n 'grey17': '#2b2b2b',\n 'grey18': '#2e2e2e',\n 'grey19': '#303030',\n 'grey2': '#050505',\n 'grey20': '#333333',\n 'grey21': '#363636',\n 'grey22': '#383838',\n 'grey23': '#3b3b3b',\n 'grey24': '#3d3d3d',\n 'grey25': '#404040',\n 'grey26': '#424242',\n 'grey27': '#454545',\n 'grey28': '#474747',\n 'grey29': '#4a4a4a',\n 'grey3': '#080808',\n 'grey30': '#4d4d4d',\n 'grey31': '#4f4f4f',\n 'grey32': '#525252',\n 'grey33': '#545454',\n 'grey34': '#575757',\n 'grey35': '#595959',\n 'grey36': '#5c5c5c',\n 'grey37': '#5e5e5e',\n 'grey38': '#616161',\n 'grey39': '#636363',\n 'grey4': '#0a0a0a',\n 'grey40': '#666666',\n 'grey41': '#696969',\n 'grey42': '#6b6b6b',\n 'grey43': '#6e6e6e',\n 'grey44': '#707070',\n 'grey45': '#737373',\n 'grey46': '#757575',\n 'grey47': '#787878',\n 'grey48': '#7a7a7a',\n 'grey49': '#7d7d7d',\n 'grey5': '#0d0d0d',\n 'grey50': '#7f7f7f',\n 'grey51': '#828282',\n 'grey52': '#858585',\n 'grey53': '#878787',\n 'grey54': '#8a8a8a',\n 'grey55': '#8c8c8c',\n 'grey56': '#8f8f8f',\n 'grey57': '#919191',\n 'grey58': '#949494',\n 'grey59': '#969696',\n 'grey6': '#0f0f0f',\n 'grey60': '#999999',\n 'grey61': '#9c9c9c',\n 'grey62': '#9e9e9e',\n 'grey63': '#a1a1a1',\n 'grey64': '#a3a3a3',\n 'grey65': '#a6a6a6',\n 'grey66': '#a8a8a8',\n 'grey67': '#ababab',\n 'grey68': '#adadad',\n 'grey69': '#b0b0b0',\n 'grey7': '#121212',\n 'grey70': '#b3b3b3',\n 'grey71': '#b5b5b5',\n 'grey72': '#b8b8b8',\n 'grey73': '#bababa',\n 'grey74': '#bdbdbd',\n 'grey75': '#bfbfbf',\n 'grey76': '#c2c2c2',\n 'grey77': '#c4c4c4',\n 'grey78': '#c7c7c7',\n 'grey79': '#c9c9c9',\n 'grey8': '#141414',\n 'grey80': '#cccccc',\n 'grey81': '#cfcfcf',\n 'grey82': '#d1d1d1',\n 'grey83': '#d4d4d4',\n 'grey84': '#d6d6d6',\n 'grey85': '#d9d9d9',\n 'grey86': '#dbdbdb',\n 'grey87': '#dedede',\n 'grey88': '#e0e0e0',\n 'grey89': '#e3e3e3',\n 'grey9': '#171717',\n 'grey90': '#e5e5e5',\n 'grey91': '#e8e8e8',\n 'grey92': '#ebebeb',\n 'grey93': '#ededed',\n 'grey94': '#f0f0f0',\n 'grey95': '#f2f2f2',\n 'grey96': '#f5f5f5',\n 'grey97': '#f7f7f7',\n 'grey98': '#fafafa',\n 'grey99': '#fcfcfc',\n 'honeydew': '#f0fff0',\n 'honeydew1': '#f0fff0',\n 'honeydew2': '#e0eee0',\n 'honeydew3': '#c1cdc1',\n 'honeydew4': '#838b83',\n 'hot': '#ff69b4',\n 'hotpink': '#ff69b4',\n 'hotpink1': '#ff6eb4',\n 'hotpink2': '#ee6aa7',\n 'hotpink3': '#cd6090',\n 'hotpink4': '#8b3a62',\n 'indian': '#cd5c5c',\n 'indianred': '#cd5c5c',\n 'indianred1': '#ff6a6a',\n 'indianred2': '#ee6363',\n 'indianred3': '#cd5555',\n 'indianred4': '#8b3a3a',\n 'ivory': '#fffff0',\n 'ivory1': '#fffff0',\n 'ivory2': '#eeeee0',\n 'ivory3': '#cdcdc1',\n 'ivory4': '#8b8b83',\n 'khaki': '#f0e68c',\n 'khaki1': '#fff68f',\n 'khaki2': '#eee685',\n 'khaki3': '#cdc673',\n 'khaki4': '#8b864e',\n 'lavender': '#fff0f5',\n 'lavenderblush': '#fff0f5',\n 'lavenderblush1': '#fff0f5',\n 'lavenderblush2': '#eee0e5',\n 'lavenderblush3': '#cdc1c5',\n 'lavenderblush4': '#8b8386',\n 'lawn': '#7cfc00',\n 'lawngreen': '#7cfc00',\n 'lemon': '#fffacd',\n 'lemonchiffon': '#fffacd',\n 'lemonchiffon1': '#fffacd',\n 'lemonchiffon2': '#eee9bf',\n 'lemonchiffon3': '#cdc9a5',\n 'lemonchiffon4': '#8b8970',\n 'light': '#90ee90',\n 'lightblue': '#add8e6',\n 'lightblue1': '#bfefff',\n 'lightblue2': '#b2dfee',\n 'lightblue3': '#9ac0cd',\n 'lightblue4': '#68838b',\n 'lightcoral': '#f08080',\n 'lightcyan': '#e0ffff',\n 'lightcyan1': '#e0ffff',\n 'lightcyan2': '#d1eeee',\n 'lightcyan3': '#b4cdcd',\n 'lightcyan4': '#7a8b8b',\n 'lightgoldenrod': '#eedd82',\n 'lightgoldenrod1': '#ffec8b',\n 'lightgoldenrod2': '#eedc82',\n 'lightgoldenrod3': '#cdbe70',\n 'lightgoldenrod4': '#8b814c',\n 'lightgoldenrodyellow': '#fafad2',\n 'lightgray': '#d3d3d3',\n 'lightgreen': '#90ee90',\n 'lightgrey': '#d3d3d3',\n 'lightpink': '#ffb6c1',\n 'lightpink1': '#ffaeb9',\n 'lightpink2': '#eea2ad',\n 'lightpink3': '#cd8c95',\n 'lightpink4': '#8b5f65',\n 'lightsalmon': '#ffa07a',\n 'lightsalmon1': '#ffa07a',\n 'lightsalmon2': '#ee9572',\n 'lightsalmon3': '#cd8162',\n 'lightsalmon4': '#8b5742',\n 'lightseagreen': '#20b2aa',\n 'lightskyblue': '#87cefa',\n 'lightskyblue1': '#b0e2ff',\n 'lightskyblue2': '#a4d3ee',\n 'lightskyblue3': '#8db6cd',\n 'lightskyblue4': '#607b8b',\n 'lightslateblue': '#8470ff',\n 'lightslategray': '#778899',\n 'lightslategrey': '#778899',\n 'lightsteelblue': '#b0c4de',\n 'lightsteelblue1': '#cae1ff',\n 'lightsteelblue2': '#bcd2ee',\n 'lightsteelblue3': '#a2b5cd',\n 'lightsteelblue4': '#6e7b8b',\n 'lightyellow': '#ffffe0',\n 'lightyellow1': '#ffffe0',\n 'lightyellow2': '#eeeed1',\n 'lightyellow3': '#cdcdb4',\n 'lightyellow4': '#8b8b7a',\n 'lime': '#32cd32',\n 'limegreen': '#32cd32',\n 'linen': '#faf0e6',\n 'magenta': '#ff00ff',\n 'magenta1': '#ff00ff',\n 'magenta2': '#ee00ee',\n 'magenta3': '#cd00cd',\n 'magenta4': '#8b008b',\n 'maroon': '#b03060',\n 'maroon1': '#ff34b3',\n 'maroon2': '#ee30a7',\n 'maroon3': '#cd2990',\n 'maroon4': '#8b1c62',\n 'medium': '#9370db',\n 'mediumaquamarine': '#66cdaa',\n 'mediumblue': '#0000cd',\n 'mediumorchid': '#ba55d3',\n 'mediumorchid1': '#e066ff',\n 'mediumorchid2': '#d15fee',\n 'mediumorchid3': '#b452cd',\n 'mediumorchid4': '#7a378b',\n 'mediumpurple': '#9370db',\n 'mediumpurple1': '#ab82ff',\n 'mediumpurple2': '#9f79ee',\n 'mediumpurple3': '#8968cd',\n 'mediumpurple4': '#5d478b',\n 'mediumseagreen': '#3cb371',\n 'mediumslateblue': '#7b68ee',\n 'mediumspringgreen': '#00fa9a',\n 'mediumturquoise': '#48d1cc',\n 'mediumvioletred': '#c71585',\n 'midnight': '#191970',\n 'midnightblue': '#191970',\n 'mint': '#f5fffa',\n 'mintcream': '#f5fffa',\n 'misty': '#ffe4e1',\n 'mistyrose': '#ffe4e1',\n 'mistyrose1': '#ffe4e1',\n 'mistyrose2': '#eed5d2',\n 'mistyrose3': '#cdb7b5',\n 'mistyrose4': '#8b7d7b',\n 'moccasin': '#ffe4b5',\n 'navajo': '#ffdead',\n 'navajowhite': '#ffdead',\n 'navajowhite1': '#ffdead',\n 'navajowhite2': '#eecfa1',\n 'navajowhite3': '#cdb38b',\n 'navajowhite4': '#8b795e',\n 'navy': '#000080',\n 'navyblue': '#000080',\n 'old': '#fdf5e6',\n 'oldlace': '#fdf5e6',\n 'olive': '#6b8e23',\n 'olivedrab': '#6b8e23',\n 'olivedrab1': '#c0ff3e',\n 'olivedrab2': '#b3ee3a',\n 'olivedrab3': '#9acd32',\n 'olivedrab4': '#698b22',\n 'orange': '#ff4500',\n 'orange1': '#ffa500',\n 'orange2': '#ee9a00',\n 'orange3': '#cd8500',\n 'orange4': '#8b5a00',\n 'orangered': '#ff4500',\n 'orangered1': '#ff4500',\n 'orangered2': '#ee4000',\n 'orangered3': '#cd3700',\n 'orangered4': '#8b2500',\n 'orchid': '#da70d6',\n 'orchid1': '#ff83fa',\n 'orchid2': '#ee7ae9',\n 'orchid3': '#cd69c9',\n 'orchid4': '#8b4789',\n 'pale': '#db7093',\n 'palegoldenrod': '#eee8aa',\n 'palegreen': '#98fb98',\n 'palegreen1': '#9aff9a',\n 'palegreen2': '#90ee90',\n 'palegreen3': '#7ccd7c',\n 'palegreen4': '#548b54',\n 'paleturquoise': '#afeeee',\n 'paleturquoise1': '#bbffff',\n 'paleturquoise2': '#aeeeee',\n 'paleturquoise3': '#96cdcd',\n 'paleturquoise4': '#668b8b',\n 'palevioletred': '#db7093',\n 'palevioletred1': '#ff82ab',\n 'palevioletred2': '#ee799f',\n 'palevioletred3': '#cd6889',\n 'palevioletred4': '#8b475d',\n 'papaya': '#ffefd5',\n 'papayawhip': '#ffefd5',\n 'peach': '#ffdab9',\n 'peachpuff': '#ffdab9',\n 'peachpuff1': '#ffdab9',\n 'peachpuff2': '#eecbad',\n 'peachpuff3': '#cdaf95',\n 'peachpuff4': '#8b7765',\n 'peru': '#cd853f',\n 'pink': '#ffc0cb',\n 'pink1': '#ffb5c5',\n 'pink2': '#eea9b8',\n 'pink3': '#cd919e',\n 'pink4': '#8b636c',\n 'plum': '#dda0dd',\n 'plum1': '#ffbbff',\n 'plum2': '#eeaeee',\n 'plum3': '#cd96cd',\n 'plum4': '#8b668b',\n 'powder': '#b0e0e6',\n 'powderblue': '#b0e0e6',\n 'purple': '#a020f0',\n 'purple1': '#9b30ff',\n 'purple2': '#912cee',\n 'purple3': '#7d26cd',\n 'purple4': '#551a8b',\n 'red': '#ff0000',\n 'red1': '#ff0000',\n 'red2': '#ee0000',\n 'red3': '#cd0000',\n 'red4': '#8b0000',\n 'rosy': '#bc8f8f',\n 'rosybrown': '#bc8f8f',\n 'rosybrown1': '#ffc1c1',\n 'rosybrown2': '#eeb4b4',\n 'rosybrown3': '#cd9b9b',\n 'rosybrown4': '#8b6969',\n 'royal': '#4169e1',\n 'royalblue': '#4169e1',\n 'royalblue1': '#4876ff',\n 'royalblue2': '#436eee',\n 'royalblue3': '#3a5fcd',\n 'royalblue4': '#27408b',\n 'saddle': '#8b4513',\n 'saddlebrown': '#8b4513',\n 'salmon': '#fa8072',\n 'salmon1': '#ff8c69',\n 'salmon2': '#ee8262',\n 'salmon3': '#cd7054',\n 'salmon4': '#8b4c39',\n 'sandy': '#f4a460',\n 'sandybrown': '#f4a460',\n 'sea': '#2e8b57',\n 'seagreen': '#2e8b57',\n 'seagreen1': '#54ff9f',\n 'seagreen2': '#4eee94',\n 'seagreen3': '#43cd80',\n 'seagreen4': '#2e8b57',\n 'seashell': '#fff5ee',\n 'seashell1': '#fff5ee',\n 'seashell2': '#eee5de',\n 'seashell3': '#cdc5bf',\n 'seashell4': '#8b8682',\n 'sienna': '#a0522d',\n 'sienna1': '#ff8247',\n 'sienna2': '#ee7942',\n 'sienna3': '#cd6839',\n 'sienna4': '#8b4726',\n 'sky': '#87ceeb',\n 'skyblue': '#87ceeb',\n 'skyblue1': '#87ceff',\n 'skyblue2': '#7ec0ee',\n 'skyblue3': '#6ca6cd',\n 'skyblue4': '#4a708b',\n 'slate': '#6a5acd',\n 'slateblue': '#6a5acd',\n 'slateblue1': '#836fff',\n 'slateblue2': '#7a67ee',\n 'slateblue3': '#6959cd',\n 'slateblue4': '#473c8b',\n 'slategray': '#708090',\n 'slategray1': '#c6e2ff',\n 'slategray2': '#b9d3ee',\n 'slategray3': '#9fb6cd',\n 'slategray4': '#6c7b8b',\n 'slategrey': '#708090',\n 'snow': '#fffafa',\n 'snow1': '#fffafa',\n 'snow2': '#eee9e9',\n 'snow3': '#cdc9c9',\n 'snow4': '#8b8989',\n 'spring': '#00ff7f',\n 'springgreen': '#00ff7f',\n 'springgreen1': '#00ff7f',\n 'springgreen2': '#00ee76',\n 'springgreen3': '#00cd66',\n 'springgreen4': '#008b45',\n 'steel': '#4682b4',\n 'steelblue': '#4682b4',\n 'steelblue1': '#63b8ff',\n 'steelblue2': '#5cacee',\n 'steelblue3': '#4f94cd',\n 'steelblue4': '#36648b',\n 'tan': '#d2b48c',\n 'tan1': '#ffa54f',\n 'tan2': '#ee9a49',\n 'tan3': '#cd853f',\n 'tan4': '#8b5a2b',\n 'thistle': '#d8bfd8',\n 'thistle1': '#ffe1ff',\n 'thistle2': '#eed2ee',\n 'thistle3': '#cdb5cd',\n 'thistle4': '#8b7b8b',\n 'tomato': '#ff6347',\n 'tomato1': '#ff6347',\n 'tomato2': '#ee5c42',\n 'tomato3': '#cd4f39',\n 'tomato4': '#8b3626',\n 'turquoise': '#40e0d0',\n 'turquoise1': '#00f5ff',\n 'turquoise2': '#00e5ee',\n 'turquoise3': '#00c5cd',\n 'turquoise4': '#00868b',\n 'violet': '#ee82ee',\n 'violetred': '#d02090',\n 'violetred1': '#ff3e96',\n 'violetred2': '#ee3a8c',\n 'violetred3': '#cd3278',\n 'violetred4': '#8b2252',\n 'wheat': '#f5deb3',\n 'wheat1': '#ffe7ba',\n 'wheat2': '#eed8ae',\n 'wheat3': '#cdba96',\n 'wheat4': '#8b7e66',\n 'white': '#ffffff',\n 'whitesmoke': '#f5f5f5',\n 'yellow': '#ffff00',\n 'yellow1': '#ffff00',\n 'yellow2': '#eeee00',\n 'yellow3': '#cdcd00',\n 'yellow4': '#8b8b00',\n 'yellowgreen': '#9acd32'\n}\n\nTOKENS = {\n 'normal': '',\n 'string': 'String',\n 'number': 'Number',\n 'float': 'Number.Float',\n 'constant': 'Name.Constant',\n 'number': 'Number',\n 'statement': ('Keyword', 'Name.Tag'),\n 'identifier': 'Name.Variable',\n 'operator': 'Operator.Word',\n 'label': 'Name.Label',\n 'exception': 'Name.Exception',\n 'function': ('Name.Function', 'Name.Attribute'),\n 'preproc': 'Comment.Preproc',\n 'comment': 'Comment',\n 'type': 'Keyword.Type',\n 'diffadd': 'Generic.Inserted',\n 'diffdelete': 'Generic.Deleted',\n 'error': 'Generic.Error',\n 'errormsg': 'Generic.Traceback',\n 'title': ('Generic.Heading', 'Generic.Subheading'),\n 'underlined': 'Generic.Emph',\n 'special': 'Name.Entity',\n 'nontext': 'Generic.Output'\n}\n\nTOKEN_TYPES = set()\nfor token in TOKENS.itervalues():\n if not isinstance(token, tuple):\n token = (token,)\n for token in token:\n if token:\n TOKEN_TYPES.add(token.split('.')[0])\n\n\n\n\n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n sys.exit(main() or 0)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "'number':", "start_line": 743, "start_column": 4, "end_line": 743, "end_column": 12 } ]
[ { "span": "'number':", "start_line": 746, "start_column": 4, "end_line": 746, "end_column": 12 } ]
1
true
[ "[CLS]_", "Duplicate", "_", "key_", "in_", "dict_", "literal_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Vi", "m", " ", "Color", "sche", "me", " ", "Converte", "r", "\\", "10", ";", " ", " ", " ", " ", "~~~~~~~~~~~", "~~~~~~~~~~~", "~~~", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "script", " ", "convert", "s", " ", "vim", " ", "colors", "chem", "e", " ", "files", " ", "to", " ", "valid", " ", "pyg", "ment", "s", "\\", "10", ";", " ", " ", " ", " ", "style", " ", "classe", "s", " ", "mean", "t", " ", "for", " ", "put", "ting", " ", "int", "o", " ", "module", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "copyr", "ight", " ", "2006", " ", "by", " ", "Arm", "in", " ", "Ro", "nac", "her", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "license", ":", " ", "BS", "D", ",", " ", "see", " ", "LICENSE", " ", "for", " ", "deta", "il", "s", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "os_", "import_", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "c", "String", "IO_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "split", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "r", "'(?<", "!\\\\", "\\\\)", "\\\\", "s", "+'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "SCRIPT", "\\u", "NAME_", "=_", "'", "Vi", "m", " ", "Color", "sche", "me", " ", "Converte", "r", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SCRIPT", "\\u", "VERSION_", "=_", "'", "0.", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "COLORS_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Numer", "ic", " ", "Colors_", "\\u\\u\\uNL\\u\\u\\u_", "'", "0", "'_", ":_", "'#", "000000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "1", "'_", ":_", "'#", "c0", "0000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "2", "'_", ":_", "'#", "0080", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "3", "'_", ":_", "'#", "808", "000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "4", "'_", ":_", "'#", "0000", "c0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "5", "'_", ":_", "'#", "c0", "00", "c0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "6", "'_", ":_", "'#", "0080", "80", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "7", "'_", ":_", "'#", "c0", "c0", "c0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "8", "'_", ":_", "'#", "808", "080", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "9", "'_", ":_", "'#", "ff", "606", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "10", "'_", ":_", "'#", "00", "ff", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "11", "'_", ":_", "'#", "fff", "f0", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "1", "2", "'_", ":_", "'#", "808", "0f", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "13", "'_", ":_", "'#", "ff", "40", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "14", "'_", ":_", "'#", "00", "fff", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "15", "'_", ":_", "'#", "ffffff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Name", "d", " ", "Colors_", "\\u\\u\\uNL\\u\\u\\u_", "'", "alic", "e", "'_", ":_", "'#", "f0", "f8", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "alic", "eb", "lue", "'_", ":_", "'#", "f0", "f8", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "anti", "que", "'_", ":_", "'#", "fa", "eb", "d7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "anti", "que", "white", "'_", ":_", "'#", "fa", "eb", "d7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "anti", "que", "white", "1", "'_", ":_", "'#", "ffe", "fdb", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "anti", "que", "white", "2", "'_", ":_", "'#", "eed", "fcc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "anti", "que", "white", "3", "'_", ":_", "'#", "cdc", "0b", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "anti", "que", "white", "4", "'_", ":_", "'#", "8b", "837", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "aqu", "amar", "ine", "'_", ":_", "'#", "7f", "ffd", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "aqu", "amar", "ine", "1", "'_", ":_", "'#", "7f", "ffd", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "aqu", "amar", "ine", "2", "'_", ":_", "'#", "7", "6e", "ec", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "aqu", "amar", "ine", "3", "'_", ":_", "'#", "6", "6c", "da", "a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "aqu", "amar", "ine", "4", "'_", ":_", "'#", "458", "b7", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "azu", "re", "'_", ":_", "'#", "f0", "fff", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "azu", "re", "1", "'_", ":_", "'#", "f0", "fff", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "azu", "re", "2", "'_", ":_", "'#", "e0", "eeee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "azu", "re", "3", "'_", ":_", "'#", "c1", "cdc", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "azu", "re", "4", "'_", ":_", "'#", "838", "b8", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bei", "ge", "'_", ":_", "'#", "f5", "f5", "dc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bis", "que", "'_", ":_", "'#", "ffe", "4c", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bis", "que", "1", "'_", ":_", "'#", "ffe", "4c", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bis", "que", "2", "'_", ":_", "'#", "eed", "5b", "7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bis", "que", "3", "'_", ":_", "'#", "cdb", "7", "9e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bis", "que", "4", "'_", ":_", "'#", "8b", "7d", "6b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "black", "'_", ":_", "'#", "000000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bla", "nche", "d", "'_", ":_", "'#", "ffe", "bcd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bla", "nche", "dal", "mond", "'_", ":_", "'#", "ffe", "bcd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "blue", "'_", ":_", "'#", "8a", "2b", "e2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "blue", "1", "'_", ":_", "'#", "0000", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "blue", "2", "'_", ":_", "'#", "0000", "ee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "blue", "3", "'_", ":_", "'#", "0000", "cd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "blue", "4", "'_", ":_", "'#", "0000", "8b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "blue", "violet", "'_", ":_", "'#", "8a", "2b", "e2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "brow", "n", "'_", ":_", "'#", "a5", "2a", "2a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "brow", "n1", "'_", ":_", "'#", "ff", "404", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "brow", "n2", "'_", ":_", "'#", "ee", "3b", "3b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "brow", "n", "3", "'_", ":_", "'#", "cd", "3333", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "brow", "n4", "'_", ":_", "'#", "8b", "232", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bur", "ly", "wood", "'_", ":_", "'#", "deb", "887", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bur", "ly", "wood", "1", "'_", ":_", "'#", "ffd", "3", "9", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bur", "ly", "wood", "2", "'_", ":_", "'#", "eec", "591", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bur", "ly", "wood", "3", "'_", ":_", "'#", "cda", "a7", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bur", "ly", "wood", "4", "'_", ":_", "'#", "8b", "735", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cade", "t", "'_", ":_", "'#", "5f", "9e", "a0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cade", "tbl", "ue", "'_", ":_", "'#", "5f", "9e", "a0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cade", "tbl", "ue", "1", "'_", ":_", "'#", "98", "f5", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cade", "tbl", "ue", "2", "'_", ":_", "'#", "8e", "e5", "ee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cade", "tbl", "ue", "3", "'_", ":_", "'#", "7a", "c5", "cd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cade", "tbl", "ue", "4", "'_", ":_", "'#", "538", "6", "8b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "chart", "reus", "e", "'_", ":_", "'#", "7f", "ff", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "chart", "reus", "e1", "'_", ":_", "'#", "7f", "ff", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "chart", "reus", "e2", "'_", ":_", "'#", "7", "6e", "e0", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "chart", "reus", "e3", "'_", ":_", "'#", "6", "6c", "d0", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "chart", "reus", "e4", "'_", ":_", "'#", "458", "b0", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cho", "colat", "e", "'_", ":_", "'#", "d2", "691", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cho", "colat", "e1", "'_", ":_", "'#", "ff", "7f", "24", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cho", "colat", "e2", "'_", ":_", "'#", "ee", "762", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cho", "colat", "e3", "'_", ":_", "'#", "cd", "661", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cho", "colat", "e4", "'_", ":_", "'#", "8b", "451", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cora", "l", "'_", ":_", "'#", "ff", "7f", "50", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cora", "l1", "'_", ":_", "'#", "ff", "725", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cora", "l2", "'_", ":_", "'#", "ee", "6a", "50", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cora", "l3", "'_", ":_", "'#", "cd", "5b", "4", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cora", "l4", "'_", ":_", "'#", "8b", "3e", "2f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "corn", "flower", "'_", ":_", "'#", "649", "5e", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "corn", "flower", "blue", "'_", ":_", "'#", "649", "5e", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "corn", "sil", "k", "'_", ":_", "'#", "fff", "8d", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "corn", "sil", "k", "1", "'_", ":_", "'#", "fff", "8d", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "corn", "sil", "k2", "'_", ":_", "'#", "eee", "8c", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "corn", "sil", "k3", "'_", ":_", "'#", "cdc", "8b", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "corn", "sil", "k", "4", "'_", ":_", "'#", "8b", "887", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cya", "n", "'_", ":_", "'#", "00", "fff", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cya", "n1", "'_", ":_", "'#", "00", "fff", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cya", "n2", "'_", ":_", "'#", "00", "eeee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cya", "n", "3", "'_", ":_", "'#", "00", "cdc", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cya", "n4", "'_", ":_", "'#", "008", "b8", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "'_", ":_", "'#", "8b", "0000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "blue", "'_", ":_", "'#", "0000", "8b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "cya", "n", "'_", ":_", "'#", "008", "b8", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "golden", "rod", "'_", ":_", "'#", "b8", "860", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "golden", "rod", "1", "'_", ":_", "'#", "ff", "b9", "0f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "golden", "rod", "2", "'_", ":_", "'#", "ee", "ad", "0e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "golden", "rod", "3", "'_", ":_", "'#", "cd", "950", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "golden", "rod", "4", "'_", ":_", "'#", "8b", "650", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "gray", "'_", ":_", "'#", "a9", "a9", "a9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "green", "'_", ":_", "'#", "006", "400", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "grey", "'_", ":_", "'#", "a9", "a9", "a9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "kha", "ki", "'_", ":_", "'#", "bdb", "7", "6b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "mage", "nta", "'_", ":_", "'#", "8b", "008", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "oli", "veg", "reen", "'_", ":_", "'#", "556", "b2", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "oli", "veg", "reen", "1", "'_", ":_", "'#", "caf", "f7", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "oli", "veg", "reen", "2", "'_", ":_", "'#", "bce", "e", "6", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "oli", "veg", "reen", "3", "'_", ":_", "'#", "a2", "cd", "5a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "oli", "veg", "reen", "4", "'_", ":_", "'#", "6e", "8b", "3d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "orange", "'_", ":_", "'#", "ff", "8c", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "orange", "1", "'_", ":_", "'#", "ff", "7f", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "orange", "2", "'_", ":_", "'#", "ee", "760", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "orange", "3", "'_", ":_", "'#", "cd", "660", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "orange", "4", "'_", ":_", "'#", "8b", "4500", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "orch", "id", "'_", ":_", "'#", "993", "2c", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "orch", "id", "1", "'_", ":_", "'#", "bf", "3e", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "orch", "id2", "'_", ":_", "'#", "b2", "3a", "ee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "orch", "id", "3", "'_", ":_", "'#", "9", "a3", "2c", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "orch", "id", "4", "'_", ":_", "'#", "682", "2", "8b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "red", "'_", ":_", "'#", "8b", "0000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "sal", "mon", "'_", ":_", "'#", "e9", "967", "a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "sea", "green", "'_", ":_", "'#", "8f", "bc", "8f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "sea", "green", "1", "'_", ":_", "'#", "c1", "ffc", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "sea", "green", "2", "'_", ":_", "'#", "b4", "ee", "b4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "sea", "green", "3", "'_", ":_", "'#", "9", "bcd", "9", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "sea", "green", "4", "'_", ":_", "'#", "698", "b6", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "slate", "blue", "'_", ":_", "'#", "483", "d8", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "slate", "gray", "'_", ":_", "'#", "2f", "4f", "4f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "slate", "gray", "1", "'_", ":_", "'#", "9", "7f", "fff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "slate", "gray", "2", "'_", ":_", "'#", "8d", "eeee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "slate", "gray", "3", "'_", ":_", "'#", "7", "9c", "dcd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "slate", "gray", "4", "'_", ":_", "'#", "528", "b8", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "slate", "grey", "'_", ":_", "'#", "2f", "4f", "4f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "tur", "quo", "ise", "'_", ":_", "'#", "00", "ced", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", "violet", "'_", ":_", "'#", "940", "0d", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deep", "'_", ":_", "'#", "ff", "149", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deep", "pin", "k", "'_", ":_", "'#", "ff", "149", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deep", "pin", "k", "1", "'_", ":_", "'#", "ff", "149", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deep", "pin", "k2", "'_", ":_", "'#", "ee", "128", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deep", "pin", "k3", "'_", ":_", "'#", "cd", "107", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deep", "pin", "k", "4", "'_", ":_", "'#", "8b", "0a", "50", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deep", "sky", "blue", "'_", ":_", "'#", "00", "bf", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deep", "sky", "blue", "1", "'_", ":_", "'#", "00", "bf", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deep", "sky", "blue", "2", "'_", ":_", "'#", "00", "b2", "ee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deep", "sky", "blue", "3", "'_", ":_", "'#", "009", "acd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deep", "sky", "blue", "4", "'_", ":_", "'#", "006", "88", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dim", "'_", ":_", "'#", "696", "969", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dim", "gray", "'_", ":_", "'#", "696", "969", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dim", "grey", "'_", ":_", "'#", "696", "969", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dod", "ger", "'_", ":_", "'#", "1e", "90", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dod", "ger", "blue", "'_", ":_", "'#", "1e", "90", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dod", "ger", "blue", "1", "'_", ":_", "'#", "1e", "90", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dod", "ger", "blue", "2", "'_", ":_", "'#", "1c", "86", "ee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dod", "ger", "blue", "3", "'_", ":_", "'#", "187", "4c", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dod", "ger", "blue", "4", "'_", ":_", "'#", "104", "e8", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fire", "brick", "'_", ":_", "'#", "b2", "2222", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fire", "brick", "1", "'_", ":_", "'#", "ff", "303", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fire", "brick", "2", "'_", ":_", "'#", "ee", "2c", "2c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fire", "brick", "3", "'_", ":_", "'#", "cd", "262", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fire", "brick", "4", "'_", ":_", "'#", "8b", "1a", "1a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "flo", "ral", "'_", ":_", "'#", "fff", "af", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "flo", "ral", "white", "'_", ":_", "'#", "fff", "af", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "forest", "'_", ":_", "'#", "228", "b2", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "forest", "green", "'_", ":_", "'#", "228", "b2", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gains", "bor", "o", "'_", ":_", "'#", "dcd", "cdc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ghost", "'_", ":_", "'#", "f8", "f8", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ghost", "white", "'_", ":_", "'#", "f8", "f8", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gold", "'_", ":_", "'#", "ffd", "700", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gold", "1", "'_", ":_", "'#", "ffd", "700", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gold", "2", "'_", ":_", "'#", "eec", "900", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gold", "3", "'_", ":_", "'#", "cda", "d0", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gold", "4", "'_", ":_", "'#", "8b", "750", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "golden", "rod", "'_", ":_", "'#", "da", "a5", "20", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "golden", "rod", "1", "'_", ":_", "'#", "ffc", "125", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "golden", "rod", "2", "'_", ":_", "'#", "ee", "b4", "2", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "golden", "rod", "3", "'_", ":_", "'#", "cd", "9", "b1", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "golden", "rod", "4", "'_", ":_", "'#", "8b", "691", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "'_", ":_", "'#", "be", "be", "be", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "0", "'_", ":_", "'#", "000000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "1", "'_", ":_", "'#", "030", "303", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "10", "'_", ":_", "'#", "1a", "1a", "1a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "100", "'_", ":_", "'#", "ffffff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "11", "'_", ":_", "'#", "1c", "1c", "1c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "1", "2", "'_", ":_", "'#", "1f", "1f", "1f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "13", "'_", ":_", "'#", "212", "121", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "14", "'_", ":_", "'#", "242", "424", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "15", "'_", ":_", "'#", "262", "626", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "16", "'_", ":_", "'#", "292", "929", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "1", "7", "'_", ":_", "'#", "2b", "2b", "2b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "1", "8", "'_", ":_", "'#", "2e", "2e", "2e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "1", "9", "'_", ":_", "'#", "303", "030", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "2", "'_", ":_", "'#", "050", "505", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "20", "'_", ":_", "'#", "33333", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "21", "'_", ":_", "'#", "3636", "3", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "2", "2", "'_", ":_", "'#", "383", "838", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "23", "'_", ":_", "'#", "3b", "3b", "3b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "24", "'_", ":_", "'#", "3d", "3d", "3d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "25", "'_", ":_", "'#", "404", "040", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "2", "6", "'_", ":_", "'#", "424", "242", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "2", "7", "'_", ":_", "'#", "454", "545", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "2", "8", "'_", ":_", "'#", "474", "747", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "2", "9", "'_", ":_", "'#", "4a", "4a", "4a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "3", "'_", ":_", "'#", "080", "808", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "30", "'_", ":_", "'#", "4d", "4d", "4d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "3", "1", "'_", ":_", "'#", "4f", "4f", "4f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "32", "'_", ":_", "'#", "525", "252", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "3", "3", "'_", ":_", "'#", "545", "454", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "3", "4", "'_", ":_", "'#", "575", "757", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "3", "5", "'_", ":_", "'#", "595", "959", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "3", "6", "'_", ":_", "'#", "5c", "5c", "5c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "3", "7", "'_", ":_", "'#", "5e", "5e", "5e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "3", "8", "'_", ":_", "'#", "616", "161", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "3", "9", "'_", ":_", "'#", "636", "363", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "4", "'_", ":_", "'#", "0a", "0a", "0a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "40", "'_", ":_", "'#", "666666", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "4", "1", "'_", ":_", "'#", "696", "969", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "4", "2", "'_", ":_", "'#", "6b", "6b", "6b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "4", "3", "'_", ":_", "'#", "6e", "6e", "6e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "4", "4", "'_", ":_", "'#", "707", "070", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "4", "5", "'_", ":_", "'#", "737", "373", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "4", "6", "'_", ":_", "'#", "757", "575", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "4", "7", "'_", ":_", "'#", "787", "878", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "4", "8", "'_", ":_", "'#", "7a", "7a", "7a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "4", "9", "'_", ":_", "'#", "7d", "7d", "7d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "5", "'_", ":_", "'#", "0d", "0d", "0d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "50", "'_", ":_", "'#", "7f", "7f", "7f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "5", "1", "'_", ":_", "'#", "828", "282", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "5", "2", "'_", ":_", "'#", "858", "585", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "5", "3", "'_", ":_", "'#", "878", "787", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "5", "4", "'_", ":_", "'#", "8a", "8a", "8a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "5", "5", "'_", ":_", "'#", "8c", "8c", "8c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "56", "'_", ":_", "'#", "8f", "8f", "8f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "5", "7", "'_", ":_", "'#", "919", "191", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "5", "8", "'_", ":_", "'#", "949", "494", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "5", "9", "'_", ":_", "'#", "969", "696", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "6", "'_", ":_", "'#", "0f", "0f", "0f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "60", "'_", ":_", "'#", "999999", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "6", "1", "'_", ":_", "'#", "9c", "9c", "9c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "6", "2", "'_", ":_", "'#", "9e", "9e", "9e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "6", "3", "'_", ":_", "'#", "a1", "a1", "a1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "64", "'_", ":_", "'#", "a3", "a3", "a3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "6", "5", "'_", ":_", "'#", "a6", "a6", "a6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "6", "6", "'_", ":_", "'#", "a8", "a8", "a8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "6", "7", "'_", ":_", "'#", "aba", "bab", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "6", "8", "'_", ":_", "'#", "ada", "dad", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "6", "9", "'_", ":_", "'#", "b0", "b0", "b0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "7", "'_", ":_", "'#", "1212", "1", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "7", "0", "'_", ":_", "'#", "b3", "b3", "b3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "7", "1", "'_", ":_", "'#", "b5", "b5", "b5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "7", "2", "'_", ":_", "'#", "b8", "b8", "b8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "7", "3", "'_", ":_", "'#", "bababa", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "7", "4", "'_", ":_", "'#", "bdb", "dbd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "7", "5", "'_", ":_", "'#", "bf", "bf", "bf", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "7", "6", "'_", ":_", "'#", "c2", "c2", "c2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "7", "7", "'_", ":_", "'#", "c4", "c4", "c4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "7", "8", "'_", ":_", "'#", "c7", "c7", "c7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "7", "9", "'_", ":_", "'#", "c9", "c9", "c9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "8", "'_", ":_", "'#", "141", "414", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "80", "'_", ":_", "'#", "ccccc", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "8", "1", "'_", ":_", "'#", "cfc", "fcf", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "8", "2", "'_", ":_", "'#", "d1", "d1", "d1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "8", "3", "'_", ":_", "'#", "d4", "d4", "d4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "84", "'_", ":_", "'#", "d6", "d6", "d6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "85", "'_", ":_", "'#", "d", "9", "d", "9", "d", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "86", "'_", ":_", "'#", "dbd", "bdb", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "87", "'_", ":_", "'#", "ded", "ede", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "88", "'_", ":_", "'#", "e0", "e0", "e0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "89", "'_", ":_", "'#", "e3", "e3", "e3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "9", "'_", ":_", "'#", "171", "717", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "90", "'_", ":_", "'#", "e5", "e5", "e5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "9", "1", "'_", ":_", "'#", "e8", "e8", "e8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "9", "2", "'_", ":_", "'#", "ebe", "be", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "9", "3", "'_", ":_", "'#", "eded", "ed", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "9", "4", "'_", ":_", "'#", "f0", "f0", "f0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "9", "5", "'_", ":_", "'#", "f2", "f2", "f2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "96", "'_", ":_", "'#", "f5", "f5", "f5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "9", "7", "'_", ":_", "'#", "f7", "f7", "f7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "98", "'_", ":_", "'#", "fa", "fa", "fa", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gray", "9", "9", "'_", ":_", "'#", "fcf", "cfc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "green", "'_", ":_", "'#", "adf", "f2", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "green", "1", "'_", ":_", "'#", "00", "ff", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "green", "2", "'_", ":_", "'#", "00", "ee", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "green", "3", "'_", ":_", "'#", "00", "cd", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "green", "4", "'_", ":_", "'#", "008", "b0", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "green", "yell", "ow", "'_", ":_", "'#", "adf", "f2", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "'_", ":_", "'#", "be", "be", "be", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "0", "'_", ":_", "'#", "000000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "1", "'_", ":_", "'#", "030", "303", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "10", "'_", ":_", "'#", "1a", "1a", "1a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "100", "'_", ":_", "'#", "ffffff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "11", "'_", ":_", "'#", "1c", "1c", "1c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "1", "2", "'_", ":_", "'#", "1f", "1f", "1f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "13", "'_", ":_", "'#", "212", "121", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "14", "'_", ":_", "'#", "242", "424", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "15", "'_", ":_", "'#", "262", "626", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "16", "'_", ":_", "'#", "292", "929", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "1", "7", "'_", ":_", "'#", "2b", "2b", "2b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "1", "8", "'_", ":_", "'#", "2e", "2e", "2e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "1", "9", "'_", ":_", "'#", "303", "030", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "2", "'_", ":_", "'#", "050", "505", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "20", "'_", ":_", "'#", "33333", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "21", "'_", ":_", "'#", "3636", "3", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "2", "2", "'_", ":_", "'#", "383", "838", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "23", "'_", ":_", "'#", "3b", "3b", "3b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "24", "'_", ":_", "'#", "3d", "3d", "3d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "25", "'_", ":_", "'#", "404", "040", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "2", "6", "'_", ":_", "'#", "424", "242", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "2", "7", "'_", ":_", "'#", "454", "545", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "2", "8", "'_", ":_", "'#", "474", "747", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "2", "9", "'_", ":_", "'#", "4a", "4a", "4a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "3", "'_", ":_", "'#", "080", "808", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "30", "'_", ":_", "'#", "4d", "4d", "4d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "3", "1", "'_", ":_", "'#", "4f", "4f", "4f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "32", "'_", ":_", "'#", "525", "252", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "3", "3", "'_", ":_", "'#", "545", "454", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "3", "4", "'_", ":_", "'#", "575", "757", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "3", "5", "'_", ":_", "'#", "595", "959", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "3", "6", "'_", ":_", "'#", "5c", "5c", "5c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "3", "7", "'_", ":_", "'#", "5e", "5e", "5e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "3", "8", "'_", ":_", "'#", "616", "161", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "3", "9", "'_", ":_", "'#", "636", "363", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "4", "'_", ":_", "'#", "0a", "0a", "0a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "40", "'_", ":_", "'#", "666666", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "4", "1", "'_", ":_", "'#", "696", "969", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "4", "2", "'_", ":_", "'#", "6b", "6b", "6b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "4", "3", "'_", ":_", "'#", "6e", "6e", "6e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "4", "4", "'_", ":_", "'#", "707", "070", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "4", "5", "'_", ":_", "'#", "737", "373", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "4", "6", "'_", ":_", "'#", "757", "575", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "4", "7", "'_", ":_", "'#", "787", "878", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "4", "8", "'_", ":_", "'#", "7a", "7a", "7a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "4", "9", "'_", ":_", "'#", "7d", "7d", "7d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "5", "'_", ":_", "'#", "0d", "0d", "0d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "50", "'_", ":_", "'#", "7f", "7f", "7f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "5", "1", "'_", ":_", "'#", "828", "282", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "5", "2", "'_", ":_", "'#", "858", "585", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "5", "3", "'_", ":_", "'#", "878", "787", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "5", "4", "'_", ":_", "'#", "8a", "8a", "8a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "5", "5", "'_", ":_", "'#", "8c", "8c", "8c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "56", "'_", ":_", "'#", "8f", "8f", "8f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "5", "7", "'_", ":_", "'#", "919", "191", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "5", "8", "'_", ":_", "'#", "949", "494", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "5", "9", "'_", ":_", "'#", "969", "696", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "6", "'_", ":_", "'#", "0f", "0f", "0f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "60", "'_", ":_", "'#", "999999", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "6", "1", "'_", ":_", "'#", "9c", "9c", "9c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "6", "2", "'_", ":_", "'#", "9e", "9e", "9e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "6", "3", "'_", ":_", "'#", "a1", "a1", "a1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "64", "'_", ":_", "'#", "a3", "a3", "a3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "6", "5", "'_", ":_", "'#", "a6", "a6", "a6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "6", "6", "'_", ":_", "'#", "a8", "a8", "a8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "6", "7", "'_", ":_", "'#", "aba", "bab", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "6", "8", "'_", ":_", "'#", "ada", "dad", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "6", "9", "'_", ":_", "'#", "b0", "b0", "b0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "7", "'_", ":_", "'#", "1212", "1", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "7", "0", "'_", ":_", "'#", "b3", "b3", "b3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "7", "1", "'_", ":_", "'#", "b5", "b5", "b5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "7", "2", "'_", ":_", "'#", "b8", "b8", "b8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "7", "3", "'_", ":_", "'#", "bababa", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "7", "4", "'_", ":_", "'#", "bdb", "dbd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "7", "5", "'_", ":_", "'#", "bf", "bf", "bf", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "7", "6", "'_", ":_", "'#", "c2", "c2", "c2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "7", "7", "'_", ":_", "'#", "c4", "c4", "c4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "7", "8", "'_", ":_", "'#", "c7", "c7", "c7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "7", "9", "'_", ":_", "'#", "c9", "c9", "c9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "8", "'_", ":_", "'#", "141", "414", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "80", "'_", ":_", "'#", "ccccc", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "8", "1", "'_", ":_", "'#", "cfc", "fcf", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "8", "2", "'_", ":_", "'#", "d1", "d1", "d1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "8", "3", "'_", ":_", "'#", "d4", "d4", "d4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "84", "'_", ":_", "'#", "d6", "d6", "d6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "85", "'_", ":_", "'#", "d", "9", "d", "9", "d", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "86", "'_", ":_", "'#", "dbd", "bdb", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "87", "'_", ":_", "'#", "ded", "ede", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "88", "'_", ":_", "'#", "e0", "e0", "e0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "89", "'_", ":_", "'#", "e3", "e3", "e3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "9", "'_", ":_", "'#", "171", "717", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "90", "'_", ":_", "'#", "e5", "e5", "e5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "9", "1", "'_", ":_", "'#", "e8", "e8", "e8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "9", "2", "'_", ":_", "'#", "ebe", "be", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "9", "3", "'_", ":_", "'#", "eded", "ed", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "9", "4", "'_", ":_", "'#", "f0", "f0", "f0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "9", "5", "'_", ":_", "'#", "f2", "f2", "f2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "96", "'_", ":_", "'#", "f5", "f5", "f5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "9", "7", "'_", ":_", "'#", "f7", "f7", "f7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "98", "'_", ":_", "'#", "fa", "fa", "fa", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grey", "9", "9", "'_", ":_", "'#", "fcf", "cfc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "honey", "dew", "'_", ":_", "'#", "f0", "fff", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "honey", "dew", "1", "'_", ":_", "'#", "f0", "fff", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "honey", "dew", "2", "'_", ":_", "'#", "e0", "eee", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "honey", "dew", "3", "'_", ":_", "'#", "c1", "cdc", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "honey", "dew", "4", "'_", ":_", "'#", "838", "b8", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hot", "'_", ":_", "'#", "ff", "6", "9", "b4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hot", "pin", "k", "'_", ":_", "'#", "ff", "6", "9", "b4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hot", "pin", "k", "1", "'_", ":_", "'#", "ff", "6e", "b4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hot", "pin", "k2", "'_", ":_", "'#", "ee", "6a", "a7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hot", "pin", "k3", "'_", ":_", "'#", "cd", "609", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hot", "pin", "k", "4", "'_", ":_", "'#", "8b", "3a", "6", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "india", "n", "'_", ":_", "'#", "cd", "5c", "5c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "india", "nre", "d", "'_", ":_", "'#", "cd", "5c", "5c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "india", "nre", "d1", "'_", ":_", "'#", "ff", "6a", "6a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "india", "nre", "d2", "'_", ":_", "'#", "ee", "636", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "india", "nre", "d3", "'_", ":_", "'#", "cd", "5555", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "india", "nre", "d4", "'_", ":_", "'#", "8b", "3a", "3a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ivo", "ry", "'_", ":_", "'#", "fffff", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ivo", "ry", "1", "'_", ":_", "'#", "fffff", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ivo", "ry", "2", "'_", ":_", "'#", "eeee", "e0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ivo", "ry", "3", "'_", ":_", "'#", "cdc", "dc", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ivo", "ry", "4", "'_", ":_", "'#", "8b", "8b", "8", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "kha", "ki", "'_", ":_", "'#", "f0", "e", "6", "8c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "kha", "ki", "1", "'_", ":_", "'#", "fff", "6", "8f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "kha", "ki", "2", "'_", ":_", "'#", "eee", "685", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "kha", "ki", "3", "'_", ":_", "'#", "cdc", "673", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "kha", "ki", "4", "'_", ":_", "'#", "8b", "864", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lav", "ender", "'_", ":_", "'#", "fff", "0f", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lav", "ender", "blu", "sh", "'_", ":_", "'#", "fff", "0f", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lav", "ender", "blu", "sh", "1", "'_", ":_", "'#", "fff", "0f", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lav", "ender", "blu", "sh", "2", "'_", ":_", "'#", "eee", "0e", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lav", "ender", "blu", "sh", "3", "'_", ":_", "'#", "cdc", "1c", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lav", "ender", "blu", "sh", "4", "'_", ":_", "'#", "8b", "838", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "law", "n", "'_", ":_", "'#", "7c", "fc", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "law", "ngr", "een", "'_", ":_", "'#", "7c", "fc", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lem", "on", "'_", ":_", "'#", "fff", "acd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lem", "onc", "hi", "ffo", "n", "'_", ":_", "'#", "fff", "acd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lem", "onc", "hi", "ffo", "n1", "'_", ":_", "'#", "fff", "acd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lem", "onc", "hi", "ffo", "n2", "'_", ":_", "'#", "eee", "9", "bf", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lem", "onc", "hi", "ffo", "n", "3", "'_", ":_", "'#", "cdc", "9", "a5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lem", "onc", "hi", "ffo", "n4", "'_", ":_", "'#", "8b", "897", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "'_", ":_", "'#", "90", "ee", "90", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "blue", "'_", ":_", "'#", "add", "8e", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "blue", "1", "'_", ":_", "'#", "bf", "eff", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "blue", "2", "'_", ":_", "'#", "b2", "df", "ee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "blue", "3", "'_", ":_", "'#", "9", "ac", "0c", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "blue", "4", "'_", ":_", "'#", "688", "3", "8b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "cora", "l", "'_", ":_", "'#", "f0", "808", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "cya", "n", "'_", ":_", "'#", "e0", "fff", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "cya", "n1", "'_", ":_", "'#", "e0", "fff", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "cya", "n2", "'_", ":_", "'#", "d1", "eeee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "cya", "n", "3", "'_", ":_", "'#", "b4", "cdc", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "cya", "n4", "'_", ":_", "'#", "7a", "8b", "8b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lightg", "old", "enr", "od", "'_", ":_", "'#", "eed", "d8", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lightg", "old", "enr", "od", "1", "'_", ":_", "'#", "ffe", "c8", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lightg", "old", "enr", "od", "2", "'_", ":_", "'#", "eed", "c8", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lightg", "old", "enr", "od", "3", "'_", ":_", "'#", "cdb", "e7", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lightg", "old", "enr", "od", "4", "'_", ":_", "'#", "8b", "814", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lightg", "old", "enr", "ody", "ello", "w", "'_", ":_", "'#", "fa", "fad", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lightg", "ray", "'_", ":_", "'#", "d3", "d3", "d3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lightg", "reen", "'_", ":_", "'#", "90", "ee", "90", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lightg", "rey", "'_", ":_", "'#", "d3", "d3", "d3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "pin", "k", "'_", ":_", "'#", "ff", "b6", "c1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "pin", "k", "1", "'_", ":_", "'#", "ffa", "eb", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "pin", "k2", "'_", ":_", "'#", "ee", "a2", "ad", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "pin", "k3", "'_", ":_", "'#", "cd", "8c", "9", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "pin", "k", "4", "'_", ":_", "'#", "8b", "5f", "6", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "alm", "on", "'_", ":_", "'#", "ffa", "0", "7a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "alm", "on1", "'_", ":_", "'#", "ffa", "0", "7a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "alm", "on2", "'_", ":_", "'#", "ee", "957", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "alm", "on", "3", "'_", ":_", "'#", "cd", "816", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "alm", "on", "4", "'_", ":_", "'#", "8b", "574", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "ea", "green", "'_", ":_", "'#", "20", "b2", "aa", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "ky", "blue", "'_", ":_", "'#", "87", "cef", "a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "ky", "blue", "1", "'_", ":_", "'#", "b0", "e2", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "ky", "blue", "2", "'_", ":_", "'#", "a4", "d3", "ee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "ky", "blue", "3", "'_", ":_", "'#", "8d", "b6", "cd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "ky", "blue", "4", "'_", ":_", "'#", "607", "b8", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "late", "blue", "'_", ":_", "'#", "847", "0f", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "late", "gray", "'_", ":_", "'#", "778", "899", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "late", "grey", "'_", ":_", "'#", "778", "899", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "tee", "lbl", "ue", "'_", ":_", "'#", "b0", "c4", "de", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "tee", "lbl", "ue", "1", "'_", ":_", "'#", "cae", "1f", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "tee", "lbl", "ue", "2", "'_", ":_", "'#", "bcd", "2e", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "tee", "lbl", "ue", "3", "'_", ":_", "'#", "a2", "b5", "cd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lights", "tee", "lbl", "ue", "4", "'_", ":_", "'#", "6e", "7b", "8b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "yell", "ow", "'_", ":_", "'#", "fff", "fe", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "yell", "ow", "1", "'_", ":_", "'#", "fff", "fe", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "yell", "ow", "2", "'_", ":_", "'#", "eeee", "d1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "yell", "ow", "3", "'_", ":_", "'#", "cdc", "db", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", "yell", "ow", "4", "'_", ":_", "'#", "8b", "8b", "7a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lim", "e", "'_", ":_", "'#", "32", "cd", "32", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lim", "egr", "een", "'_", ":_", "'#", "32", "cd", "32", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "linen", "'_", ":_", "'#", "fa", "f0", "e", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mage", "nta", "'_", ":_", "'#", "ff", "00", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mage", "nta", "1", "'_", ":_", "'#", "ff", "00", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mage", "nta", "2", "'_", ":_", "'#", "ee", "00", "ee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mage", "nta", "3", "'_", ":_", "'#", "cd", "00", "cd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mage", "nta", "4", "'_", ":_", "'#", "8b", "008", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mar", "oon", "'_", ":_", "'#", "b0", "306", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mar", "oon", "1", "'_", ":_", "'#", "ff", "3", "4b", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mar", "oon", "2", "'_", ":_", "'#", "ee", "30", "a7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mar", "oon", "3", "'_", ":_", "'#", "cd", "299", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mar", "oon", "4", "'_", ":_", "'#", "8b", "1c", "6", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "'_", ":_", "'#", "937", "0d", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "aqu", "amar", "ine", "'_", ":_", "'#", "6", "6c", "da", "a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "blue", "'_", ":_", "'#", "0000", "cd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "orch", "id", "'_", ":_", "'#", "ba", "5", "5d", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "orch", "id", "1", "'_", ":_", "'#", "e0", "6", "6f", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "orch", "id2", "'_", ":_", "'#", "d1", "5f", "ee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "orch", "id", "3", "'_", ":_", "'#", "b4", "5", "2c", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "orch", "id", "4", "'_", ":_", "'#", "7a", "378", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "pur", "ple", "'_", ":_", "'#", "937", "0d", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "pur", "ple", "1", "'_", ":_", "'#", "ab", "8", "2f", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "pur", "ple", "2", "'_", ":_", "'#", "9", "f7", "9e", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "pur", "ple", "3", "'_", ":_", "'#", "896", "8c", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "pur", "ple", "4", "'_", ":_", "'#", "5d", "478", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "sea", "green", "'_", ":_", "'#", "3c", "b3", "7", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "slate", "blue", "'_", ":_", "'#", "7b", "6", "8e", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "spring", "green", "'_", ":_", "'#", "00", "fa", "9", "a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "tur", "quo", "ise", "'_", ":_", "'#", "4", "8d", "1c", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "medium", "violet", "red", "'_", ":_", "'#", "c7", "158", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mid", "night", "'_", ":_", "'#", "191", "970", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mid", "night", "blue", "'_", ":_", "'#", "191", "970", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mint", "'_", ":_", "'#", "f5", "fff", "a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mint", "crea", "m", "'_", ":_", "'#", "f5", "fff", "a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mist", "y", "'_", ":_", "'#", "ffe", "4e", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mist", "yro", "se", "'_", ":_", "'#", "ffe", "4e", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mist", "yro", "se", "1", "'_", ":_", "'#", "ffe", "4e", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mist", "yro", "se", "2", "'_", ":_", "'#", "eed", "5d", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mist", "yro", "se", "3", "'_", ":_", "'#", "cdb", "7b", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mist", "yro", "se", "4", "'_", ":_", "'#", "8b", "7d", "7b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "moc", "casi", "n", "'_", ":_", "'#", "ffe", "4b", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nav", "ajo", "'_", ":_", "'#", "ffd", "ead", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nav", "ajo", "white", "'_", ":_", "'#", "ffd", "ead", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nav", "ajo", "white", "1", "'_", ":_", "'#", "ffd", "ead", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nav", "ajo", "white", "2", "'_", ":_", "'#", "eec", "fa", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nav", "ajo", "white", "3", "'_", ":_", "'#", "cdb", "3", "8b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nav", "ajo", "white", "4", "'_", ":_", "'#", "8b", "795", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nav", "y", "'_", ":_", "'#", "0000", "80", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nav", "yb", "lue", "'_", ":_", "'#", "0000", "80", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "old", "'_", ":_", "'#", "fdf", "5e", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "old", "lace", "'_", ":_", "'#", "fdf", "5e", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "oli", "ve", "'_", ":_", "'#", "6b", "8e", "23", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "oli", "ved", "rab", "'_", ":_", "'#", "6b", "8e", "23", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "oli", "ved", "rab", "1", "'_", ":_", "'#", "c0", "ff", "3e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "oli", "ved", "rab", "2", "'_", ":_", "'#", "b3", "ee", "3a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "oli", "ved", "rab", "3", "'_", ":_", "'#", "9", "acd", "32", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "oli", "ved", "rab", "4", "'_", ":_", "'#", "698", "b2", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orange", "'_", ":_", "'#", "ff", "4500", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orange", "1", "'_", ":_", "'#", "ffa", "500", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orange", "2", "'_", ":_", "'#", "ee", "9", "a0", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orange", "3", "'_", ":_", "'#", "cd", "850", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orange", "4", "'_", ":_", "'#", "8b", "5a", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orange", "red", "'_", ":_", "'#", "ff", "4500", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orange", "red", "1", "'_", ":_", "'#", "ff", "4500", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orange", "red", "2", "'_", ":_", "'#", "ee", "4000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orange", "red", "3", "'_", ":_", "'#", "cd", "370", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orange", "red", "4", "'_", ":_", "'#", "8b", "2500", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orch", "id", "'_", ":_", "'#", "da", "7", "0d", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orch", "id", "1", "'_", ":_", "'#", "ff", "8", "3f", "a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orch", "id2", "'_", ":_", "'#", "ee", "7a", "e9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orch", "id", "3", "'_", ":_", "'#", "cd", "6", "9c", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orch", "id", "4", "'_", ":_", "'#", "8b", "478", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pale", "'_", ":_", "'#", "db", "709", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pale", "golden", "rod", "'_", ":_", "'#", "eee", "8a", "a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pale", "green", "'_", ":_", "'#", "98", "fb", "98", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pale", "green", "1", "'_", ":_", "'#", "9", "aff", "9", "a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pale", "green", "2", "'_", ":_", "'#", "90", "ee", "90", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pale", "green", "3", "'_", ":_", "'#", "7c", "cd", "7c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pale", "green", "4", "'_", ":_", "'#", "548", "b5", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pale", "tur", "quo", "ise", "'_", ":_", "'#", "afe", "eee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pale", "tur", "quo", "ise", "1", "'_", ":_", "'#", "bb", "fff", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pale", "tur", "quo", "ise", "2", "'_", ":_", "'#", "ae", "eeee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pale", "tur", "quo", "ise", "3", "'_", ":_", "'#", "96", "cdc", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pale", "tur", "quo", "ise", "4", "'_", ":_", "'#", "668", "b8", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pale", "violet", "red", "'_", ":_", "'#", "db", "709", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pale", "violet", "red", "1", "'_", ":_", "'#", "ff", "8", "2a", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pale", "violet", "red", "2", "'_", ":_", "'#", "ee", "799", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pale", "violet", "red", "3", "'_", ":_", "'#", "cd", "688", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pale", "violet", "red", "4", "'_", ":_", "'#", "8b", "475", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pap", "aya", "'_", ":_", "'#", "ffe", "fd", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pap", "aya", "whi", "p", "'_", ":_", "'#", "ffe", "fd", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "peac", "h", "'_", ":_", "'#", "ffd", "ab", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "peac", "hp", "uff", "'_", ":_", "'#", "ffd", "ab", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "peac", "hp", "uff", "1", "'_", ":_", "'#", "ffd", "ab", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "peac", "hp", "uff", "2", "'_", ":_", "'#", "eec", "bad", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "peac", "hp", "uff", "3", "'_", ":_", "'#", "cda", "f9", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "peac", "hp", "uff", "4", "'_", ":_", "'#", "8b", "776", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "per", "u", "'_", ":_", "'#", "cd", "853", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pin", "k", "'_", ":_", "'#", "ffc", "0c", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pin", "k", "1", "'_", ":_", "'#", "ff", "b5", "c5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pin", "k2", "'_", ":_", "'#", "ee", "a9", "b8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pin", "k3", "'_", ":_", "'#", "cd", "919", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pin", "k", "4", "'_", ":_", "'#", "8b", "636", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "plum", "'_", ":_", "'#", "dda", "0d", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "plum", "1", "'_", ":_", "'#", "ff", "bb", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "plum", "2", "'_", ":_", "'#", "ee", "ae", "ee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "plum", "3", "'_", ":_", "'#", "cd", "96", "cd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "plum", "4", "'_", ":_", "'#", "8b", "668", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pow", "der", "'_", ":_", "'#", "b0", "e0", "e", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pow", "der", "blue", "'_", ":_", "'#", "b0", "e0", "e", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pur", "ple", "'_", ":_", "'#", "a0", "20", "f0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pur", "ple", "1", "'_", ":_", "'#", "9", "b3", "0f", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pur", "ple", "2", "'_", ":_", "'#", "912", "cee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pur", "ple", "3", "'_", ":_", "'#", "7d", "2", "6c", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pur", "ple", "4", "'_", ":_", "'#", "551", "a8", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "red", "'_", ":_", "'#", "ff", "0000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "red", "1", "'_", ":_", "'#", "ff", "0000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "red", "2", "'_", ":_", "'#", "ee", "0000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "red", "3", "'_", ":_", "'#", "cd", "0000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "red", "4", "'_", ":_", "'#", "8b", "0000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ros", "y", "'_", ":_", "'#", "bc", "8f", "8f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ros", "yb", "rown", "'_", ":_", "'#", "bc", "8f", "8f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ros", "yb", "rown", "1", "'_", ":_", "'#", "ffc", "1c", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ros", "yb", "rown", "2", "'_", ":_", "'#", "ee", "b4", "b4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ros", "yb", "rown", "3", "'_", ":_", "'#", "cd", "9", "b9", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ros", "yb", "rown", "4", "'_", ":_", "'#", "8b", "696", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "roy", "al", "'_", ":_", "'#", "416", "9e", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "roy", "alb", "lue", "'_", ":_", "'#", "416", "9e", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "roy", "alb", "lue", "1", "'_", ":_", "'#", "487", "6f", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "roy", "alb", "lue", "2", "'_", ":_", "'#", "436", "eee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "roy", "alb", "lue", "3", "'_", ":_", "'#", "3a", "5f", "cd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "roy", "alb", "lue", "4", "'_", ":_", "'#", "274", "0", "8b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sadd", "le", "'_", ":_", "'#", "8b", "451", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sadd", "le", "brow", "n", "'_", ":_", "'#", "8b", "451", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sal", "mon", "'_", ":_", "'#", "fa", "807", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sal", "mon", "1", "'_", ":_", "'#", "ff", "8c", "6", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sal", "mon", "2", "'_", ":_", "'#", "ee", "826", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sal", "mon", "3", "'_", ":_", "'#", "cd", "705", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sal", "mon", "4", "'_", ":_", "'#", "8b", "4c", "3", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sand", "y", "'_", ":_", "'#", "f4", "a4", "60", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sand", "yb", "rown", "'_", ":_", "'#", "f4", "a4", "60", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sea", "'_", ":_", "'#", "2e", "8b", "5", "7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sea", "green", "'_", ":_", "'#", "2e", "8b", "5", "7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sea", "green", "1", "'_", ":_", "'#", "5", "4f", "f9", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sea", "green", "2", "'_", ":_", "'#", "4e", "ee", "9", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sea", "green", "3", "'_", ":_", "'#", "4", "3c", "d8", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sea", "green", "4", "'_", ":_", "'#", "2e", "8b", "5", "7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sea", "shell", "'_", ":_", "'#", "fff", "5e", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sea", "shell", "1", "'_", ":_", "'#", "fff", "5e", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sea", "shell", "2", "'_", ":_", "'#", "eee", "5d", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sea", "shell", "3", "'_", ":_", "'#", "cdc", "5b", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sea", "shell", "4", "'_", ":_", "'#", "8b", "868", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sie", "nna", "'_", ":_", "'#", "a0", "522", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sie", "nna", "1", "'_", ":_", "'#", "ff", "824", "7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sie", "nna", "2", "'_", ":_", "'#", "ee", "794", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sie", "nna", "3", "'_", ":_", "'#", "cd", "683", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sie", "nna", "4", "'_", ":_", "'#", "8b", "472", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sky", "'_", ":_", "'#", "87", "cee", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sky", "blue", "'_", ":_", "'#", "87", "cee", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sky", "blue", "1", "'_", ":_", "'#", "87", "cef", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sky", "blue", "2", "'_", ":_", "'#", "7e", "c0", "ee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sky", "blue", "3", "'_", ":_", "'#", "6c", "a6", "cd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sky", "blue", "4", "'_", ":_", "'#", "4a", "708", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slate", "'_", ":_", "'#", "6a", "5a", "cd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slate", "blue", "'_", ":_", "'#", "6a", "5a", "cd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slate", "blue", "1", "'_", ":_", "'#", "836", "fff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slate", "blue", "2", "'_", ":_", "'#", "7a", "6", "7e", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slate", "blue", "3", "'_", ":_", "'#", "695", "9c", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slate", "blue", "4", "'_", ":_", "'#", "473", "c8", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slate", "gray", "'_", ":_", "'#", "708", "090", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slate", "gray", "1", "'_", ":_", "'#", "c6", "e2", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slate", "gray", "2", "'_", ":_", "'#", "b9", "d3", "ee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slate", "gray", "3", "'_", ":_", "'#", "9", "fb", "6c", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slate", "gray", "4", "'_", ":_", "'#", "6c", "7b", "8b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slate", "grey", "'_", ":_", "'#", "708", "090", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "snow", "'_", ":_", "'#", "fff", "afa", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "snow", "1", "'_", ":_", "'#", "fff", "afa", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "snow", "2", "'_", ":_", "'#", "eee", "9e", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "snow", "3", "'_", ":_", "'#", "cdc", "9c", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "snow", "4", "'_", ":_", "'#", "8b", "898", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "spring", "'_", ":_", "'#", "00", "ff", "7f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "spring", "green", "'_", ":_", "'#", "00", "ff", "7f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "spring", "green", "1", "'_", ":_", "'#", "00", "ff", "7f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "spring", "green", "2", "'_", ":_", "'#", "00", "ee", "7", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "spring", "green", "3", "'_", ":_", "'#", "00", "cd", "6", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "spring", "green", "4", "'_", ":_", "'#", "008", "b4", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "steel", "'_", ":_", "'#", "468", "2b", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "steel", "blue", "'_", ":_", "'#", "468", "2b", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "steel", "blue", "1", "'_", ":_", "'#", "6", "3b", "8f", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "steel", "blue", "2", "'_", ":_", "'#", "5c", "ace", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "steel", "blue", "3", "'_", ":_", "'#", "4f", "9", "4c", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "steel", "blue", "4", "'_", ":_", "'#", "366", "4", "8b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tan", "'_", ":_", "'#", "d2", "b4", "8c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tan", "1", "'_", ":_", "'#", "ffa", "5", "4f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tan", "2", "'_", ":_", "'#", "ee", "9", "a4", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tan", "3", "'_", ":_", "'#", "cd", "853", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tan", "4", "'_", ":_", "'#", "8b", "5a", "2b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "this", "tle", "'_", ":_", "'#", "d8", "bf", "d8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "this", "tle", "1", "'_", ":_", "'#", "ffe", "1f", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "this", "tle", "2", "'_", ":_", "'#", "eed", "2e", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "this", "tle", "3", "'_", ":_", "'#", "cdb", "5c", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "this", "tle", "4", "'_", ":_", "'#", "8b", "7b", "8b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "toma", "to", "'_", ":_", "'#", "ff", "634", "7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "toma", "to", "1", "'_", ":_", "'#", "ff", "634", "7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "toma", "to", "2", "'_", ":_", "'#", "ee", "5c", "4", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "toma", "to", "3", "'_", ":_", "'#", "cd", "4f", "3", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "toma", "to", "4", "'_", ":_", "'#", "8b", "362", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tur", "quo", "ise", "'_", ":_", "'#", "40", "e0", "d0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tur", "quo", "ise", "1", "'_", ":_", "'#", "00", "f5", "ff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tur", "quo", "ise", "2", "'_", ":_", "'#", "00", "e5", "ee", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tur", "quo", "ise", "3", "'_", ":_", "'#", "00", "c5", "cd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tur", "quo", "ise", "4", "'_", ":_", "'#", "008", "6", "8b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "violet", "'_", ":_", "'#", "ee", "8", "2e", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "violet", "red", "'_", ":_", "'#", "d0", "209", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "violet", "red", "1", "'_", ":_", "'#", "ff", "3e", "96", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "violet", "red", "2", "'_", ":_", "'#", "ee", "3a", "8c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "violet", "red", "3", "'_", ":_", "'#", "cd", "327", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "violet", "red", "4", "'_", ":_", "'#", "8b", "225", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "whe", "at", "'_", ":_", "'#", "f5", "deb", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "whe", "at", "1", "'_", ":_", "'#", "ffe", "7b", "a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "whe", "at", "2", "'_", ":_", "'#", "eed", "8a", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "whe", "at", "3", "'_", ":_", "'#", "cdb", "a9", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "whe", "at", "4", "'_", ":_", "'#", "8b", "7e", "6", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "white", "'_", ":_", "'#", "ffffff", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "white", "smoke", "'_", ":_", "'#", "f5", "f5", "f5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "yell", "ow", "'_", ":_", "'#", "fff", "f0", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "yell", "ow", "1", "'_", ":_", "'#", "fff", "f0", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "yell", "ow", "2", "'_", ":_", "'#", "eeee", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "yell", "ow", "3", "'_", ":_", "'#", "cdc", "d0", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "yell", "ow", "4", "'_", ":_", "'#", "8b", "8b", "00", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "yell", "ow", "green", "'_", ":_", "'#", "9", "acd", "32", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TOKEN", "S_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "normal", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "string", "'_", ":_", "'", "String", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "'_", ":_", "'", "Number", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "float", "'_", ":_", "'", "Number", ".", "Float", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "constant", "'_", ":_", "'", "Name", ".", "Const", "ant", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "'_", ":_", "'", "Number", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "statem", "ent", "'_", ":_", "(_", "'", "Key", "word", "'_", ",_", "'", "Name", ".", "Ta", "g", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "identifi", "er", "'_", ":_", "'", "Name", ".", "Varia", "ble", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "opera", "tor", "'_", ":_", "'", "Opera", "tor", ".", "Word", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "'_", ":_", "'", "Name", ".", "Label", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "exception", "'_", ":_", "'", "Name", ".", "Except", "ion", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "function", "'_", ":_", "(_", "'", "Name", ".", "Function", "'_", ",_", "'", "Name", ".", "Attribute", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "preproc", "'_", ":_", "'", "Comme", "nt", ".", "Prep", "roc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "comment", "'_", ":_", "'", "Comme", "nt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "Key", "word", ".", "Type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "diff", "add", "'_", ":_", "'", "Gene", "ric", ".", "Insert", "ed", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "diff", "delete", "'_", ":_", "'", "Gene", "ric", ".", "Delete", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "'_", ":_", "'", "Gene", "ric", ".", "Error", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "errorm", "sg", "'_", ":_", "'", "Gene", "ric", ".", "Trace", "back", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "Gene", "ric", ".", "Head", "ing", "'_", ",_", "'", "Gene", "ric", ".", "Sub", "heading", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "underl", "ine", "d", "'_", ":_", "'", "Gene", "ric", ".", "Emp", "h", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "special", "'_", ":_", "'", "Name", ".", "Entit", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nont", "ext", "'_", ":_", "'", "Gene", "ric", ".", "Output", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TOKEN", "\\u", "TYPES_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "token_", "in_", "TOKEN", "S_", "._", "itervalues_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "token_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "token_", "=_", "(_", "token_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "token_", "in_", "token_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "token_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "TOKEN", "\\u", "TYPES_", "._", "add_", "(_", "token_", "._", "split_", "(_", "'.'_", ")_", "[_", "0_", "]_", ")_", "\\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_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "exit_", "(_", "main_", "(_", ")_", "or_", "0_", ")_", "\\u\\u\\uDEDENT\\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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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Modification of parameter with default
PublicMapping/DistrictBuilder/docs/loadcensus/configureCensus.py
[ { "content": " def __init__(self, dict={}, **keywords):\n self.dict = dict\n self.dict.update(keywords)", "metadata": "root.DictionaryTemplate.__init__", "header": "['class', 'DictionaryTemplate', ':', '___EOS___']", "index": 138 } ]
[ { "span": "self.dict.", "start_line": 140, "start_column": 8, "end_line": 140, "end_column": 17 } ]
[ { "span": "dict=", "start_line": 138, "start_column": 23, "end_line": 138, "end_column": 27 } ]
1
true
[ "[CLS]_", "Modifica", "tion_", "of_", "parameter_", "with_", "default_", "[SEP]_", "class_", "Dict", "ionar", "y", "Template_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "dict_", "=_", "{_", "}_", ",_", "**_", "keywords_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "dict_", "=_", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dict_", "._", "update_", "(_", "keywords_", ")_", "\\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, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2 ]
Unused import
cloudera/hue/desktop/core/ext-py/Mako-0.8.1/mako/compat.py
[ { "content": "import sys\nimport time\n\npy3k = sys.version_info >= (3, 0)\npy33 = sys.version_info >= (3, 3)\npy26 = sys.version_info >= (2, 6)\npy25 = sys.version_info >= (2, 5)\njython = sys.platform.startswith('java')\nwin32 = sys.platform.startswith('win')\npypy = hasattr(sys, 'pypy_version_info')\n\nif py3k:\n from io import StringIO\n import builtins as compat_builtins\n from urllib.parse import quote_plus, unquote_plus\n from html.entities import codepoint2name, name2codepoint\n string_types = str,\n binary_type = bytes\n text_type = str\n\n\n\nelse:\n import __builtin__ as compat_builtins\n try:\n from cStringIO import StringIO\n except:\n from StringIO import StringIO\n from urllib import quote_plus, unquote_plus\n from htmlentitydefs import codepoint2name, name2codepoint\n string_types = basestring,\n binary_type = str\n text_type = unicode\n\n\n\n\nif py33:\n from importlib import machinery\nelse:\n import imp\n\n\n\ntry:\n import threading\n if py3k:\n import _thread as thread\n else:\n import thread\nexcept ImportError:\n import dummy_threading as threading\n if py3k:\n import _dummy_thread as thread\n else:\n import dummy_thread as thread\n\nif win32 or jython:\n time_func = time.clock\nelse:\n time_func = time.time\n\ntry:\n from functools import partial\nexcept:\n\nif not py25:\n\nelse:\n all = all\n\n\ntry:\n from inspect import CO_VARKEYWORDS, CO_VARARGS\nexcept ImportError:\n import inspect\n\nif py3k:\nelse:\n callable = callable\n\n\n################################################\n# cross-compatible metaclass implementation\n# Copyright (c) 2010-2012 Benjamin Peterson\n################################################\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": " def u(s):\n return s", "metadata": "root.u", "header": "['module', '___EOS___']", "index": 20 }, { "content": " def octal(lit):\n return eval(\"0o\" + lit)", "metadata": "root.octal", "header": "['module', '___EOS___']", "index": 23 }, { "content": " def u(s):\n return unicode(s, \"utf-8\")", "metadata": "root.u", "header": "['module', '___EOS___']", "index": 38 }, { "content": " def octal(lit):\n return eval(\"0\" + lit)", "metadata": "root.octal", "header": "['module', '___EOS___']", "index": 41 }, { "content": " def load_module(module_id, path):\n return machinery.SourceFileLoader(module_id, path).load_module()", "metadata": "root.load_module", "header": "['module', '___EOS___']", "index": 47 }, { "content": " def load_module(module_id, path):\n fp = open(path, 'rb')\n try:\n return imp.load_source(module_id, path, fp)\n finally:\n fp.close()", "metadata": "root.load_module", "header": "['module', '___EOS___']", "index": 51 }, { "content": "def exception_as():\n return sys.exc_info()[1]", "metadata": "root.exception_as", "header": "['module', '___EOS___']", "index": 59 }, { "content": " def partial(func, *args, **keywords):\n def newfunc(*fargs, **fkeywords):\n newkeywords = keywords.copy()\n newkeywords.update(fkeywords)\n return func(*(args + fargs), **newkeywords)\n return newfunc", "metadata": "root.partial", "header": "['module', '___EOS___']", "index": 83 }, { "content": " def all(iterable):\n for i in iterable:\n if not i:\n return False\n return True", "metadata": "root.all", "header": "['module', '___EOS___']", "index": 91 }, { "content": " def exception_name(exc):\n try:\n return exc.__class__.__name__\n except AttributeError:\n return exc.__name__", "metadata": "root.exception_name", "header": "['module', '___EOS___']", "index": 97 }, { "content": " def exception_name(exc):\n return exc.__class__.__name__", "metadata": "root.exception_name", "header": "['module', '___EOS___']", "index": 105 }, { "content": " def inspect_func_args(fn):\n if py3k:\n co = fn.__code__\n else:\n co = fn.func_code\n\n nargs = co.co_argcount\n names = co.co_varnames\n args = list(names[:nargs])\n\n varargs = None\n if co.co_flags & CO_VARARGS:\n varargs = co.co_varnames[nargs]\n nargs = nargs + 1\n varkw = None\n if co.co_flags & CO_VARKEYWORDS:\n varkw = co.co_varnames[nargs]\n\n if py3k:\n return args, varargs, varkw, fn.__defaults__\n else:\n return args, varargs, varkw, fn.func_defaults", "metadata": "root.inspect_func_args", "header": "['module', '___EOS___']", "index": 110 }, { "content": " def inspect_func_args(fn):\n return inspect.getargspec(fn)", "metadata": "root.inspect_func_args", "header": "['module', '___EOS___']", "index": 134 }, { "content": " def callable(fn):\n return hasattr(fn, '__call__')", "metadata": "root.callable", "header": "['module', '___EOS___']", "index": 138 }, { "content": "def with_metaclass(meta, base=object):\n \"\"\"Create a base class with a metaclass.\"\"\"\n return meta(\"%sBase\" % meta.__name__, (base,), {})", "metadata": "root.with_metaclass", "header": "['module', '___EOS___']", "index": 147 } ]
[ { "span": "from io import StringIO", "start_line": 12, "start_column": 4, "end_line": 12, "end_column": 27 }, { "span": "import builtins as compat_builtins", "start_line": 13, "start_column": 4, "end_line": 13, "end_column": 38 }, { "span": "from urllib.parse import quote_plus, unquote_plus", "start_line": 14, "start_column": 4, "end_line": 14, "end_column": 53 }, { "span": "from html.entities import codepoint2name, name2codepoint", "start_line": 15, "start_column": 4, "end_line": 15, "end_column": 60 }, { "span": "import threading", "start_line": 63, "start_column": 4, "end_line": 63, "end_column": 20 }, { "span": "import _thread as thread", "start_line": 65, "start_column": 8, "end_line": 65, "end_column": 32 }, { "span": "import dummy_threading as threading", "start_line": 69, "start_column": 4, "end_line": 69, "end_column": 39 }, { "span": "import _dummy_thread as thread", "start_line": 71, "start_column": 8, "end_line": 71, "end_column": 38 }, { "span": "from functools import partial", "start_line": 81, "start_column": 4, "end_line": 81, "end_column": 33 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "py3", "k_", "=_", "sys_", "._", "version", "\\u", "info_", ">=_", "(_", "3_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "py3", "3_", "=_", "sys_", "._", "version", "\\u", "info_", ">=_", "(_", "3_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "py2", "6_", "=_", "sys_", "._", "version", "\\u", "info_", ">=_", "(_", "2_", ",_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "py2", "5_", "=_", "sys_", "._", "version", "\\u", "info_", ">=_", "(_", "2_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jy", "tho", "n_", "=_", "sys_", "._", "platform_", "._", "startswith_", "(_", "'", "java", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win32", "_", "=_", "sys_", "._", "platform_", "._", "startswith_", "(_", "'", "win", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pypy", "_", "=_", "hasattr_", "(_", "sys_", ",_", "'", "pypy", "\\u", "version", "\\u", "info", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "py3", "k_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "io_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "builtins_", "as_", "compa", "t", "\\u", "builtins_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urllib_", "._", "parse_", "import_", "quote", "\\u", "plus_", ",_", "unqu", "ote", "\\u", "plus_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "html_", "._", "entities_", "import_", "codepoint", "2n", "ame_", ",_", "name2", "codepoint", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "string", "\\u", "types_", "=_", "str_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "binar", "y", "\\u", "type_", "=_", "bytes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "type_", "=_", "str_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "\\u\\u", "builtin\\u\\u_", "as_", "compa", "t", "\\u", "builtins_", "\\u\\u\\uNEWLINE\\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_", ":_", "\\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\\uDEDENT\\u\\u\\u_", "from_", "urllib_", "import_", "quote", "\\u", "plus_", ",_", "unqu", "ote", "\\u", "plus_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "html", "entity", "defs_", "import_", "codepoint", "2n", "ame_", ",_", "name2", "codepoint", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "string", "\\u", "types_", "=_", "basestring_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "binar", "y", "\\u", "type_", "=_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "type_", "=_", "unicode_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "py3", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "importlib_", "import_", "machine", "ry_", "\\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_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "imp_", "\\u\\u\\uNEWLINE\\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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "threading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "py3", "k_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "\\u", "thread_", "as_", "thread_", "\\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_", "thread_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\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_", "dummy", "\\u", "threading_", "as_", "threading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "py3", "k_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "\\u", "dummy", "\\u", "thread_", "as_", "thread_", "\\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_", "dummy", "\\u", "thread_", "as_", "thread_", "\\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_", "win32", "_", "or_", "jy", "tho", "n_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time", "\\u", "func_", "=_", "time_", "._", "clock_", "\\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 ", " _", "time", "\\u", "func_", "=_", "time_", "._", "time_", "\\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_", "functools_", "import_", "partial_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\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_", "if_", "not_", "py2", "5_", ":_", "\\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_", "\\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 ", " _", "all_", "=_", "all_", "\\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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "inspect_", "import_", "CO", "\\u", "VAR", "KEYWORDS", "_", ",_", "CO", "\\u", "VAR", "ARGS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\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_", "inspect_", "\\u\\u\\uNEWLINE\\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_", "if_", "py3", "k_", ":_", "\\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_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "callable_", "=_", "callable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "cross", "-", "compatible", " ", "metaclass", " ", "implementation_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2010", "-", "2012", " ", "Ben", "jam", "in", " ", "Peter", "son_", "\\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_", "u_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "s_", "\\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_", "octa", "l_", "(_", "lit_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "eval_", "(_", "\"", "0o", "\"_", "+_", "lit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "u_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "unicode_", "(_", "s_", ",_", "\"", "utf", "-", "8", "\"_", ")_", "\\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_", "octa", "l_", "(_", "lit_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "eval_", "(_", "\"", "0", "\"_", "+_", "lit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "load", "\\u", "module_", "(_", "module", "\\u", "id_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "machine", "ry_", "._", "Sou", "rce", "File", "Loader_", "(_", "module", "\\u", "id_", ",_", "path_", ")_", "._", "load", "\\u", "module_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "load", "\\u", "module_", "(_", "module", "\\u", "id_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "=_", "open_", "(_", "path_", ",_", "'", "rb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "imp_", "._", "load", "\\u", "source_", "(_", "module", "\\u", "id_", ",_", "path_", ",_", "fp_", ")_", "\\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 ", " _", "fp_", "._", "close_", "(_", ")_", "\\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_", "exception", "\\u", "as_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "[_", "1_", "]_", "\\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 ", " _", "def_", "partial_", "(_", "func_", ",_", "*_", "args_", ",_", "**_", "keywords_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "newf", "unc_", "(_", "*_", "far", "gs_", ",_", "**_", "fkey", "words_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "keywords_", "=_", "keywords_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "keywords_", "._", "update_", "(_", "fkey", "words_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "func_", "(_", "*_", "(_", "args_", "+_", "far", "gs_", ")_", ",_", "**_", "new", "keywords_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "newf", "unc_", "\\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 ", " _", "def_", "all_", "(_", "iterable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "iterable_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "i_", ":_", "\\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_", "return_", "True_", "\\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_", "exception", "\\u", "name_", "(_", "exc_", ")_", ":_", "\\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_", "exc_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "\\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 ", " _", "return_", "exc_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "exception", "\\u", "name_", "(_", "exc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "exc_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "inspect", "\\u", "func", "\\u", "args_", "(_", "fn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "py3", "k_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "co_", "=_", "fn_", "._", "\\u\\u", "code", "\\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 ", " _", "co_", "=_", "fn_", "._", "func", "\\u", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "nargs_", "=_", "co_", "._", "co", "\\u", "argc", "ount_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "names_", "=_", "co_", "._", "co", "\\u", "varnames", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "list_", "(_", "names_", "[_", ":_", "nargs_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "varargs", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "co_", "._", "co", "\\u", "flags_", "&_", "CO", "\\u", "VAR", "ARGS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "varargs", "_", "=_", "co_", "._", "co", "\\u", "varnames", "_", "[_", "nargs_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nargs_", "=_", "nargs_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "var", "kw_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "co_", "._", "co", "\\u", "flags_", "&_", "CO", "\\u", "VAR", "KEYWORDS", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "var", "kw_", "=_", "co_", "._", "co", "\\u", "varnames", "_", "[_", "nargs_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "py3", "k_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "args_", ",_", "varargs", "_", ",_", "var", "kw_", ",_", "fn_", "._", "\\u\\u", "default", "s\\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 ", " _", "return_", "args_", ",_", "varargs", "_", ",_", "var", "kw_", ",_", "fn_", "._", "func", "\\u", "defaults_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "inspect", "\\u", "func", "\\u", "args_", "(_", "fn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "inspect_", "._", "getargs", "pec_", "(_", "fn_", ")_", "\\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 ", " _", "def_", "callable_", "(_", "fn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "hasattr_", "(_", "fn_", ",_", "'\\u", "\\u", "call", "\\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_", "def_", "with", "\\u", "metaclass_", "(_", "meta_", ",_", "base_", "=_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "e", " ", "a", " ", "base", " ", "class", " ", "with", " ", "a", " ", "metaclass", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "meta_", "(_", "\"%", "s", "Base", "\"_", "%_", "meta_", "._", "\\u\\u", "name\\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, 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, 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, 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 ]
Unused import
deceze/Sphinx-HTTP-domain/sphinx_http_domain/directives.py
[ { "content": "# -*- coding: utf-8 -*-\n\"\"\"\n sphinx.domains.http\n ~~~~~~~~~~~~~~~~~~~\n\n Directives for the HTTP domain.\n\"\"\"\n\nimport re\nfrom urlparse import urlsplit\n\nfrom docutils.nodes import literal, strong, Text\nfrom docutils.parsers.rst import directives\n\nfrom sphinx.locale import l_, _\nfrom sphinx.directives import ObjectDescription\nfrom sphinx.util.docfields import TypedField\n\nfrom sphinx_http_domain.docfields import NoArgGroupedField, ResponseField\nfrom sphinx_http_domain.nodes import (desc_http_method, desc_http_url,\n desc_http_path, desc_http_patharg,\n desc_http_query, desc_http_queryparam,\n desc_http_fragment, desc_http_response)\nfrom sphinx_http_domain.utils import slugify, slugify_url\n\ntry:\n from urlparse import parse_qsl\nexcept ImportError:\n from cgi import parse_qsl\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class HTTPDescription(ObjectDescription):\n\n\n\n\n", "metadata": "root.HTTPDescription", "header": "['module', '___EOS___']", "index": 30 }, { "content": " def get_anchor(self, name, sig):\n \"\"\"\n Returns anchor for cross-reference IDs.\n\n *name* is whatever :meth:`handle_signature()` returned.\n \"\"\"\n return self.typ + '-' + self.get_id(name, sig)", "metadata": "root.HTTPDescription.get_anchor", "header": "['class', 'HTTPDescription', '(', 'ObjectDescription', ')', ':', '___EOS___']", "index": 31 }, { "content": " def get_entry(self, name, sig):\n \"\"\"\n Returns entry to add for cross-reference IDs.\n\n *name* is whatever :meth:`handle_signature()` returned.\n \"\"\"\n return name", "metadata": "root.HTTPDescription.get_entry", "header": "['class', 'HTTPDescription', '(', 'ObjectDescription', ')', ':', '___EOS___']", "index": 39 }, { "content": " def get_id(self, name, sig):\n \"\"\"\n Returns cross-reference ID.\n\n *name* is whatever :meth:`handle_signature()` returned.\n \"\"\"\n return name", "metadata": "root.HTTPDescription.get_id", "header": "['class', 'HTTPDescription', '(', 'ObjectDescription', ')', ':', '___EOS___']", "index": 47 }, { "content": " def add_target_and_index(self, name, sig, signode):\n \"\"\"\n Add cross-reference IDs and entries to self.indexnode, if applicable.\n\n *name* is whatever :meth:`handle_signature()` returned.\n \"\"\"\n anchor = self.get_anchor(name, sig)\n id = self.get_id(name, sig)\n self.add_target(anchor=anchor, entry=self.get_entry(name, sig),\n id=id, sig=sig, signode=signode)\n self.add_index(anchor=anchor, name=name, sig=sig)", "metadata": "root.HTTPDescription.add_target_and_index", "header": "['class', 'HTTPDescription', '(', 'ObjectDescription', ')', ':', '___EOS___']", "index": 55 }, { "content": " def add_target(self, anchor, id, entry, sig, signode):\n \"\"\"Add cross-references to self.env.domaindata, if applicable.\"\"\"\n if anchor not in self.state.document.ids:\n signode['names'].append(anchor)\n signode['ids'].append(anchor)\n signode['first'] = (not self.names)\n self.state.document.note_explicit_target(signode)\n data = self.env.domaindata['http'][self.typ]\n if id in data:\n otherdocname = data[id][0]\n self.env.warn(\n self.env.docname,\n 'duplicate method description of %s, ' % sig +\n 'other instance in ' +\n self.env.doc2path(otherdocname) +\n ', use :noindex: for one of them',\n self.lineno\n )\n data[id] = entry", "metadata": "root.HTTPDescription.add_target", "header": "['class', 'HTTPDescription', '(', 'ObjectDescription', ')', ':', '___EOS___']", "index": 67 }, { "content": " def add_index(self, anchor, name, sig):\n \"\"\"\n Add index entries to self.indexnode, if applicable.\n\n *name* is whatever :meth:`handle_signature()` returned.\n \"\"\"\n raise NotImplemented", "metadata": "root.HTTPDescription.add_index", "header": "['class', 'HTTPDescription', '(', 'ObjectDescription', ')', ':', '___EOS___']", "index": 87 }, { "content": "class HTTPMethod(HTTPDescription):\n \"\"\"\n Description of a general HTTP method.\n \"\"\"\n typ = 'method'\n nodetype = literal\n\n option_spec = {\n 'noindex': directives.flag,\n 'title': directives.unchanged,\n 'label-name': directives.unchanged,\n }\n doc_field_types = [\n TypedField('argument', label=l_('Path arguments'),\n names=('arg', 'argument', 'patharg'),\n typenames=('argtype', 'pathargtype'),\n can_collapse=True),\n TypedField('parameter', label=l_('Query params'),\n names=('param', 'parameter', 'queryparam'),\n typenames=('paramtype', 'queryparamtype'),\n typerolename='response',\n can_collapse=True),\n TypedField('optional_parameter', label=l_('Opt. params'),\n names=('optparam', 'optional', 'optionalparameter'),\n typenames=('optparamtype',),\n can_collapse=True),\n TypedField('fragment', label=l_('Fragments'),\n names=('frag', 'fragment'),\n typenames=('fragtype',),\n can_collapse=True),\n ResponseField('response', label=l_('Responses'),\n names=('resp', 'responds', 'response'),\n typerolename='response',\n can_collapse=True)\n ]\n\n # RE for HTTP method signatures\n sig_re = re.compile(\n (\n r'^'\n r'(?:(GET|POST|PUT|DELETE)\\s+)?' # HTTP method\n r'(.+)' # URL\n r'\\s*$'\n ),\n re.IGNORECASE\n )\n\n # Note, path_re.findall() will produce an extra ('', '') tuple\n # at the end of its matches. You should strip it off, or you will\n path_re = re.compile(\n (\n r'([^{]*)' # Plain text\n r'(\\{[^}]*\\})?' # {arg} in matched braces\n ),\n re.VERBOSE\n )\n\n\n\n\n\n\n\n\n\n", "metadata": "root.HTTPMethod", "header": "['module', '___EOS___']", "index": 96 }, { "content": " def node_from_method(self, method):\n \"\"\"Returns a ``desc_http_method`` Node from a ``method`` string.\"\"\"\n if method is None:\n method = 'GET'\n return desc_http_method(method, method.upper())", "metadata": "root.HTTPMethod.node_from_method", "header": "['class', 'HTTPMethod', '(', 'HTTPDescription', ')', ':', '___EOS___']", "index": 153 }, { "content": " def node_from_url(self, url):\n \"\"\"Returns a ``desc_http_url`` Node from a ``url`` string.\"\"\"\n if url is None:\n raise ValueError\n # Split URL into path, query, and fragment\n path, query, fragment = self.split_url(url)\n urlnode = desc_http_url()\n urlnode += self.node_from_path(path)\n node = self.node_from_query(query)\n if node:\n urlnode += node\n node = self.node_from_fragment(fragment)\n if node:\n urlnode += node\n return urlnode", "metadata": "root.HTTPMethod.node_from_url", "header": "['class', 'HTTPMethod', '(', 'HTTPDescription', ')', ':', '___EOS___']", "index": 159 }, { "content": " def node_from_path(self, path):\n \"\"\"Returns a ``desc_http_path`` Node from a ``path`` string.\"\"\"\n if path:\n pathnode = desc_http_path(path)\n path_segments = self.path_re.findall(path)[:-1]\n for text, arg in path_segments:\n pathnode += Text(text)\n if arg:\n arg = arg[1:-1] # Strip off { and }\n pathnode += desc_http_patharg(arg, arg)\n return pathnode\n else:\n raise ValueError", "metadata": "root.HTTPMethod.node_from_path", "header": "['class', 'HTTPMethod', '(', 'HTTPDescription', ')', ':', '___EOS___']", "index": 175 }, { "content": " def node_from_query(self, query):\n \"\"\"Returns a ``desc_http_query`` Node from a ``query`` string.\"\"\"\n if query:\n querynode = desc_http_query(query)\n query_params = query.split('&')\n for p in query_params:\n querynode += desc_http_queryparam(p, p)\n return querynode", "metadata": "root.HTTPMethod.node_from_query", "header": "['class', 'HTTPMethod', '(', 'HTTPDescription', ')', ':', '___EOS___']", "index": 189 }, { "content": " def node_from_fragment(self, fragment):\n \"\"\"Returns a ``desc_http_fragment`` Node from a ``fragment`` string.\"\"\"\n if fragment:\n return desc_http_fragment(fragment, fragment)", "metadata": "root.HTTPMethod.node_from_fragment", "header": "['class', 'HTTPMethod', '(', 'HTTPDescription', ')', ':', '___EOS___']", "index": 198 }, { "content": " def split_url(self, url):\n \"\"\"\n Splits a ``url`` string into its components.\n Returns (path, query string, fragment).\n \"\"\"\n _, _, path, query, fragment = urlsplit(url)\n return (path, query, fragment)", "metadata": "root.HTTPMethod.split_url", "header": "['class', 'HTTPMethod', '(', 'HTTPDescription', ')', ':', '___EOS___']", "index": 203 }, { "content": " def handle_signature(self, sig, signode):\n \"\"\"\n Transform an HTTP method signature into RST nodes.\n Returns (method name, full URL).\n \"\"\"\n # Match the signature to extract the method and URL\n m = self.sig_re.match(sig)\n if m is None:\n raise ValueError\n method, url = m.groups()\n # Append nodes to signode for method and url\n signode += self.node_from_method(method)\n signode += self.node_from_url(url)\n # Name and title\n name = self.options.get('label-name',\n slugify_url(method.lower() + '-' + url))\n title = self.options.get('title', sig)\n return (method.upper(), url, name, title)", "metadata": "root.HTTPMethod.handle_signature", "header": "['class', 'HTTPMethod', '(', 'HTTPDescription', ')', ':', '___EOS___']", "index": 211 }, { "content": " def get_entry(self, name, sig):\n \"\"\"\n Returns entry to add for cross-reference IDs.\n\n *name* is whatever :meth:`handle_signature()` returned.\n \"\"\"\n method, _, _, title = name\n return (self.env.docname, sig, title, method)", "metadata": "root.HTTPMethod.get_entry", "header": "['class', 'HTTPMethod', '(', 'HTTPDescription', ')', ':', '___EOS___']", "index": 230 }, { "content": " def get_id(self, name, sig):\n \"\"\"\n Returns cross-reference ID.\n\n *name* is whatever :meth:`handle_signature()` returned.\n \"\"\"\n return name[2]", "metadata": "root.HTTPMethod.get_id", "header": "['class', 'HTTPMethod', '(', 'HTTPDescription', ')', ':', '___EOS___']", "index": 239 }, { "content": " def add_index(self, anchor, name, sig):\n \"\"\"\n Add index entries to self.indexnode, if applicable.\n\n *name* is whatever :meth:`handle_signature()` returned.\n \"\"\"\n method, url, id, title = name\n if title != sig:\n self.indexnode['entries'].append(('single',\n _(\"%s (HTTP method)\") % title,\n anchor, anchor))\n self.indexnode['entries'].append(\n ('single',\n _(\"%(method)s (HTTP method); %(url)s\") % {'method': method,\n 'url': url},\n anchor, anchor)\n )", "metadata": "root.HTTPMethod.add_index", "header": "['class', 'HTTPMethod', '(', 'HTTPDescription', ')', ':', '___EOS___']", "index": 247 }, { "content": "class HTTPResponse(HTTPDescription):\n \"\"\"\n Description of a general HTTP response.\n \"\"\"\n typ = 'response'\n nodetype = strong\n\n option_spec = {\n 'noindex': directives.flag,\n }\n doc_field_types = [\n TypedField('data', label=l_('Data'),\n names=('data',),\n typenames=('datatype', 'type'),\n typerolename='response',\n can_collapse=True),\n NoArgGroupedField('contenttype', label=l_('Content Types'),\n names=('contenttype', 'mimetype', 'format'),\n can_collapse=True),\n ]\n\n\n", "metadata": "root.HTTPResponse", "header": "['module', '___EOS___']", "index": 266 }, { "content": " def handle_signature(self, sig, signode):\n \"\"\"\n Transform an HTTP response into RST nodes.\n Returns the reference name.\n \"\"\"\n name = slugify(sig)\n signode += desc_http_response(name, sig)\n return name", "metadata": "root.HTTPResponse.handle_signature", "header": "['class', 'HTTPResponse', '(', 'HTTPDescription', ')', ':', '___EOS___']", "index": 287 }, { "content": " def get_entry(self, name, sig):\n return (self.env.docname, sig, sig)", "metadata": "root.HTTPResponse.get_entry", "header": "['class', 'HTTPResponse', '(', 'HTTPDescription', ')', ':', '___EOS___']", "index": 296 }, { "content": " def add_index(self, anchor, name, sig):\n \"\"\"\n Add index entries to self.indexnode, if applicable.\n\n *name* is whatever :meth:`handle_signature()` returned.\n \"\"\"\n self.indexnode['entries'].append(('single',\n _(\"%s (HTTP response)\") % sig,\n anchor, anchor))\n self.indexnode['entries'].append(('single',\n _(\"HTTP response; %s\") % sig,\n anchor, anchor))", "metadata": "root.HTTPResponse.add_index", "header": "['class', 'HTTPResponse', '(', 'HTTPDescription', ')', ':', '___EOS___']", "index": 299 } ]
[ { "span": "from urlparse import parse_qsl", "start_line": 26, "start_column": 4, "end_line": 26, "end_column": 34 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "sphinx", ".", "domains", ".", "http", "\\", "10", ";", " ", " ", " ", " ", "~~~~~~~~~~~", "~~~~~", "~~~", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Directive", "s", " ", "for", " ", "the", " ", "HTTP", " ", "domain", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urlparse_", "import_", "urlsplit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "docutils_", "._", "nodes_", "import_", "literal_", ",_", "strong", "_", ",_", "Text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "docutils_", "._", "parsers_", "._", "rst_", "import_", "directives_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sphinx_", "._", "locale_", "import_", "l\\u", "_", ",_", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sphinx_", "._", "directives_", "import_", "Object", "Description_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sphinx_", "._", "util_", "._", "doc", "fields_", "import_", "Type", "d", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sphinx", "\\u", "http", "\\u", "domain_", "._", "doc", "fields_", "import_", "No", "Arg", "Groupe", "d", "Field_", ",_", "Respons", "e", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sphinx", "\\u", "http", "\\u", "domain_", "._", "nodes_", "import_", "(_", "desc", "\\u", "http", "\\u", "method_", ",_", "desc", "\\u", "http", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "desc", "\\u", "http", "\\u", "path_", ",_", "desc", "\\u", "http", "\\u", "path", "arg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "desc", "\\u", "http", "\\u", "query_", ",_", "desc", "\\u", "http", "\\u", "query", "param_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "desc", "\\u", "http", "\\u", "fragment_", ",_", "desc", "\\u", "http", "\\u", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sphinx", "\\u", "http", "\\u", "domain_", "._", "utils_", "import_", "slugify_", ",_", "slug", "if", "y", "\\u", "url_", "\\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 ", " _", "from_", "urlparse_", "import_", "parse", "\\u", "qs", "l_", "\\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_", "cgi_", "import_", "parse", "\\u", "qs", "l_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "HTTP", "Description_", "(_", "Object", "Description_", ")_", ":_", "\\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_", "[SEP]_", "class_", "HTTP", "Description_", "(_", "Object", "Description_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "anchor_", "(_", "self_", ",_", "name_", ",_", "sig_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "anchor", " ", "for", " ", "cross", "-", "reference", " ", "ID", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", "name", "*", " ", "is", " ", "what", "ever", " ", ":", "meth", ":`", "handle", "\\u", "signa", "ture", "()`", " ", "return", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "typ_", "+_", "'-'_", "+_", "self_", "._", "get", "\\u", "id_", "(_", "name_", ",_", "sig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Description_", "(_", "Object", "Description_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "entry_", "(_", "self_", ",_", "name_", ",_", "sig_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "entry", " ", "to", " ", "add", " ", "for", " ", "cross", "-", "reference", " ", "ID", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", "name", "*", " ", "is", " ", "what", "ever", " ", ":", "meth", ":`", "handle", "\\u", "signa", "ture", "()`", " ", "return", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Description_", "(_", "Object", "Description_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "id_", "(_", "self_", ",_", "name_", ",_", "sig_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "cross", "-", "reference", " ", "ID", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", "name", "*", " ", "is", " ", "what", "ever", " ", ":", "meth", ":`", "handle", "\\u", "signa", "ture", "()`", " ", "return", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Description_", "(_", "Object", "Description_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "target", "\\u", "and", "\\u", "index_", "(_", "self_", ",_", "name_", ",_", "sig_", ",_", "signo", "de_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Add", " ", "cross", "-", "reference", " ", "ID", "s", " ", "and", " ", "entri", "es", " ", "to", " ", "self", ".", "index", "node", ",", " ", "if", " ", "applica", "ble", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", "name", "*", " ", "is", " ", "what", "ever", " ", ":", "meth", ":`", "handle", "\\u", "signa", "ture", "()`", " ", "return", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "anchor_", "=_", "self_", "._", "get", "\\u", "anchor_", "(_", "name_", ",_", "sig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "id_", "=_", "self_", "._", "get", "\\u", "id_", "(_", "name_", ",_", "sig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "target_", "(_", "anchor_", "=_", "anchor_", ",_", "entry_", "=_", "self_", "._", "get", "\\u", "entry_", "(_", "name_", ",_", "sig_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "id_", "=_", "id_", ",_", "sig_", "=_", "sig_", ",_", "signo", "de_", "=_", "signo", "de_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "index_", "(_", "anchor_", "=_", "anchor_", ",_", "name_", "=_", "name_", ",_", "sig_", "=_", "sig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Description_", "(_", "Object", "Description_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "target_", "(_", "self_", ",_", "anchor_", ",_", "id_", ",_", "entry_", ",_", "sig_", ",_", "signo", "de_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Add", " ", "cross", "-", "reference", "s", " ", "to", " ", "self", ".", "env", ".", "domain", "data", ",", " ", "if", " ", "applica", "ble", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "anchor_", "not_", "in_", "self_", "._", "state_", "._", "document_", "._", "ids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "signo", "de_", "[_", "'", "names", "'_", "]_", "._", "append_", "(_", "anchor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signo", "de_", "[_", "'", "ids", "'_", "]_", "._", "append_", "(_", "anchor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signo", "de_", "[_", "'", "first", "'_", "]_", "=_", "(_", "not_", "self_", "._", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "document_", "._", "note", "\\u", "explicit", "\\u", "target_", "(_", "signo", "de_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "self_", "._", "env_", "._", "domain", "data_", "[_", "'", "http", "'_", "]_", "[_", "self_", "._", "typ_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "id_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "other", "docname_", "=_", "data_", "[_", "id_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "env_", "._", "warn_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "env_", "._", "docname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "duplicat", "e", " ", "method", " ", "description", " ", "of", " ", "%", "s", ",", " ", "'_", "%_", "sig_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "'", "other", " ", "instance", " ", "in", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "env_", "._", "doc2", "path_", "(_", "other", "docname_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "use", " ", ":", "noin", "dex", ":", " ", "for", " ", "one", " ", "of", " ", "them", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lineno_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "[_", "id_", "]_", "=_", "entry_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Description_", "(_", "Object", "Description_", ")_", ":_", "\\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_", "add", "\\u", "index_", "(_", "self_", ",_", "anchor_", ",_", "name_", ",_", "sig_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Add", " ", "index", " ", "entri", "es", " ", "to", " ", "self", ".", "index", "node", ",", " ", "if", " ", "applica", "ble", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", "name", "*", " ", "is", " ", "what", "ever", " ", ":", "meth", ":`", "handle", "\\u", "signa", "ture", "()`", " ", "return", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Implemented_", "\\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_", "HTTP", "Method_", "(_", "HTTP", "Description_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Descripti", "on", " ", "of", " ", "a", " ", "genera", "l", " ", "HTTP", " ", "method", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "typ_", "=_", "'", "method", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nodet", "ype_", "=_", "literal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "option", "\\u", "spec_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "noin", "dex", "'_", ":_", "directives_", "._", "flag_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "directives_", "._", "unchanged", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "-", "name", "'_", ":_", "directives_", "._", "unchanged", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "\\u", "field", "\\u", "types_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Type", "d", "Field_", "(_", "'", "argu", "ment", "'_", ",_", "label_", "=_", "l\\u", "_", "(_", "'", "Path", " ", "argu", "ment", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "names_", "=_", "(_", "'", "arg", "'_", ",_", "'", "argu", "ment", "'_", ",_", "'", "path", "arg", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "names_", "=_", "(_", "'", "arg", "type", "'_", ",_", "'", "path", "arg", "type", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "can", "\\u", "collapse", "_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Type", "d", "Field_", "(_", "'", "parameter", "'_", ",_", "label_", "=_", "l\\u", "_", "(_", "'", "Query", " ", "params", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "names_", "=_", "(_", "'", "param", "'_", ",_", "'", "parameter", "'_", ",_", "'", "query", "param", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "names_", "=_", "(_", "'", "param", "type", "'_", ",_", "'", "query", "param", "type", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "role", "name_", "=_", "'", "response", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "can", "\\u", "collapse", "_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Type", "d", "Field_", "(_", "'", "option", "al", "\\u", "parameter", "'_", ",_", "label_", "=_", "l\\u", "_", "(_", "'", "Opt", ".", " ", "params", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "names_", "=_", "(_", "'", "opt", "param", "'_", ",_", "'", "option", "al", "'_", ",_", "'", "option", "alp", "aram", "eter", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "names_", "=_", "(_", "'", "opt", "param", "type", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "can", "\\u", "collapse", "_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Type", "d", "Field_", "(_", "'", "fragment", "'_", ",_", "label_", "=_", "l\\u", "_", "(_", "'", "Fragment", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "names_", "=_", "(_", "'", "frag", "'_", ",_", "'", "fragment", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "names_", "=_", "(_", "'", "frag", "type", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "can", "\\u", "collapse", "_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Respons", "e", "Field_", "(_", "'", "response", "'_", ",_", "label_", "=_", "l\\u", "_", "(_", "'", "Responses", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "names_", "=_", "(_", "'", "resp", "'_", ",_", "'", "respond", "s", "'_", ",_", "'", "response", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "role", "name_", "=_", "'", "response", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "can", "\\u", "collapse", "_", "=_", "True_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "RE", " ", "for", " ", "HTTP", " ", "method", " ", "signatures_", "\\u\\u\\uNL\\u\\u\\u_", "sig", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'", "^", "'_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'(?:", "(", "GET", "|", "POST", "|", "PU", "T", "|", "DELET", "E", ")\\\\", "s", "+)?", "'_", "#", " ", "HTTP", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'(", ".+)", "'_", "#", " ", "URL_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'\\\\", "s", "*$'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "re_", "._", "IGNORECASE_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", ",", " ", "path", "\\u", "re", ".", "find", "all", "()", " ", "will", " ", "produce", " ", "an", " ", "extra", " ", "(''", ",", " ", "''", ")", " ", "tuple_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "at", " ", "the", " ", "end", " ", "of", " ", "its", " ", "matche", "s", ".", " ", "You", " ", "shou", "ld", " ", "strip", " ", "it", " ", "off", ",", " ", "or", " ", "you", " ", "will", "_", "\\u\\u\\uNL\\u\\u\\u_", "path", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'(", "[", "^", "{", "]*)", "'_", "#", " ", "Plai", "n", " ", "text_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'(\\\\", "{[", "^", "}]", "*\\\\", "})", "?'_", "#", " ", "{", "arg", "}", " ", "in", " ", "matche", "d", " ", "braces", "_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "re_", "._", "VERBOSE_", "\\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_", "HTTP", "Method_", "(_", "HTTP", "Description_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "node", "\\u", "from", "\\u", "method_", "(_", "self_", ",_", "method_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "a", " ", "``", "desc", "\\u", "http", "\\u", "method", "``", " ", "Node", " ", "from", " ", "a", " ", "``", "method", "``", " ", "string", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "method_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "method_", "=_", "'", "GET", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "desc", "\\u", "http", "\\u", "method_", "(_", "method_", ",_", "method_", "._", "upper_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Method_", "(_", "HTTP", "Description_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "node", "\\u", "from", "\\u", "url_", "(_", "self_", ",_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "a", " ", "``", "desc", "\\u", "http", "\\u", "url", "``", " ", "Node", " ", "from", " ", "a", " ", "``", "url", "``", " ", "string", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "url_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Split", " ", "URL", " ", "int", "o", " ", "path", ",", " ", "query", ",", " ", "and", " ", "fragment_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "path_", ",_", "query_", ",_", "fragment_", "=_", "self_", "._", "split", "\\u", "url_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url", "node_", "=_", "desc", "\\u", "http", "\\u", "url_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url", "node_", "+=_", "self_", "._", "node", "\\u", "from", "\\u", "path_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node_", "=_", "self_", "._", "node", "\\u", "from", "\\u", "query_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "node_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url", "node_", "+=_", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "node_", "=_", "self_", "._", "node", "\\u", "from", "\\u", "fragment_", "(_", "fragment_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "node_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url", "node_", "+=_", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "url", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Method_", "(_", "HTTP", "Description_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "node", "\\u", "from", "\\u", "path_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "a", " ", "``", "desc", "\\u", "http", "\\u", "path", "``", " ", "Node", " ", "from", " ", "a", " ", "``", "path", "``", " ", "string", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path", "node_", "=_", "desc", "\\u", "http", "\\u", "path_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "\\u", "segments_", "=_", "self_", "._", "path", "\\u", "re_", "._", "findall_", "(_", "path_", ")_", "[_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "text_", ",_", "arg_", "in_", "path", "\\u", "segments_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path", "node_", "+=_", "Text_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "arg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "arg_", "=_", "arg_", "[_", "1_", ":_", "-_", "1_", "]_", "#", " ", "Strip", " ", "off", " ", "{", " ", "and", " ", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "node_", "+=_", "desc", "\\u", "http", "\\u", "path", "arg_", "(_", "arg_", ",_", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "path", "node_", "\\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 ", " _", "raise_", "Value", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Method_", "(_", "HTTP", "Description_", ")_", ":_", "\\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_", "node", "\\u", "from", "\\u", "query_", "(_", "self_", ",_", "query_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "a", " ", "``", "desc", "\\u", "http", "\\u", "query", "``", " ", "Node", " ", "from", " ", "a", " ", "``", "query", "``", " ", "string", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "query_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query", "node_", "=_", "desc", "\\u", "http", "\\u", "query_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query", "\\u", "params_", "=_", "query_", "._", "split_", "(_", "'&'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "query", "\\u", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query", "node_", "+=_", "desc", "\\u", "http", "\\u", "query", "param_", "(_", "p_", ",_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "query", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Method_", "(_", "HTTP", "Description_", ")_", ":_", "\\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_", "node", "\\u", "from", "\\u", "fragment_", "(_", "self_", ",_", "fragment_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "a", " ", "``", "desc", "\\u", "http", "\\u", "fragment", "``", " ", "Node", " ", "from", " ", "a", " ", "``", "fragment", "``", " ", "string", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fragment_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "desc", "\\u", "http", "\\u", "fragment_", "(_", "fragment_", ",_", "fragment_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Method_", "(_", "HTTP", "Description_", ")_", ":_", "\\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_", "split", "\\u", "url_", "(_", "self_", ",_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Split", "s", " ", "a", " ", "``", "url", "``", " ", "string", " ", "int", "o", " ", "its", " ", "component", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "(", "path", ",", " ", "query", " ", "string", ",", " ", "fragment", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u_", ",_", "\\u_", ",_", "path_", ",_", "query_", ",_", "fragment_", "=_", "urlsplit_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "path_", ",_", "query_", ",_", "fragment_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Method_", "(_", "HTTP", "Description_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "signature_", "(_", "self_", ",_", "sig_", ",_", "signo", "de_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Transform", " ", "an", " ", "HTTP", " ", "method", " ", "signa", "ture", " ", "int", "o", " ", "RST", " ", "nodes", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "(", "method", " ", "name", ",", " ", "full", " ", "URL", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Match", " ", "the", " ", "signa", "ture", " ", "to", " ", "extract", " ", "the", " ", "method", " ", "and", " ", "URL_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "=_", "self_", "._", "sig", "\\u", "re_", "._", "match_", "(_", "sig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "m_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "method_", ",_", "url_", "=_", "m_", "._", "groups_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Append", " ", "nodes", " ", "to", " ", "signo", "de", " ", "for", " ", "method", " ", "and", " ", "url_", "\\u\\u\\uNL\\u\\u\\u_", "signo", "de_", "+=_", "self_", "._", "node", "\\u", "from", "\\u", "method_", "(_", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signo", "de_", "+=_", "self_", "._", "node", "\\u", "from", "\\u", "url_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Name", " ", "and", " ", "title_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "options_", "._", "get_", "(_", "'", "label", "-", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slug", "if", "y", "\\u", "url_", "(_", "method_", "._", "lower_", "(_", ")_", "+_", "'-'_", "+_", "url_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "title_", "=_", "self_", "._", "options_", "._", "get_", "(_", "'", "title", "'_", ",_", "sig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "method_", "._", "upper_", "(_", ")_", ",_", "url_", ",_", "name_", ",_", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Method_", "(_", "HTTP", "Description_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "entry_", "(_", "self_", ",_", "name_", ",_", "sig_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "entry", " ", "to", " ", "add", " ", "for", " ", "cross", "-", "reference", " ", "ID", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", "name", "*", " ", "is", " ", "what", "ever", " ", ":", "meth", ":`", "handle", "\\u", "signa", "ture", "()`", " ", "return", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "method_", ",_", "\\u_", ",_", "\\u_", ",_", "title_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "self_", "._", "env_", "._", "docname_", ",_", "sig_", ",_", "title_", ",_", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Method_", "(_", "HTTP", "Description_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "id_", "(_", "self_", ",_", "name_", ",_", "sig_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "cross", "-", "reference", " ", "ID", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", "name", "*", " ", "is", " ", "what", "ever", " ", ":", "meth", ":`", "handle", "\\u", "signa", "ture", "()`", " ", "return", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "name_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Method_", "(_", "HTTP", "Description_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "index_", "(_", "self_", ",_", "anchor_", ",_", "name_", ",_", "sig_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Add", " ", "index", " ", "entri", "es", " ", "to", " ", "self", ".", "index", "node", ",", " ", "if", " ", "applica", "ble", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", "name", "*", " ", "is", " ", "what", "ever", " ", ":", "meth", ":`", "handle", "\\u", "signa", "ture", "()`", " ", "return", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "method_", ",_", "url_", ",_", "id_", ",_", "title_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "title_", "!=_", "sig_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "index", "node_", "[_", "'", "entri", "es", "'_", "]_", "._", "append_", "(_", "(_", "'", "single", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"%", "s", " ", "(", "HTTP", " ", "method", ")\"_", ")_", "%_", "title_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "anchor_", ",_", "anchor_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "index", "node_", "[_", "'", "entri", "es", "'_", "]_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "single", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"%", "(", "method", ")", "s", " ", "(", "HTTP", " ", "method", ");", " ", "%", "(", "url", ")", "s", "\"_", ")_", "%_", "{_", "'", "method", "'_", ":_", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "url_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "anchor_", ",_", "anchor_", ")_", "\\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_", "HTTP", "Response_", "(_", "HTTP", "Description_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Descripti", "on", " ", "of", " ", "a", " ", "genera", "l", " ", "HTTP", " ", "response", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "typ_", "=_", "'", "response", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nodet", "ype_", "=_", "strong", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "option", "\\u", "spec_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "noin", "dex", "'_", ":_", "directives_", "._", "flag_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "\\u", "field", "\\u", "types_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Type", "d", "Field_", "(_", "'", "data", "'_", ",_", "label_", "=_", "l\\u", "_", "(_", "'", "Data", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "names_", "=_", "(_", "'", "data", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "names_", "=_", "(_", "'", "datatype", "'_", ",_", "'", "type", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "role", "name_", "=_", "'", "response", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "can", "\\u", "collapse", "_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "No", "Arg", "Groupe", "d", "Field_", "(_", "'", "contenttype", "'_", ",_", "label_", "=_", "l\\u", "_", "(_", "'", "Conten", "t", " ", "Type", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "names_", "=_", "(_", "'", "contenttype", "'_", ",_", "'", "mime", "type", "'_", ",_", "'", "format", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "can", "\\u", "collapse", "_", "=_", "True_", ")_", ",_", "\\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_", "HTTP", "Response_", "(_", "HTTP", "Description_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "handle", "\\u", "signature_", "(_", "self_", ",_", "sig_", ",_", "signo", "de_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Transform", " ", "an", " ", "HTTP", " ", "response", " ", "int", "o", " ", "RST", " ", "nodes", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "reference", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "slugify_", "(_", "sig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signo", "de_", "+=_", "desc", "\\u", "http", "\\u", "response_", "(_", "name_", ",_", "sig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Response_", "(_", "HTTP", "Description_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "entry_", "(_", "self_", ",_", "name_", ",_", "sig_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "self_", "._", "env_", "._", "docname_", ",_", "sig_", ",_", "sig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "Response_", "(_", "HTTP", "Description_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "index_", "(_", "self_", ",_", "anchor_", ",_", "name_", ",_", "sig_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Add", " ", "index", " ", "entri", "es", " ", "to", " ", "self", ".", "index", "node", ",", " ", "if", " ", "applica", "ble", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", "name", "*", " ", "is", " ", "what", "ever", " ", ":", "meth", ":`", "handle", "\\u", "signa", "ture", "()`", " ", "return", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "index", "node_", "[_", "'", "entri", "es", "'_", "]_", "._", "append_", "(_", "(_", "'", "single", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"%", "s", " ", "(", "HTTP", " ", "response", ")\"_", ")_", "%_", "sig_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "anchor_", ",_", "anchor_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "index", "node_", "[_", "'", "entri", "es", "'_", "]_", "._", "append_", "(_", "(_", "'", "single", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"", "HTTP", " ", "response", ";", " ", "%", "s", "\"_", ")_", "%_", "sig_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "anchor_", ",_", "anchor_", ")_", ")_" ]
[ 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, 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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, 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, 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 ]
Unreachable code
PyTables/PyTables/bench/search-bench-plot.py
[ { "content": "from __future__ import print_function\nimport tables\nfrom pylab import *\n\n\n\n\n\nif __name__ == '__main__':\n\n import sys\n import getopt\n\n usage = \"\"\"usage: %s [-o file] [-t title] [--insert] [--table-size] [--query] [--query-cache] [--MB-units] files\n -o filename for output (only .png and .jpg extensions supported)\n -t title of the plot\n --insert -- Insert time for table\n --table-size -- Size of table\n --query -- Time for querying the integer column\n --query-cache -- Time for querying the integer (cached)\n --MB-units -- Express speed in MB/s instead of MRows/s\n \\n\"\"\" % sys.argv[0]\n\n try:\n opts, pargs = getopt.getopt(sys.argv[1:], 'o:t:',\n ['insert',\n 'table-size',\n 'query',\n 'query-cache',\n 'MB-units',\n ])\n except:\n sys.stderr.write(usage)\n sys.exit(0)\n\n progname = sys.argv[0]\n args = sys.argv[1:]\n\n # if we pass too few parameters, abort\n if len(pargs) < 1:\n sys.stderr.write(usage)\n sys.exit(0)\n\n # default options\n outfile = None\n insert = 0\n table_size = 0\n query = 0\n query_cache = 0\n mb_units = 0\n yaxis = \"No axis name\"\n tit = None\n gtitle = \"Please set a title!\"\n\n # Get the options\n for option in opts:\n if option[0] == '-o':\n outfile = option[1]\n elif option[0] == '-t':\n tit = option[1]\n elif option[0] == '--insert':\n insert = 1\n yaxis = \"MRows/s\"\n gtitle = \"Writing with small (16 bytes) record size\"\n elif option[0] == '--table-size':\n table_size = 1\n yaxis = \"Bytes/row\"\n gtitle = (\"Disk space taken by a record (original record size: \"\n \"16 bytes)\")\n elif option[0] == '--query':\n query = 1\n yaxis = \"MRows/s\"\n gtitle = (\"Selecting with small (16 bytes) record size (file not \"\n \"in cache)\")\n elif option[0] == '--query-cache':\n query_cache = 1\n yaxis = \"MRows/s\"\n gtitle = (\"Selecting with small (16 bytes) record size (file in \"\n \"cache)\")\n elif option[0] == '--MB-units':\n mb_units = 1\n\n filenames = pargs\n\n if mb_units and yaxis == \"MRows/s\":\n yaxis = \"MB/s\"\n\n if tit:\n gtitle = tit\n\n plots = []\n legends = []\n for filename in filenames:\n plegend = filename[filename.find('cl-') + 3:filename.index('.h5')]\n plegend = plegend.replace('-', ' ')\n xval, yval = get_values(filename, '')\n print(\"Values for %s --> %s, %s\" % (filename, xval, yval))\n #plots.append(loglog(xval, yval, linewidth=5))\n plots.append(semilogx(xval, yval, linewidth=4))\n legends.append(plegend)\n if 0: # Per a introduir dades simulades si es vol...\n xval = [1000, 10000, 100000, 1000000, 10000000,\n 100000000, 1000000000]\n# yval = [0.003, 0.005, 0.02, 0.06, 1.2,\n# 40, 210]\n yval = [0.0009, 0.0011, 0.0022, 0.005, 0.02,\n 0.2, 5.6]\n plots.append(loglog(xval, yval, linewidth=5))\n legends.append(\"PyTables Std\")\n show_plot(plots, yaxis, legends, gtitle)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "xval = [1000, 10000, 100000, 1000000, 10000000,\n 100000000, 1000000000]", "start_line": 139, "start_column": 8, "end_line": 140, "end_column": 38 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tables_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pylab_", "import_", "*_", "\\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_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "getopt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "usage_", "=_", "\"\"\"", "usage", ":", " ", "%", "s", " ", "[-", "o", " ", "file", "]", " ", "[-", "t", " ", "title", "]", " ", "[-", "-", "insert", "]", " ", "[-", "-", "table", "-", "size", "]", " ", "[-", "-", "query", "]", " ", "[-", "-", "query", "-", "cache", "]", " ", "[-", "-", "MB", "-", "unit", "s", "]", " ", "files", "\\", "10", ";", " ", "-", "o", " ", "filename", " ", "for", " ", "output", " ", "(", "only", " ", ".", "png", " ", "and", " ", ".", "jp", "g", " ", "extensi", "ons", " ", "support", "ed", ")", "\\", "10", ";", " ", "-", "t", " ", "title", " ", "of", " ", "the", " ", "plot", "\\", "10", ";", " ", "--", "insert", " ", "--", " ", "Insert", " ", "time", " ", "for", " ", "table", "\\", "10", ";", " ", "--", "table", "-", "size", " ", "--", " ", "Size", " ", "of", " ", "table", "\\", "10", ";", " ", "--", "query", " ", "--", " ", "Time", " ", "for", " ", "query", "ing", " ", "the", " ", "integ", "er", " ", "column", "\\", "10", ";", " ", "--", "query", "-", "cache", " ", "--", " ", "Time", " ", "for", " ", "query", "ing", " ", "the", " ", "integ", "er", " ", "(", "cache", "d", ")", "\\", "10", ";", " ", "--", "MB", "-", "unit", "s", " ", "--", " ", "Exp", "ress", " ", "speed", " ", "in", " ", "MB", "/", "s", " ", "inst", "ead", " ", "of", " ", "MR", "ow", "s", "/", "s", "\\", "10", ";", " ", "\\\\", "n", "\"\"\"_", "%_", "sys_", "._", "argv_", "[_", "0_", "]_", "\\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 ", " _", "opts_", ",_", "pargs_", "=_", "getopt_", "._", "getopt_", "(_", "sys_", "._", "argv_", "[_", "1_", ":_", "]_", ",_", "'", "o", ":", "t", ":'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "insert", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "table", "-", "size", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "query", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "query", "-", "cache", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "MB", "-", "unit", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\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 ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "usage_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prog", "name_", "=_", "sys_", "._", "argv_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "sys_", "._", "argv_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "pass", " ", "too", " ", "few", " ", "parameter", "s", ",", " ", "abort_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "pargs_", ")_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "usage_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "default", " ", "options_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "outfile_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "insert_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table", "\\u", "size_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query", "\\u", "cache_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mb", "\\u", "units_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "=_", "\"", "No", " ", "axis", " ", "name", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tit", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gti", "tle_", "=_", "\"", "Ple", "ase", " ", "set", " ", "a", " ", "title", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "options_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "option_", "in_", "opts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "option_", "[_", "0_", "]_", "==_", "'-", "o", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "outfile_", "=_", "option_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "option_", "[_", "0_", "]_", "==_", "'-", "t", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tit", "_", "=_", "option_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "option_", "[_", "0_", "]_", "==_", "'--", "insert", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "insert_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "=_", "\"", "MR", "ow", "s", "/", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gti", "tle_", "=_", "\"", "Writ", "ing", " ", "with", " ", "small", " ", "(", "16", " ", "bytes", ")", " ", "record", " ", "size", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "option_", "[_", "0_", "]_", "==_", "'--", "table", "-", "size", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "table", "\\u", "size_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "=_", "\"", "Byte", "s", "/", "row", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gti", "tle_", "=_", "(_", "\"", "Disk", " ", "space", " ", "take", "n", " ", "by", " ", "a", " ", "record", " ", "(", "original", " ", "record", " ", "size", ":", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "16", " ", "bytes", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "option_", "[_", "0_", "]_", "==_", "'--", "query", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "=_", "\"", "MR", "ow", "s", "/", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gti", "tle_", "=_", "(_", "\"", "Selecti", "ng", " ", "with", " ", "small", " ", "(", "16", " ", "bytes", ")", " ", "record", " ", "size", " ", "(", "file", " ", "not", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "in", " ", "cache", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "option_", "[_", "0_", "]_", "==_", "'--", "query", "-", "cache", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query", "\\u", "cache_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "=_", "\"", "MR", "ow", "s", "/", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gti", "tle_", "=_", "(_", "\"", "Selecti", "ng", " ", "with", " ", "small", " ", "(", "16", " ", "bytes", ")", " ", "record", " ", "size", " ", "(", "file", " ", "in", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cache", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "option_", "[_", "0_", "]_", "==_", "'--", "MB", "-", "unit", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mb", "\\u", "units_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "filenames_", "=_", "pargs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "mb", "\\u", "units_", "and_", "yaxis_", "==_", "\"", "MR", "ow", "s", "/", "s", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yaxis_", "=_", "\"", "MB", "/", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "tit", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gti", "tle_", "=_", "tit", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plots_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "legend", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "filename_", "in_", "filenames_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ple", "gen", "d_", "=_", "filename_", "[_", "filename_", "._", "find_", "(_", "'", "cl", "-'_", ")_", "+_", "3_", ":_", "filename_", "._", "index_", "(_", "'.", "h5", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ple", "gen", "d_", "=_", "ple", "gen", "d_", "._", "replace_", "(_", "'-'_", ",_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xval", "_", ",_", "yval", "_", "=_", "get", "\\u", "values_", "(_", "filename_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Value", "s", " ", "for", " ", "%", "s", " ", "-->", " ", "%", "s", ",", " ", "%", "s", "\"_", "%_", "(_", "filename_", ",_", "xval", "_", ",_", "yval", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "plots", ".", "append", "(", "loglo", "g", "(", "xval", ",", " ", "yval", ",", " ", "line", "widt", "h", "=", "5", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "plots_", "._", "append_", "(_", "semi", "log", "x_", "(_", "xval", "_", ",_", "yval", "_", ",_", "linewidth_", "=_", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "legend", "s_", "._", "append_", "(_", "ple", "gen", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "0_", ":_", "#", " ", "Per", " ", "a", " ", "intro", "dui", "r", " ", "dades", " ", "simu", "lad", "es", " ", "si", " ", "es", " ", "vol", "..._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xval", "_", "=_", "[_", "1000_", ",_", "10000_", ",_", "100000_", ",_", "1000000_", ",_", "10000000", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "100000000", "_", ",_", "1000000000", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "yval", " ", "=", " ", "[", "0.003", ",", " ", "0.005", ",", " ", "0.02", ",", " ", "0.06", ",", " ", "1.2", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "40", ",", " ", "210", "]_", "\\u\\u\\uNL\\u\\u\\u_", "yval", "_", "=_", "[_", "0.000", "9_", ",_", "0.001", "1_", ",_", "0.002", "2_", ",_", "0.005_", ",_", "0.02_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "0.2_", ",_", "5.6", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plots_", "._", "append_", "(_", "loglo", "g_", "(_", "xval", "_", ",_", "yval", "_", ",_", "linewidth_", "=_", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "legend", "s_", "._", "append_", "(_", "\"", "Py", "Table", "s", " ", "Std", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "show", "\\u", "plot_", "(_", "plots_", ",_", "yaxis_", ",_", "legend", "s_", ",_", "gti", "tle_", ")_", "\\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,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